|  |  | 
 |  |  |                     || saveUnionChangeDTO.getAddValidDate().getTime()> unionApply.getEndTime().getTime()){ | 
 |  |  |                 throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"合并单的批单加保生效期错误"); | 
 |  |  |             } | 
 |  |  |             if(saveUnionChangeDTO.getDelValidDate().getTime()<unionApply.getStartTime().getTime() | 
 |  |  |                     || saveUnionChangeDTO.getDelValidDate().getTime()> unionApply.getEndTime().getTime()){ | 
 |  |  |                 throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"合并单的批单减保生效期错误"); | 
 |  |  |             } | 
 |  |  |              | 
 |  |  |             //加入 查询是否存在减保的数据  如果存在减保数据 进行该日期的判断 2024年7月30日16:38:18 | 
 |  |  |             if(applyChagneDetailJoinMapper.selectCount(new QueryWrapper<ApplyChagneDetail>().lambda() | 
 |  |  |                             .eq(ApplyChagneDetail::getType,Constants.ONE) | 
 |  |  |                     .in(ApplyChagneDetail::getApplyChangeId,saveUnionChangeDTO.getApplyIds()))>Constants.ZERO){ | 
 |  |  |                 if(saveUnionChangeDTO.getDelValidDate().getTime()<unionApply.getStartTime().getTime() | 
 |  |  |                         || saveUnionChangeDTO.getDelValidDate().getTime()> unionApply.getEndTime().getTime()){ | 
 |  |  |                     throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"合并单的批单减保生效期错误"); | 
 |  |  |                 } | 
 |  |  |             }; | 
 |  |  |  | 
 |  |  |         }else{ | 
 |  |  |             if(saveUnionChangeDTO.getApplyDate().getTime()<DateUtil.afterDateByType(unionApply.getStartTime(),0,1).getTime() | 
 |  |  |                     || saveUnionChangeDTO.getApplyDate().getTime()> unionApply.getEndTime().getTime()){ | 
 |  |  | 
 |  |  |             } | 
 |  |  |             saveUnionChangeDTO.setAddValidDate(saveUnionChangeDTO.getApplyDate()); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |         List<ApplyChange> applyChangeList = applyChangeJoinMapper.selectJoinList(ApplyChange.class, | 
 |  |  |                 new MPJLambdaWrapper<ApplyChange>() | 
 |  |  | 
 |  |  |                         .eq(ApplyChange::getStatus,Constants.ApplyChangeStatus.CHECHED_PASSED.getKey()) | 
 |  |  |                         .eq(InsuranceApply::getStatus,Constants.InsuranceApplyStatus.WTB_DONE.getKey()) | 
 |  |  |                         .eq(ApplyChange::getType,saveUnionChangeDTO.getBusinessType()) | 
 |  |  |                         .le(ApplyChange::getApplyStartTime,DateUtil.getCurrDateTime()) | 
 |  |  | //                        .le(InsuranceApply::getStartTime,DateUtil.getCurrDateTime()) | 
 |  |  |                         .in(ApplyChange::getId,saveUnionChangeDTO.getApplyIds()) | 
 |  |  |                         .isNull(ApplyChange::getUnionChangeId) | 
 |  |  |         ); | 
 |  |  | 
 |  |  |                 .set(ApplyChagneDetail::getUnionChangeId,unionChange.getId()) | 
 |  |  |                 .in(ApplyChagneDetail::getApplyChangeId,saveUnionChangeDTO.getApplyIds())); | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  |         Constants.ApplyLogType applyLogType = Constants.ApplyLogType.CA_HBD_UPLOAD; | 
 |  |  |         ApplyLog log = new ApplyLog(unionChange,applyLogType.getName(), null | 
 |  |  |                 ,unionChange.getId(),applyLogType.getKey(),null, JSONObject.toJSONString(unionChange)); |