1
0

Constants.java 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  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. */
  17. public enum ActivityTopicEnum {
  18. /**
  19. * 满赠活动
  20. */
  21. MZ("mz", "满赠", 3),
  22. /**
  23. * 限时特价活动
  24. */
  25. LSCX("lscx", "限时特价", 1),
  26. /**
  27. * 优惠券活动
  28. */
  29. YHQ("yhq", "优惠券", 5),
  30. /**
  31. * 积分抵扣
  32. */
  33. JFDK("jfdk", "积分抵扣", 99),
  34. ;
  35. private final String topicCode;
  36. private final String topicName;
  37. private final Integer priority;
  38. ActivityTopicEnum(String topicCode, String topicName, Integer priority) {
  39. this.topicCode = topicCode;
  40. this.topicName = topicName;
  41. this.priority = priority;
  42. }
  43. public String getTopicCode() {
  44. return topicCode;
  45. }
  46. public String getTopicName() {
  47. return topicName;
  48. }
  49. public Integer getPriority() {
  50. return priority;
  51. }
  52. }
  53. /**
  54. * 活动类型
  55. */
  56. public enum ActivityType {
  57. /**
  58. * 按品牌参加活动
  59. */
  60. BRAND("0", "商品品牌"),
  61. /**
  62. * 按分类参加活动
  63. */
  64. CATEGORY("1", "商品分类"),
  65. /**
  66. * 按单个商品参加活动
  67. */
  68. PRODUCT("2", "商品")
  69. ;
  70. private final String activityTypeCode;
  71. private final String activityType;
  72. ActivityType(String activityTypeCode, String activityType) {
  73. this.activityTypeCode = activityTypeCode;
  74. this.activityType = activityType;
  75. }
  76. public String getActivityTypeCode() {
  77. return activityTypeCode;
  78. }
  79. public String getActivityType() {
  80. return activityType;
  81. }
  82. public static ActivityType customValueOf(String val) {
  83. for (ActivityType value : ActivityType.values()) {
  84. if (val.equals(value.getActivityTypeCode())) {
  85. return value;
  86. }
  87. }
  88. return null;
  89. }
  90. }
  91. /**
  92. * 参与了限时特价的商品是否参与积分抵扣
  93. */
  94. public enum PromotionActivityRejectEnum {
  95. /**
  96. * 允许参加积分抵扣
  97. */
  98. ALLOW("0", "不互斥"),
  99. /**
  100. * 不允许参加积分抵扣
  101. */
  102. REJECT("1", "互斥"),
  103. ;
  104. private final String code;
  105. private final String desc;
  106. PromotionActivityRejectEnum(String code, String desc) {
  107. this.code = code;
  108. this.desc = desc;
  109. }
  110. public String getCode() {
  111. return code;
  112. }
  113. public String getDesc() {
  114. return desc;
  115. }
  116. }
  117. /**
  118. * 会员积分生成规则类型
  119. */
  120. public enum MemberScoreRulesEnum{
  121. /**
  122. * 门店规则
  123. */
  124. ZERO(0, "门店"),
  125. /**
  126. * 分类规则
  127. */
  128. ONE(1, "商品分类"),
  129. /**
  130. * 单个商品规则
  131. */
  132. TWO(2, "商品")
  133. ;
  134. private final Integer code;
  135. private final String type;
  136. MemberScoreRulesEnum(Integer code, String type) {
  137. this.code = code;
  138. this.type = type;
  139. }
  140. public Integer getCode() {
  141. return code;
  142. }
  143. public String getType() {
  144. return type;
  145. }
  146. }
  147. /**
  148. * 积分抵扣活动,是否参与
  149. */
  150. public enum RejectStatus {
  151. /**
  152. * 参加积分抵扣
  153. */
  154. ALLOW("0", "参与"),
  155. /**
  156. * 不参加积分抵扣
  157. */
  158. REJECT("1", "不参与"),
  159. ;
  160. private final String code;
  161. private final String desc;
  162. RejectStatus(String code, String desc) {
  163. this.code = code;
  164. this.desc = desc;
  165. }
  166. public String getCode() {
  167. return code;
  168. }
  169. public String getDesc() {
  170. return desc;
  171. }
  172. }
  173. }