浏览代码

no message

FengChaoYu 6 月之前
父节点
当前提交
fb45882185

+ 1 - 0
mall-miniapp-service/src/main/java/com/gree/mall/miniapp/logic/worker/WorkerTeamLogic.java

@@ -118,6 +118,7 @@ public class WorkerTeamLogic {
         final List<WebsitUser> websitUsers = websitUserService.lambdaQuery()
                 .eq(WebsitUser::getCompanyWechatId, current.getUser().getCompanyWechatId())
                 .eq(WebsitUser::getWebsitId, websitId)
+                .ne(WebsitUser::getUserId, current.getUserId())
                 .eq(WebsitUser::getExamineStatus, ExamineStatusEnum.OK.getKey())
                 .list();
         final List<User> userList = userService.lambdaQuery()

+ 14 - 1
mall-server-api/src/main/java/com/gree/mall/manager/logic/worker/WorkerTeamLogic.java

@@ -14,8 +14,10 @@ import com.gree.mall.manager.logic.common.CommonLogic;
 import com.gree.mall.manager.plus.entity.User;
 import com.gree.mall.manager.plus.entity.WebsitUser;
 import com.gree.mall.manager.plus.entity.WorkerTeam;
+import com.gree.mall.manager.plus.entity.WorkerTeamApply;
 import com.gree.mall.manager.plus.service.UserService;
 import com.gree.mall.manager.plus.service.WebsitUserService;
+import com.gree.mall.manager.plus.service.WorkerTeamApplyService;
 import com.gree.mall.manager.plus.service.WorkerTeamService;
 import com.gree.mall.manager.utils.CommonUtils;
 import com.gree.mall.manager.utils.excel.ExcelUtils;
@@ -42,6 +44,7 @@ public class WorkerTeamLogic {
     private final WorkerTeamService workerTeamService;
     private final WebsitUserService websitUserService;
     private final UserService userService;
+    private final WorkerTeamApplyService workerTeamApplyService;
 
     public IPage<WorkerTeamVO> list(ZfireParamBean zfireParamBean) {
         AdminUserCom adminUser = commonLogic.getAdminUser();
@@ -96,7 +99,17 @@ public class WorkerTeamLogic {
                 .ne(StringUtils.isNotBlank(workerTeam.getId()), WorkerTeam::getId, workerTeam.getId())
                 .count();
         if (count > 0) {
-            throw new RemoteServiceException(workerTeam.getWebsitId() + "已存在一组同样师傅的记录" + workerTeam.getAssistantWorkerId() + "," + workerTeam.getAssistantWorkerId());
+            throw new RemoteServiceException(workerTeam.getWebsitId() + "已存在一组同样师傅的记录" + workerTeam.getMasterWorkerId() + "," + workerTeam.getAssistantWorkerId());
+        }
+
+        final Integer count1 = workerTeamApplyService.lambdaQuery()
+                .eq(WorkerTeamApply::getCompanyWechatId, workerTeam.getCompanyWechatId())
+                .eq(WorkerTeamApply::getStatus, ExamineStatusEnum.WAIT.getKey())
+                .eq(WorkerTeamApply::getMasterWorkerId, workerTeam.getMasterWorkerId())
+                .eq(WorkerTeamApply::getAssistantWorkerId, workerTeam.getAssistantWorkerId())
+                .count();
+        if (count1 > 0) {
+            throw new RemoteServiceException(workerTeam.getWebsitId() + "已存在一组同样师傅的待师傅确认的申请记录" + workerTeam.getMasterWorkerId() + "," + workerTeam.getAssistantWorkerId());
         }
     }