From 0c9a7d863d46138a574ed3aa966f9a2e1b6a2d91 Mon Sep 17 00:00:00 2001
From: k94314517 <8417338+k94314517@user.noreply.gitee.com>
Date: 星期五, 29 三月 2024 11:39:18 +0800
Subject: [PATCH] git ch

---
 server/service/src/main/java/com/doumee/service/business/impl/ApplyChangeServiceImpl.java    |   51 ++++++++++
 server/service/src/main/java/com/doumee/service/business/ApplyChangeService.java             |    1 
 server/service/src/main/java/com/doumee/core/utils/Constants.java                            |    6 +
 server/service/src/main/java/com/doumee/service/business/impl/InsuranceApplyServiceImpl.java |  117 +++++++++++++++++++----
 server/service/src/main/java/com/doumee/service/business/impl/UnionChangeServiceImpl.java    |    2 
 server/shop/src/main/java/com/doumee/api/business/ApplyChangeController.java                 |    9 +
 server/service/src/main/java/com/doumee/dao/business/model/InsuranceApply.java               |    8 +
 server/shop/src/main/java/com/doumee/api/business/UnionChangeController.java                 |    2 
 server/service/src/main/java/com/doumee/service/business/InsuranceApplyService.java          |    7 +
 server/service/src/main/java/com/doumee/dao/business/dto/UploadMultifileDTO.java             |   12 +
 server/service/src/main/java/com/doumee/service/business/impl/UnionApplyServiceImpl.java     |   63 ++++++++++--
 11 files changed, 235 insertions(+), 43 deletions(-)

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 546c231..3761334 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
@@ -446,6 +446,7 @@
         SOLUTIONS_CONFIRMATION_LATTER(18, "濮旀墭淇� - 鎶曚繚鏂规纭涔�", "濮旀墭淇� - 鏂规纭涔�"),
         MEMBER_LIST_LATTER(19, "濮旀墭淇� - 鎶曚繚浜哄憳鍚嶅崟", "濮旀墭淇� - 鏂规纭涔�"),
         CHANGE_MEMBER_LIST_LATTER(20, "濮旀墭淇� - 鍔犲噺淇濅汉鍛樺悕鍗�", "濮旀墭淇� - 鏂规纭涔�"),
+        WTB_BD_DONE_PDF(21, "濮旀墭鎶曚繚鍗� - 鍚堝苟鍗曟渶缁堜繚鍗�", "濮旀墭淇� - 鍚堝苟鍗曚繚鍗�"),
 
 
 
@@ -1065,11 +1066,14 @@
         COMPANY_BACK_APPLY_SIGNATURE(8, "浼佷笟鐢宠閫�鍥�(宸茬绔�)","鎻愪氦鎰忚锛�${param}",5),
         CLOSE(9, "璁㈠崟鍏抽棴","",6),
         PLATFORM_CHECK_PASS(10,"骞冲彴鎶曚繚瀹℃牳閫氳繃","鎻愪氦鎰忚锛�${param}",0),
+        COMPANY_BACK_APPLY_PASS(11, "浼佷笟鐢宠閫�鍥�(骞冲彴鎶曚繚瀹℃牳閫氳繃)","鎻愪氦鎰忚锛�${param}",5),
+
+
 
         WTB_UPLOAD(20, "鎻愪氦鎶曚繚","",28),
         WTB_COMPANY_APPLY_SIGNATURE(21, "濮旀墭淇�-浼佷笟宸茬缃叉姇淇濈‘璁や功","鎻愪氦鎰忚锛�${param}",28),
         WTB_COMPANY_MEMBER_LIST_SIGNATURE(22, "濮旀墭淇�-浼佷笟宸茬缃蹭汉鍛樺悕鍗�","鎻愪氦鎰忚锛�${param}",22),
-        WTB_PCHECK_PASS(23,"骞冲彴鎶曚繚瀹℃牳閫氳繃","鎻愪氦鎰忚锛�${param}",23),
+        WTB_BUSSINESS_CHECK_PASS(23,"鍟嗘埛鎶曚繚瀹℃牳閫氳繃","鎻愪氦鎰忚锛�${param}",23),
         WTB_RETURN(24, "宸查��鍥�","鎻愪氦鎰忚锛�${param}",24),
         WTB_CLOSED(25, "宸插叧闂�","鎻愪氦鎰忚锛�${param}",25),
         WTB_TOUBAOING(26, "鎶曚繚涓�","鎻愪氦鎰忚锛�${param}",26),
