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/ApplyChangeServiceImpl.java    |   22 +++++-----
 server/service/src/main/java/com/doumee/core/utils/Constants.java                            |    4 +-
 server/service/src/main/java/com/doumee/service/business/impl/InsuranceApplyServiceImpl.java |   20 ++++++---
 server/service/src/main/java/com/doumee/service/business/impl/UnionChangeServiceImpl.java    |    4 +
 server/shop/src/main/java/com/doumee/api/business/ApplyChangeController.java                 |   12 ++++++
 server/service/src/main/java/com/doumee/core/annotation/excel/ExcelExporter.java             |    2 
 6 files changed, 42 insertions(+), 22 deletions(-)

diff --git a/server/service/src/main/java/com/doumee/core/annotation/excel/ExcelExporter.java b/server/service/src/main/java/com/doumee/core/annotation/excel/ExcelExporter.java
index ad906fc..cb80484 100644
--- a/server/service/src/main/java/com/doumee/core/annotation/excel/ExcelExporter.java
+++ b/server/service/src/main/java/com/doumee/core/annotation/excel/ExcelExporter.java
@@ -1153,7 +1153,7 @@
             }
             Row header1 = sheet.createRow(1);
             header1.createCell(0).setCellValue("鎶曚繚浜�");
-            header1.createCell(1).setCellValue("鎶ヤ繚闄╀汉");
+            header1.createCell(1).setCellValue("琚繚闄╀汉");
             header1.createCell(2).setCellValue("");
             header1.createCell(3).setCellValue("淇濋櫓鏂规");
             header1.createCell(4).setCellValue("淇濋櫓鐢熸晥璧锋湡");
diff --git a/server/service/src/main/java/com/doumee/core/utils/Constants.java b/server/service/src/main/java/com/doumee/core/utils/Constants.java
index e215b17..17fdfc2 100644
--- a/server/service/src/main/java/com/doumee/core/utils/Constants.java
+++ b/server/service/src/main/java/com/doumee/core/utils/Constants.java
@@ -1375,9 +1375,9 @@
         RETURN_APPLY_SIGNATURE(4, "鍙戣捣閫�鍥炵敵璇凤紙宸茬绔狅級"),
         PLATFORM_AGREE(5, "骞冲彴鍚屾剰锛堝凡閫�鍥烇級"),
         CLOSE(6, "宸插叧闂�"),
-        PALTFORM_CHECK_PASS(7, "瀹℃牳閫氳繃"),
+        COMPANY_SIGN(7, "瀹℃牳閫氳繃"),
         PALTFORM_CHECK_PASS_NO(8, "瀹℃牳涓嶉�氳繃"),
-        COMPANY_SIGN(9, "浼佷笟绛剧讲浜哄憳鍚嶅崟 - 濮旀墭淇�"),
+        WTB_TOUBAOING(9, "鎶曚繚涓�"),
         ;
         // 鎴愬憳鍙橀噺
         private String name;
diff --git a/server/service/src/main/java/com/doumee/service/business/impl/ApplyChangeServiceImpl.java b/server/service/src/main/java/com/doumee/service/business/impl/ApplyChangeServiceImpl.java
index 1ae0751..252e5f9 100644
--- a/server/service/src/main/java/com/doumee/service/business/impl/ApplyChangeServiceImpl.java
+++ b/server/service/src/main/java/com/doumee/service/business/impl/ApplyChangeServiceImpl.java
@@ -135,13 +135,17 @@
             throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"鏈煡璇㈠埌鏂规淇℃伅");
         }
 
-        if(
-//                Constants.equalsInteger(model.getStatus(),Constants.ApplyChangeStatus.UPLOAD.getKey())
-//                ||Constants.equalsInteger(model.getStatus(),Constants.ApplyChangeStatus.SIGNATURE.getKey())
-//                ||
-                Constants.equalsInteger(model.getStatus(),Constants.ApplyChangeStatus.APPROVE.getKey())){
-            //宸叉彁浜ゅ拰宸插畬鎴愮姸鎬佷笉鏀寔瀹℃牳涓嶉�氳繃
-            throw  new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"瀵逛笉璧凤紝璇ョ敵璇风姸鎬佸凡娴佽浆锛屽綋鍓嶄笉鏀寔璇ユ搷浣渵");
+        if(Constants.equalsInteger(solutions.getType(),Constants.ZERO)){
+            if(Constants.equalsInteger(model.getStatus(),Constants.ApplyChangeStatus.APPROVE.getKey())){
+                //宸叉彁浜ゅ拰宸插畬鎴愮姸鎬佷笉鏀寔瀹℃牳涓嶉�氳繃
+                throw  new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"瀵逛笉璧凤紝璇ョ敵璇风姸鎬佸凡娴佽浆锛屽綋鍓嶄笉鏀寔璇ユ搷浣渵");
+            }
+        }else if(Constants.equalsInteger(solutions.getType(),Constants.ZERO)){
+            if(Constants.equalsInteger(model.getStatus(),Constants.ApplyChangeStatus.UPLOAD.getKey())
+            || Constants.equalsInteger(model.getStatus(),Constants.ApplyChangeStatus.SIGNATURE.getKey()) ){
+                //宸叉彁浜ゅ拰宸插畬鎴愮姸鎬佷笉鏀寔瀹℃牳涓嶉�氳繃
+                throw  new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"瀵逛笉璧凤紝璇ョ敵璇风姸鎬佸凡娴佽浆锛屽綋鍓嶄笉鏀寔璇ユ搷浣渵");
+            }
         }
         LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
         ApplyChange update = new ApplyChange();
