From 0a4c7c2b7a73b89c9ac3845f98cac96765a78384 Mon Sep 17 00:00:00 2001
From: k94314517 <8417338+k94314517@user.noreply.gitee.com>
Date: 星期三, 03 四月 2024 10:21:54 +0800
Subject: [PATCH] git ch

---
 server/service/src/main/java/com/doumee/service/business/impl/InsuranceApplyServiceImpl.java |   23 +++++++++++++++--------
 1 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/server/service/src/main/java/com/doumee/service/business/impl/InsuranceApplyServiceImpl.java b/server/service/src/main/java/com/doumee/service/business/impl/InsuranceApplyServiceImpl.java
index ebd3268..4d5ee27 100644
--- a/server/service/src/main/java/com/doumee/service/business/impl/InsuranceApplyServiceImpl.java
+++ b/server/service/src/main/java/com/doumee/service/business/impl/InsuranceApplyServiceImpl.java
@@ -113,24 +113,30 @@
             throw  new BusinessException(ResponseStatus.BAD_REQUEST);
         }
         InsuranceApply model = insuranceApplyMapper.selectById(insuranceApply.getId());
-
         if(model == null ||!Constants.equalsInteger(model.getIsdeleted(),Constants.ZERO)){
             throw  new BusinessException(ResponseStatus.DATA_EMPTY);
         }
-        if(Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.UPLOAD_INSURANCE.getKey())){
-            throw  new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"瀵逛笉璧凤紝璇ョ敵璇风姸鎬佸凡娴佽浆锛屽綋鍓嶄笉鏀寔璇ユ搷浣渵");
-        }
-
         Solutions solutions = solutionsMapper.selectById(model.getSolutionId());
         if(Objects.isNull(solutions)){
             throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"鏈煡璇㈡柟妗堜俊鎭�");
         }
-
         LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
         InsuranceApply update = new InsuranceApply();
+        if(Constants.equalsInteger(solutions.getType(),Constants.ZERO)){
+            if(Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.UPLOAD_INSURANCE.getKey())){
+                throw  new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"瀵逛笉璧凤紝璇ョ敵璇风姸鎬佸凡娴佽浆锛屽綋鍓嶄笉鏀寔璇ユ搷浣渵");
+            }
+            update.setStatus(Constants.InsuranceApplyStatus.FAIL_RETURN.getKey());
+        }else{
+            if( !(Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.WTB_COMPANY_MEMBER_LIST_SIGNATURE.getKey())
+            || Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.WTB_COMPANY_APPLY_SIGNATURE.getKey()))){
+                throw  new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"瀵逛笉璧凤紝璇ョ敵璇风姸鎬佸凡娴佽浆锛屽綋鍓嶄笉鏀寔璇ユ搷浣渵");
+            }
+            update.setStatus(Constants.InsuranceApplyStatus.WTB_RETURN.getKey());
+        }
+
         update.setEditDate(new Date());
         update.setEditor(user.getId());
-        update.setStatus(Constants.InsuranceApplyStatus.FAIL_RETURN.getKey());
         update.setCheckDate(update.getEditDate());
         update.setCheckInfo(insuranceApply.getCheckInfo());
         update.setCheckUserId(user.getId());
@@ -738,7 +744,7 @@
         ApplyChange update = new ApplyChange();
         update.setEditDate(new Date());
         update.setEditor(model.getCreator());
-        update.setStatus(Constants.ApplyChangeStatus.COMPANY_SIGN.getKey());
+        update.setStatus(Constants.ApplyChangeStatus.SIGNATURE.getKey());
         update.setCheckDate(update.getEditDate());
         update.setCheckInfo("浼佷笟瀹屾垚绛剧讲浜哄憳鍚嶅崟");
         update.setCheckUserId(model.getCreator());
@@ -1989,6 +1995,7 @@
     @Override
     public List<InsuranceApply> findListByDTO(InsuranceApplyQueryDTO model) {
         LoginUserInfo loginUserInfo = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
+
         MPJLambdaWrapper<InsuranceApply> queryWrapper = new MPJLambdaWrapper<>();
         queryWrapper.selectAll(InsuranceApply.class);
         queryWrapper.selectAs(Company::getName,InsuranceApply::getCompanyName);

--
Gitblit v1.9.3