Browse Source

配置增加非空判断

liangpeile 1 year ago
parent
commit
ac63e0c477

+ 3 - 0
crmeb-front/src/main/java/com/zbkj/front/controller/NewFrontApi.java

@@ -562,6 +562,9 @@ public class NewFrontApi {
     public CommonResult<?> specialReminder() {
         HashMap<String, String> info = systemConfigService.info(58);
         String specialReminder = info.get("specialReminder");
+        if (StringUtils.isNotBlank(specialReminder)){
+            return CommonResult.success("");
+        }
         return CommonResult.success(specialReminder);
     }
 }

+ 14 - 13
crmeb-service/src/main/java/com/zbkj/service/service/impl/CartServiceImpl.java

@@ -7,6 +7,7 @@ import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.zbkj.common.constants.DateConstants;
@@ -143,19 +144,19 @@ public class CartServiceImpl extends ServiceImpl<CartDao, Cart> implements CartS
         for (CartShare cartShare : cartList) {
             HashMap<String, String> info = systemConfigService.info(58);
             String loseTime = info.get("loseTime");
-
-            Date dt = cartShare.getStartTime();
-            Calendar rightNow = Calendar.getInstance();
-            rightNow.setTime(dt);
-            rightNow.add(Calendar.HOUR, Integer.parseInt(loseTime));
-            Date endTime = rightNow.getTime();
-
-            Date date = new Date();
-
-            if (date.after(endTime)) {
-                cartShare.setIsInvalid(0);
-            } else {
-                cartShare.setIsInvalid(1);
+            if (StringUtils.isNotBlank(loseTime)){
+                Date dt = cartShare.getStartTime();
+                Calendar rightNow = Calendar.getInstance();
+                rightNow.setTime(dt);
+                rightNow.add(Calendar.HOUR, Integer.parseInt(loseTime));
+                Date endTime = rightNow.getTime();
+                Date date = new Date();
+
+                if (date.after(endTime)) {
+                    cartShare.setIsInvalid(0);
+                } else {
+                    cartShare.setIsInvalid(1);
+                }
             }
             cartShareService.updateByShareId(cartShare.getShareId(),cartShare.getIsInvalid());
         }