From 0c9a7d863d46138a574ed3aa966f9a2e1b6a2d91 Mon Sep 17 00:00:00 2001
From: k94314517 <8417338+k94314517@user.noreply.gitee.com>
Date: 星期五, 29 三月 2024 11:39:18 +0800
Subject: [PATCH] git ch

---
 server/service/src/main/java/com/doumee/service/business/impl/ApplyChangeServiceImpl.java |   51 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 51 insertions(+), 0 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 69d410b..35a6dd9 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
@@ -2020,6 +2020,57 @@
 
 
 
+    @Override
+    @Transactional(rollbackFor = {Exception.class,BusinessException.class})
+    public Integer check(ApplyChange applyChange) {
+        LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
+        if(!user.getType().equals(Constants.TWO)){
+            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"闈炲晢鎴风鏃犳硶杩涜璇ユ搷浣�");
+        }
+        if(applyChange.getId() == null){
+            throw  new BusinessException(ResponseStatus.BAD_REQUEST);
+        }
+        ApplyChange model = applyChangeJoinMapper.selectJoinOne(ApplyChange.class,
+                new MPJLambdaWrapper<ApplyChange>()
+                        .selectAll(ApplyChange.class)
+                        .selectAs(InsuranceApply::getSolutionId,ApplyChange::getSolutionsId)
+                        .leftJoin(InsuranceApply.class,InsuranceApply::getId,ApplyChange::getApplyId)
+                        .eq(ApplyChange::getId,applyChange.getId())
+                        .last(" limit 1")
+        );
 
+        if(model == null ||!Constants.equalsInteger(model.getIsdeleted(),Constants.ZERO)){
+            throw  new BusinessException(ResponseStatus.DATA_EMPTY);
+        }
+        Solutions solutions = solutionsMapper.selectById(model.getSolutionsId());
+        if(Objects.isNull(solutions)){
+            throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"鏈煡璇㈡柟妗堜俊鎭�");
+        }
+        if(solutions.getType().equals(Constants.ZERO)){
+           throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"鐩翠繚鍗曟嵁鏃犳硶杩涜璇ユ搷浣�");
+        }else{
+            if(!Constants.equalsInteger(model.getStatus(),Constants.ApplyChangeStatus.COMPANY_SIGN.getKey())){
+                throw  new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"瀵逛笉璧凤紝璇ョ敵璇风姸鎬佸凡娴佽浆锛屽綋鍓嶄笉鏀寔璇ユ搷浣渵");
+            }
+        }
+
+        ApplyChange update = new ApplyChange();
+        update.setEditDate(new Date());
+        update.setEditor(user.getId());
+        update.setCheckDate(update.getEditDate());
+        update.setCheckInfo(applyChange.getCheckInfo());
+        update.setCheckUserId(user.getId());
+        update.setId(model.getId());
+        if(applyChange.getDealBackApply() ==1){
+            //濡傛灉鏄笉閫氳繃
+            update.setStatus(Constants.ApplyChangeStatus.PALTFORM_CHECK_PASS_NO.getKey());
+        }else{
+            update.setStatus(Constants.ApplyChangeStatus.PALTFORM_CHECK_PASS.getKey());
+        }
+        applyChangeJoinMapper.updateById(update);
+
+        return  1;
+
+    }
 
 }

--
Gitblit v1.9.3