浏览代码

no message

FengChaoYu 6 月之前
父节点
当前提交
3e76f1765c

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

@@ -155,6 +155,22 @@ public class WorkerTeamLogic {
             throw new RemoteServiceException("申请发起人不能”确认“记录");
         }
         if (status.getKey().equals(ExamineStatusEnum.OK.getKey())) {
+            apply.setStatus(status.getKey())
+                    .updateById();
+            final Integer count = workerTeamService.lambdaQuery()
+                    .eq(WorkerTeam::getWebsitId, apply.getWebsitId())
+                    .eq(WorkerTeam::getMasterWorkerId, apply.getMasterWorkerId())
+                    .eq(WorkerTeam::getAssistantWorkerId, apply.getAssistantWorkerId())
+                    .count();
+            final Integer count1 = workerTeamService.lambdaQuery()
+                    .eq(WorkerTeam::getWebsitId, apply.getWebsitId())
+                    .eq(WorkerTeam::getMasterWorkerId, apply.getAssistantWorkerId())
+                    .eq(WorkerTeam::getAssistantWorkerId, apply.getMasterWorkerId())
+                    .count();
+
+            if (count > 0 || count1 > 0) {
+                return;
+            }
             new WorkerTeam()
                     .setCompanyWechatId(apply.getCompanyWechatId())
                     .setCompanyWechatName(apply.getCompanyWechatName())