diff --git a/server/service/src/main/java/com/doumee/dao/business/dto/UploadMultifileDTO.java b/server/service/src/main/java/com/doumee/dao/business/dto/UploadMultifileDTO.java
index 1b472ca..628858a 100644
--- a/server/service/src/main/java/com/doumee/dao/business/dto/UploadMultifileDTO.java
+++ b/server/service/src/main/java/com/doumee/dao/business/dto/UploadMultifileDTO.java
@@ -1,7 +1,10 @@
 package com.doumee.dao.business.dto;
 
+import com.doumee.dao.business.model.Multifile;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
+
+import java.util.List;
 
 /**
  * Created by IntelliJ IDEA.
@@ -16,10 +19,13 @@
     @ApiModelProperty(value = "涓氬姟涓婚敭")
     private Integer businessId;
 
-    @ApiModelProperty(value = "鏂囦欢璺緞")
-    private String filePath;
+    @ApiModelProperty(value = "鏂囦欢璺緞 ")
+    private String fileurl;
 
     @ApiModelProperty(value = "鏂囦欢鍚嶇О")
-    private String fileName;
+    private String name;
+
+    @ApiModelProperty(value = "浼佷笟淇濆崟 - 淇濋櫓鍗�")
+    private List<Multifile> multifileList;
 
 }
diff --git a/server/service/src/main/java/com/doumee/dao/business/model/InsuranceApply.java b/server/service/src/main/java/com/doumee/dao/business/model/InsuranceApply.java
index 9faba2b..3009e5b 100644
--- a/server/service/src/main/java/com/doumee/dao/business/model/InsuranceApply.java
+++ b/server/service/src/main/java/com/doumee/dao/business/model/InsuranceApply.java
@@ -108,8 +108,12 @@
     @ExcelColumn(name="鍚堝苟鍗曠紪鐮侊紙鍏宠仈union_apply)")
     private Integer unionApplyId;
 
-    @ApiModelProperty(value = "鍚堝苟鍗�-鎶曚繚鍗曠姸鎬� 0=鏈笂浼�;1=宸蹭笂浼�;2=宸茬缃�", example = "1")
+    @ApiModelProperty(value = "鍚堝苟鍗�-鎶曚繚鍗曠姸鎬� 0=鏈笂浼�;1=宸蹭笂浼�;2=宸茬缃�;3=宸蹭笂浼犱繚闄╁崟", example = "1")
     private Integer unionApplyTbdStatus;
+
+    @ApiModelProperty(value = "濮旀墭淇�-鎶曚繚鍗曞悎鍚屽彿 锛堝晢鎴蜂笂浼狅紝浼佷笟绛剧讲锛�")
+    @ExcelColumn(name="濮旀墭淇�-鎶曚繚鍗曞悎鍚屽彿 锛堝晢鎴蜂笂浼狅紝浼佷笟绛剧讲锛�")
+    private String applyTbdNo;
 
     @ApiModelProperty(value = "鍗曞彿")
     @ExcelColumn(name="鍗曞彿")
@@ -208,7 +212,6 @@
     @TableField(exist = false)
     private Date lastChangeDate;
 
-
     @ApiModelProperty(value = "鏈�浣庡勾榫�", example = "1")
     @TableField(exist = false)
     private Integer minAge;
@@ -216,7 +219,6 @@
     @ApiModelProperty(value = "鏈�楂樺勾榫�", example = "1")
     @TableField(exist = false)
     private Integer maxAge;
-
 
     @ApiModelProperty(value = "淇濋櫓璐圭敤(浜�/澶╋級", example = "1")
     @TableField(exist = false)
diff --git a/server/service/src/main/java/com/doumee/service/business/ApplyChangeService.java b/server/service/src/main/java/com/doumee/service/business/ApplyChangeService.java
index f831e59..5998bcf 100644
--- a/server/service/src/main/java/com/doumee/service/business/ApplyChangeService.java
+++ b/server/service/src/main/java/com/doumee/service/business/ApplyChangeService.java
@@ -28,6 +28,7 @@
     Integer back(ApplyChange param);
     Integer dealBackApply(ApplyChange param);
     Integer uploadPidan(ApplyChange insuranceApply);
+    Integer check(ApplyChange applyChange);
     /**
      * 涓婚敭鍒犻櫎
      *
diff --git a/server/service/src/main/java/com/doumee/service/business/InsuranceApplyService.java b/server/service/src/main/java/com/doumee/service/business/InsuranceApplyService.java
index f46c055..b4dec09 100644
--- a/server/service/src/main/java/com/doumee/service/business/InsuranceApplyService.java
+++ b/server/service/src/main/java/com/doumee/service/business/InsuranceApplyService.java
@@ -154,5 +154,12 @@
      * @return
      */
     String getMemberListOnlineSignLink(Integer applyId);
