k94314517
2024-04-02 11927cefa1347d192105c9b0bc08d1b91badf18c
server/service/src/main/java/com/doumee/service/business/impl/UnionApplyServiceImpl.java
@@ -389,7 +389,7 @@
                eq(Solutions::getType,Constants.ONE)
                .eq(Solutions::getIsdeleted,Constants.ZERO)
                .eq(Solutions::getDataType,Constants.ZERO)
                .eq(Solutions::getBaseId,saveUnionApplyDTO.getBaseSolutionId()));
                .eq(Solutions::getId,saveUnionApplyDTO.getBaseSolutionId()));
        //查询方案数据
        if(solutions == null){
            throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"对不起,方案信息有误,请刷新页面重试");
@@ -495,7 +495,7 @@
            multifileMapper.delete(new QueryWrapper<Multifile>()
                    .lambda()
                    .apply(" multifile.id in ( select i.id  from insurance_apply i where i.UNION_APPLY_ID = "+unionApply.getId()+" ) ")
                    .eq(Multifile::getObjType,Constants.MultiFile.COMPANY_TBD_SIGNED.getKey()));
                    .eq(Multifile::getObjType,Constants.MultiFile.BD_APPLY_PDF.getKey()));
        }
        insuranceApplyJoinMapper.update(null,new UpdateWrapper<InsuranceApply>().lambda()
                .set(InsuranceApply::getUnionApplyId,null)
@@ -579,7 +579,7 @@
                multifile.setCreator(user.getId());
                multifile.setCreateDate(new Date());
                multifile.setCreateDate(new Date());
                multifile.setObjType(Constants.MultiFile.COMPANY_TBD_SIGNED.getKey());
                multifile.setObjType(Constants.MultiFile.BD_APPLY_PDF.getKey());
                multifile.setType(Constants.TWO);
                multifileMapper.insert(multifile);
@@ -650,7 +650,7 @@
        }
        Multifile f = multifileMapper.selectOne(new QueryWrapper<Multifile>().lambda()
                .eq(Multifile::getObjId,unionApply.getId())
                .eq(Multifile::getObjType,Constants.MultiFile.HBD_BD_SIGNED_PDF.getKey())
                .eq(Multifile::getObjType,Constants.MultiFile.HBD_BD_APPLY_PDF.getKey())
                .eq(Multifile::getIsdeleted,Constants.ZERO)
                .last("limit 1"));
        if(f == null || StringUtils.isBlank(f.getFileurl())){
@@ -694,6 +694,8 @@
            || Objects.isNull(unionApplyBXDDTO.getStartTime())
            || Objects.isNull(unionApplyBXDDTO.getEndTime())
            || StringUtils.isBlank(unionApplyBXDDTO.getCode())
            || StringUtils.isBlank(unionApplyBXDDTO.getFileUrl())
            || StringUtils.isBlank(unionApplyBXDDTO.getFileName())
        ){
            throw new BusinessException(ResponseStatus.BAD_REQUEST);
        }
@@ -705,7 +707,7 @@
        if(unionApply == null ||!Constants.equalsInteger(unionApply.getIsdeleted(),Constants.ZERO)){
            throw  new BusinessException(ResponseStatus.DATA_EMPTY);
        }
        if(unionApply.getStatus().equals(Constants.UnionApplyStatus.UPLOAD_INSURANCE_POLICY.getKey())){
        if(!unionApply.getStatus().equals(Constants.UnionApplyStatus.UPLOAD_INSURANCE_POLICY.getKey())){
            throw  new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,该合并单状态已流转,当前不支持该操作~");
        }
        //加价参数
@@ -752,7 +754,7 @@
                    insuranceApply.setUnionApplyTbdStatus(Constants.ZERO);
                }
            }
            //实际已产生费用
            //实际已产生费用(单人)
            BigDecimal currentFee = BigDecimal.ZERO;
            if(useDays==-1){
                currentFee =  new BigDecimal(maxDays).multiply(price);
@@ -763,17 +765,11 @@
            List<ApplyDetail> applyDetails = applyDetailList.stream().filter(m->m.getApplyId().equals(insuranceApply.getId())).collect(Collectors.toList());
            //更新投保申请单
            insuranceApplyJoinMapper.update(null,new UpdateWrapper<InsuranceApply>().lambda()
                    .set(InsuranceApply::getFee,
                            new BigDecimal(applyDetails.size())
                                    .multiply(price)
                    )
                    .set(InsuranceApply::getStatus,Constants.InsuranceApplyStatus.WTB_DONE.getKey())
                    .set(InsuranceApply::getUnionApplyTbdStatus,3)
                    .set(InsuranceApply::getFee,price.multiply(new BigDecimal(applyDetails.size())).multiply(new BigDecimal(maxDays)))
                    .set(InsuranceApply::getCurrentFee,currentFee.multiply(new BigDecimal(applyDetails.size())))
                    .set(InsuranceApply::getStartTime,unionApplyBXDDTO.getStartTime())
                    .set(InsuranceApply::getEndTime,unionApplyBXDDTO.getEndTime())
                    .set(InsuranceApply::getUnionApplyTbdStatus,insuranceApply.getUnionApplyTbdStatus())
                    .set(InsuranceApply::getEditDate,new Date())
                    .set(InsuranceApply::getEditor,user.getId())
                    .eq(InsuranceApply::getId,insuranceApply.getId()));
@@ -788,10 +784,8 @@
                    .set(ApplyDetail::getEndTime,unionApplyBXDDTO.getEndTime())
                    .in(ApplyDetail::getId,applyDetails.stream().map(m->m.getId()).collect(Collectors.toList()))
            );
            sumFee = sumFee.add(price.multiply(new BigDecimal(applyDetails.size())).multiply(new BigDecimal(maxDays)));
            sumCurrFee = sumCurrFee.add(currentFee.multiply(new BigDecimal(applyDetails.size())));
        }
        unionApplyMapper.update(null,new UpdateWrapper<UnionApply>()