From 142df5ee1c533f4b068e37b6ba524297a8f8617f Mon Sep 17 00:00:00 2001
From: k94314517 <8417338+k94314517@user.noreply.gitee.com>
Date: 星期二, 09 四月 2024 14:04:16 +0800
Subject: [PATCH] git ch

---
 server/service/src/main/java/com/doumee/service/business/impl/InsuranceApplyServiceImpl.java |   39 +++++++++++++++++++++++++++++----------
 1 files changed, 29 insertions(+), 10 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 fe9edfc..690ced5 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
@@ -1532,6 +1532,18 @@
         if(!(solutions.getIsdeleted().equals(Constants.ZERO)||solutions.getStatus().equals(Constants.ZERO))){
             throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"鏂规淇℃伅宸茶绂佺敤");
         }
+        if(solutions.getValidType().equals(Constants.ZERO)){
+            if(DateUtil.getMontageDate(
+                    DateUtil.addDaysToDate(new Date(),solutions.getValidTypeNum()),1).getTime()
+                    >insuranceApply.getApplyStartTime().getTime()){
+                throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"淇濆崟鐢熸晥璧锋湡閿欒");
+            }
+        }else{
+            if(DateUtil.getNextMonthFirst(new Date()).getTime()>insuranceApply.getApplyStartTime().getTime()){
+                throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"淇濆崟鐢熸晥璧锋湡閿欒");
+            }
+        }
+
         List<ApplyDetail> applyDetailList = insuranceApply.getApplyDetailList();
         //鍒ゆ柇鏄惁瀛樺湪閲嶅淇℃伅
         List<String> idCardList = applyDetailList.stream().map(i->i.getIdcardNo()).collect(Collectors.toList());
@@ -1872,17 +1884,17 @@
             return  new ArrayList<>();
         }
         List<Integer> statusList = Constants.InsuranceApplyStatus.getKesByStatus(collectStatus);
