k94314517
2024-04-09 02bc3bfe47e3d5311a0bb041c94e70a34b1ca73c
server/service/src/main/java/com/doumee/service/business/impl/InsuranceApplyServiceImpl.java
@@ -1532,6 +1532,17 @@
        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.getValidType()),0).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());
@@ -1919,11 +1930,11 @@
        queryWrapper.like(StringUtils.isNotBlank(pageWrap.getModel().getSolutionName()),Solutions::getName,pageWrap.getModel().getSolutionName());
        if(Constants.equalsInteger(pageWrap.getModel().getStatusCollect(),Constants.ApplyCollectStatus.YGQ.getKey()) ){
            //如果是已過期
            queryWrapper.eq(InsuranceApply::getStatus,Constants.InsuranceApplyStatus.UPLOAD_INSURANCE.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.eq(InsuranceApply::getStatus,Constants.InsuranceApplyStatus.UPLOAD_INSURANCE.getKey());
            queryWrapper.gt(InsuranceApply::getEndTime, Utils.Date.getStart(new Date()));
        }
        LoginUserInfo loginUserInfo = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
@@ -2452,7 +2463,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 ");