From 31a2a1e82c6d1a80b62ef65bcfba46e084e372aa Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期三, 31 一月 2024 09:37:05 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 server/service/src/main/java/com/doumee/service/business/impl/InsuranceApplyServiceImpl.java |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 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 b3c53e3..d9c548e 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
@@ -17,6 +17,7 @@
 import com.doumee.dao.business.dto.InsuranceApplyQueryDTO;
 import com.doumee.dao.business.join.ApplyDetailJoinMapper;
 import com.doumee.dao.business.join.ApplyLogJoinMapper;
+import com.doumee.dao.business.join.DuSolutionJoinMapper;
 import com.doumee.dao.business.join.InsuranceApplyJoinMapper;
 import com.doumee.dao.business.model.*;
 import com.doumee.dao.business.vo.CountCyclePriceVO;
@@ -86,6 +87,8 @@
     private MemberMapper memberMapper;
     @Autowired
     private DuSolutionMapper duSolutionMapper;
+    @Autowired
+    private DuSolutionJoinMapper duSolutionJoinMapper;
     @Autowired
     private DuWorktypeMapper duWorktypeMapper;
 
@@ -704,7 +707,12 @@
             throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"鏈煡璇㈠埌鏂规淇℃伅");
         }
         //鏌ヨ淇濋櫓鏂规涓嬬殑鎵�鏈夋淳閬e崟浣�
-        List<DuSolution> duSolutionList = duSolutionMapper.selectList(new QueryWrapper<DuSolution>().lambda()
+        List<DuSolution>  duSolutionList = duSolutionJoinMapper.selectJoinList(DuSolution.class,new MPJLambdaWrapper<DuSolution>()
+                .selectAll(DuSolution.class)
+                .innerJoin(DispatchUnit.class,DispatchUnit::getId,DuSolution::getDispatchUnitId)
+                .eq(DispatchUnit::getCompanyId,insuranceApply.getCompanyId())
+                .eq(DispatchUnit::getIsdeleted,Constants.ZERO)
+                .eq(DispatchUnit::getUnitStatus,Constants.ONE)
                 .eq(DuSolution::getIsdeleted,Constants.ZERO)
                 .eq(DuSolution::getStatus,Constants.ONE)
                 .eq(DuSolution::getSolutionId,insuranceApply.getSolutionId()));
@@ -1044,7 +1052,7 @@
         MPJLambdaWrapper wrapper=  new MPJLambdaWrapper<InsuranceApply>()
                 .selectAll(InsuranceApply.class)
                 .selectAs(Solutions::getName,InsuranceApply::getSolutionsName)
-                .selectAs(Company::getName,ApplyLog::getCompanyName)
+                .selectAs(Company::getName,InsuranceApply::getCompanyName)
                 .select(" ( select count(1) from apply_detail ad  where ad.apply_id = t.id ) as insureNum")
                 .leftJoin(Solutions.class,Solutions::getId,InsuranceApply::getSolutionId)
                 .leftJoin(Company.class,Company::getId,InsuranceApply::getCompanyId)
@@ -1056,6 +1064,11 @@
             throw new BusinessException(ResponseStatus.DATA_EMPTY);
         }
 
+        if(insuranceApply.getStartTime().compareTo(new Date())<0  && insuranceApply.getEndTime().compareTo(new Date()) > 0 ){
+            insuranceApply.setLoseEfficacyDays(DateUtil.daysBetweenDates(insuranceApply.getEndTime(),new Date()));
+        }
+
+
         initApplyStatus(insuranceApply);
 
         //鏌ヨ闄勪欢鏁版嵁

--
Gitblit v1.9.3