CouponUserView.java 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. package com.cyksj.model.views;
  2. import com.cyksj.model.entity.Coupon;
  3. import com.cyksj.model.entity.CouponUser;
  4. import com.ejlchina.searcher.bean.DbField;
  5. import com.ejlchina.searcher.bean.DbIgnore;
  6. import com.ejlchina.searcher.bean.SearchBean;
  7. import com.fasterxml.jackson.annotation.JsonIgnore;
  8. import lombok.Getter;
  9. import lombok.Setter;
  10. import java.math.BigDecimal;
  11. import java.util.Date;
  12. /*
  13. *项目名: netflix
  14. *文件名: CouponUserView
  15. *创建者: JavaZou
  16. *创建时间:2022/11/18 12:12
  17. */
  18. @Getter
  19. @Setter
  20. @SearchBean(tables = "coupon_user cu left join coupon_active ca on ca.id = cu.coupon_active_id" +
  21. " left join coupon c on c.id = cu.coupon_id left join coupon_classification cc on cc.id = c.classification_id",
  22. where = "c.deleted and c.status")
  23. public class CouponUserView {
  24. @DbField("cu.id")
  25. private Long id;
  26. /**
  27. * 获取渠道
  28. */
  29. @DbField("cu.channel")
  30. private CouponUser.Channel channel;
  31. /**
  32. * 优惠券使用状态
  33. */
  34. @DbField("cu.status")
  35. private CouponUser.Status couponUserStatus;
  36. /**
  37. * 用户id
  38. */
  39. @DbField("cu.user_id")
  40. private Long userId;
  41. /**
  42. * 优惠券id
  43. */
  44. @DbField("c.id")
  45. private Long couponId;
  46. /**
  47. * 优惠券发放id
  48. */
  49. @DbField("ca.id")
  50. private Long couponActiveId;
  51. /**
  52. * 优惠券名称
  53. */
  54. @DbField("c.name")
  55. private String name;
  56. @DbField("cc.id")
  57. private Long classificationId;
  58. @DbField("cc.name")
  59. private String couponClassificationName;
  60. /**
  61. * 优惠券平台类型
  62. */
  63. @DbField("c.goods_type")
  64. private Coupon.GoodsType goodsType;
  65. /**
  66. * 优惠券类型
  67. */
  68. @DbField("c.type")
  69. private Coupon.Type type;
  70. /**
  71. * 可用满减卷金额条件
  72. */
  73. @DbField("c.reduce_condition")
  74. private BigDecimal reduceCondition;
  75. @DbField("c.scope")
  76. private Coupon.Scope scope;
  77. /**
  78. * 抵扣金额
  79. */
  80. @DbField("c.reduce_money")
  81. private BigDecimal reduceMoney;
  82. /**
  83. * 折扣
  84. */
  85. @DbField("c.discount")
  86. private BigDecimal discount;
  87. /**
  88. * 平台规格集合
  89. */
  90. @DbField("c.goods_sku_ids")
  91. private String goodsSkuIds;
  92. @DbIgnore
  93. private String goodsSkuStr;
  94. /**
  95. * 是否是有效时间
  96. */
  97. @DbField("c.is_valid_time")
  98. private Boolean isValidTime;
  99. /**
  100. * 起始有效时间
  101. */
  102. @DbField("cu.valid_start_time")
  103. private Date validStartTime;
  104. /**
  105. * 领取有效天数
  106. */
  107. @DbField("c.valid_days")
  108. private Integer validDays;
  109. @DbField("c.valid_hours")
  110. private Integer validHours;
  111. /**
  112. * 截止有效时间
  113. */
  114. @DbField("cu.valid_end_time")
  115. private Date validEndTime;
  116. @DbIgnore
  117. private Long validEndTimestamp;
  118. @DbField("c.use_scope")
  119. private Coupon.UseScope useScope;
  120. /**
  121. * 发放优惠券状态(默认启用)
  122. */
  123. @DbField("ca.status")
  124. private Boolean status;
  125. /**
  126. * 有效状态(默认有效)
  127. */
  128. @DbField("ca.expiry_status")
  129. private Boolean expiryStatus;
  130. @DbField("case when cu.status = 'unused' then 0" +
  131. " when cu.status = 'expired' then 1" +
  132. " when cu.status = 'invalid' then 2" +
  133. " when cu.status = 'used' then 3" +
  134. " end")
  135. @JsonIgnore
  136. private Integer orderBy;
  137. /**
  138. * 0不可用/1可用
  139. */
  140. @DbIgnore
  141. private Boolean isAvailable;
  142. /**
  143. * 不可用原因
  144. */
  145. @DbIgnore
  146. private String reason;
  147. @DbField("cu.created_time")
  148. private Date createdTime;
  149. @DbIgnore
  150. private String goodsImg;
  151. }