From 0afc0d40e019c168d47a79e90bdff2aba29ad553 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期五, 26 一月 2024 16:47:10 +0800
Subject: [PATCH] 开发业务接口

---
 server/service/src/main/java/com/doumee/service/business/impl/InsuranceApplyServiceImpl.java |   23 ++++++++++++++++-------
 1 files changed, 16 insertions(+), 7 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 ae88abb..6f15c4d 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
@@ -100,7 +100,7 @@
         InsuranceApply update = new InsuranceApply();
         update.setEditDate(new Date());
         update.setEditor(user.getId());
-        update.setStatus(Constants.InsuranceApplyStatus.PLATFORM_RETURN.getKey());
+        update.setStatus(Constants.InsuranceApplyStatus.FAIL_RETURN.getKey());
         update.setCheckDate(update.getEditDate());
         update.setCheckInfo(insuranceApply.getCheckInfo());
         update.setCheckUserId(user.getId());
@@ -530,14 +530,14 @@
     }
 
     /**
-     * 瀹℃牳閫氳繃
+     * 瀹℃牳閫氳繃鎴栬�呬笉閫氳繃
      * @param insuranceApply
      * @return
      */
     @Override
     @Transactional(rollbackFor = {Exception.class,BusinessException.class})
     public Integer check(InsuranceApply insuranceApply) {
-        if(insuranceApply.getId() == null ||StringUtils.isBlank(insuranceApply.getCheckInfo())){
+        if(insuranceApply.getId() == null || StringUtils.isBlank(insuranceApply.getCheckInfo())){
             throw  new BusinessException(ResponseStatus.BAD_REQUEST);
         }
         InsuranceApply model = insuranceApplyMapper.selectById(insuranceApply.getId());
@@ -548,19 +548,28 @@
         if(!Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.UPLOAD.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.setStatus(Constants.InsuranceApplyStatus.PLATFORM_CHECK_PASS.getKey());
         update.setCheckDate(update.getEditDate());
         update.setCheckInfo(insuranceApply.getCheckInfo());
         update.setCheckUserId(user.getId());
         update.setId(model.getId());
+        if(insuranceApply.getDealBackApply() ==1){
+            //濡傛灉鏄笉閫氳繃
+            applyLogType = Constants.ApplyLogType.PLATFORM_RETURN ;
+            update.setStatus(Constants.InsuranceApplyStatus.PLATFORM_RETURN.getKey());
+        }else{
+            applyLogType = Constants.ApplyLogType.PLATFORM_CHECK_PASS;
+            update.setStatus(Constants.InsuranceApplyStatus.PLATFORM_CHECK_PASS.getKey());
+        }
         insuranceApplyMapper.updateById(update);
-
-        Constants.ApplyLogType applyLogType = Constants.ApplyLogType.PLATFORM_CHECK_PASS;
-        ApplyLog log = new ApplyLog(update,applyLogType.getName(),null,update.getId(),applyLogType.getKey(),JSONObject.toJSONString(model), JSONObject.toJSONString(update));
+        String info =applyLogType.getInfo();
+        info = info.replace("${param}", update.getCheckInfo());
+        ApplyLog log = new ApplyLog(update,applyLogType.getName(),info,update.getId(),applyLogType.getKey(),JSONObject.toJSONString(model), JSONObject.toJSONString(update));
         applyLogMapper.insert(log);
         return  1;
 

--
Gitblit v1.9.3