From 3e76171990be40e226341da1cd7c2d159c9a3b70 Mon Sep 17 00:00:00 2001
From: k94314517 <8417338+k94314517@user.noreply.gitee.com>
Date: 星期五, 02 二月 2024 18:11:31 +0800
Subject: [PATCH] 111

---
 server/service/src/main/java/com/doumee/service/business/impl/ApplyChangeServiceImpl.java |   48 ++++++++++++++++++++++++++++++------------------
 1 files changed, 30 insertions(+), 18 deletions(-)

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 d1c2c30..d599b6c 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
@@ -637,7 +637,14 @@
         applyChangeMapper.updateById(applyChangeFee);
 
 
-        this.saveApplyLog(applyChange,Constants.ApplyChangeLogStatus.UPLOAD,null);
+
+        Constants.ApplyLogType applyLogType = Constants.ApplyLogType.CA_COMPANY_COMMIT;
+        String info =applyLogType.getInfo();
+//        info = info.replace("${param}", update.getCheckInfo());
+        ApplyLog log = new ApplyLog(applyChange,applyLogType.getName(),info,applyChange.getId(),applyLogType.getKey(), null, null);
+        applyLogMapper.insert(log);
+        
+
         return applyChange.getId();
     }
 
@@ -710,7 +717,15 @@
         BigDecimal fee = this.dealApplyChangeData(applyChange,insuranceApply,companySolution,solutions,loginUserInfo,BigDecimal.ZERO);
         applyChange.setFee(fee);
         applyChangeMapper.updateById(applyChange);
-        this.saveApplyLog(applyChange,Constants.ApplyChangeLogStatus.UPLOAD,null);
+
+
+        Constants.ApplyLogType applyLogType = Constants.ApplyLogType.CA_UPLOAD_AGAIN;
+        String info =applyLogType.getInfo();
+//        info = info.replace("${param}", update.getCheckInfo());
+        ApplyLog log = new ApplyLog(applyChange,applyLogType.getName(),info,applyChange.getId(),applyLogType.getKey(), null, null);
+        applyLogMapper.insert(log);
+
+
         return applyChange.getId();
     }
 
@@ -783,23 +798,18 @@
     }
 
 
-
-
-
-    public void saveApplyLog(ApplyChange applyChange,Constants.ApplyChangeLogStatus applyChangeLogStatus,String content){
+    public void saveApplyLog(ApplyChange applyChange,Constants.ApplyLogType applyLogType,String content){
         LoginUserInfo loginUserInfo = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
         ApplyLog applyLog = new ApplyLog();
         applyLog.setCreateDate(new Date());
         applyLog.setCreator(loginUserInfo.getId());
         applyLog.setIsdeleted(Constants.ZERO);
         applyLog.setApplyId(applyChange.getApplyId());
-        applyLog.setTitle(applyChangeLogStatus.getName());
+        applyLog.setTitle(applyLogType.getName());
         if(StringUtils.isNotBlank(content)){
-            applyLog.setContent(applyChangeLogStatus.getInfo().replace("${param}",content));
-        }else{
-            applyLog.setContent(applyChangeLogStatus.getInfo());
+            applyLog.setContent(applyLogType.getInfo().replace("${param}",content));
         }
-        applyLog.setObjType(applyChangeLogStatus.getKey());
+        applyLog.setObjType(applyLogType.getKey());
         applyLog.setObjId( applyChange.getId());
         applyLog.setStatus(applyChange.getStatus());
         applyLogMapper.insert(applyLog);
@@ -1190,7 +1200,7 @@
             throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"鏈煡璇㈡柟妗堜俊鎭�");
         }
 
-        Constants.ApplyChangeLogStatus applyChangeLogStatus = Constants.ApplyChangeLogStatus.RETURN_APPLY;
+        Constants.ApplyLogType applyLogType = Constants.ApplyLogType.CA_PLATFORM_CHECK_PASS_NO;
 
         Constants.NoticeObjectType noticeObjectType = Constants.NoticeObjectType.APPLY_CHANGE;
         if(applyChange.getType().equals(Constants.ONE)){
@@ -1221,7 +1231,7 @@
 
 
         }else if(applyChangeOptDTO.getOptType().equals(4)){
-            applyChangeLogStatus = Constants.ApplyChangeLogStatus.PLATFORM_AGREE;
+            applyLogType = Constants.ApplyLogType.CA_PLATFORM_AGREE_BACK_APPLY;
             //骞冲彴鍚屾剰閫�鍥�
             if(loginUserInfo.getType().equals(Constants.ZERO)){
                 throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"闈炲钩鍙扮鐢ㄦ埛鏃犳硶杩涜璇ユ搷浣�");
@@ -1232,7 +1242,7 @@
                 throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"鏁版嵁鐘舵�侀敊璇棤娉曡繘琛岃鎿嶄綔!");
             }
         }else if(applyChangeOptDTO.getOptType().equals(5)){
-            applyChangeLogStatus = Constants.ApplyChangeLogStatus.PLATFORM_UN_AGREE;
+            applyLogType = Constants.ApplyLogType.CA_PALTFORM_REFUSE_APPLY;
             //骞冲彴椹冲洖閫�鍥�
             if(loginUserInfo.getType().equals(Constants.ZERO)){
                 throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"闈炲钩鍙扮鐢ㄦ埛鏃犳硶杩涜璇ユ搷浣�");
@@ -1249,7 +1259,7 @@
             }
         }else if(applyChangeOptDTO.getOptType().equals(6)){
             //浼佷笟鍏抽棴
-            applyChangeLogStatus = Constants.ApplyChangeLogStatus.CLOSE;
+            applyLogType = Constants.ApplyLogType.CA_COMPANY_CLOSE;
             if(!loginUserInfo.getType().equals(Constants.ONE)){
                 throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"闈炰紒涓氱鐢ㄦ埛鏃犳硶杩涜璇ユ搷浣�");
             }
@@ -1257,7 +1267,6 @@
                 throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"鏁版嵁鐘舵�侀敊璇棤娉曡繘琛岃鎿嶄綔!");
             }
             applyChange.setStatus(Constants.ApplyChangeStatus.CLOSE.getKey());
-
 
             //瀛樺偍寰呭姙淇℃伅
             //鍒犻櫎鍏朵粬寰呭姙
@@ -1270,8 +1279,10 @@
         applyChange.setEditDate(new Date());
         applyChangeMapper.updateById(applyChange);
 
-        //瀛樺偍鏃ュ織鏁版嵁
-        this.saveApplyLog(applyChange,applyChangeLogStatus,applyChangeOptDTO.getOptIllustration());
+        String info = applyLogType.getInfo();
+        info = info.replace("${param}", applyChangeOptDTO.getOptIllustration());
+        ApplyLog log = new ApplyLog(applyChange,applyLogType.getName(),info,applyChange.getId(),applyLogType.getKey(), null, null);
+        applyLogMapper.insert(log);
     }
 
 
@@ -1302,6 +1313,7 @@
                         .selectAs(Company::getName,ApplyLog::getCompanyName)
                         .leftJoin(SystemUser.class,SystemUser::getId,ApplyLog::getCreator)
                         .leftJoin(Company.class,Company::getId,SystemUser::getCompanyId)
+                        .in(ApplyLog::getObjType,Constants.ApplyLogType.getTypeList(Constants.ONE))
                         .eq(ApplyLog::getObjId,applyChange.getId())
                         .orderByAsc(ApplyLog::getCreateDate)
         );

--
Gitblit v1.9.3