+
+    /**
+     * 濮旀墭淇� 鎶曚繚鐢宠绛剧讲
+     * @param id
+     * @return
+     */
+    String getSignWTBTBDLink(Integer id);
 }
 
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 69d410b..35a6dd9 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
@@ -2020,6 +2020,57 @@
 
 
 
+    @Override
+    @Transactional(rollbackFor = {Exception.class,BusinessException.class})
+    public Integer check(ApplyChange applyChange) {
+        LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
+        if(!user.getType().equals(Constants.TWO)){
+            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"闈炲晢鎴风鏃犳硶杩涜璇ユ搷浣�");
+        }
+        if(applyChange.getId() == null){
+            throw  new BusinessException(ResponseStatus.BAD_REQUEST);
+        }
+        ApplyChange model = applyChangeJoinMapper.selectJoinOne(ApplyChange.class,
+                new MPJLambdaWrapper<ApplyChange>()
+                        .selectAll(ApplyChange.class)
+                        .selectAs(InsuranceApply::getSolutionId,ApplyChange::getSolutionsId)
+                        .leftJoin(InsuranceApply.class,InsuranceApply::getId,ApplyChange::getApplyId)
+                        .eq(ApplyChange::getId,applyChange.getId())
+                        .last(" limit 1")
+        );
 
+        if(model == null ||!Constants.equalsInteger(model.getIsdeleted(),Constants.ZERO)){
+            throw  new BusinessException(ResponseStatus.DATA_EMPTY);
+        }
+        Solutions solutions = solutionsMapper.selectById(model.getSolutionsId());
+        if(Objects.isNull(solutions)){
+            throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"鏈煡璇㈡柟妗堜俊鎭�");
+        }
+        if(solutions.getType().equals(Constants.ZERO)){
+           throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"鐩翠繚鍗曟嵁鏃犳硶杩涜璇ユ搷浣�");
+        }else{
+            if(!Constants.equalsInteger(model.getStatus(),Constants.ApplyChangeStatus.COMPANY_SIGN.getKey())){
+                throw  new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"瀵逛笉璧凤紝璇ョ敵璇风姸鎬佸凡娴佽浆锛屽綋鍓嶄笉鏀寔璇ユ搷浣渵");
+            }
+        }
+
+        ApplyChange update = new ApplyChange();
+        update.setEditDate(new Date());
+        update.setEditor(user.getId());
+        update.setCheckDate(update.getEditDate());
+        update.setCheckInfo(applyChange.getCheckInfo());
+        update.setCheckUserId(user.getId());
+        update.setId(model.getId());
+        if(applyChange.getDealBackApply() ==1){
+            //濡傛灉鏄笉閫氳繃
+            update.setStatus(Constants.ApplyChangeStatus.PALTFORM_CHECK_PASS_NO.getKey());
+        }else{
+            update.setStatus(Constants.ApplyChangeStatus.PALTFORM_CHECK_PASS.getKey());
+        }
+        applyChangeJoinMapper.updateById(update);
+
+        return  1;
+
+    }
 
 }
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 03a8e69..1117e60 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
@@ -514,7 +514,7 @@
         InsuranceApply update = new InsuranceApply();
         update.setEditDate(new Date());
         update.setEditor(model.getCreator());
-        update.setStatus(Constants.InsuranceApplyStatus.COMPANY_APPLY_SIGNATURE.getKey());
+        update.setStatus(Constants.InsuranceApplyStatus.WTB_UPLOAD.getKey());
         update.setCheckDate(update.getEditDate());
         update.setCheckInfo("浼佷笟瀹屾垚绛剧讲鏂规纭涔�");
         update.setCheckUserId(model.getCreator());
@@ -547,7 +547,7 @@
         InsuranceApply update = new InsuranceApply();
         update.setEditDate(new Date());
         update.setEditor(model.getCreator());
-        update.setStatus(Constants.InsuranceApplyStatus.COMPANY_MEMBER_LIST_SIGNATURE.getKey());
+        update.setStatus(Constants.InsuranceApplyStatus.WTB_COMPANY_MEMBER_LIST_SIGNATURE.getKey());
         update.setCheckDate(update.getEditDate());
         update.setCheckInfo("浼佷笟瀹屾垚绛剧讲浜哄憳鍚嶅崟");
         update.setCheckUserId(model.getCreator());
@@ -752,7 +752,7 @@
                         .selectAs(Company::getName,InsuranceApply::getCompanyName)
                         .leftJoin(Solutions.class,Solutions::getId,InsuranceApply::getSolutionId)
                         .leftJoin(Company.class,Company::getId,InsuranceApply::getCompanyId)
