k94314517
2024-04-09 9333d15ca58cb0ddd8340deb7668aa7d1faad776
server/service/src/main/java/com/doumee/service/business/impl/ApplyChangeServiceImpl.java
@@ -320,7 +320,7 @@
    }
    /**
     * 处理加减保明细数据
     * 处理换厂明细数据
     * @param update
     */
    private void dealDetailsDUdata(ApplyChange update,InsuranceApply insuranceApply) {
@@ -351,7 +351,6 @@
        //实际批单生效日期
        Date applyStartTime = DateUtil.getMontageDate(update.getApplyStartTime(),1);
        for(ApplyChagneDetail detail : detailList){
            //查询减保人员是否存在 冲突的 保单明细数据
            if(applyDetailJoinMapper.selectCount(new QueryWrapper<ApplyDetail>()
                    .lambda()
                    .eq(ApplyDetail::getApplyId,update.getApplyId())
@@ -1010,7 +1009,8 @@
                throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "该企业分配保险方案无法进行减保");
            }
            //减保明细数据 计算金额  根据批单时间 前一天 计算
            applyChangeCyclePriceDTO.setValidTime(DateUtil.getMontageDate(applyChange.getValidTime(),2));
            applyChangeCyclePriceDTO.setValidTime(DateUtil.getMontageDate(applyChange.getValidTime(),3));
            CountCyclePriceVO countCyclePriceVO =  this.getChangeCountCyclePriceVO(applyChangeCyclePriceDTO);
            BigDecimal detailFee = countCyclePriceVO.getCyclePrice();
            this.delChangeDetail(applyChange,delDetailList,insuranceApply,solutions,loginUserInfo,detailFee,applyChangeCyclePriceDTO.getValidTime());
@@ -1097,6 +1097,7 @@
                throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "减保人员【" + applyChagneDetail.getMemberName() + "】保单保障日期至:【" + applyDetail.getEndTime() + "】无法通过本次申请");
            }
            applyChagneDetail.setPrice(applyDetail.getPrice());
            applyChagneDetail.setCreateDate(new Date());
            applyChagneDetail.setCreator(loginUserInfo.getId());
@@ -1114,7 +1115,10 @@
            member.setEndTime(applyChagneDetail.getEndTime());
            memberMapper.updateById(member);
            applyChagneDetail.setFee( detailFee.multiply(new BigDecimal(-1)));
            //查询减保日期
            Integer delDays = DateUtil.daysBetweenDates(applyDetail.getEndTime(),endTime);
            applyChagneDetail.setFee( new BigDecimal(delDays).multiply(applyDetail.getPrice()).multiply(new BigDecimal(-1)));
            applyChagneDetailJoinMapper.insert(applyChagneDetail);
        }
    }
@@ -2206,6 +2210,19 @@
            update.setStatus(Constants.ApplyChangeStatus.CHECHED_PASSED.getKey());
        }
        applyChangeJoinMapper.updateById(update);
        Constants.ApplyLogType applyLogType = Constants.ApplyLogType.CA_HBD_AUDIT;
        String info = applyChange.getCheckInfo();
        if(StringUtils.isNotBlank(applyChange.getCheckInfo())){
            info = info.replace("${param}", applyChange.getCheckInfo());
        }else{
            info = info.replace("${param}", "");
        }
        ApplyLog log = new ApplyLog(applyChange,applyLogType.getName(),info,applyChange.getId(),applyLogType.getKey(), null, null);
        applyLogMapper.insert(log);
        Constants.NoticeObjectType noticeObjectType = Constants.NoticeObjectType.APPLY_CHANGE;
        if(Constants.equalsInteger(applyChange.getType(),Constants.ONE)){
            noticeObjectType = Constants.NoticeObjectType.CHANGE_FACTORY;