Constants.java 7.2 KB

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