Coupon.java 2.6 KB

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