111
k94314517
2024-01-24 0c009141867c996897928c4f12490f21b78222f2
server/service/src/main/java/com/doumee/service/business/impl/ApplyChangeServiceImpl.java
@@ -51,6 +51,9 @@
    private InsuranceApplyMapper insuranceApplyMapper;
    @Autowired
    private CompanySolutionMapper companySolutionMapper;
    @Autowired
    private ApplyChangeJoinMapper applyChangeJoinMapper;
    @Autowired
@@ -348,7 +351,7 @@
            }
        }
        if(addList!=null && addList.size()>0){
            applyChagneDetailJoinMapper.insertBatchSomeColumn(addList);
            applyDetailJoinMapper.insertBatchSomeColumn(addList);
        }
        if(totalFee.compareTo(new BigDecimal(0)) != 0){
            //如果保单金额发生编码,更新总保单金额
@@ -453,6 +456,15 @@
        if(Objects.isNull(solutions)){
            throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"未查询到保险方案");
        }
        CompanySolution companySolution = companySolutionMapper.selectOne(new QueryWrapper<CompanySolution>().lambda()
                .eq(CompanySolution::getCompanyId,loginUserInfo.getCompanyId())
                .eq(CompanySolution::getSolutionBaseId,solutions.getId())
                .eq(CompanySolution::getIsdeleted,Constants.ZERO)
                .last(" limit 1 ")
        );
        if(Objects.isNull(companySolution)){
            throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"未查询到企业分配保险方案信息");
        }
        //申请时间必须处于保单的时间范围内
        if (!(DateUtil.compareDate(applyChange.getValidTime(), insuranceApply.getStartTime()) >= Constants.ZERO
                && DateUtil.compareDate(insuranceApply.getEndTime(), applyChange.getValidTime()) >= Constants.ZERO)) {
@@ -485,12 +497,18 @@
        //加保数据
        List<ApplyChagneDetail> addDetailList = applyChange.getAddDetailList();
        if (CollectionUtils.isNotEmpty(addDetailList)) {
           if(companySolution.getCanAdd().equals(Constants.ZERO)){
               throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "该企业分配保险方案无法进行加保");
           }
            this.addChangeDetail(applyChange,addDetailList,duWorktypeList,duSolutionList,insuranceApply,solutions,loginUserInfo);
        }
        //减保数据
        List<ApplyChagneDetail> delDetailList = applyChange.getDelDetailList();
        if (CollectionUtils.isNotEmpty(delDetailList)) {
            if(companySolution.getCanReduce().equals(Constants.ZERO)){
                throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "该企业分配保险方案无法进行加保");
            }
            this.delChangeDetail(applyChange,delDetailList,insuranceApply,solutions,loginUserInfo);
        }
        //换厂业务