-                        .eq(InsuranceApply::getStatus,Constants.InsuranceApplyStatus.UPLOAD.getKey())
+                        .eq(InsuranceApply::getStatus,Constants.InsuranceApplyStatus.WTB_UPLOAD.getKey())
                         .eq(Solutions::getType,Constants.ONE)
                         .isNotNull(InsuranceApply::getSignQrsNo));
         if(applyList !=null && applyList.size()>0 ){
@@ -781,7 +781,7 @@
                         .selectAs(Company::getName,InsuranceApply::getCompanyName)
                         .leftJoin(Solutions.class,Solutions::getId,InsuranceApply::getSolutionId)
                         .leftJoin(Company.class,Company::getId,InsuranceApply::getCompanyId)
-                        .eq(InsuranceApply::getStatus,Constants.InsuranceApplyStatus.COMPANY_APPLY_SIGNATURE.getKey())
+                        .eq(InsuranceApply::getStatus,Constants.InsuranceApplyStatus.WTB_COMPANY_APPLY_SIGNATURE.getKey())
                         .eq(Solutions::getType,Constants.ONE)
                         .isNotNull(InsuranceApply::getSignMemberListNo));
         if(applyList !=null && applyList.size()>0 ){
@@ -956,7 +956,7 @@
                             .eq(Solutions::getType,Constants.ONE)
                             .eq(InsuranceApply::getSignMemberListNo,data.getApplyNo())
                             .last("limit 1" ));
-            if(modelMemberList != null && Constants.equalsInteger(modelMemberList.getStatus(),Constants.InsuranceApplyStatus.COMPANY_APPLY_SIGNATURE.getKey())){
+            if(modelMemberList != null && Constants.equalsInteger(modelMemberList.getStatus(),Constants.InsuranceApplyStatus.WTB_COMPANY_APPLY_SIGNATURE.getKey())){
                 //瀹屾垚绛剧讲宸插畬鎴愭搷浣�
                 String link = signService.linkFile(data.getApplyNo());
                 String fileUrl = uploadSignFile(link);
@@ -1129,6 +1129,7 @@
     @Override
     @Transactional(rollbackFor = {Exception.class,BusinessException.class})
     public Integer check(InsuranceApply insuranceApply) {
+        LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
         if(insuranceApply.getId() == null){
             throw  new BusinessException(ResponseStatus.BAD_REQUEST);
         }
@@ -1137,31 +1138,35 @@
         if(model == null ||!Constants.equalsInteger(model.getIsdeleted(),Constants.ZERO)){
             throw  new BusinessException(ResponseStatus.DATA_EMPTY);
         }
-        if(!Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.UPLOAD.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(),"鏈煡璇㈡柟妗堜俊鎭�");
         }
+        if(solutions.getType().equals(Constants.ZERO)){
+            if(!Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.UPLOAD.getKey())){
+                throw  new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"瀵逛笉璧凤紝璇ョ敵璇风姸鎬佸凡娴佽浆锛屽綋鍓嶄笉鏀寔璇ユ搷浣渵");
+            }
+        }else{
+            if(!user.getType().equals(Constants.TWO)){
+                throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"闈炲晢鎴风鏃犳硶杩涜璇ユ搷浣�");
+            }
+            if(!Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.WTB_RETURN.getKey())){
+                throw  new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"瀵逛笉璧凤紝璇ョ敵璇风姸鎬佸凡娴佽浆锛屽綋鍓嶄笉鏀寔璇ユ搷浣渵");
+            }
+        }
 
         Constants.ApplyLogType applyLogType = null;
-        LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
         InsuranceApply update = new InsuranceApply();
         update.setEditDate(new Date());
         update.setEditor(user.getId());
         update.setCheckDate(update.getEditDate());
         update.setCheckInfo(insuranceApply.getCheckInfo());
         update.setCheckUserId(user.getId());
-        update.setId(model.getId());
-        Constants.NoticeType noticeType = Constants.NoticeType.ONE;
+        update.setId(model.getId()); 
         if(insuranceApply.getDealBackApply() ==1){
             //濡傛灉鏄笉閫氳繃
             applyLogType = Constants.ApplyLogType.PLATFORM_RETURN ;
             update.setStatus(Constants.InsuranceApplyStatus.PLATFORM_RETURN.getKey());
-
-            noticeType = Constants.NoticeType.FOUR;
         }else{
             applyLogType = Constants.ApplyLogType.PLATFORM_CHECK_PASS;
             update.setStatus(Constants.InsuranceApplyStatus.PLATFORM_CHECK_PASS.getKey());
@@ -1173,10 +1178,7 @@
         //鍒犻櫎鍏朵粬寰呭姙
         noticesMapper.delete(new QueryWrapper<Notices>().lambda().eq(Notices::getObjType,noticeObjectType.getKey())
                 .ne(Notices::getType,Constants.NoticeType.SIX.getStatus())
-                .eq(Notices::getObjId,model.getId()));
-//        Notices notices = new Notices(noticeObjectType,Constants.ONE,model.getId(),solutions.getName(),model.getCompanyId(),noticeType);
-//        noticesMapper.insert(notices);
-
+                .eq(Notices::getObjId,model.getId())); 
         String info =applyLogType.getInfo();
         if(StringUtils.isNotBlank(update.getCheckInfo())){
             info = info.replace("${param}", update.getCheckInfo());
@@ -1220,6 +1222,9 @@
             throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"鍛樺伐淇℃伅瀛樺湪閲嶅淇℃伅");
         }
         Constants.InsuranceApplyStatus insuranceApplyStatus = Constants.InsuranceApplyStatus.UPLOAD;
