From eea444a1d985ddd104565139c65e4b3921285e81 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期二, 23 一月 2024 10:20:39 +0800
Subject: [PATCH] 开发业务接口

---
 server/service/src/main/java/com/doumee/service/business/impl/InsuranceApplyServiceImpl.java |   39 +++++++++++++++++++++++++++++----------
 1 files changed, 29 insertions(+), 10 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 dc2857e..760d0d0 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
@@ -180,23 +180,32 @@
         LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
         Constants.ApplyLogType applyLogType = null;
         String info = "";
+        InsuranceApply update = new InsuranceApply();
         if(insuranceApply.getDealBackApply() ==1){
-            //濡傛灉鏄┏鍥�,鍙兘鍙┏鍥炵敵璇风姸鎬佽繘琛屾搷浣�
-            if(!Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.COMPANY_APPLY_RETURN_SELECT.getKey())){
+            //濡傛灉鏄┏鍥�,鍙兘鍙┏鍥炲凡绛剧珷鐘舵�佷笅鐨勯��鍥炵敵璇风姸鎬佽繘琛屾搷浣�
+            if(!Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.COMPANY_BACK_APPLY_SIGNATURE.getKey())){
                 throw  new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"瀵逛笉璧凤紝璇ョ敵璇风姸鎬佸凡娴佽浆锛屽綋鍓嶄笉鏀寔璇ユ搷浣渵");
             }
             applyLogType = Constants.ApplyLogType.PLATFORM_UN_AGREE_BACK;
             info = applyLogType.getInfo();
             info = info.replace("${param}", insuranceApply.getCheckInfo());
+            update.setStatus(Constants.InsuranceApplyStatus.SIGNATURE.getKey());
         }else{
             //濡傛灉鏄悓鎰�,涓ょ鐢宠閫�鍥炵姸鎬侀兘鍙搷浣�
-            if(!(Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.COMPANY_APPLY_RETURN_SELECT.getKey())
-                ||Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.COMPANY_APPLY_RETURN.getKey()))){
+            if(!(Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.COMPANY_BACK_APPLY_SIGNATURE.getKey())
+                    ||Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.COMPANY_BACK_APPLY_WAIT_SIGNATURE.getKey())
+                    ||Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.COMPANY_BACK_APPLY_UPLOAD.getKey()))){
                 throw  new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"瀵逛笉璧凤紝璇ョ敵璇风姸鎬佸凡娴佽浆锛屽綋鍓嶄笉鏀寔璇ユ搷浣渵");
             }
             applyLogType = Constants.ApplyLogType.PLATFORM_AGREE_BACK;
+            if( Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.COMPANY_BACK_APPLY_SIGNATURE.getKey())){
+                update.setStatus(Constants.InsuranceApplyStatus.SIGNATURE.getKey());
+            }else if( Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.COMPANY_BACK_APPLY_WAIT_SIGNATURE.getKey())){
+                update.setStatus(Constants.InsuranceApplyStatus.WAIT_SIGNATURE.getKey());
+            }else if(  Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.COMPANY_BACK_APPLY_UPLOAD.getKey())){
+                update.setStatus(Constants.InsuranceApplyStatus.UPLOAD.getKey());
+            }
         }
-        InsuranceApply update = new InsuranceApply();
         update.setEditDate(new Date());
         update.setEditor(user.getId());
         //鍚屾剰閫�鍥烇紝鐩存帴鍥炲埌鏈�鍒濈姸鎬侊紝濡傛灉椹冲洖閫�鍥炵敵璇凤紝鍒欎繚鍗曠姸鎬佸洖鍒板緟涓婁紶淇濋櫓鍗�
@@ -670,15 +679,20 @@
         if(insuranceApply.getIsdeleted().equals(Constants.ONE)){
             throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"鏁版嵁宸插垹闄�,鏃犳硶杩涜璇ユ搷浣�");
         }
-        Constants.InsuranceApplyStatus insuranceApplyStatus =  Constants.InsuranceApplyStatus.COMPANY_APPLY_RETURN;
+        //-----TODU-------RJ-------瀹屽杽閫�鍥炵姸鎬佸垎寮�鏍囪------------------
+        Constants.InsuranceApplyStatus insuranceApplyStatus =  Constants.InsuranceApplyStatus.COMPANY_BACK_APPLY_SIGNATURE;
         if(insuranceApplyOptDTO.getOptType().equals(Constants.ONE)){
-            if(insuranceApply.getStatus().equals(Constants.InsuranceApplyStatus.COMPANY_APPLY_RETURN.getKey())){
-                throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"閫�鍥炵敵璇蜂腑锛岃鍕块噸澶嶆搷浣�");
-            }
             if(!(insuranceApply.getStatus().equals(Constants.InsuranceApplyStatus.UPLOAD.getKey())
                     ||insuranceApply.getStatus().equals(Constants.InsuranceApplyStatus.WAIT_SIGNATURE.getKey())
                     ||insuranceApply.getStatus().equals(Constants.InsuranceApplyStatus.SIGNATURE.getKey()))){
                 throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"鏁版嵁鐘舵�侀潪鍙敵璇烽��鍥�!");
+            }
+            if(insuranceApply.getStatus().equals(Constants.InsuranceApplyStatus.UPLOAD.getKey())){
+                insuranceApplyStatus =  Constants.InsuranceApplyStatus.COMPANY_BACK_APPLY_UPLOAD;
+            }else   if(insuranceApply.getStatus().equals(Constants.InsuranceApplyStatus.WAIT_SIGNATURE.getKey())){
+                insuranceApplyStatus =  Constants.InsuranceApplyStatus.COMPANY_BACK_APPLY_WAIT_SIGNATURE;
+            }else  if(insuranceApply.getStatus().equals(Constants.InsuranceApplyStatus.SIGNATURE.getKey())){
+                insuranceApplyStatus =  Constants.InsuranceApplyStatus.COMPANY_BACK_APPLY_SIGNATURE;
             }
         }else if(insuranceApplyOptDTO.getOptType().equals(Constants.TWO)){
             insuranceApplyStatus =  Constants.InsuranceApplyStatus.CLOSE;
@@ -697,7 +711,12 @@
         insuranceApply.setCheckUserId(loginUserInfo.getId());
         insuranceApplyMapper.updateById(insuranceApply);
         //瀛樺偍鏃ュ織鏁版嵁
-        this.saveApplyLog(insuranceApply,insuranceApplyStatus,null);
+        Constants.ApplyLogType applyLogType = Constants.ApplyLogType.COMPANY_APPLY_RETURN;
+        String info =applyLogType.getInfo();
+        info = info.replace("${param}", insuranceApplyOptDTO.getOptIllustration());
+        ApplyLog log = new ApplyLog(insuranceApply,applyLogType.getName(),info,insuranceApply.getId(),applyLogType.getKey(),JSONObject.toJSONString(insuranceApply), JSONObject.toJSONString(insuranceApply));
+        applyLogMapper.insert(log);
+//        this.saveApplyLog(insuranceApply,insuranceApplyStatus,null);
     }
 
 

--
Gitblit v1.9.3