From 54bbda6f374f3b8ebafed04d49f756fd75e53a1a Mon Sep 17 00:00:00 2001
From: nidapeng <jp@doumee.com>
Date: 星期六, 06 四月 2024 12:31:39 +0800
Subject: [PATCH] 提交一把

---
 server/service/src/main/java/com/doumee/service/business/impl/InsuranceApplyServiceImpl.java |   40 ++++++++++++++++++++++++++++------------
 1 files changed, 28 insertions(+), 12 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 0f2eeb9..c50290c 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());
@@ -750,7 +756,11 @@
         f.setCreator(model.getCreator());
         f.setObjId(update.getId());
         f.setCreateDate(update.getEditDate());
-        f.setObjType(Constants.MultiFile.CHANGE_MEMBER_LIST_LATTER.getKey());
+        if(model.getType().equals(Constants.ZERO)){
+            f.setObjType(Constants.MultiFile.CA_APPLY_JIAJIAN_SIGN.getKey());
+        }else{
+            f.setObjType(Constants.MultiFile.CA_APPLY_CHANGEUNIT_SIGN.getKey());
+        }
         f.setType(Constants.TWO);
         f.setFileurl(fileurl);
         f.setFileurlFull(fullurl);
@@ -842,8 +852,8 @@
         f.setType(Constants.TWO);
         f.setFileurl(fileurl);
         f.setFileurlFull(fullUrl);
-        f.setInfo("濮旀墭鍔犲噺淇�/鎹㈠巶涓氬姟 -鎶曚繚鍗�");
-        f.setName("濮旀墭鍔犲噺淇�/鎹㈠巶涓氬姟 -鎶曚繚鍗�.pdf");
+        f.setInfo("鎶曚繚鐢宠鍗� -鐢宠鍗�");
+        f.setName("鎶曚繚鐢宠鍗�.pdf");
         multifileMapper.insert(f);
 
         Constants.ApplyLogType applyLogType = Constants.ApplyLogType.CA_HBD_SIGNATURE_TBD;
@@ -1888,6 +1898,7 @@
         queryWrapper.eq(InsuranceApply::getIsdeleted,Constants.ZERO);
         queryWrapper.eq(pageWrap.getModel().getBaseSolutionId()!=null,Solutions::getBaseId,pageWrap.getModel().getBaseSolutionId());
         queryWrapper.in(statusList.size()>0,InsuranceApply::getStatus,statusList);
+        queryWrapper.like(StringUtils.isNotBlank(pageWrap.getModel().getSolutionName()),Solutions::getName,pageWrap.getModel().getSolutionName());
         if(Constants.equalsInteger(pageWrap.getModel().getStatusCollect(),Constants.THREE) ){
             queryWrapper.eq(InsuranceApply::getStatus,Constants.InsuranceApplyStatus.UPLOAD_INSURANCE.getKey());
             queryWrapper.lt(InsuranceApply::getEndTime, Utils.Date.getStart(new Date()));
@@ -1988,6 +1999,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);
@@ -2001,6 +2013,7 @@
         queryWrapper.leftJoin(Company.class,Company::getId,InsuranceApply::getCompanyId);
         queryWrapper.eq(InsuranceApply::getIsdeleted,Constants.ZERO);
         queryWrapper.eq(model.getUnionApplyId()!=null,InsuranceApply::getUnionApplyId, model.getUnionApplyId());
+        queryWrapper.eq(model.getBaseSolutionId()!=null,Solutions::getBaseId,model.getBaseSolutionId());
         //浼佷笟浜哄憳鏌ョ湅鏈紒涓氭暟鎹�
         if(loginUserInfo.getType().equals(Constants.ONE)){
             queryWrapper.eq(InsuranceApply::getCompanyId, loginUserInfo.getCompanyId());
@@ -2352,7 +2365,10 @@
             if(!(insuranceApply.getStatus().equals(Constants.InsuranceApplyStatus.WAIT_SIGNATURE.getKey())
                     ||insuranceApply.getStatus().equals(Constants.InsuranceApplyStatus.SIGNATURE.getKey())
                     ||insuranceApply.getStatus().equals(Constants.InsuranceApplyStatus.FAIL_RETURN.getKey())
-                    ||insuranceApply.getStatus().equals(Constants.InsuranceApplyStatus.PLATFORM_CHECK_PASS.getKey()))){
+                    ||insuranceApply.getStatus().equals(Constants.InsuranceApplyStatus.PLATFORM_CHECK_PASS.getKey())
+                    ||insuranceApply.getStatus().equals(Constants.InsuranceApplyStatus.WTB_RETURN.getKey())
+            )
+            ){
                 throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"鏁版嵁鐘舵�佹棤娉曡繘琛屽叧闂�!");
             }
             //鍒犻櫎鍏朵粬寰呭姙

--
Gitblit v1.9.3