Constants.java 8.0 KB

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