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());
@@ -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 ");