From deb3baf0fb04c3a9f5b0d4b5bd9fb3237908d576 Mon Sep 17 00:00:00 2001
From: k94314517 <8417338+k94314517@user.noreply.gitee.com>
Date: 星期一, 19 二月 2024 18:38:12 +0800
Subject: [PATCH] 111

---
 server/service/src/main/java/com/doumee/service/business/impl/InsuranceApplyServiceImpl.java |   24 ++++++++++++++----------
 1 files changed, 14 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 1790a06..1a722e1 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
@@ -816,6 +816,8 @@
         Constants.InsuranceApplyStatus insuranceApplyStatus = Constants.InsuranceApplyStatus.UPLOAD;
         insuranceApply.setCreateDate(new Date());
         insuranceApply.setCreator(loginUserInfo.getId());
+        insuranceApply.setEditor(loginUserInfo.getId());
+        insuranceApply.setEditDate(new Date());
         insuranceApply.setIsdeleted(Constants.ZERO);
         insuranceApply.setCompanyId(loginUserInfo.getCompanyId());
         insuranceApply.setCheckInfo(insuranceApplyStatus.getName());
@@ -1045,6 +1047,7 @@
                 applyDetail.setIdcardNo(member.getIdcardNo());
                 applyDetail.setSex(member.getSex());
                 applyDetail.setFee(countCyclePriceVO.getCyclePrice());
+                applyDetail.setCurrentFee(BigDecimal.ZERO);
                 //楠岃瘉娲鹃仯鍗曚綅淇℃伅鏄惁瀛樺湪
                 if(duSolutionList.stream().filter(d->d.getDispatchUnitId().equals(applyDetail.getDuId())).collect(Collectors.toList()).size()<=Constants.ZERO){
                     throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"銆�"+applyDetail.getMemberName()+"銆戝憳宸ユ淳閬e崟浣嶆湭鏌ヨ鍒帮紒");
@@ -1120,7 +1123,7 @@
         queryWrapper.selectAs(Company::getName,InsuranceApply::getCompanyName);
         queryWrapper.selectAs(Solutions::getName,InsuranceApply::getSolutionsName);
         queryWrapper.select(" DATEDIFF( t.END_TIME ,now()  ) AS loseEfficacyDays  ");