+        if(solutions.getType().equals(Constants.ONE)){
+            insuranceApplyStatus = Constants.InsuranceApplyStatus.WTB_UPLOAD;
+        }
         insuranceApply.setCreateDate(new Date());
         insuranceApply.setCreator(loginUserInfo.getId());
         insuranceApply.setEditor(loginUserInfo.getId());
@@ -2083,7 +2088,7 @@
         Constants.ApplyLogType applyLogType = null;
         String info = "";
         //濡傛灉鏄┏鍥�,鍙兘鍙┏鍥炲凡绛剧珷鐘舵�佷笅鐨勯��鍥炵敵璇风姸鎬佽繘琛屾搷浣�
-        if(!Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.UPLOAD.getKey())){
+        if(!Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.WTB_UPLOAD.getKey())){
             throw  new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"瀵逛笉璧凤紝璇ョ敵璇风姸鎬佸凡娴佽浆锛屽綋鍓嶄笉鏀寔璇ユ搷浣渵");
         }
         Company company = user.getCompany();
@@ -2120,6 +2125,8 @@
         return  link;
     }
 
+
+
     @Override
     public  InsuranceApply  queryApplyDetail(Integer applyId){
         InsuranceApply model = findDetail(applyId);
@@ -2154,7 +2161,7 @@
         if(Objects.isNull(model) ||! Constants.equalsInteger(Constants.ZERO,model.getIsdeleted())){
             throw new BusinessException(ResponseStatus.DATA_EMPTY);
         }
-        if(!Constants.equalsInteger(Constants.ZERO,model.getStatus())){
+        if(!Constants.equalsInteger(Constants.InsuranceApplyStatus.WTB_COMPANY_APPLY_SIGNATURE.getKey(),model.getStatus())){
             throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"瀵逛笉璧凤紝璇ョ敵璇风姸鎬佸凡娴佽浆锛屽綋鍓嶄笉鏀寔绛剧珷鎿嶄綔锛�");
         }
         LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
@@ -2193,6 +2200,76 @@
     }
 
 
