CouponActiveView.java 2.8 KB

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