Browse Source

平台优惠券bug修复

ssk 2 months ago
parent
commit
7f2f1db29f

+ 5 - 5
alien-store/src/main/java/shop/alien/store/service/impl/LifeDiscountCouponServiceImpl.java

@@ -676,7 +676,7 @@ public class LifeDiscountCouponServiceImpl extends ServiceImpl<LifeDiscountCoupo
         for (LifeDiscountCouponUser lifeDiscountCouponUser : lifeDiscountCouponUserIPage.getRecords()) {
         for (LifeDiscountCouponUser lifeDiscountCouponUser : lifeDiscountCouponUserIPage.getRecords()) {
             LifeDiscountCoupon lifeDiscountCouponOne = lifeDiscountCoupons.stream().filter(lifeDiscountCoupon -> lifeDiscountCoupon.getId().equals(lifeDiscountCouponUser.getCouponId())).collect(Collectors.toList()).get(0);
             LifeDiscountCoupon lifeDiscountCouponOne = lifeDiscountCoupons.stream().filter(lifeDiscountCoupon -> lifeDiscountCoupon.getId().equals(lifeDiscountCouponUser.getCouponId())).collect(Collectors.toList()).get(0);
             StoreInfo storeInfoOne = null;
             StoreInfo storeInfoOne = null;
-            if (!storeInfoList.isEmpty()) {
+            if (!storeInfoList.isEmpty() && !StringUtils.isEmpty(lifeDiscountCouponOne.getStoreId())) {
                 storeInfoOne = storeInfoList.stream().filter(storeInfo -> storeInfo.getId().toString().equals(lifeDiscountCouponOne.getStoreId())).collect(Collectors.toList()).get(0);
                 storeInfoOne = storeInfoList.stream().filter(storeInfo -> storeInfo.getId().toString().equals(lifeDiscountCouponOne.getStoreId())).collect(Collectors.toList()).get(0);
             }
             }
             LifeDiscountCouponVo lifeDiscountCouponVo = new LifeDiscountCouponVo();
             LifeDiscountCouponVo lifeDiscountCouponVo = new LifeDiscountCouponVo();
@@ -770,7 +770,7 @@ public class LifeDiscountCouponServiceImpl extends ServiceImpl<LifeDiscountCoupo
                         lifeDiscountCouponVo.setStatus(Integer.parseInt(DiscountCouponEnum.HAVE_NOT_STARTED.getValue()));
                         lifeDiscountCouponVo.setStatus(Integer.parseInt(DiscountCouponEnum.HAVE_NOT_STARTED.getValue()));
                     } else if (lifeDiscountCoupon.getGetStatus() == null || lifeDiscountCoupon.getGetStatus().toString().equals(DiscountCouponEnum.NO_GET.getValue())) {
                     } else if (lifeDiscountCoupon.getGetStatus() == null || lifeDiscountCoupon.getGetStatus().toString().equals(DiscountCouponEnum.NO_GET.getValue())) {
                         lifeDiscountCouponVo.setStatus(Integer.parseInt(DiscountCouponEnum.SUSPEND_GET.getValue()));
                         lifeDiscountCouponVo.setStatus(Integer.parseInt(DiscountCouponEnum.SUSPEND_GET.getValue()));
-                    }  else if (endResult > 0) {
+                    } else if (endResult > 0) {
                         lifeDiscountCouponVo.setStatus(Integer.parseInt(DiscountCouponEnum.FINISHED.getValue()));
                         lifeDiscountCouponVo.setStatus(Integer.parseInt(DiscountCouponEnum.FINISHED.getValue()));
                     } else if (startResult >= 0 && endResult <= 0) {
                     } else if (startResult >= 0 && endResult <= 0) {
                         lifeDiscountCouponVo.setStatus(Integer.parseInt(DiscountCouponEnum.UNDER_WAY.getValue()));
                         lifeDiscountCouponVo.setStatus(Integer.parseInt(DiscountCouponEnum.UNDER_WAY.getValue()));
@@ -1190,14 +1190,14 @@ public class LifeDiscountCouponServiceImpl extends ServiceImpl<LifeDiscountCoupo
     @Override
     @Override
     public List<LifeDiscountCoupon> getPlatformCoupon(Integer couponId, Integer couponType) {
     public List<LifeDiscountCoupon> getPlatformCoupon(Integer couponId, Integer couponType) {
         LambdaQueryWrapper<LifeDiscountCoupon> lifeDiscountCouponLambdaQueryWrapper = new LambdaQueryWrapper<>();
         LambdaQueryWrapper<LifeDiscountCoupon> lifeDiscountCouponLambdaQueryWrapper = new LambdaQueryWrapper<>();
-        if(couponId != null){
+        if (couponId != null) {
             lifeDiscountCouponLambdaQueryWrapper.eq(LifeDiscountCoupon::getId, couponId);
             lifeDiscountCouponLambdaQueryWrapper.eq(LifeDiscountCoupon::getId, couponId);
         }
         }
-        if(couponType != null){
+        if (couponType != null) {
             lifeDiscountCouponLambdaQueryWrapper.eq(LifeDiscountCoupon::getType, couponType);
             lifeDiscountCouponLambdaQueryWrapper.eq(LifeDiscountCoupon::getType, couponType);
         }
         }
         lifeDiscountCouponLambdaQueryWrapper.eq(LifeDiscountCoupon::getDeleteFlag, 0);
         lifeDiscountCouponLambdaQueryWrapper.eq(LifeDiscountCoupon::getDeleteFlag, 0);
-        lifeDiscountCouponLambdaQueryWrapper.eq(LifeDiscountCoupon::getGetStatus,1);
+        lifeDiscountCouponLambdaQueryWrapper.eq(LifeDiscountCoupon::getGetStatus, 1);
         return lifeDiscountCouponMapper.selectList(lifeDiscountCouponLambdaQueryWrapper);
         return lifeDiscountCouponMapper.selectList(lifeDiscountCouponLambdaQueryWrapper);
     }
     }
 }
 }