+    /**
+     * 濮旀墭淇� 鎶曚繚鐢宠绛剧讲
+     * @param id
+     * @return
+     */
+    @Override
+    public  String getSignWTBTBDLink(Integer id) {
+        if(id == null ){
+            throw  new BusinessException(ResponseStatus.BAD_REQUEST);
+        }
+        MPJLambdaWrapper wrapper=  new MPJLambdaWrapper<InsuranceApply>()
+                .selectAll(InsuranceApply.class)
+                .selectAs(Solutions::getSignKeyword,InsuranceApply::getSignKeyword)
+                .leftJoin(Solutions.class,Solutions::getId,InsuranceApply::getSolutionId)
+                .eq(InsuranceApply::getId,id)
+                .last("limit 1");
 
+        InsuranceApply model = insuranceApplyJoinMapper.selectJoinOne(InsuranceApply.class,wrapper);
+        if(model == null ||!Constants.equalsInteger(model.getIsdeleted(),Constants.ZERO)){
+            throw  new BusinessException(ResponseStatus.DATA_EMPTY);
+        }
+        Solutions solutions = solutionsMapper.selectById(model.getSolutionId());
+        if(Objects.isNull(solutions)){
+            throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"鏈煡璇㈡柟妗堜俊鎭�");
+        }
+        if(solutions.getType().equals(Constants.ZERO)){
+            throw  new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"瀵逛笉璧凤紝闈炲鎵樹繚鏂规淇濆崟!");
+        }
+        if(!model.getUnionApplyTbdStatus().equals(Constants.ONE)){
+            throw  new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"瀵逛笉璧凤紝鍟嗘埛鏈笂浼犳垨宸茬缃�");
+        }
+        LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
+        Constants.ApplyLogType applyLogType = null;
+        String info = "";
+        //濡傛灉鏄┏鍥�,鍙兘鍙┏鍥炲凡绛剧珷鐘舵�佷笅鐨勯��鍥炵敵璇风姸鎬佽繘琛屾搷浣�
+        if(!Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.WTB_UPLOAD.getKey())){
+            throw  new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"瀵逛笉璧凤紝璇ョ敵璇风姸鎬佸凡娴佽浆锛屽綋鍓嶄笉鏀寔璇ユ搷浣渵");
+        }
+        Company company = user.getCompany();
+        if(debugModel){
+            company = companyMapper.selectById(model.getCompanyId());
+        }
+        if(company== null || StringUtils.isBlank( company.getEmail()) || !Constants.equalsInteger(company.getSignStatus(),Constants.THREE)){
+            throw  new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"瀵逛笉璧凤紝浼佷笟灏氭湭鍏峰鍦ㄧ嚎绛剧珷鏉′欢锛岃鑱旂郴骞冲彴绠$悊鍛樼‘璁");
+        }
+        Multifile f = multifileMapper.selectOne(new QueryWrapper<Multifile>().lambda()
+                .eq(Multifile::getObjId,model.getId())
+                .eq(Multifile::getObjType,Constants.MultiFile.COMPANY_TBD_SIGNED_PDF.getKey())
+                .eq(Multifile::getIsdeleted,Constants.ZERO).last("limit 1"));
+        if(f == null || StringUtils.isBlank(f.getFileurl())){
+            throw  new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"瀵逛笉璧凤紝鑾峰彇纭涔︽枃浠跺け璐ワ紝璇疯仈绯诲晢鎴风‘璁ゆ姇淇濈敵璇蜂功鏄惁姝g‘锛�");
+        }
+        String url = systemDictDataBiz.queryByCode(Constants.OSS,Constants.RESOURCE_PATH).getCode()+systemDictDataBiz.queryByCode(Constants.OSS,Constants.APPLY_FILE).getCode()+f.getFileurl();
+        String notifyUrl = systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.SIGN_DONE_NOTIFY_URL).getCode();
+        notifyUrl = notifyUrl.replace("${type}","0").replace("${id}",model.getId().toString());
+        String applyNo = signService.applySign(company.getName(),url,company.getName(),company.getCode(),company.getEmail(),model.getSignKeyword(),company.getSignId(),notifyUrl);
+        if(StringUtils.isBlank(applyNo) ){
+            throw  new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"瀵逛笉璧凤紝鑾峰彇鍦ㄧ嚎绛剧珷鍦板潃澶辫触锛岃绋嶅悗閲嶈瘯锛�");
+        }
+        String link = signService.signLink(applyNo,company.getName(),company.getCode());
+        if(StringUtils.isBlank(link) ){
+            throw  new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"瀵逛笉璧凤紝鑾峰彇鍦ㄧ嚎绛剧珷鍦板潃澶辫触锛岃绋嶅悗閲嶈瘯锛�");
+        }
+        InsuranceApply update= new InsuranceApply();
+        update.setId(model.getId());
+        update.setEditor(user.getId());
+        update.setEditDate(new Date());
+        update.setApplyTbdNo(applyNo);
+        insuranceApplyMapper.updateById(update);
+        return  link;
+    }
 
 }
diff --git a/server/service/src/main/java/com/doumee/service/business/impl/UnionApplyServiceImpl.java b/server/service/src/main/java/com/doumee/service/business/impl/UnionApplyServiceImpl.java
index 5327580..0e16c1d 100644
--- a/server/service/src/main/java/com/doumee/service/business/impl/UnionApplyServiceImpl.java
+++ b/server/service/src/main/java/com/doumee/service/business/impl/UnionApplyServiceImpl.java
@@ -35,7 +35,7 @@
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
-import org.springframework.util.CollectionUtils;
+import com.github.xiaoymin.knife4j.core.util.CollectionUtils;
 
 import java.math.BigDecimal;
 import java.util.ArrayList;
@@ -287,7 +287,7 @@
                         .selectAs(InsuranceApply::getSolutionBaseId,Solutions::getBaseId)
                         .leftJoin(Solutions.class,Solutions::getId,InsuranceApply::getSolutionId)
                         .eq(InsuranceApply::getIsdeleted, Constants.ZERO)
-                        .eq(InsuranceApply::getStatus,Constants.InsuranceApplyStatus.COMPANY_MEMBER_LIST_SIGNATURE.getKey())
+                        .eq(InsuranceApply::getStatus,Constants.InsuranceApplyStatus.WTB_BUSSINESS_CHECK_PASS.getKey())
                         .eq(Solutions::getBaseId,saveUnionApplyDTO.getBaseSolutionId())
                         .in(InsuranceApply::getId,saveUnionApplyDTO.getApplyIds())
                         .isNull(InsuranceApply::getUnionApplyId)
