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/shop/src/main/java/com/doumee/api/business/UnionApplyController.java                  |   11 +--
 server/service/src/main/java/com/doumee/dao/business/model/ApplyLog.java                     |   15 +++++
 server/service/src/main/java/com/doumee/dao/business/dto/CloseDTO.java                       |   23 +++++++
 server/service/src/main/java/com/doumee/core/utils/Constants.java                            |   16 ++++-
 server/service/src/main/java/com/doumee/service/business/UnionApplyService.java              |    9 +--
 server/service/src/main/java/com/doumee/service/business/impl/InsuranceApplyServiceImpl.java |    9 ++
 server/service/src/main/java/com/doumee/service/business/impl/UnionApplyServiceImpl.java     |   39 ++++++++++---
 7 files changed, 95 insertions(+), 27 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 7403a7e..44ea2b3 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
@@ -784,18 +784,26 @@
         CA_CHANGUNIT_APPLY_SIGN(24, "鎹㈠巶鐢宠浼佷笟绛剧珷","",1),
         CA_UPLOAD_AGAIN(25, "鍐嶆鎶曚繚","",1),
 
-
         WTB_FINISH_FAQRS(26, "濮旀墭淇� - 浼佷笟瀹屾垚绛剧讲鏂规纭涔�","",0),
         WTB_FINISH_MEMBER_LIST(27, "濮旀墭淇� - 浼佷笟瀹屾垚绛剧讲浜哄憳鍚嶅崟","",0),
-
         CA_WTB_FINISH_MEMBER_LIST(28, "濮旀墭淇� - 鍔犲噺淇濈缃蹭汉鍛樺悕鍗�","",1),
-
         UPLOAD_AGAIN(29, "鍐嶆鎶曚繚","",0),
-
         PALTFORM_EDIT_BD(30, "淇敼淇濆崟","淇敼鍘熷洜锛�${param}",0),
         SHOP_CLOSE_WTB_APPLY(31, "鍏抽棴鐢宠","鍘熷洜锛�${param}",0),
 
 
+        /**
+         * 濮旀墭淇濆悎骞跺崟
+         */
+        IA_HBD_UPLOAD(32, "鎻愪氦鐢宠","",3),
+        IA_HBD_UPLOAD_TBD(33, "涓婁紶鎶曚繚鍗�","",3),
+        IA_HBD_SIGNATURE_TBD(34, "绛剧讲鎶曚繚鍗�","",3),
+        IA_HBD_UPLOAD_INSURANCE(35, "涓婁紶淇濋櫓鍗�","淇濋櫓鐢熸晥璧锋湡锛�${param1}鍙樻洿涓�${param2}",3),
+        IA_HBD_CLOSE(36, "閫�鍥炵敵璇�","鍘熷洜锛�${param}",3),
+
+
+
+
 
 
 
diff --git a/server/service/src/main/java/com/doumee/dao/business/dto/CloseDTO.java b/server/service/src/main/java/com/doumee/dao/business/dto/CloseDTO.java
new file mode 100644
index 0000000..de521b8
--- /dev/null
+++ b/server/service/src/main/java/com/doumee/dao/business/dto/CloseDTO.java
@@ -0,0 +1,23 @@
+package com.doumee.dao.business.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * Created by IntelliJ IDEA.
+ *
+ * @Author : Rk
+ * @create 2024/4/1 14:57
+ */
+@Data
+public class CloseDTO {
+
+    @ApiModelProperty(value = "涓氬姟涓婚敭")
+    private Integer id;
+
+    @ApiModelProperty(value = "閫�鍥炲師鍥�")
+    private String reason;
+
+
+
+}
diff --git a/server/service/src/main/java/com/doumee/dao/business/model/ApplyLog.java b/server/service/src/main/java/com/doumee/dao/business/model/ApplyLog.java
index 7b95188..5b0f624 100644
--- a/server/service/src/main/java/com/doumee/dao/business/model/ApplyLog.java
+++ b/server/service/src/main/java/com/doumee/dao/business/model/ApplyLog.java
@@ -36,6 +36,7 @@
         this.beforeContent=before;
         this.afterContent=after;
     }
+
     public ApplyLog(ApplyChange apply,String title,String content,Integer objId,Integer objType, String before,String after){
         this.title =title;
         this.content=content;
@@ -49,6 +50,20 @@
         this.afterContent=after;
     }
 
+    public ApplyLog(UnionApply apply,String title,String content,Integer objId,Integer objType, String before,String after){
+        this.title =title;
+        this.content=content;
+        this.applyId = apply.getId();
+        this.createDate =apply.getEditDate();
+        this.creator =apply.getEditor();
+        this.status = apply.getStatus();
+        this.objId=objId;
+        this.objType = objType;
+        this.beforeContent=before;
+        this.afterContent=after;
+    }
+
+
     @TableId(type = IdType.AUTO)
     @ApiModelProperty(value = "涓婚敭", example = "1")
     @ExcelColumn(name="涓婚敭")
