Coupon.java 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. package com.cyksj.model.entity;
  2. import com.baomidou.mybatisplus.annotation.TableLogic;
  3. import lombok.Getter;
  4. import lombok.Setter;
  5. import javax.validation.constraints.NotEmpty;
  6. import javax.validation.constraints.NotNull;
  7. import java.math.BigDecimal;
  8. import java.util.Date;
  9. /*
  10. *项目名: netflix
  11. *文件名: Coupon
  12. *创建者: JavaZou
  13. *创建时间:2022/11/17 15:49
  14. */
  15. @Getter
  16. @Setter
  17. public class Coupon extends BaseEntity {
  18. /**
  19. * 优惠券名称
  20. */
  21. @NotEmpty(message = "优惠券名称不能为空")
  22. private String name;
  23. /**
  24. * 优惠券分类id
  25. */
  26. private Long classificationId;
  27. /**
  28. * 优惠券平台类型
  29. */
  30. @NotNull(message = "优惠券平台类型不能为空")
  31. private GoodsType goodsType;
  32. /**
  33. * 优惠券类型
  34. */
  35. @NotNull(message = "优惠券类型不能为空")
  36. private Type type;
  37. /**
  38. * 可用满减卷金额条件
  39. */
  40. private BigDecimal reduceCondition;
  41. /**
  42. * 抵扣金额
  43. */
  44. private BigDecimal reduceMoney;
  45. /**
  46. * 折扣
  47. */
  48. private BigDecimal discount;
  49. /**
  50. * 领取人范围
  51. */
  52. @NotNull(message = "领取人不能为空")
  53. private Scope scope;
  54. /**
  55. * 平台规格集合
  56. */
  57. @NotEmpty
  58. private String goodsSkuIds;
  59. /**
  60. * 是否是有效时间
  61. */
  62. private Boolean isValidTime;
  63. /**
  64. * 起始有效时间
  65. */
  66. private Date validStartTime;
  67. /**
  68. * 截止有效时间
  69. */
  70. private Date validEndTime;
  71. /**
  72. * 领取有效天数
  73. */
  74. private Integer validDays;
  75. /**
  76. * 领取有效小时
  77. */
  78. private Integer validHours;
  79. /**
  80. * 使用范围
  81. */
  82. private UseScope useScope;
  83. /**
  84. * 兑换码
  85. */
  86. private String exCode;
  87. /**
  88. * 发放状态
  89. */
  90. private Boolean sendStatus;
  91. /**
  92. * 推荐状态
  93. */
  94. private Boolean hotStatus;
  95. @TableLogic(value = "1", delval = "0")
  96. private Boolean deleted;
  97. @Getter
  98. public enum GoodsType {
  99. realGoods("实物"),
  100. virtualGoods("虚物"),
  101. ;
  102. String type;
  103. GoodsType(String type) {
  104. this.type = type;
  105. }
  106. }
  107. @Getter
  108. public enum Type {
  109. reduce("立减卷"),
  110. discount("折扣卷"),
  111. ;
  112. String desc;
  113. Type(String desc) {
  114. this.desc = desc;
  115. }
  116. }
  117. @Getter
  118. public enum Scope {
  119. everyone("所有人"),
  120. newUser("新用户"),
  121. ;
  122. String desc;
  123. Scope(String desc) {
  124. this.desc = desc;
  125. }
  126. }
  127. @Getter
  128. public enum UseScope {
  129. orders("下单可用"),
  130. renew("续费可用"),
  131. all("所有")
  132. ;
  133. String desc;
  134. UseScope(String desc) {
  135. this.desc = desc;
  136. }
  137. }
  138. @Getter
  139. @Setter
  140. public static class CouponGoodsSku {
  141. private Long goodsId;
  142. private Long skuId;
  143. }
  144. }