CouponActiveView.java 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  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. /**
  99. * 使用范围
  100. */
  101. @DbField("c.use_scope")
  102. private Coupon.UseScope useScope;
  103. /**
  104. * 发放数量
  105. */
  106. @DbField("ca.num")
  107. private Integer num;
  108. /**
  109. * 状态(默认启用)
  110. */
  111. @DbField("ca.status")
  112. private Boolean status;
  113. /**
  114. * 有效状态(默认有效)
  115. */
  116. @DbField("ca.expiry_status")
  117. private Boolean expiryStatus;
  118. /**
  119. * 剩余数量
  120. */
  121. @DbField("ca.remain_num")
  122. private Integer remainNum;
  123. /**
  124. * 领取人数
  125. */
  126. @DbIgnore
  127. private Integer receiptNum;
  128. /**
  129. * 使用人数
  130. */
  131. @DbIgnore
  132. private Integer usedNum;
  133. @DbIgnore
  134. private CouponStatus couponStatus;
  135. @DbIgnore
  136. @JsonIgnore
  137. private Integer order;
  138. @DbField("ca.created_time")
  139. private Date createdTime;
  140. @Getter
  141. public enum CouponStatus {
  142. collecting("collecting", "待领取"),
  143. received("received", "已领取"),
  144. over("over", "已领完"),
  145. stop("stop", "停止领取"),
  146. ;
  147. private String status;
  148. private String desc;
  149. CouponStatus(String status, String desc) {
  150. this.status = status;
  151. this.desc = desc;
  152. }
  153. }
  154. }