|
@@ -145,6 +145,24 @@ public class WorkerTeamLogic {
|
|
|
if (count1 > 0) {
|
|
|
throw new RemoteServiceException("已和 " + workerTeam.getAssistantWorkerName() + " 师傅组队");
|
|
|
}
|
|
|
+ final Integer count3 = workerTeamApplyService.lambdaQuery()
|
|
|
+ .eq(WorkerTeamApply::getWebsitId, workerTeam.getWebsitId())
|
|
|
+ .eq(WorkerTeamApply::getMasterWorkerId, workerTeam.getMasterWorkerId())
|
|
|
+ .eq(WorkerTeamApply::getAssistantWorkerId, workerTeam.getAssistantWorkerId())
|
|
|
+ .eq(WorkerTeamApply::getStatus, ExamineStatusEnum.WAIT.getKey())
|
|
|
+ .count();
|
|
|
+ if (count3 > 0) {
|
|
|
+ throw new RemoteServiceException("已有一条待确认记录和 " + workerTeam.getAssistantWorkerName() + " 师傅组队");
|
|
|
+ }
|
|
|
+ final Integer count4 = workerTeamApplyService.lambdaQuery()
|
|
|
+ .eq(WorkerTeamApply::getWebsitId, workerTeam.getWebsitId())
|
|
|
+ .eq(WorkerTeamApply::getMasterWorkerId, workerTeam.getAssistantWorkerId())
|
|
|
+ .eq(WorkerTeamApply::getAssistantWorkerId, workerTeam.getMasterWorkerId())
|
|
|
+ .eq(WorkerTeamApply::getStatus, ExamineStatusEnum.WAIT.getKey())
|
|
|
+ .count();
|
|
|
+ if (count4 > 0) {
|
|
|
+ throw new RemoteServiceException("已有一条待确认记录和 " + workerTeam.getAssistantWorkerName() + " 师傅组队");
|
|
|
+ }
|
|
|
workerTeam.insert();
|
|
|
}
|
|
|
|