Procházet zdrojové kódy

Merge remote-tracking branch 'origin/developerA' into developerA

Aslee před 3 roky
rodič
revize
89dff2d2a5

+ 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);
         });

+ 2 - 1
src/main/resources/mappings/modules/super/CmCouponVipMapper.xml

@@ -99,7 +99,8 @@
                 </foreach>
             </if>
         </where>
-        GROUP BY a.id DESC
+        GROUP BY a.id
+        ORDER BY a.createDate DESC
     </select>
     <delete id="deleteByMonthId">
         UPDATE cm_svip_coupon SET delFlag=1 WHERE montId = #{montId}