Explorar o código

Merge remote-tracking branch 'origin/master'

FengChaoYu hai 1 mes
pai
achega
78611526a0

+ 7 - 3
src/main/java/com/gree/mall/manager/logic/coupon/CouponLogic.java

@@ -280,9 +280,6 @@ public class CouponLogic {
                 couponUser.setCreateTime(new Date());
                 couponUser.setCreateTime(new Date());
                 couponUserList.add(couponUser);
                 couponUserList.add(couponUser);
             }
             }
-            if (userCouponList.size() > 0) {
-                userCouponService.saveBatch(userCouponList);
-            }
             if (couponUserList.size() > 0) {
             if (couponUserList.size() > 0) {
                 couponUserService.saveBatch(couponUserList);
                 couponUserService.saveBatch(couponUserList);
             }
             }
@@ -309,6 +306,13 @@ public class CouponLogic {
         }
         }
 
 
 
 
+        couponService.lambdaUpdate()
+                .eq(Coupon::getFlag, CouponFlagEnum.WAIT.toString())
+                .le(Coupon::getObtainStartTime, new Date())
+                .set(Coupon::getFlag, CouponFlagEnum.START.toString())
+                .update();
+
+
     }
     }
 
 
 
 

+ 5 - 0
src/main/java/com/gree/mall/manager/logic/user/UserLogic.java

@@ -31,6 +31,7 @@ import com.gree.mall.manager.plus.entity.*;
 import com.gree.mall.manager.plus.service.*;
 import com.gree.mall.manager.plus.service.*;
 import com.gree.mall.manager.utils.CommonUtils;
 import com.gree.mall.manager.utils.CommonUtils;
 import com.gree.mall.manager.utils.RedisUtil;
 import com.gree.mall.manager.utils.RedisUtil;
+import com.gree.mall.manager.utils.StringUtil;
 import com.gree.mall.manager.utils.excel.ExcelUtils;
 import com.gree.mall.manager.utils.excel.ExcelUtils;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.collections4.CollectionUtils;
@@ -243,6 +244,10 @@ public class UserLogic {
             throw new RemoteServiceException("请先取消内部人员");
             throw new RemoteServiceException("请先取消内部人员");
         }
         }
 
 
+        if (StringUtil.isEmpty(websitId) && isService) {
+            throw new RemoteServiceException("必须要有所属网点");
+        }
+
         final List<String> userIds = Collections.singletonList(userId);
         final List<String> userIds = Collections.singletonList(userId);
         this.batchChangeServiceUser(userIds, isService);
         this.batchChangeServiceUser(userIds, isService);