@@ -318,6 +318,7 @@
                 .set(InsuranceApply::getUnionApplyId,unionApply.getId())
                 .set(InsuranceApply::getCheckDate,new Date())
                 .set(InsuranceApply::getCheckUserId,user.getId())
+                .set(InsuranceApply::getStatus,Constants.InsuranceApplyStatus.WTB_TOUBAOING.getKey())
                 .in(InsuranceApply::getId,saveUnionApplyDTO.getApplyIds()));
 
         applyDetailJoinMapper.update(null,new UpdateWrapper<ApplyDetail>().lambda()
@@ -363,6 +364,7 @@
                 .set(InsuranceApply::getUnionApplyId,null)
                 .set(InsuranceApply::getCheckDate,new Date())
                 .set(InsuranceApply::getCheckUserId,user.getId())
+                .set(InsuranceApply::getStatus,Constants.InsuranceApplyStatus.WTB_BUSSINESS_CHECK_PASS.getKey())
                 .eq(InsuranceApply::getUnionApplyId,unionApply.getId()));
 
         applyDetailJoinMapper.update(null,new UpdateWrapper<ApplyDetail>().lambda()
@@ -382,8 +384,8 @@
     @Transactional(rollbackFor = {Exception.class,BusinessException.class})
     public void uploadToubaodan(UploadMultifileDTO uploadMultifileDTO){
         if(uploadMultifileDTO.getBusinessId() == null
-                ||StringUtils.isBlank( uploadMultifileDTO.getFilePath())
-                ||StringUtils.isBlank( uploadMultifileDTO.getFileName())){
+                ||StringUtils.isBlank( uploadMultifileDTO.getFileurl())
+                ||StringUtils.isBlank( uploadMultifileDTO.getName())){
             throw  new BusinessException(ResponseStatus.BAD_REQUEST);
         }
         LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
@@ -404,6 +406,41 @@
             throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"瀵逛笉璧凤紝鍚堝苟鍗曚笟鍔″凡娴佽浆锛屾偍鏃犳硶杩涜璇ユ搷浣滐紒");
         }
 
+        if(CollectionUtils.isNotEmpty(uploadMultifileDTO.getMultifileList())){
+            List<Multifile> multifileList = uploadMultifileDTO.getMultifileList();
+            for (Multifile multifile:multifileList) {
+                if(Objects.isNull(multifile.getObjId())
+                    ||Objects.isNull(multifile.getName())
+                    ||Objects.isNull(multifile.getFileurl())){
+                    throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"浼佷笟鎶曚繚鍗曢檮浠跺弬鏁伴敊璇�");
+                }
+                InsuranceApply insuranceApply = insuranceApplyJoinMapper.selectOne(new QueryWrapper<InsuranceApply>().lambda()
+                        .eq(InsuranceApply::getId,multifile.getObjId())
+                        .eq(InsuranceApply::getUnionApplyId,uploadMultifileDTO.getBusinessId())
+                );
+                if(Objects.isNull(insuranceApply)){
+                    throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"浼佷笟鎶曚繚鍗曟湭鏌ヨ鍒�");
+                }
+
+                multifile.setIsdeleted(Constants.ZERO);
+                multifile.setCreator(user.getId());
+                multifile.setCreateDate(new Date());
+                multifile.setCreateDate(new Date());
+                multifile.setObjType(Constants.MultiFile.COMPANY_TBD_SIGNED_PDF.getKey());
+                multifile.setType(Constants.TWO);
+                multifileMapper.insert(multifile);
+
+                insuranceApplyJoinMapper.update(null,new UpdateWrapper<InsuranceApply>().lambda()
+                        .set(InsuranceApply::getUnionApplyTbdStatus,Constants.ONE)
+                        .set(InsuranceApply::getEditDate,new Date())
+                        .set(InsuranceApply::getEditor,user.getId())
+                        .eq(InsuranceApply::getId,multifile.getObjId())
+                );
+
+            }
+        }
+
+
         unionApply.setCheckDate(new Date());
         unionApply.setCheckUserId(user.getId());
         unionApply.setStatus(Constants.UnionApplyStatus.WAIT_SIGNATURE.getKey());
@@ -419,9 +456,12 @@
         multifile.setCreateDate(new Date());
         multifile.setObjType(Constants.MultiFile.HBD_BD_SIGNED_PDF.getKey());
         multifile.setType(Constants.TWO);
-        multifile.setFileurl(uploadMultifileDTO.getFilePath());
-        multifile.setName(uploadMultifileDTO.getFileName());
+        multifile.setFileurl(uploadMultifileDTO.getFileurl());
+        multifile.setName(uploadMultifileDTO.getName());
         multifileMapper.insert(multifile);