-        queryWrapper.select(" ( select count(1) from apply_detail ad  where ad.apply_id = t.id ) as insureNum");
+        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 != 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 != 2 and td.INSURANCE_APPLY_ID = t.id order by td.CREATE_DATE desc limit 1 ) as taxesLast ");
@@ -1154,19 +1157,19 @@
             queryWrapper.ge(InsuranceApply::getEndTime, Utils.Date.getStart(pageWrap.getModel().getEndTimeS()));
         }
         if (pageWrap.getModel().getEndTimeE() != null) {
-            queryWrapper.le(InsuranceApply::getEndTime, Utils.Date.getEnd(pageWrap.getModel().getEndTimeE()));
+            queryWrapper.lt(InsuranceApply::getEndTime, Utils.Date.getEnd(pageWrap.getModel().getEndTimeE()));
         }
         if (pageWrap.getModel().getStartTimeS() != null) {
             queryWrapper.ge(InsuranceApply::getStartTime, Utils.Date.getStart(pageWrap.getModel().getStartTimeS()));
         }
         if (pageWrap.getModel().getStartTimeE() != null) {
-            queryWrapper.le(InsuranceApply::getStartTime, Utils.Date.getEnd(pageWrap.getModel().getStartTimeE()));
+            queryWrapper.lt(InsuranceApply::getStartTime, Utils.Date.getEnd(pageWrap.getModel().getStartTimeE()));
         }
         if (pageWrap.getModel().getCreateTimeS() != null) {
             queryWrapper.ge(InsuranceApply::getCreateDate, Utils.Date.getStart(pageWrap.getModel().getCreateTimeS()));
         }
         if (pageWrap.getModel().getCreateTimeE() != null) {
-            queryWrapper.le(InsuranceApply::getCreateDate, Utils.Date.getEnd(pageWrap.getModel().getCreateTimeE()));
+            queryWrapper.lt(InsuranceApply::getCreateDate, Utils.Date.getEnd(pageWrap.getModel().getCreateTimeE()));
         }
         if (pageWrap.getModel().getType() != null) {
             queryWrapper.eq(Solutions::getType, pageWrap.getModel().getType());
@@ -1175,7 +1178,7 @@
             queryWrapper.eq(InsuranceApply::getCode, pageWrap.getModel().getCode());
         }
         if (pageWrap.getModel().getStatus() != null) {
-            queryWrapper.eq(InsuranceApply::getStatus, pageWrap.getModel().getStatus());
+            queryWrapper.in(InsuranceApply::getStatus, pageWrap.getModel().getStatus().split(","));
         }
         if(CollectionUtils.isNotEmpty(pageWrap.getSorts())){
             for(PageWrap.SortData sortData: pageWrap.getSorts()) {
@@ -1200,7 +1203,7 @@
 
     public void    initApplyStatus(InsuranceApply apply){
         apply.setStatusCollect(Constants.InsuranceApplyStatus.getCollectStatus(apply.getStatus()));
-        if(Constants.equalsInteger(apply.getStatusCollect(),Constants.InsuranceApplyStatus.UPLOAD_INSURANCE.getKey())){
+        if(Constants.equalsInteger(apply.getStatus(),Constants.InsuranceApplyStatus.UPLOAD_INSURANCE.getKey())){
             //濡傛灉宸插畬鎴�
             if(apply.getEndTime()==null || System.currentTimeMillis()>apply.getEndTime().getTime()){
                 apply.setStatusCollect(Constants.THREE);//宸茶繃鏈�
@@ -1261,7 +1264,7 @@
             queryWrapper.eq(InsuranceApply::getCode, model.getCode());
         }
         if (model.getStatus() != null) {
-            queryWrapper.eq(InsuranceApply::getStatus, model.getStatus());
+            queryWrapper.in(InsuranceApply::getStatus, model.getStatus().split(","));
         }
         if (CollectionUtils.isNotEmpty(model.getIds())) {
             queryWrapper.in(InsuranceApply::getId, model.getIds());
@@ -1286,7 +1289,8 @@
                 .selectAll(InsuranceApply.class)
                 .selectAs(Solutions::getName,InsuranceApply::getSolutionsName)
                 .selectAs(Company::getName,InsuranceApply::getCompanyName)
-                .select(" ( select count(1) from apply_detail ad  where ad.apply_id = t.id ) as insureNum")
+                .select(" ( select max(ac.APPLY_START_TIME) from apply_change ac  where ac.apply_id = t.id and ac.status = 2 ) as lastChangeDate")
+                .select(" ( select count(DISTINCT(ad.MEMBER_ID)) 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)
                 .eq(InsuranceApply::getId,id)
@@ -1309,6 +1313,7 @@
                         .selectAll(ApplyLog.class)
                         .selectAs(SystemUser::getRealname,ApplyLog::getCreatorName)
                         .selectAs(Company::getName,ApplyLog::getCompanyName)
+                        .selectAs(SystemUser::getType,ApplyLog::getCreatorType)
                         .leftJoin(SystemUser.class,SystemUser::getId,ApplyLog::getCreator)
                         .leftJoin(Company.class,Company::getId,SystemUser::getCompanyId)
                         .in(ApplyLog::getObjType,Constants.ApplyLogType.getTypeList(Constants.ZERO))
@@ -1415,8 +1420,7 @@
     @Transactional(rollbackFor = {Exception.class,BusinessException.class})
     public void applyOpt(InsuranceApplyOptDTO insuranceApplyOptDTO){
         if(Objects.isNull(insuranceApplyOptDTO)
-            ||Objects.isNull(insuranceApplyOptDTO.getApplyId())
-            ||StringUtils.isBlank(insuranceApplyOptDTO.getOptIllustration())){
+            ||Objects.isNull(insuranceApplyOptDTO.getApplyId())){
             throw new BusinessException(ResponseStatus.BAD_REQUEST);
         }
         LoginUserInfo loginUserInfo = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();

--
Gitblit v1.9.3