Constants.java 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410
  1. package com.kmall.admin.haikong.constant;
  2. import java.util.Arrays;
  3. /**
  4. * 常量类
  5. * @author lhm
  6. * @createDate 2021-10-30
  7. */
  8. public class Constants {
  9. /* --------------------------------------------------redis常量----------------------------------------------- */
  10. public static final String MEMBER_SYS_ACCESS_TOKEN_REDIS_KEY = "haikong_memberSys_accessToken";
  11. public static final String MEMBER_SYS_REFRESH_TOKEN_REDIS_KEY = "haikong_memberSys_refreshToken";
  12. public static final String WAREHOUSE_STOCK_MAP_KEY = "haikong_warehouse_stock_cache";
  13. /* --------------------------------------------------redis常量----------------------------------------------- */
  14. /* --------------------------------------------------系统常量----------------------------------------------- */
  15. public static final String HAIKONG_MEMBER_SCORE_LIMIT = "HAIKONG_MEMBER_SCORE_LIMIT";
  16. public static final String HAIKONG_MEMBER_MAX_SCORE_RATIO = "HAIKONG_MEMBER_MAX_SCORE_RATIO";
  17. public static final String CUSTOMS_PORT_CODE = "CUSTOMS_PORT_CODE";
  18. /* --------------------------------------------------系统常量----------------------------------------------- */
  19. /* --------------------------------------------------环境常量----------------------------------------------- */
  20. public static final String DEV = "dev";
  21. public static final String TEST = "test";
  22. public static final String PRE = "pre";
  23. public static final String PROD = "prod";
  24. /* --------------------------------------------------环境常量----------------------------------------------- */
  25. /* --------------------------------------------------支付宝常量----------------------------------------------- */
  26. //响应的是否成功
  27. public static final String SUCCESS = "T";
  28. public static final String SUCCESS_CODE = "SUCCESS";
  29. //失败
  30. public static final String FAIL = "F";
  31. public static final String FAIL_CODE = "FAIL";
  32. //支付公司标识:支付宝
  33. public static final String ALIPAY = "00";
  34. //微信
  35. public static final String WECHAT = "10";
  36. //工行
  37. public static final String ICBC = "20";
  38. /* --------------------------------------------------支付宝常量----------------------------------------------- */
  39. /**
  40. * 活动主题枚举
  41. */
  42. public enum ActivityTopicEnum {
  43. /**
  44. * 满赠活动
  45. */
  46. MZ("mz", "满赠", 3),
  47. /**
  48. * 限时特价活动
  49. */
  50. LSCX("lscx", "限时特价", 1),
  51. /**
  52. * 优惠券活动
  53. */
  54. YHQ("yhq", "优惠券", 5),
  55. /**
  56. * 积分抵扣
  57. */
  58. JFDK("jfdk", "积分抵扣", 99),
  59. /**
  60. * 赠送积分
  61. */
  62. ZSJF("zsjf", "赠送积分", 80),
  63. ;
  64. private final String topicCode;
  65. private final String topicName;
  66. private final Integer priority;
  67. ActivityTopicEnum(String topicCode, String topicName, Integer priority) {
  68. this.topicCode = topicCode;
  69. this.topicName = topicName;
  70. this.priority = priority;
  71. }
  72. public String getTopicCode() {
  73. return topicCode;
  74. }
  75. public String getTopicName() {
  76. return topicName;
  77. }
  78. public Integer getPriority() {
  79. return priority;
  80. }
  81. }
  82. /**
  83. * 活动类型
  84. */
  85. public enum ActivityType {
  86. /**
  87. * 按品牌参加活动
  88. */
  89. BRAND("0", "商品品牌"),
  90. /**
  91. * 按分类参加活动
  92. */
  93. CATEGORY("1", "商品分类"),
  94. /**
  95. * 按单个商品参加活动
  96. */
  97. PRODUCT("2", "商品")
  98. ;
  99. private final String activityTypeCode;
  100. private final String activityType;
  101. ActivityType(String activityTypeCode, String activityType) {
  102. this.activityTypeCode = activityTypeCode;
  103. this.activityType = activityType;
  104. }
  105. public String getActivityTypeCode() {
  106. return activityTypeCode;
  107. }
  108. public String getActivityType() {
  109. return activityType;
  110. }
  111. public static ActivityType customValueOf(String val) {
  112. for (ActivityType value : ActivityType.values()) {
  113. if (val.equals(value.getActivityTypeCode())) {
  114. return value;
  115. }
  116. }
  117. return null;
  118. }
  119. }
  120. /**
  121. * 参与了限时特价的商品是否参与积分抵扣
  122. */
  123. public enum PromotionActivityRejectEnum {
  124. /**
  125. * 允许参加积分抵扣
  126. */
  127. ALLOW("0", "不互斥"),
  128. /**
  129. * 不允许参加积分抵扣
  130. */
  131. REJECT("1", "互斥"),
  132. ;
  133. private final String code;
  134. private final String desc;
  135. PromotionActivityRejectEnum(String code, String desc) {
  136. this.code = code;
  137. this.desc = desc;
  138. }
  139. public String getCode() {
  140. return code;
  141. }
  142. public String getDesc() {
  143. return desc;
  144. }
  145. }
  146. /**
  147. * 会员积分生成规则类型
  148. */
  149. public enum MemberScoreRulesEnum{
  150. /**
  151. * 门店规则
  152. */
  153. ZERO(0, "门店"),
  154. /**
  155. * 分类规则
  156. */
  157. ONE(1, "商品分类"),
  158. /**
  159. * 单个商品规则
  160. */
  161. TWO(2, "商品")
  162. ;
  163. private final Integer code;
  164. private final String type;
  165. MemberScoreRulesEnum(Integer code, String type) {
  166. this.code = code;
  167. this.type = type;
  168. }
  169. public Integer getCode() {
  170. return code;
  171. }
  172. public String getType() {
  173. return type;
  174. }
  175. }
  176. /**
  177. * 积分抵扣活动,是否参与
  178. */
  179. public enum RejectStatus {
  180. /**
  181. * 参加积分抵扣
  182. */
  183. ALLOW("0", "参与"),
  184. /**
  185. * 不参加积分抵扣
  186. */
  187. REJECT("1", "不参与"),
  188. ;
  189. private final String code;
  190. private final String desc;
  191. RejectStatus(String code, String desc) {
  192. this.code = code;
  193. this.desc = desc;
  194. }
  195. public String getCode() {
  196. return code;
  197. }
  198. public String getDesc() {
  199. return desc;
  200. }
  201. }
  202. /**
  203. * 海关申报状态,10:等待海关处理,11:海关申报中,12:海关申报成功,13:海关申报中失败
  204. */
  205. public enum DocStatus {
  206. item_10("10", "等待海关处理"),
  207. item_11("11", "海关申报中"),
  208. item_12("12", "海关申报成功"),
  209. item_13("13", "海关申报中失败");
  210. private String item;
  211. private String itemName;
  212. DocStatus(String item, String itemName) {
  213. this.item = item;
  214. this.itemName = itemName;
  215. }
  216. public String getItem() {
  217. return item;
  218. }
  219. public void setItem(String item) {
  220. this.item = item;
  221. }
  222. public String getItemName() {
  223. return itemName;
  224. }
  225. public void setItemName(String itemName) {
  226. this.itemName = itemName;
  227. }
  228. }
  229. /**
  230. * 库存类型,string (50),SY=所有,ZP=正品, CC=残次,JS=机损, XS= 箱损, ZT=在途库存,默认为查所有类型的库存
  231. */
  232. public enum InventoryType {
  233. /**
  234. * 所有库存
  235. */
  236. SY("SY", "所有"),
  237. /**
  238. * 正品库存
  239. */
  240. ZP("ZP", "正品"),
  241. /**
  242. * 残次库存
  243. */
  244. CC("CC", "残次"),
  245. /**
  246. * 机损库存
  247. */
  248. JS("JS", "机损"),
  249. /**
  250. * 箱损库存
  251. */
  252. XS("XS", "箱损"),
  253. /**
  254. * 在途库存
  255. */
  256. ZT("ZT", "在途"),
  257. ;
  258. private final String type;
  259. private final String desc;
  260. InventoryType(String type, String desc) {
  261. this.type = type;
  262. this.desc = desc;
  263. }
  264. public String getType() {
  265. return type;
  266. }
  267. public String getDesc() {
  268. return desc;
  269. }
  270. }
  271. /**
  272. * 0:普通入库
  273. * 1:调拨入库
  274. * 2:销售出库(下单时自动写入明细,不需要导入)
  275. * 3:普通出库
  276. * 4:调拨出库
  277. */
  278. public enum StockChangeType {
  279. /**
  280. * 普通入库
  281. */
  282. item_0("0", "普通入库"),
  283. /**
  284. * 调拨入库
  285. */
  286. item_1("1", "调拨入库"),
  287. /**
  288. * 销售出库
  289. */
  290. item_2("2", "销售出库"),
  291. item_3("3", "普通出库"),
  292. item_4("4", "调拨出库"),
  293. ;
  294. private final String type;
  295. private final String desc;
  296. StockChangeType(String type, String desc) {
  297. this.type = type;
  298. this.desc = desc;
  299. }
  300. public String getType() {
  301. return type;
  302. }
  303. public String getDesc() {
  304. return desc;
  305. }
  306. }
  307. /**
  308. * 审核状态,0:待审核 1:审核成功 2:审核拒绝
  309. */
  310. public enum AuditStatus {
  311. WAIT_AUDIT("0", "待审核"),
  312. AUDIT_SUCCESS("1", "审核成功"),
  313. AUDIT_REJECT("2", "审核拒绝"),
  314. ;
  315. private final String type;
  316. private final String desc;
  317. AuditStatus(String type, String desc) {
  318. this.type = type;
  319. this.desc = desc;
  320. }
  321. public String getType() {
  322. return type;
  323. }
  324. public String getDesc() {
  325. return desc;
  326. }
  327. }
  328. }