diff --git a/server/service/src/main/java/com/doumee/service/business/UnionApplyService.java b/server/service/src/main/java/com/doumee/service/business/UnionApplyService.java
index bc3f69e..8594892 100644
--- a/server/service/src/main/java/com/doumee/service/business/UnionApplyService.java
+++ b/server/service/src/main/java/com/doumee/service/business/UnionApplyService.java
@@ -2,10 +2,7 @@
 
 import com.doumee.core.model.PageData;
 import com.doumee.core.model.PageWrap;
-import com.doumee.dao.business.dto.SaveUnionApplyDTO;
-import com.doumee.dao.business.dto.SmsCheckDTO;
-import com.doumee.dao.business.dto.UnionApplyBXDDTO;
-import com.doumee.dao.business.dto.UploadMultifileDTO;
+import com.doumee.dao.business.dto.*;
 import com.doumee.dao.business.model.UnionApply;
 import java.util.List;
 
@@ -107,9 +104,9 @@
 
     /**
      * 鍙栨秷鍚堝苟鍗�
-     * @param id
+     * @param closeDTO
      */
-    void cancelMerge(Integer id);
+    void cancelMerge(CloseDTO closeDTO);
 
     /**
      * 涓婁紶鎶曚繚鍗�
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 153b63e..20e2309 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
@@ -777,6 +777,13 @@
 //        applyLogMapper.insert(log);
 //
 //        startSendEmail(f, model.getCompanyName(),model.getSolutionsName(),model.getSolutionEmail());
+
+
+        Constants.ApplyLogType applyLogType = Constants.ApplyLogType.IA_HBD_SIGNATURE_TBD;
+        ApplyLog log = new ApplyLog(model,applyLogType.getName(), null
+                ,model.getId(),applyLogType.getKey(),null, JSONObject.toJSONString(model));
+        applyLogMapper.insert(log);
+
         return  f;
     }
 
@@ -1932,10 +1939,10 @@
                 .selectAs(Solutions::getTimeUnit,InsuranceApply::getTimeUnit)
                 .selectAs(Solutions::getType,InsuranceApply::getSolutionType)
                 .selectAs(Solutions::getName,InsuranceApply::getSolutionsName)
-                .selectAs(Solutions::getName,InsuranceApply::getShopName)
                 .selectAs(Company::getName,InsuranceApply::getCompanyName)
                 .select(" ( select max(ac.APPLY_START_TIME) from apply_change ac  where ac.apply_id = t.id and ac.status = 2 ) as lastChangeDate")
                 .select(" ( select count(DISTINCT(ad.MEMBER_ID)) from apply_detail ad  where ad.apply_id = t.id ) as insureNum")
+                .select(" t3.name as shopName")
                 .leftJoin(Solutions.class,Solutions::getId,InsuranceApply::getSolutionId)
                 .leftJoin(Company.class,Company::getId,InsuranceApply::getCompanyId)
                 .leftJoin(Company.class,Company::getId,Solutions::getShopId)
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);
 
 
 }
diff --git a/server/shop/src/main/java/com/doumee/api/business/UnionApplyController.java b/server/shop/src/main/java/com/doumee/api/business/UnionApplyController.java
index 10f399e..1a57ba5 100644
--- a/server/shop/src/main/java/com/doumee/api/business/UnionApplyController.java
+++ b/server/shop/src/main/java/com/doumee/api/business/UnionApplyController.java
@@ -6,10 +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.SaveUnionApplyDTO;
-import com.doumee.dao.business.dto.SmsCheckDTO;
-import com.doumee.dao.business.dto.UnionApplyBXDDTO;
-import com.doumee.dao.business.dto.UploadMultifileDTO;
+import com.doumee.dao.business.dto.*;
 import com.doumee.dao.business.model.UnionApply;
 import com.doumee.service.business.UnionApplyService;
 import io.swagger.annotations.Api;
@@ -103,10 +100,10 @@
     }
 
     @ApiOperation("鍏抽棴鍚堝苟鍗�")
-    @GetMapping("/close")
+    @PostMapping("/close")
     @RequiresPermissions("business:unionapply:close")
-    public ApiResponse close(@RequestParam Integer id) {
-        unionApplyService.cancelMerge(id);
+    public ApiResponse close(@RequestBody CloseDTO closeDTO) {
+        unionApplyService.cancelMerge(closeDTO);
         return ApiResponse.success(null);
     }
 

--
Gitblit v1.9.3