Constants.java 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324
  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. /* --------------------------------------------------系统常量----------------------------------------------- */
  18. /* --------------------------------------------------支付宝常量----------------------------------------------- */
  19. //响应的是否成功
  20. public static final String SUCCESS = "T";
  21. public static final String SUCCESS_CODE = "SUCCESS";
  22. //失败
  23. public static final String FAIL = "F";
  24. public static final String FAIL_CODE = "FAIL";
  25. //支付公司标识:支付宝
  26. public static final String ALIPAY = "00";
  27. //微信
  28. public static final String WECHAT = "10";
  29. //工行
  30. public static final String ICBC = "20";
  31. /* --------------------------------------------------支付宝常量----------------------------------------------- */
  32. /**
  33. * 活动主题枚举
  34. */
  35. public enum ActivityTopicEnum {
  36. /**
  37. * 满赠活动
  38. */
  39. MZ("mz", "满赠", 3),
  40. /**
  41. * 限时特价活动
  42. */
  43. LSCX("lscx", "限时特价", 1),
  44. /**
  45. * 优惠券活动
  46. */
  47. YHQ("yhq", "优惠券", 5),
  48. /**
  49. * 积分抵扣
  50. */
  51. JFDK("jfdk", "积分抵扣", 99),
  52. ;
  53. private final String topicCode;
  54. private final String topicName;
  55. private final Integer priority;
  56. ActivityTopicEnum(String topicCode, String topicName, Integer priority) {
  57. this.topicCode = topicCode;
  58. this.topicName = topicName;
  59. this.priority = priority;
  60. }
  61. public String getTopicCode() {
  62. return topicCode;
  63. }
  64. public String getTopicName() {
  65. return topicName;
  66. }
  67. public Integer getPriority() {
  68. return priority;
  69. }
  70. }
  71. /**
  72. * 活动类型
  73. */
  74. public enum ActivityType {
  75. /**
  76. * 按品牌参加活动
  77. */
  78. BRAND("0", "商品品牌"),
  79. /**
  80. * 按分类参加活动
  81. */
  82. CATEGORY("1", "商品分类"),
  83. /**
  84. * 按单个商品参加活动
  85. */
  86. PRODUCT("2", "商品")
  87. ;
  88. private final String activityTypeCode;
  89. private final String activityType;
  90. ActivityType(String activityTypeCode, String activityType) {
  91. this.activityTypeCode = activityTypeCode;
  92. this.activityType = activityType;
  93. }
  94. public String getActivityTypeCode() {
  95. return activityTypeCode;
  96. }
  97. public String getActivityType() {
  98. return activityType;
  99. }
  100. public static ActivityType customValueOf(String val) {
  101. for (ActivityType value : ActivityType.values()) {
  102. if (val.equals(value.getActivityTypeCode())) {
  103. return value;
  104. }
  105. }
  106. return null;
  107. }
  108. }
  109. /**
  110. * 参与了限时特价的商品是否参与积分抵扣
  111. */
  112. public enum PromotionActivityRejectEnum {
  113. /**
  114. * 允许参加积分抵扣
  115. */
  116. ALLOW("0", "不互斥"),
  117. /**
  118. * 不允许参加积分抵扣
  119. */
  120. REJECT("1", "互斥"),
  121. ;
  122. private final String code;
  123. private final String desc;
  124. PromotionActivityRejectEnum(String code, String desc) {
  125. this.code = code;
  126. this.desc = desc;
  127. }
  128. public String getCode() {
  129. return code;
  130. }
  131. public String getDesc() {
  132. return desc;
  133. }
  134. }
  135. /**
  136. * 会员积分生成规则类型
  137. */
  138. public enum MemberScoreRulesEnum{
  139. /**
  140. * 门店规则
  141. */
  142. ZERO(0, "门店"),
  143. /**
  144. * 分类规则
  145. */
  146. ONE(1, "商品分类"),
  147. /**
  148. * 单个商品规则
  149. */
  150. TWO(2, "商品")
  151. ;
  152. private final Integer code;
  153. private final String type;
  154. MemberScoreRulesEnum(Integer code, String type) {
  155. this.code = code;
  156. this.type = type;
  157. }
  158. public Integer getCode() {
  159. return code;
  160. }
  161. public String getType() {
  162. return type;
  163. }
  164. }
  165. /**
  166. * 积分抵扣活动,是否参与
  167. */
  168. public enum RejectStatus {
  169. /**
  170. * 参加积分抵扣
  171. */
  172. ALLOW("0", "参与"),
  173. /**
  174. * 不参加积分抵扣
  175. */
  176. REJECT("1", "不参与"),
  177. ;
  178. private final String code;
  179. private final String desc;
  180. RejectStatus(String code, String desc) {
  181. this.code = code;
  182. this.desc = desc;
  183. }
  184. public String getCode() {
  185. return code;
  186. }
  187. public String getDesc() {
  188. return desc;
  189. }
  190. }
  191. /**
  192. * 海关申报状态,10:等待海关处理,11:海关申报中,12:海关申报成功,13:海关申报中失败
  193. */
  194. public enum DocStatus {
  195. item_10("10", "等待海关处理"),
  196. item_11("11", "海关申报中"),
  197. item_12("12", "海关申报成功"),
  198. item_13("13", "海关申报中失败");
  199. private String item;
  200. private String itemName;
  201. DocStatus(String item, String itemName) {
  202. this.item = item;
  203. this.itemName = itemName;
  204. }
  205. public String getItem() {
  206. return item;
  207. }
  208. public void setItem(String item) {
  209. this.item = item;
  210. }
  211. public String getItemName() {
  212. return itemName;
  213. }
  214. public void setItemName(String itemName) {
  215. this.itemName = itemName;
  216. }
  217. }
  218. /**
  219. * 库存类型,string (50),SY=所有,ZP=正品, CC=残次,JS=机损, XS= 箱损, ZT=在途库存,默认为查所有类型的库存
  220. */
  221. public enum InventoryType {
  222. /**
  223. * 所有库存
  224. */
  225. SY("SY", "所有"),
  226. /**
  227. * 正品库存
  228. */
  229. ZP("ZP", "正品"),
  230. /**
  231. * 残次库存
  232. */
  233. CC("CC", "残次"),
  234. /**
  235. * 机损库存
  236. */
  237. JS("JS", "机损"),
  238. /**
  239. * 箱损库存
  240. */
  241. XS("XS", "箱损"),
  242. /**
  243. * 在途库存
  244. */
  245. ZT("ZT", "在途"),
  246. ;
  247. private final String type;
  248. private final String desc;
  249. InventoryType(String type, String desc) {
  250. this.type = type;
  251. this.desc = desc;
  252. }
  253. public String getType() {
  254. return type;
  255. }
  256. public String getDesc() {
  257. return desc;
  258. }
  259. }
  260. }