From bf8602574fb825691147964c1e9436c3df855dc5 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期一, 22 一月 2024 15:17:11 +0800
Subject: [PATCH] 开发业务接口

---
 server/service/src/main/java/com/doumee/service/business/impl/InsuranceApplyServiceImpl.java |   28 +++++++++++++++++++++++++++-
 1 files changed, 27 insertions(+), 1 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 599e639..a01003d 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
@@ -80,7 +80,7 @@
         if(model == null ||!Constants.equalsInteger(model.getIsdeleted(),Constants.ZERO)){
             throw  new BusinessException(ResponseStatus.DATA_EMPTY);
         }
-        if(!Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.UPLOAD.getKey())){
+        if(Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.UPLOAD_INSURANCE.getKey())){
             throw  new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"瀵逛笉璧凤紝璇ョ敵璇风姸鎬佸凡娴佽浆锛屽綋鍓嶄笉鏀寔璇ユ搷浣渵");
         }
         LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
@@ -572,6 +572,32 @@
         insuranceApply.setApplyLogList(applyLogList);
         return insuranceApply;
     }
+    @Override
+    public  InsuranceApply  findDetailForExport(InsuranceApply model){
+        MPJLambdaWrapper wrapper=  new MPJLambdaWrapper<InsuranceApply>()
+                .selectAll(InsuranceApply.class)
+                .selectAs(Solutions::getName,InsuranceApply::getSolutionsName)
+                .selectAs(Company::getName,ApplyLog::getCompanyName)
+                .leftJoin(Solutions.class,Solutions::getId,InsuranceApply::getSolutionId)
+                .leftJoin(Company.class,Company::getId,InsuranceApply::getCompanyId)
+                .eq(InsuranceApply::getId,model.getId())
+                .last("limit 1");
+
+        InsuranceApply insuranceApply = insuranceApplyJoinMapper.selectJoinOne(InsuranceApply.class,wrapper);
+        if(Objects.isNull(insuranceApply)){
+            throw new BusinessException(ResponseStatus.DATA_EMPTY);
+        }
+        //鏌ヨ鏄庣粏
+        List<ApplyDetail> detailList =applyDetailMapper.selectList(new QueryWrapper<ApplyDetail>().lambda().eq(ApplyDetail::getApplyId,insuranceApply.getId())
+                .eq(ApplyDetail::getIsdeleted,Constants.ZERO));
+
+        if(detailList!=null){
+            insuranceApply.setInsureNum(detailList.size());
+            insuranceApply.setApplyDetailList(detailList);
+        }
+        insuranceApply.setRemark(model.getRemark());
+        return insuranceApply;
+    }
 
 
     @Override

--
Gitblit v1.9.3