@@ -1606,14 +1610,10 @@
         }else if(applyChangeOptDTO.getOptType().equals(6)){
             //浼佷笟鍏抽棴
             applyLogType = Constants.ApplyLogType.CA_COMPANY_CLOSE;
-            if(!loginUserInfo.getType().equals(Constants.ONE)){
-                throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"闈炰紒涓氱鐢ㄦ埛鏃犳硶杩涜璇ユ搷浣�");
-            }
             if(!applyChange.getStatus().equals(Constants.ApplyChangeStatus.PLATFORM_AGREE.getKey())){
                 throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"鏁版嵁鐘舵�侀敊璇棤娉曡繘琛岃鎿嶄綔!");
             }
             applyChange.setStatus(Constants.ApplyChangeStatus.CLOSE.getKey());
-
             //瀛樺偍寰呭姙淇℃伅
             //鍒犻櫎鍏朵粬寰呭姙
             noticesMapper.delete(new QueryWrapper<Notices>().lambda().eq(Notices::getObjType,noticeObjectType.getKey()).eq(Notices::getObjId,applyChange.getId()));
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 19e00a0..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());
diff --git a/server/service/src/main/java/com/doumee/service/business/impl/UnionChangeServiceImpl.java b/server/service/src/main/java/com/doumee/service/business/impl/UnionChangeServiceImpl.java
index 954312e..4cfca91 100644
--- a/server/service/src/main/java/com/doumee/service/business/impl/UnionChangeServiceImpl.java
+++ b/server/service/src/main/java/com/doumee/service/business/impl/UnionChangeServiceImpl.java
@@ -311,7 +311,7 @@
                         .leftJoin(InsuranceApply.class,InsuranceApply::getId,ApplyChange::getApplyId)
                         .eq(ApplyChange::getIsdeleted, Constants.ZERO)
                         .eq(InsuranceApply::getUnionApplyId,saveUnionChangeDTO.getUnionApplyId())
-                        .eq(ApplyChange::getStatus,Constants.ApplyChangeStatus.PALTFORM_CHECK_PASS.getKey())
+                        .eq(ApplyChange::getStatus,Constants.ApplyChangeStatus.COMPANY_SIGN.getKey())
                         .eq(InsuranceApply::getStatus,Constants.InsuranceApplyStatus.UPLOAD_INSURANCE.getKey())
                         .eq(ApplyChange::getType,saveUnionChangeDTO.getBusinessType())
                         .in(ApplyChange::getId,saveUnionChangeDTO.getApplyIds())
@@ -336,6 +336,7 @@
                 .set(ApplyChange::getUnionChangeId,unionChange.getId())
                 .set(ApplyChange::getCheckDate,new Date())
                 .set(ApplyChange::getCheckUserId,user.getId())
+                .set(ApplyChange::getStatus,Constants.ApplyChangeStatus.WTB_TOUBAOING.getKey())
                 .in(ApplyChange::getId,saveUnionChangeDTO.getApplyIds())
         );
 
@@ -391,6 +392,7 @@
                 .set(ApplyChange::getUnionChangeId,null)
                 .set(ApplyChange::getCheckDate,new Date())
                 .set(ApplyChange::getCheckUserId,user.getId())
+                .set(ApplyChange::getStatus,Constants.ApplyChangeStatus.COMPANY_SIGN.getKey())
                 .in(ApplyChange::getUnionChangeId,unionChange.getId())
         );
 
diff --git a/server/shop/src/main/java/com/doumee/api/business/ApplyChangeController.java b/server/shop/src/main/java/com/doumee/api/business/ApplyChangeController.java
index a05160a..f154af0 100644
--- a/server/shop/src/main/java/com/doumee/api/business/ApplyChangeController.java
+++ b/server/shop/src/main/java/com/doumee/api/business/ApplyChangeController.java
@@ -6,6 +6,7 @@
 import com.doumee.core.model.ApiResponse;
 import com.doumee.core.model.PageData;
 import com.doumee.core.model.PageWrap;
+import com.doumee.dao.business.dto.ApplyChangeOptDTO;
 import com.doumee.dao.business.model.ApplyChange;
 import com.doumee.dao.business.model.InsuranceApply;
 import com.doumee.service.business.ApplyChangeService;
@@ -149,4 +150,15 @@
     public ApiResponse check(@RequestBody ApplyChange model) {
         return ApiResponse.success(applyChangeService.check(model));
     }
+
+
+
+    @ApiOperation(value = "涓氬姟澶勭悊",notes = "閫�鍥炵敵璇凤紝鍏抽棴绛�")
+    @PostMapping("/applyChangeOpt")
+    public ApiResponse applyChangeOpt (@RequestBody ApplyChangeOptDTO applyChangeOptDTO) {
+        applyChangeService.changeOpt(applyChangeOptDTO);
+        return ApiResponse.success("鎿嶄綔鎴愬姛");
+    }
+
+
 }

--
Gitblit v1.9.3