CouponActiveView.java 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. package com.cyksj.model.views;
  2. import com.cyksj.model.entity.Coupon;
  3. import com.ejlchina.searcher.bean.DbField;
  4. import com.ejlchina.searcher.bean.DbIgnore;
  5. import com.ejlchina.searcher.bean.SearchBean;
  6. import com.fasterxml.jackson.annotation.JsonIgnore;
  7. import lombok.Getter;
  8. import lombok.Setter;
  9. import java.math.BigDecimal;
  10. import java.util.Date;
  11. import java.util.List;
  12. /*
  13. *项目名: netflix
  14. *文件名: CouponActiveView
  15. *创建者: JavaZou
  16. *创建时间:2022/11/18 10:00
  17. */
  18. @Getter
  19. @Setter
  20. @SearchBean(tables = "coupon_active ca left join coupon c on c.id = ca.coupon_id left join coupon_classification cc on cc.id = c.classification_id",
  21. where = "ca.deleted is true")
  22. public class CouponActiveView {
  23. @DbField("ca.id")
  24. private Long id;
  25. /**
  26. * 优惠券id
  27. */
  28. @DbField("c.id")
  29. private Long couponId;
  30. /**
  31. * 优惠券名称
  32. */
  33. @DbField("c.name")
  34. private String name;
  35. @DbField("cc.id")
  36. private Long classificationId;
  37. @DbField("cc.name")
  38. private String couponClassificationName;
  39. /**
  40. * 优惠券平台类型
  41. */
  42. @DbField("c.goods_type")
  43. private Coupon.GoodsType goodsType;
  44. /**
  45. * 优惠券类型
  46. */
  47. @DbField("c.type")
  48. private Coupon.Type type;
  49. /**
  50. * 可用满减卷金额条件
  51. */
  52. @DbField("c.reduce_condition")
  53. private BigDecimal reduceCondition;
  54. /**
  55. * 抵扣金额
  56. */
  57. @DbField("c.reduce_money")
  58. private BigDecimal reduceMoney;
  59. /**
  60. * 折扣
  61. */
  62. @DbField("c.discount")
  63. private BigDecimal discount;
  64. /**
  65. * 领取人范围
  66. */
  67. @DbField("c.scope")
  68. private Coupon.Scope scope;
  69. /**
  70. * 平台规格集合
  71. */
  72. @DbField("c.goods_sku_ids")
  73. private String goodsSkuIds;
  74. @DbIgnore
  75. private String goodsSkuStr;
  76. @DbIgnore
  77. private List<GoodsDonSkuView> skuViewList;
  78. /**
  79. * 是否是有效时间
  80. */
  81. @DbField("c.is_valid_time")
  82. private Boolean isValidTime;
  83. /**
  84. * 起始有效时间
  85. */
  86. @DbField("c.valid_start_time")
  87. private Date validStartTime;
  88. /**
  89. * 截止有效时间
  90. */
  91. @DbField("c.valid_end_time")
  92. private Date validEndTime;
  93. /**
  94. * 领取有效天数
  95. */
  96. @DbField("c.valid_days")
  97. private Integer validDays;
  98. @DbField("c.valid_hours")
  99. private Integer validHours;
  100. /**
  101. * 使用范围
  102. */
  103. @DbField("c.use_scope")
  104. private Coupon.UseScope useScope;
  105. /**
  106. * 发放数量
  107. */
  108. @DbField("ca.num")
  109. private Integer num;
  110. /**
  111. * 状态(默认启用)
  112. */
  113. @DbField("ca.status")
  114. private Boolean status;
  115. /**
  116. * 有效状态(默认有效)
  117. */
  118. @DbField("ca.expiry_status")
  119. private Boolean expiryStatus;
  120. /**
  121. * 剩余数量
  122. */
  123. @DbField("ca.remain_num")
  124. private Integer remainNum;
  125. /**
  126. * 领取人数
  127. */
  128. @DbIgnore
  129. private Integer receiptNum;
  130. /**
  131. * 使用人数
  132. */
  133. @DbIgnore
  134. private Integer usedNum;
  135. @DbIgnore
  136. private CouponStatus couponStatus;
  137. @DbIgnore
  138. @JsonIgnore
  139. private Integer order;
  140. @DbField("ca.created_time")
  141. private Date createdTime;
  142. @Getter
  143. public enum CouponStatus {
  144. collecting("collecting", "待领取"),
  145. received("received", "已领取"),
  146. over("over", "已领完"),
  147. stop("stop", "停止领取"),
  148. ;
  149. private String status;
  150. private String desc;
  151. CouponStatus(String status, String desc) {
  152. this.status = status;
  153. this.desc = desc;
  154. }
  155. }
  156. }