-        if(collectStatus.equals(Constants.ApplyCollectStatus.DCD)){
+        if(collectStatus.equals(Constants.ApplyCollectStatus.DCD.getKey())){
             statusList.addAll(Constants.InsuranceApplyStatus.getKesByStatus(Constants.ApplyCollectStatus.WTBDCD.getKey()));
-        }else if(collectStatus.equals(Constants.ApplyCollectStatus.DSP)){
+        }else if(collectStatus.equals(Constants.ApplyCollectStatus.DSP.getKey())){
             statusList.addAll(Constants.InsuranceApplyStatus.getKesByStatus(Constants.ApplyCollectStatus.WTBDSH.getKey()));
-        }else if(collectStatus.equals(Constants.ApplyCollectStatus.BZZ)){
+        }else if(collectStatus.equals(Constants.ApplyCollectStatus.BZZ.getKey())){
             statusList.addAll(Constants.InsuranceApplyStatus.getKesByStatus(Constants.ApplyCollectStatus.WTBBZZ.getKey()));
-        }else if(collectStatus.equals(Constants.ApplyCollectStatus.YTH)){
+        }else if(collectStatus.equals(Constants.ApplyCollectStatus.YTH.getKey())){
             statusList.addAll(Constants.InsuranceApplyStatus.getKesByStatus(Constants.ApplyCollectStatus.WTBYTH.getKey()));
-        }else if(collectStatus.equals(Constants.ApplyCollectStatus.YGB)){
+        }else if(collectStatus.equals(Constants.ApplyCollectStatus.YGB.getKey())){
             statusList.addAll(Constants.InsuranceApplyStatus.getKesByStatus(Constants.ApplyCollectStatus.WTBYGB.getKey()));
-        }else if(collectStatus.equals(Constants.ApplyCollectStatus.DQYQZ)){
+        }else if(collectStatus.equals(Constants.ApplyCollectStatus.DQYQZ.getKey())){
             statusList.addAll(Constants.InsuranceApplyStatus.getKesByStatus(Constants.ApplyCollectStatus.WTBDQS.getKey()));
         }
 
@@ -1908,7 +1920,7 @@
         queryWrapper.select(" DATEDIFF( t.END_TIME ,now()  ) AS loseEfficacyDays  ");
         queryWrapper.select(" ( select count(DISTINCT(ad.MEMBER_ID)) from apply_detail ad  where ad.apply_id = t.id ) as insureNum");
         if(!Objects.isNull(pageWrap.getModel())&&!Objects.isNull(pageWrap.getModel().getType())){
-            queryWrapper.select(" ifnull(( select sum(td.fee) from taxes ts inner join tax_detial td on td.TAX_ID = ts.id  where ts.status  = 1 and td.INSURANCE_APPLY_ID = t.id ),0) as taxesMoney");
+            queryWrapper.select(" ifnull(( select sum(td.fee) from taxes ts inner join tax_detial td on td.TAX_ID = ts.id  where ts.status != 2 and td.INSURANCE_APPLY_ID = t.id ),0) as taxesMoney");
             queryWrapper.select(" ( select td.CREATE_DATE from taxes ts inner join tax_detial td on td.TAX_ID = ts.id  where ts.status = 1 and td.INSURANCE_APPLY_ID = t.id order by td.CREATE_DATE desc limit 1 ) as taxesLast ");
         }
         queryWrapper.leftJoin(Solutions.class,Solutions::getId,InsuranceApply::getSolutionId);
@@ -1917,9 +1929,14 @@
         queryWrapper.eq(pageWrap.getModel().getBaseSolutionId()!=null,Solutions::getBaseId,pageWrap.getModel().getBaseSolutionId());
         queryWrapper.in(statusList.size()>0,InsuranceApply::getStatus,statusList);
         queryWrapper.like(StringUtils.isNotBlank(pageWrap.getModel().getSolutionName()),Solutions::getName,pageWrap.getModel().getSolutionName());
-        if(Constants.equalsInteger(pageWrap.getModel().getStatusCollect(),Constants.THREE) ){
-            queryWrapper.eq(InsuranceApply::getStatus,Constants.InsuranceApplyStatus.UPLOAD_INSURANCE.getKey());
+        if(Constants.equalsInteger(pageWrap.getModel().getStatusCollect(),Constants.ApplyCollectStatus.YGQ.getKey()) ){
+            //濡傛灉鏄凡閬庢湡
+//            queryWrapper.eq(InsuranceApply::getStatus,Constants.InsuranceApplyStatus.UPLOAD_INSURANCE.getKey());
             queryWrapper.lt(InsuranceApply::getEndTime, Utils.Date.getStart(new Date()));
+        }else if(Constants.equalsInteger(pageWrap.getModel().getStatusCollect(),Constants.ApplyCollectStatus.BZZ.getKey()) ){
+            //濡傛灉鏄繚闅滀腑
+//            queryWrapper.eq(InsuranceApply::getStatus,Constants.InsuranceApplyStatus.UPLOAD_INSURANCE.getKey());
+            queryWrapper.gt(InsuranceApply::getEndTime, Utils.Date.getStart(new Date()));
         }
         LoginUserInfo loginUserInfo = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
 
@@ -2289,6 +2306,7 @@
         MPJLambdaWrapper wrapper=  new MPJLambdaWrapper<InsuranceApply>()
                 .selectAll(InsuranceApply.class)
                 .selectAs(Solutions::getName,InsuranceApply::getSolutionsName)
+                .selectAs(Solutions::getType,InsuranceApply::getSolutionType)
                 .selectAs(Company::getName,InsuranceApply::getCompanyName)
                 .leftJoin(Solutions.class,Solutions::getId,InsuranceApply::getSolutionId)
                 .leftJoin(Company.class,Company::getId,InsuranceApply::getCompanyId)
@@ -2446,7 +2464,8 @@
         MPJLambdaWrapper<ApplyDetail> lambdaWrapper = new MPJLambdaWrapper<ApplyDetail>();
         lambdaWrapper.select(ApplyDetail::getId)
                 .leftJoin(InsuranceApply.class,InsuranceApply::getId,ApplyDetail::getApplyId)
-                .and(i->i.eq(InsuranceApply::getStatus,Constants.InsuranceApplyStatus.UPLOAD_INSURANCE.getKey()).or().eq(InsuranceApply::getStatus,Constants.InsuranceApplyStatus.WTB_DONE.getKey()))
+                .and(i->i.eq(InsuranceApply::getStatus,Constants.InsuranceApplyStatus.UPLOAD_INSURANCE.getKey())
+                        .or().eq(InsuranceApply::getStatus,Constants.InsuranceApplyStatus.WTB_DONE.getKey()))
                 .eq(InsuranceApply::getCompanyId,loginUserInfo.getCompanyId())
                 .apply(" now() between t.START_TIME and t.END_TIME ");
 

--
Gitblit v1.9.3