‘linchangsheng’ hai 10 meses
pai
achega
753d1e166a

+ 9 - 5
mall-miniapp-service/src/main/java/com/gree/mall/miniapp/logic/user/UserLogic.java

@@ -287,8 +287,12 @@ public class UserLogic {
     public void userTypeInit(User user) {
         String mobile = user.getMobile();
         CurrentCompanyWechat currentCompanyWechat = commonLogic.getCurrentCompanyWechat();
+
+        List<WebsitUser> websitUsers = websitUserService.lambdaQuery().eq(WebsitUser::getUserId, user.getUserId()).select(WebsitUser::getWebsitId).list();
+
         List<UserWait> list = userWaitService.lambdaQuery()
                 .eq(UserWait::getMobile, mobile)
+                .notIn(!CollectionUtils.isEmpty(websitUsers),UserWait::getWebsitId, websitUsers.stream().map(WebsitUser::getWebsitId).collect(Collectors.toList()))
                 .eq(UserWait::getCompanyWechatId, currentCompanyWechat.getCurrentCompanyWechatId())
                 .list();
         if (CollectionUtils.isEmpty(list)) {
@@ -953,10 +957,7 @@ public class UserLogic {
         if (user == null) {
             throw new RemoteServiceException(ResponseHelper.ResponseCode_AUTH_ERROR, "请求不合法");
         }
-        //授权手机号后检查是否有预设置的师傅身份信息
-        if (StringUtils.isNotBlank(user.getMobile())) {
-            userTypeInit(user);
-        }
+
         UserWxBean userWxBean = new UserWxBean();
         BeanUtils.copyProperties(user, userWxBean);
         userWxBean.setShoppingCartNums(shoppingCartLogic.total(userWxBean.getUserId()));
@@ -977,7 +978,10 @@ public class UserLogic {
         List<WorkerImg> workerImgs = workerImgService.lambdaQuery().eq(WorkerImg::getUserId, userId).list();
         userWxBean.setWorkerImgs(workerImgs);
 
-
+        //授权手机号后检查是否有预设置的师傅身份信息
+        if (StringUtils.isNotBlank(user.getMobile())) {
+            userTypeInit(user);
+        }
         return userWxBean;
     }