+
+
+
 
     }
 
@@ -563,7 +603,7 @@
                 multifile.setCreator(user.getId());
                 multifile.setCreateDate(new Date());
                 multifile.setObjId(insuranceApply.getId());
-                multifile.setObjType(Constants.MultiFile.COMPANY_TBD_SIGNED_PDF.getKey());
+                multifile.setObjType(Constants.MultiFile.BD_DONE_PDF.getKey());
                 multifile.setType(Constants.TWO);
                 multifile.setFileurl(unionApplyBXDDDetailTO.getFileUrl());
                 multifile.setName(unionApplyBXDDDetailTO.getFileName());
@@ -578,7 +618,8 @@
                             new BigDecimal(applyDetails.size())
                             .multiply(price)
                     )
-                    .set(InsuranceApply::getStatus,Constants.InsuranceApplyStatus.UPLOAD_INSURANCE.getKey())
+                    .set(InsuranceApply::getStatus,Constants.InsuranceApplyStatus.WTB_DONE.getKey())
+                    .set(InsuranceApply::getUnionApplyTbdStatus,3)
                     .set(InsuranceApply::getFee,price.multiply(new BigDecimal(applyDetails.size())).multiply(new BigDecimal(maxDays)))
                     .set(InsuranceApply::getCurrentFee,currentFee.multiply(new BigDecimal(applyDetails.size())))
                     .set(InsuranceApply::getStartTime,unionApplyBXDDTO.getStartTime())
@@ -620,16 +661,12 @@
             multifile.setCreator(user.getId());
             multifile.setCreateDate(new Date());
             multifile.setObjId(unionApply.getId());
-            multifile.setObjType(Constants.MultiFile.HBD_BD_APPLY_PDF.getKey());
+            multifile.setObjType(Constants.MultiFile.WTB_BD_DONE_PDF.getKey());
             multifile.setType(Constants.TWO);
             multifile.setFileurl(unionApplyBXDDTO.getFileUrl());
             multifile.setName(unionApplyBXDDTO.getFileName());
             multifileMapper.insert(multifile);
         }
-
-
-
-
     }
 
 
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 fee92f3..d9a2a12 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
@@ -234,7 +234,7 @@
                         .leftJoin(InsuranceApply.class,InsuranceApply::getId,ApplyChange::getApplyId)
                         .eq(ApplyChange::getIsdeleted, Constants.ZERO)
                         .eq(InsuranceApply::getUnionApplyId,saveUnionChangeDTO.getUnionApplyId())
-                        .eq(ApplyChange::getStatus,Constants.ApplyChangeStatus.COMPANY_SIGN.getKey())
+                        .eq(ApplyChange::getStatus,Constants.ApplyChangeStatus.PALTFORM_CHECK_PASS.getKey())
                         .eq(InsuranceApply::getStatus,Constants.InsuranceApplyStatus.UPLOAD_INSURANCE.getKey())
                         .eq(ApplyChange::getType,saveUnionChangeDTO.getBusinessType())
                         .in(ApplyChange::getId,saveUnionChangeDTO.getApplyIds())
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 9bf62a2..a05160a 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
@@ -7,6 +7,7 @@
 import com.doumee.core.model.PageData;
 import com.doumee.core.model.PageWrap;
 import com.doumee.dao.business.model.ApplyChange;
+import com.doumee.dao.business.model.InsuranceApply;
 import com.doumee.service.business.ApplyChangeService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -140,4 +141,12 @@
     public ApiResponse<ApplyChange> findById(@PathVariable Integer id) {
         return ApiResponse.success(applyChangeService.findDetail(id));
     }
+
+
+    @ApiOperation("鍟嗘埛瀹℃牳 - 濮旀墭淇濅笟鍔�")
+    @PostMapping("/check")
+    @RequiresPermissions("business:applychange:check")
+    public ApiResponse check(@RequestBody ApplyChange model) {
+        return ApiResponse.success(applyChangeService.check(model));
+    }
 }
diff --git a/server/shop/src/main/java/com/doumee/api/business/UnionChangeController.java b/server/shop/src/main/java/com/doumee/api/business/UnionChangeController.java
index 4432a37..2d1822b 100644
--- a/server/shop/src/main/java/com/doumee/api/business/UnionChangeController.java
+++ b/server/shop/src/main/java/com/doumee/api/business/UnionChangeController.java
@@ -90,8 +90,6 @@
         return ApiResponse.success(unionChangeService.findById(id));
     }
 
-
-
     @PreventRepeat
     @ApiOperation("鍒涘缓鍚堝苟鍗�")
     @PostMapping("/merge")

--
Gitblit v1.9.3