|
@@ -65,15 +65,21 @@ public class CmCouponService extends CrudService<CmCouponDao, CmCoupon> {
|
|
Date date = new Date();
|
|
Date date = new Date();
|
|
couponList.forEach(coupon -> {
|
|
couponList.forEach(coupon -> {
|
|
setCouponStatus(coupon, date);
|
|
setCouponStatus(coupon, date);
|
|
- if (2 == coupon.getCouponType()) {
|
|
|
|
- //用户专享劵
|
|
|
|
- CmCouponClub couponClub = cmCouponDao.findCouponClub(coupon.getId());
|
|
|
|
- if (couponClub == null) {
|
|
|
|
- coupon.setClaimStatus("1");
|
|
|
|
- } else {
|
|
|
|
- coupon.setClaimStatus("2");
|
|
|
|
|
|
+ if ("1".equals(coupon.getCouponsMode())) {
|
|
|
|
+ //兑换码券
|
|
|
|
+ Integer num = cmCouponDao.findQuantityRedeemed(coupon.getId());
|
|
|
|
+ coupon.setCodeNum(num);
|
|
|
|
+ } else {
|
|
|
|
+ if (2 == coupon.getCouponType()) {
|
|
|
|
+ //用户专享劵
|
|
|
|
+ CmCouponClub couponClub = cmCouponDao.findCouponClub(coupon.getId());
|
|
|
|
+ if (couponClub == null) {
|
|
|
|
+ coupon.setClaimStatus("1");
|
|
|
|
+ } else {
|
|
|
|
+ coupon.setClaimStatus("2");
|
|
|
|
+ }
|
|
|
|
+ coupon.setCouponClub(couponClub);
|
|
}
|
|
}
|
|
- coupon.setCouponClub(couponClub);
|
|
|
|
}
|
|
}
|
|
});
|
|
});
|
|
return couponPage;
|
|
return couponPage;
|