Przeglądaj źródła

普通优惠券添加会员标志bugfix

chao 3 lat temu
rodzic
commit
bc0f3172b8

+ 1 - 1
src/main/java/com/caimei/modules/coupon/service/CmCouponService.java

@@ -71,7 +71,7 @@ public class CmCouponService extends CrudService<CmCouponDao, CmCoupon> {
                 Integer num = cmCouponDao.findQuantityRedeemed(coupon.getId());
                 coupon.setCodeNum(num);
             } else {
-                if (2 == coupon.getCouponType()) {
+                if (null != coupon.getCouponType() && 2 == coupon.getCouponType()) {
                     //用户专享劵
                     CmCouponClub couponClub = cmCouponDao.findCouponClub(coupon.getId());
                     if (couponClub == null) {

+ 0 - 16
src/main/java/com/caimei/modules/coupon/service/CmVipCouponService.java

@@ -60,22 +60,6 @@ public class CmVipCouponService extends CrudService<CmCouponVipDao, CmVipCoupon>
             Date date = new Date();
             couponList.forEach(coupon -> {
                 cmCouponService.setCouponStatus(coupon, date);
-                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);
-                    }
-                }
             });
             vipCoupon.setCouponList(couponList);
         });