优化
This commit is contained in:
@@ -1,24 +0,0 @@
|
||||
package top.wms.admin.common.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import top.continew.starter.core.enums.BaseEnum;
|
||||
|
||||
/**
|
||||
* 交易状态枚举
|
||||
*
|
||||
* @author Charles7c
|
||||
* @since 2022/12/29 22:38
|
||||
*/
|
||||
@Getter
|
||||
@RequiredArgsConstructor
|
||||
public enum ConsumeOrderTypeEnum implements BaseEnum<Integer> {
|
||||
|
||||
/**
|
||||
* 在线消费
|
||||
*/
|
||||
CONSUME(0, "消费");
|
||||
|
||||
private final Integer value;
|
||||
private final String description;
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
package top.wms.admin.common.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import top.continew.starter.core.enums.BaseEnum;
|
||||
|
||||
/**
|
||||
* 支付方式枚举
|
||||
*
|
||||
* @author Charles7c
|
||||
* @since 2022/12/29 22:38
|
||||
*/
|
||||
@Getter
|
||||
@RequiredArgsConstructor
|
||||
public enum ConsumePayModeEnum implements BaseEnum<Integer> {
|
||||
|
||||
/**
|
||||
* 人脸
|
||||
*/
|
||||
FACE(0, "人脸"),
|
||||
|
||||
/**
|
||||
* 云卡
|
||||
*/
|
||||
CLOUD_CARD(1, "云卡"),
|
||||
|
||||
/**
|
||||
* 刷卡
|
||||
*/
|
||||
SWIPE_CARD(2, "刷卡"),
|
||||
|
||||
/**
|
||||
* 支付宝
|
||||
*/
|
||||
ALIPAY(3, "支付宝"),
|
||||
|
||||
/**
|
||||
* 微信
|
||||
*/
|
||||
WECHAT(4, "微信"),
|
||||
|
||||
/**
|
||||
* 取餐码
|
||||
*/
|
||||
MEAL_CODE(5, "取餐码");
|
||||
|
||||
private final Integer value;
|
||||
private final String description;
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
package top.wms.admin.common.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import top.continew.starter.core.enums.BaseEnum;
|
||||
|
||||
/**
|
||||
* 消费-充值方式
|
||||
*
|
||||
* @author Charles7c
|
||||
* @since 2022/12/29 22:38
|
||||
*/
|
||||
@Getter
|
||||
@RequiredArgsConstructor
|
||||
public enum ConsumeRechargeModeEnum implements BaseEnum<Integer> {
|
||||
|
||||
/**
|
||||
* 现金
|
||||
*/
|
||||
CASH(0, "现金"),
|
||||
|
||||
/**
|
||||
* 支付宝
|
||||
*/
|
||||
ALIPAY(1, "支付宝"),
|
||||
|
||||
/**
|
||||
* 微信
|
||||
*/
|
||||
WECHAT(2, "微信"),
|
||||
|
||||
/**
|
||||
* 网银
|
||||
*/
|
||||
ONLINE_BANKING(3, "网银");
|
||||
|
||||
private final Integer value;
|
||||
private final String description;
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
package top.wms.admin.common.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import top.continew.starter.core.enums.BaseEnum;
|
||||
|
||||
/**
|
||||
* 消费-操作类型
|
||||
*
|
||||
* @author Charles7c
|
||||
* @since 2022/12/29 22:38
|
||||
*/
|
||||
@Getter
|
||||
@RequiredArgsConstructor
|
||||
public enum ConsumeRechargeTypeEnum implements BaseEnum<Integer> {
|
||||
|
||||
/**
|
||||
* 补贴
|
||||
*/
|
||||
SUBSIDY(0, "补贴"),
|
||||
|
||||
/**
|
||||
* 充值
|
||||
*/
|
||||
RECHARGE(1, "充值"),
|
||||
|
||||
/**
|
||||
* 退款
|
||||
*/
|
||||
REFUND(2, "退款"),
|
||||
|
||||
/**
|
||||
* 清零(全部)
|
||||
*/
|
||||
CLEAR(3, "清零(全部)"),
|
||||
|
||||
/**
|
||||
* 清零(充值)
|
||||
*/
|
||||
CLEAR_CZ(4, "清零(充值)"),
|
||||
|
||||
/**
|
||||
* 清零(补贴)
|
||||
*/
|
||||
CLEAR_BT(5, "清零(补贴)");
|
||||
|
||||
private final Integer value;
|
||||
private final String description;
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
package top.wms.admin.common.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import top.continew.starter.core.enums.BaseEnum;
|
||||
|
||||
/**
|
||||
* 消费-充值来源
|
||||
*
|
||||
* @author Charles7c
|
||||
* @since 2022/12/29 22:38
|
||||
*/
|
||||
@Getter
|
||||
@RequiredArgsConstructor
|
||||
public enum ConsumeRechargeWayEnum implements BaseEnum<Integer> {
|
||||
|
||||
/**
|
||||
* 在线消费
|
||||
*/
|
||||
WEB(0, "平台"),
|
||||
|
||||
/**
|
||||
* 离线消费
|
||||
*/
|
||||
PHONE(1, "手机");
|
||||
|
||||
private final Integer value;
|
||||
private final String description;
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
package top.wms.admin.common.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import top.continew.starter.core.enums.BaseEnum;
|
||||
|
||||
/**
|
||||
* 交易状态枚举
|
||||
*
|
||||
* @author Charles7c
|
||||
* @since 2022/12/29 22:38
|
||||
*/
|
||||
@Getter
|
||||
@RequiredArgsConstructor
|
||||
public enum ConsumeResultEnum implements BaseEnum<Integer> {
|
||||
|
||||
/**
|
||||
* 在线消费
|
||||
*/
|
||||
ONLINE_CONSUME(0, "在线消费"),
|
||||
|
||||
/**
|
||||
* 离线消费
|
||||
*/
|
||||
OFFLINE_CONSUME(1, "离线消费"),
|
||||
|
||||
/**
|
||||
* 超时
|
||||
*/
|
||||
TIMEOUT(2, "超时"),
|
||||
|
||||
/**
|
||||
* 消费异常
|
||||
*/
|
||||
CONSUMPTION_EXCEPTION(3, "消费异常"),
|
||||
|
||||
/**
|
||||
* 异常消费
|
||||
*/
|
||||
EXCEPTION_CONSUMPTION(4, "异常消费");
|
||||
|
||||
private final Integer value;
|
||||
private final String description;
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
package top.wms.admin.common.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import top.continew.starter.core.enums.BaseEnum;
|
||||
|
||||
/**
|
||||
* 消费-充值来源
|
||||
*
|
||||
* @author Charles7c
|
||||
* @since 2022/12/29 22:38
|
||||
*/
|
||||
@Getter
|
||||
@RequiredArgsConstructor
|
||||
public enum ConsumeTmrtypeEnum implements BaseEnum<Integer> {
|
||||
/**
|
||||
* 早餐
|
||||
*/
|
||||
BREAKFAST(0, "早餐"),
|
||||
|
||||
/**
|
||||
* 中餐
|
||||
*/
|
||||
LUNCH(1, "中餐"),
|
||||
|
||||
/**
|
||||
* 午餐
|
||||
*/
|
||||
DINNER(2, "午餐"),
|
||||
|
||||
/**
|
||||
* 夜餐
|
||||
*/
|
||||
NIGHT(3, "夜餐");
|
||||
|
||||
private final Integer value;
|
||||
private final String description;
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
package top.wms.admin.common.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import top.continew.starter.core.enums.BaseEnum;
|
||||
|
||||
/**
|
||||
* 消费类型枚举
|
||||
*
|
||||
* @author Charles7c
|
||||
* @since 2022/12/29 22:38
|
||||
*/
|
||||
@Getter
|
||||
@RequiredArgsConstructor
|
||||
public enum ConsumeTypeConverter implements BaseEnum<Integer> {
|
||||
|
||||
/**
|
||||
* 单价
|
||||
*/
|
||||
UNIT_PRICE(0, "单价"),
|
||||
|
||||
/**
|
||||
* 定额
|
||||
*/
|
||||
FIXED_PRICE(1, "定额"),
|
||||
|
||||
/**
|
||||
* 时段模式
|
||||
*/
|
||||
TIME_PERIOD(2, "时段模式"),
|
||||
|
||||
/**
|
||||
* 计次
|
||||
*/
|
||||
COUNTING(3, "计次"),
|
||||
|
||||
/**
|
||||
* 点餐机模式
|
||||
*/
|
||||
ORDERING_MACHINE(5, "点餐机模式"),
|
||||
|
||||
/**
|
||||
* 身份模式
|
||||
*/
|
||||
IDENTITY(9, "身份模式");
|
||||
|
||||
private final Integer value;
|
||||
private final String description;
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
package top.wms.admin.common.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import top.continew.starter.core.enums.BaseEnum;
|
||||
|
||||
/**
|
||||
* 钱包消费模式枚举
|
||||
*
|
||||
* @author Charles7c
|
||||
* @since 2022/12/29 22:38
|
||||
*/
|
||||
@Getter
|
||||
@RequiredArgsConstructor
|
||||
public enum ConsumeWalletModeEnum implements BaseEnum<Integer> {
|
||||
|
||||
/**
|
||||
* 先消费补贴再个人
|
||||
*/
|
||||
SUBSIDY_THEN_PERSONAL(0, "先消费补贴再个人"),
|
||||
|
||||
/**
|
||||
* 仅现金
|
||||
*/
|
||||
ONLY_CASH(1, "仅现金"),
|
||||
|
||||
/**
|
||||
* 仅补贴
|
||||
*/
|
||||
ONLY_SUBSIDY(2, "仅补贴");
|
||||
|
||||
private final Integer value;
|
||||
private final String description;
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
package top.wms.admin.common.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import top.continew.starter.core.enums.BaseEnum;
|
||||
|
||||
/**
|
||||
* 启用禁用
|
||||
*
|
||||
* @author Charles7c
|
||||
* @since 2022/12/29 22:38
|
||||
*/
|
||||
@Getter
|
||||
@RequiredArgsConstructor
|
||||
public enum EnableEnum implements BaseEnum<Integer> {
|
||||
|
||||
/**
|
||||
* 禁用
|
||||
*/
|
||||
DISABLE(0, "禁用"),
|
||||
|
||||
/**
|
||||
* 在线消费
|
||||
*/
|
||||
ENABLE(1, "启用");
|
||||
|
||||
private final Integer value;
|
||||
private final String description;
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package top.wms.admin.common.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import top.continew.starter.core.enums.BaseEnum;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author Charles7c
|
||||
* @since 2023/2/26 21:35
|
||||
*/
|
||||
@Getter
|
||||
@RequiredArgsConstructor
|
||||
public enum LightLevelEnum implements BaseEnum<Integer> {
|
||||
|
||||
/**
|
||||
* 一级
|
||||
*/
|
||||
LEVEL1(1, "一级"),
|
||||
|
||||
/**
|
||||
* 二级
|
||||
*/
|
||||
LEVEL2(2, "二级"),
|
||||
|
||||
/**
|
||||
* 三级
|
||||
*/
|
||||
LEVEL3(3, "三级");
|
||||
|
||||
private final Integer value;
|
||||
private final String description;
|
||||
|
||||
/**
|
||||
* 根据描述获取值
|
||||
*
|
||||
* @param description 描述
|
||||
* @return 值,如果找不到则返回 null
|
||||
*/
|
||||
public static Integer getValueByDescription(String description) {
|
||||
for (LightLevelEnum enumValue : values()) {
|
||||
if (enumValue.getDescription().equals(description)) {
|
||||
return enumValue.getValue();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package top.wms.admin.common.enums;
|
||||
|
||||
import com.alibaba.excel.converters.Converter;
|
||||
import com.alibaba.excel.enums.CellDataTypeEnum;
|
||||
import com.alibaba.excel.metadata.GlobalConfiguration;
|
||||
import com.alibaba.excel.metadata.data.ReadCellData;
|
||||
import com.alibaba.excel.metadata.data.WriteCellData;
|
||||
import com.alibaba.excel.metadata.property.ExcelContentProperty;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class LightLevelEnumConverter implements Converter<Integer> {
|
||||
|
||||
private static final Map<Integer, String> LIGHT_LEVEL_MAP = new HashMap<>();
|
||||
static {
|
||||
LIGHT_LEVEL_MAP.put(1, "一级");
|
||||
LIGHT_LEVEL_MAP.put(2, "二级");
|
||||
LIGHT_LEVEL_MAP.put(3, "三级");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> supportJavaTypeKey() {
|
||||
return Integer.class; // 支持的 Java 类型
|
||||
}
|
||||
|
||||
@Override
|
||||
public CellDataTypeEnum supportExcelTypeKey() {
|
||||
return CellDataTypeEnum.STRING; // 写入 Excel 时用字符串
|
||||
}
|
||||
|
||||
@Override
|
||||
public WriteCellData<String> convertToExcelData(Integer value,
|
||||
ExcelContentProperty contentProperty,
|
||||
GlobalConfiguration globalConfiguration) {
|
||||
if (value == null) {
|
||||
return new WriteCellData<>("");
|
||||
}
|
||||
String label = LIGHT_LEVEL_MAP.getOrDefault(value, "");
|
||||
return new WriteCellData<>(label);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer convertToJavaData(ReadCellData<?> cellData,
|
||||
ExcelContentProperty contentProperty,
|
||||
GlobalConfiguration globalConfiguration) {
|
||||
String stringValue = cellData.getStringValue();
|
||||
for (Map.Entry<Integer, String> entry : LIGHT_LEVEL_MAP.entrySet()) {
|
||||
if (entry.getValue().equals(stringValue)) {
|
||||
return entry.getKey();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
package top.wms.admin.common.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import top.continew.starter.core.enums.BaseEnum;
|
||||
|
||||
@Getter
|
||||
@RequiredArgsConstructor
|
||||
public enum OperTypeEnum implements BaseEnum<Integer> {
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
ADD(0, "新增"),
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
UPDATE(1, "修改"),
|
||||
|
||||
/**
|
||||
* 下发
|
||||
*/
|
||||
DOWN(2, "下发"),
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
DEL(3, "删除");
|
||||
|
||||
private final Integer value;
|
||||
private final String description;
|
||||
}
|
||||
Reference in New Issue
Block a user