瀏覽代碼

no message

FengChaoYu 6 月之前
父節點
當前提交
9db368318e

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

@@ -18,6 +18,7 @@ import com.gree.mall.miniapp.plus.service.*;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
 import javax.annotation.Resource;
 import java.util.ArrayList;
@@ -142,9 +143,16 @@ public class WorkerTeamLogic {
         workerTeam.insert();
     }
 
+    @Transactional
     public void confirm(String id, ExamineStatusEnum status) {
         CurrentCompanyWechat current = commonLogic.getCurrentCompanyWechat();
         final WorkerTeamApply apply = workerTeamApplyService.getById(id);
+        if (!apply.getStatus().equals(ExamineStatusEnum.WAIT.getKey())) {
+            throw new RemoteServiceException("申请记录非”待确认“状态");
+        }
+        if (apply.getMasterWorkerId().equals(current.getUser().getWorkerNumber())) {
+            throw new RemoteServiceException("申请发起人不能”确认“记录");
+        }
         if (status.getKey().equals(ExamineStatusEnum.OK.getKey())) {
             new WorkerTeam()
                     .setCompanyWechatId(apply.getCompanyWechatId())