CouponUserView.java 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  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. public class CouponUserView {
  23. @DbField("cu.id")
  24. private Long id;
  25. /**
  26. * 获取渠道
  27. */
  28. @DbField("cu.channel")
  29. private CouponUser.Channel channel;
  30. /**
  31. * 优惠券使用状态
  32. */
  33. @DbField("cu.status")
  34. private CouponUser.Status couponUserStatus;
  35. /**
  36. * 用户id
  37. */
  38. @DbField("cu.user_id")
  39. private Long userId;
  40. /**
  41. * 优惠券id
  42. */
  43. @DbField("c.id")
  44. private Long couponId;
  45. /**
  46. * 优惠券发放id
  47. */
  48. @DbField("ca.id")
  49. private Long couponActiveId;
  50. /**
  51. * 优惠券名称
  52. */
  53. @DbField("c.name")
  54. private String name;
  55. @DbField("cc.id")
  56. private Long classificationId;
  57. @DbField("cc.name")
  58. private String couponClassificationName;
  59. /**
  60. * 优惠券平台类型
  61. */
  62. @DbField("c.goods_type")
  63. private Coupon.GoodsType goodsType;
  64. /**
  65. * 优惠券类型
  66. */
  67. @DbField("c.type")
  68. private Coupon.Type type;
  69. /**
  70. * 可用满减卷金额条件
  71. */
  72. @DbField("c.reduce_condition")
  73. private BigDecimal reduceCondition;
  74. @DbField("c.scope")
  75. private Coupon.Scope scope;
  76. /**
  77. * 抵扣金额
  78. */
  79. @DbField("c.reduce_money")
  80. private BigDecimal reduceMoney;
  81. /**
  82. * 折扣
  83. */
  84. @DbField("c.discount")
  85. private BigDecimal discount;
  86. /**
  87. * 平台规格集合
  88. */
  89. @DbField("c.goods_sku_ids")
  90. private String goodsSkuIds;
  91. @DbIgnore
  92. private String goodsSkuStr;
  93. /**
  94. * 是否是有效时间
  95. */
  96. @DbField("c.is_valid_time")
  97. private Boolean isValidTime;
  98. /**
  99. * 起始有效时间
  100. */
  101. @DbField("cu.valid_start_time")
  102. private Date validStartTime;
  103. /**
  104. * 领取有效天数
  105. */
  106. @DbField("c.valid_days")
  107. private Integer validDays;
  108. @DbField("c.valid_hours")
  109. private Integer validHours;
  110. /**
  111. * 截止有效时间
  112. */
  113. @DbField("cu.valid_end_time")
  114. private Date validEndTime;
  115. @DbIgnore
  116. private Long validEndTimestamp;
  117. @DbField("c.use_scope")
  118. private Coupon.UseScope useScope;
  119. /**
  120. * 发放优惠券状态(默认启用)
  121. */
  122. @DbField("ca.status")
  123. private Boolean status;
  124. /**
  125. * 有效状态(默认有效)
  126. */
  127. @DbField("ca.expiry_status")
  128. private Boolean expiryStatus;
  129. @DbField("case when cu.status = 'unused' then 0" +
  130. " when cu.status = 'expired' then 1" +
  131. " when cu.status = 'invalid' then 2" +
  132. " when cu.status = 'used' then 3" +
  133. " end")
  134. @JsonIgnore
  135. private Integer orderBy;
  136. /**
  137. * 0不可用/1可用
  138. */
  139. @DbIgnore
  140. private Boolean isAvailable;
  141. /**
  142. * 不可用原因
  143. */
  144. @DbIgnore
  145. private String reason;
  146. @DbField("cu.created_time")
  147. private Date createdTime;
  148. }