package com.kmall.admin.haikong.constant; import java.util.Arrays; /** * 常量类 * @author lhm * @createDate 2021-10-30 */ public class Constants { /* --------------------------------------------------redis常量----------------------------------------------- */ public static final String MEMBER_SYS_ACCESS_TOKEN_REDIS_KEY = "haikong_memberSys_accessToken"; public static final String MEMBER_SYS_REFRESH_TOKEN_REDIS_KEY = "haikong_memberSys_refreshToken"; public static final String WAREHOUSE_STOCK_MAP_KEY = "haikong_warehouse_stock_cache"; /* --------------------------------------------------redis常量----------------------------------------------- */ /* --------------------------------------------------系统常量----------------------------------------------- */ public static final String HAIKONG_MEMBER_SCORE_LIMIT = "HAIKONG_MEMBER_SCORE_LIMIT"; public static final String HAIKONG_MEMBER_MAX_SCORE_RATIO = "HAIKONG_MEMBER_MAX_SCORE_RATIO"; public static final String CUSTOMS_PORT_CODE = "CUSTOMS_PORT_CODE"; /* --------------------------------------------------系统常量----------------------------------------------- */ /* --------------------------------------------------环境常量----------------------------------------------- */ public static final String DEV = "dev"; public static final String TEST = "test"; public static final String PRE = "pre"; public static final String PROD = "prod"; /* --------------------------------------------------环境常量----------------------------------------------- */ /* --------------------------------------------------支付宝常量----------------------------------------------- */ //响应的是否成功 public static final String SUCCESS = "T"; public static final String SUCCESS_CODE = "SUCCESS"; //失败 public static final String FAIL = "F"; public static final String FAIL_CODE = "FAIL"; //支付公司标识:支付宝 public static final String ALIPAY = "00"; //微信 public static final String WECHAT = "10"; //工行 public static final String ICBC = "20"; /* --------------------------------------------------支付宝常量----------------------------------------------- */ /** * 活动主题枚举 */ public enum ActivityTopicEnum { /** * 满赠活动 */ MZ("mz", "满赠", 3), /** * 限时特价活动 */ LSCX("lscx", "限时特价", 1), /** * 优惠券活动 */ YHQ("yhq", "优惠券", 5), /** * 积分抵扣 */ JFDK("jfdk", "积分抵扣", 99), /** * 赠送积分 */ ZSJF("zsjf", "赠送积分", 80), ; private final String topicCode; private final String topicName; private final Integer priority; ActivityTopicEnum(String topicCode, String topicName, Integer priority) { this.topicCode = topicCode; this.topicName = topicName; this.priority = priority; } public String getTopicCode() { return topicCode; } public String getTopicName() { return topicName; } public Integer getPriority() { return priority; } } /** * 活动类型 */ public enum ActivityType { /** * 按品牌参加活动 */ BRAND("0", "商品品牌"), /** * 按分类参加活动 */ CATEGORY("1", "商品分类"), /** * 按单个商品参加活动 */ PRODUCT("2", "商品") ; private final String activityTypeCode; private final String activityType; ActivityType(String activityTypeCode, String activityType) { this.activityTypeCode = activityTypeCode; this.activityType = activityType; } public String getActivityTypeCode() { return activityTypeCode; } public String getActivityType() { return activityType; } public static ActivityType customValueOf(String val) { for (ActivityType value : ActivityType.values()) { if (val.equals(value.getActivityTypeCode())) { return value; } } return null; } } /** * 参与了限时特价的商品是否参与积分抵扣 */ public enum PromotionActivityRejectEnum { /** * 允许参加积分抵扣 */ ALLOW("0", "不互斥"), /** * 不允许参加积分抵扣 */ REJECT("1", "互斥"), ; private final String code; private final String desc; PromotionActivityRejectEnum(String code, String desc) { this.code = code; this.desc = desc; } public String getCode() { return code; } public String getDesc() { return desc; } } /** * 会员积分生成规则类型 */ public enum MemberScoreRulesEnum{ /** * 门店规则 */ ZERO(0, "门店"), /** * 分类规则 */ ONE(1, "商品分类"), /** * 单个商品规则 */ TWO(2, "商品") ; private final Integer code; private final String type; MemberScoreRulesEnum(Integer code, String type) { this.code = code; this.type = type; } public Integer getCode() { return code; } public String getType() { return type; } } /** * 积分抵扣活动,是否参与 */ public enum RejectStatus { /** * 参加积分抵扣 */ ALLOW("0", "参与"), /** * 不参加积分抵扣 */ REJECT("1", "不参与"), ; private final String code; private final String desc; RejectStatus(String code, String desc) { this.code = code; this.desc = desc; } public String getCode() { return code; } public String getDesc() { return desc; } } /** * 海关申报状态,10:等待海关处理,11:海关申报中,12:海关申报成功,13:海关申报中失败 */ public enum DocStatus { item_10("10", "等待海关处理"), item_11("11", "海关申报中"), item_12("12", "海关申报成功"), item_13("13", "海关申报中失败"); private String item; private String itemName; DocStatus(String item, String itemName) { this.item = item; this.itemName = itemName; } public String getItem() { return item; } public void setItem(String item) { this.item = item; } public String getItemName() { return itemName; } public void setItemName(String itemName) { this.itemName = itemName; } } /** * 库存类型,string (50),SY=所有,ZP=正品, CC=残次,JS=机损, XS= 箱损, ZT=在途库存,默认为查所有类型的库存 */ public enum InventoryType { /** * 所有库存 */ SY("SY", "所有"), /** * 正品库存 */ ZP("ZP", "正品"), /** * 残次库存 */ CC("CC", "残次"), /** * 机损库存 */ JS("JS", "机损"), /** * 箱损库存 */ XS("XS", "箱损"), /** * 在途库存 */ ZT("ZT", "在途"), ; private final String type; private final String desc; InventoryType(String type, String desc) { this.type = type; this.desc = desc; } public String getType() { return type; } public String getDesc() { return desc; } } /** * 0:普通入库 * 1:调拨入库 * 2:销售出库(下单时自动写入明细,不需要导入) * 3:普通出库 * 4:调拨出库 */ public enum StockChangeType { /** * 普通入库 */ item_0("0", "普通入库"), /** * 调拨入库 */ item_1("1", "调拨入库"), /** * 销售出库 */ item_2("2", "销售出库"), item_3("3", "普通出库"), item_4("4", "调拨出库"), ; private final String type; private final String desc; StockChangeType(String type, String desc) { this.type = type; this.desc = desc; } public String getType() { return type; } public String getDesc() { return desc; } } /** * 审核状态,0:待审核 1:审核成功 2:审核拒绝 */ public enum AuditStatus { WAIT_AUDIT("0", "待审核"), AUDIT_SUCCESS("1", "审核成功"), AUDIT_REJECT("2", "审核拒绝"), ; private final String type; private final String desc; AuditStatus(String type, String desc) { this.type = type; this.desc = desc; } public String getType() { return type; } public String getDesc() { return desc; } } }