From 5652bd7f2e7c850dbf8403e7bb85224d3727ba41 Mon Sep 17 00:00:00 2001
From: k94314517 <8417338+k94314517@user.noreply.gitee.com>
Date: 星期一, 01 四月 2024 15:17:20 +0800
Subject: [PATCH] git ch

---
 server/service/src/main/java/com/doumee/service/business/impl/UnionApplyServiceImpl.java |   39 ++++++++++++++++++++++++++++++---------
 1 files changed, 30 insertions(+), 9 deletions(-)

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 6f22a3c..5b3fdd8 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
@@ -10,10 +10,7 @@
 import com.doumee.core.utils.Constants;
 import com.doumee.core.utils.DateUtil;
 import com.doumee.core.utils.Utils;
-import com.doumee.dao.business.CompanyMapper;
-import com.doumee.dao.business.MultifileMapper;
-import com.doumee.dao.business.SolutionsMapper;
-import com.doumee.dao.business.UnionApplyMapper;
+import com.doumee.dao.business.*;
 import com.doumee.dao.business.dto.*;
 import com.doumee.dao.business.join.ApplyDetailJoinMapper;
 import com.doumee.dao.business.join.InsuranceApplyJoinMapper;
@@ -80,6 +77,8 @@
 
     @Autowired
     private SmsEmailService smsEmailService;
+    @Autowired
+    private ApplyLogMapper applyLogMapper;
 
     @Value("${debug_model}")
     private boolean debugModel;
@@ -359,6 +358,13 @@
                 .set(ApplyDetail::getUnionApplyId,unionApply.getId())
                 .in(ApplyDetail::getApplyId,saveUnionApplyDTO.getApplyIds()));
 
+
+
+        Constants.ApplyLogType applyLogType = Constants.ApplyLogType.IA_HBD_UPLOAD;
+        ApplyLog log = new ApplyLog(unionApply,applyLogType.getName(), null
+                ,unionApply.getId(),applyLogType.getKey(),null, JSONObject.toJSONString(unionApply));
+        applyLogMapper.insert(log);
+
         return unionApply.getId();
 
     }
@@ -366,16 +372,19 @@
 
     /**
      * 鍙栨秷淇濆崟鍚堝苟
-     * @param id
+     * @param closeDTO
      */
     @Override
     @Transactional(rollbackFor = {Exception.class,BusinessException.class})
-    public void cancelMerge(Integer id){
+    public void cancelMerge(CloseDTO closeDTO){
         LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
         if(!user.getType().equals(Constants.TWO)){
             throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"闈炲晢鎴风敤鎴凤紝鏃犳硶杩涜璇ユ搷浣滐紒");
         }
-        UnionApply unionApply = unionApplyMapper.selectById(id);
+        if(Objects.isNull(closeDTO)||Objects.isNull(closeDTO.getId())){
+            throw new BusinessException(ResponseStatus.BAD_REQUEST);
+        }
+        UnionApply unionApply = unionApplyMapper.selectById(closeDTO.getId());
         if(Objects.isNull(unionApply)||!Constants.equalsInteger(unionApply.getIsdeleted(),Constants.ZERO)){
             throw new BusinessException(ResponseStatus.DATA_EMPTY);
         }
@@ -411,6 +420,16 @@
                 .set(UnionApply::getStatus,Constants.UnionApplyStatus.CLOSE.getKey())
                 .eq(UnionApply::getId,unionApply.getId())
         );
+
+
+        Constants.ApplyLogType applyLogType = Constants.ApplyLogType.IA_HBD_CLOSE;
+        String info =applyLogType.getInfo();
+        info = info.replace("${param}", closeDTO.getReason());
+        ApplyLog log = new ApplyLog(unionApply,applyLogType.getName(), info
+                ,unionApply.getId(),applyLogType.getKey(),null, null);
+        applyLogMapper.insert(log);
+
+        applyLogMapper.insert(log);
     }
 
 
@@ -705,8 +724,10 @@
         }
     }
 
-
-
+        Constants.ApplyLogType applyLogType = Constants.ApplyLogType.IA_HBD_UPLOAD_TBD;
+        ApplyLog log = new ApplyLog(unionApply,applyLogType.getName(), null
+                ,unionApply.getId(),applyLogType.getKey(),null, JSONObject.toJSONString(unionApply));
+        applyLogMapper.insert(log);
 
 
 }

--
Gitblit v1.9.3