| | |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.doumee.service.business.InsuranceApplyService; |
| | | import com.doumee.service.business.SmsEmailService; |
| | | import com.doumee.service.business.third.SignService; |
| | | import com.github.xiaoymin.knife4j.core.util.CollectionUtils; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.checkerframework.checker.units.qual.A; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | info = info.replace("${param}",param.getCheckInfo()); |
| | | ApplyLog log = new ApplyLog(update,applyLogType.getName(), info,update.getId(),applyLogType.getKey(),JSONObject.toJSONString(model), JSONObject.toJSONString(update)); |
| | | applyLogMapper.insert(log); |
| | | |
| | | return 1; |
| | | |
| | | } |
| | |
| | | // throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"未查询到方案最新版本信息"); |
| | | // } |
| | | // } |
| | | for (ApplyChagneDetail detail : detailList) { |
| | | List<ApplyChagneDetail> addList = detailList.stream().filter(f->Constants.equalsInteger(f.getType(),Constants.ZERO)).collect(Collectors.toList()); |
| | | List<ApplyChagneDetail> reduceList = detailList.stream().filter(f->Constants.equalsInteger(f.getType(),Constants.ONE)).collect(Collectors.toList()); |
| | | //减保业务 |
| | | for (ApplyChagneDetail detail:reduceList) { |
| | | Member member = memberMapper.selectById(detail.getMemberId()); |
| | | if(Objects.isNull(member)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"未查询到员工数据"); |
| | | } |
| | | //减保操作 |
| | | //查询员工是在主单下 是否存在生效中的数据 |
| | | ApplyDetail oldModel = applyDetailJoinMapper.selectOne(new QueryWrapper<ApplyDetail>().lambda() |
| | | .eq(ApplyDetail::getApplyId, update.getApplyId()) |
| | | .eq(ApplyDetail::getMemberId, detail.getMemberId()) |
| | | .orderByDesc(ApplyDetail::getCreateDate) |
| | | .last("limit 1")); |
| | | if (oldModel == null || oldModel.getStartTime() == null || oldModel.getStartTime().getTime() > update.getApplyStartTime().getTime()) { |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(), "对不起,用户【" + detail.getMemberName() + "】原保单信息有误,当前申请不支持减保处理!"); |
| | | } |
| | | if(!(oldModel.getStartTime().getTime()<update.getDelValidTime().getTime()&& oldModel.getEndTime().getTime()>=update.getDelValidTime().getTime())){ |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(), "对不起,用户【" + detail.getMemberName() + "】减保日期未在保单记录日期中!"); |
| | | } |
| | | |
| | | Date delValidTime = oldModel.getStartTime().compareTo(update.getDelValidTime())!=0? |
| | | DateUtil.getMontageDate(update.getDelValidTime(), 3): |
| | | DateUtil.getMontageDate(update.getDelValidTime(), 2); |
| | | |
| | | BigDecimal sumFee = Objects.isNull(insuranceApply.getServerCost())? |
| | | solutions.getPrice(): |
| | | solutions.getPrice().add(insuranceApply.getServerCost()); |
| | | // 减保后 总费用 |
| | | BigDecimal updateFee = Constants.reduceFee( |
| | | solutions, |
| | | sumFee |
| | | ,insuranceApply.getStartTime(),insuranceApply.getFinalEndTime(),oldModel.getStartTime(),delValidTime |
| | | ) ; |
| | | //当审批时间 大于 申请的时间时 计算实际减少金额 因为已扣金额会大于 应扣金额 |
| | | BigDecimal updateCurrentFee = BigDecimal.ZERO; |
| | | if (DateUtil.daysBetweenDates(DateUtil.getMontageDate(new Date(), 2),oldModel.getStartTime()) > 0) { |
| | | //// 2024年5月8日17:37:23 修改 计算产生费用 |
| | | updateCurrentFee = Constants.produceFee(solutions,sumFee,insuranceApply.getStartTime(),insuranceApply.getEndTime(), |
| | | oldModel.getStartTime() |
| | | ); |
| | | } |
| | | |
| | | UpdateWrapper<ApplyDetail> updateWrapper = new UpdateWrapper<ApplyDetail>(); |
| | | updateWrapper.lambda() |
| | | .setSql(" fee = " + updateFee) |
| | | .setSql(" current_fee = " + updateCurrentFee) |
| | | .set(ApplyDetail::getEndTime, delValidTime) |
| | | .set(ApplyDetail::getEditor, update.getEditor()) |
| | | .set(ApplyDetail::getEditDate, update.getEditDate()) |
| | | .eq(ApplyDetail::getId, oldModel.getId()); |
| | | |
| | | if(Constants.equalsInteger(solutions.getDelOnlyReplace(),Constants.ONE) |
| | | && Constants.equalsInteger(solutions.getTimeUnit(),solutions.getInsureCycleUnit())){ |
| | | if(delValidTime.getTime()<=oldModel.getStartTime().getTime()){ |
| | | updateFee = BigDecimal.ZERO; |
| | | updateWrapper.lambda().set(ApplyDetail::getFee,updateFee) |
| | | .set(ApplyDetail::getChangeStatus,Constants.TWO); |
| | | }else{ |
| | | //标记数据已被替换 |
| | | updateWrapper.lambda().set(ApplyDetail::getReduceMoney,solutions.getPrice().multiply(new BigDecimal(-1))) |
| | | .set(ApplyDetail::getChangeStatus,Constants.ONE); |
| | | } |
| | | detail.setApplyDetailId(oldModel.getId()); |
| | | } |
| | | |
| | | |
| | | applyDetailJoinMapper.update(null, updateWrapper); |
| | | totalFee = totalFee.add(updateFee).subtract(oldModel.getFee()); |
| | | currentFee = currentFee.add(updateCurrentFee); |
| | | |
| | | //修改 员工投保明细记录 历史数据 |
| | | memberInsuranceJoinMapper.update(null, new UpdateWrapper<MemberInsurance>().lambda() |
| | | .setSql(" fee = " + updateFee) |
| | | .set(MemberInsurance::getEndTime, delValidTime) |
| | | .eq(MemberInsurance::getRelationId, oldModel.getId()) |
| | | ); |
| | | |
| | | //修改业务明细行数据实际批单日期 |
| | | applyChangeDetailJoinMapper.update(null,new UpdateWrapper<ApplyChagneDetail>().lambda() |
| | | .set(ApplyChagneDetail::getFee,updateFee.subtract(oldModel.getFee())) |
| | | .set( ApplyChagneDetail::getEndTime, delValidTime) |
| | | .eq(ApplyChagneDetail::getId,detail.getId()) |
| | | ); |
| | | |
| | | member.setApplyId(update.getApplyId()); |
| | | member.setDuId(detail.getDuId()); |
| | | member.setWorktypeId(detail.getWorktypeId()); |
| | | member.setStartTime(detail.getStartTime()); |
| | | member.setEndTime(detail.getEndTime()); |
| | | memberMapper.updateById(member); |
| | | } |
| | | |
| | | //加保业务 |
| | | for (int i = 0; i < addList.size(); i++) { |
| | | ApplyChagneDetail detail = addList.get(i); |
| | | Member member = memberMapper.selectById(detail.getMemberId()); |
| | | if (Objects.isNull(member)) { |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(), "未查询到员工数据"); |
| | | } |
| | | //查询人员信息是否存在相同的方案下是否存在 冲突数据 |
| | | InsuranceApplyServiceImpl.checkStaticMemberSolution(solutions.getId(), |
| | | member.getIdcardNo(),member.getName(),detail.getStartTime(),detail.getEndTime(), |
| | | applyDetailJoinMapper); |
| | | |
| | | //查询加保人员是否存在 冲突的 保单明细数据 |
| | | if(applyDetailJoinMapper.selectCount(new QueryWrapper<ApplyDetail>() |
| | | .lambda() |
| | | .eq(ApplyDetail::getApplyId,update.getApplyId()) |
| | | .eq(ApplyDetail::getIdcardNo,detail.getIdcardNo()) |
| | | .le(ApplyDetail::getStartTime,DateUtil.getMontageDate(update.getApplyStartTime(),1)) |
| | | .ge(ApplyDetail::getEndTime,DateUtil.getMontageDate(detail.getEndTime(),2)) |
| | | )>Constants.ZERO){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "当前保单下,加保人员【" + detail.getMemberName() + "】存在日期冲突的数据"); |
| | | } |
| | | //加保 |
| | | ApplyDetail add = new ApplyDetail(); |
| | | add.setApplyId(update.getApplyId()); |
| | | add.setValidCode(update.getValidCode()); |
| | | add.setFee(detail.getFee()); |
| | | add.setIsdeleted(Constants.ZERO); |
| | | add.setCreator(update.getEditor()); |
| | | add.setCreateDate(update.getEditDate()); |
| | | add.setMemberId(detail.getMemberId()); |
| | | add.setMemberName(detail.getMemberName()); |
| | | add.setWorktypeId(detail.getWorktypeId()); |
| | | add.setIsdeleted(Constants.ZERO); |
| | | add.setIdcardNo(detail.getIdcardNo()); |
| | | add.setSex(Constants.getSexByIdCard(detail.getIdcardNo())); |
| | | add.setMemberName(detail.getMemberName()); |
| | | add.setRemark(detail.getRemark()); |
| | | add.setDuId(detail.getDuId()); |
| | | add.setStartTime(DateUtil.getMontageDate(update.getApplyStartTime(), 1)); |
| | | add.setEndTime(DateUtil.getMontageDate(detail.getEndTime(), 2)); |
| | | add.setFee(Constants.addFee(solutions,solutions.getPrice(),insuranceApply.getStartTime(),insuranceApply.getFinalEndTime(),update.getApplyStartTime(),insuranceApply.getEndTime())); |
| | | add.setChangeStatus(Constants.ZERO); |
| | | if(Constants.equalsInteger(solutions.getDelOnlyReplace(),Constants.ONE) |
| | | && Constants.equalsInteger(solutions.getTimeUnit(),solutions.getInsureCycleUnit())){ |
| | | add.setReduceId(reduceList.get(i).getId()); |
| | | } |
| | | if(new Date().compareTo(DateUtil.getMontageDate(detail.getStartTime(), 2))>=0){ |
| | | //2024年5月8日17:37:23 修改 计算产生费用 |
| | | add.setCurrentFee( |
| | | Constants.produceFee(solutions,add.getFee(),add.getStartTime(),add.getEndTime(),add.getStartTime()) |
| | | ); |
| | | }else{ |
| | | add.setCurrentFee(BigDecimal.ZERO); |
| | | } |
| | | applyDetailJoinMapper.insert(add); |
| | | totalFee = totalFee.add(add.getFee()); |
| | | currentFee = currentFee.add(add.getCurrentFee()); |
| | | |
| | | MemberInsurance memberInsurance = new MemberInsurance(detail, update, update.getEditor(), add.getId(),solutions.getId()); |
| | | memberInsurance.setStartTime(add.getStartTime()); |
| | | memberInsurance.setEndTime(add.getEndTime()); |
| | | memberInsurance.setRelationType(Constants.ONE); |
| | | memberInsuranceList.add(memberInsurance); |
| | | |
| | | applyChangeDetailJoinMapper.update(null,new UpdateWrapper<ApplyChagneDetail>().lambda() |
| | | .set(ApplyChagneDetail::getFee,add.getFee()) |
| | | .set(ApplyChagneDetail::getStartTime,DateUtil.getMontageDate(update.getApplyStartTime(), 1)) |
| | | .eq(ApplyChagneDetail::getId,detail.getId()) |
| | | ); |
| | | |
| | | member.setApplyId(update.getApplyId()); |
| | | member.setDuId(detail.getDuId()); |
| | | member.setWorktypeId(detail.getWorktypeId()); |
| | | member.setStartTime(detail.getStartTime()); |
| | | member.setEndTime(detail.getEndTime()); |
| | | memberMapper.updateById(member); |
| | | } |
| | | |
| | | |
| | | |
| | | /*for (ApplyChagneDetail detail : detailList) { |
| | | Member member = memberMapper.selectById(detail.getMemberId()); |
| | | if(Objects.isNull(member)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"未查询到员工数据"); |
| | |
| | | .eq(ApplyChagneDetail::getId,detail.getId()) |
| | | ); |
| | | |
| | | // if(1==1){ |
| | | // throw new BusinessException(ResponseStatus.SERVER_ERROR); |
| | | // } |
| | | |
| | | } else { |
| | | //减保操作 |
| | |
| | | ); |
| | | } |
| | | |
| | | applyDetailJoinMapper.update(null, new UpdateWrapper<ApplyDetail>().lambda() |
| | | UpdateWrapper<ApplyDetail> updateWrapper = new UpdateWrapper<ApplyDetail>(); |
| | | updateWrapper.lambda() |
| | | .setSql(" fee = " + updateFee) |
| | | .setSql(" current_fee = " + updateCurrentFee) |
| | | .set(ApplyDetail::getEndTime, delValidTime) |
| | | .set(ApplyDetail::getEditor, update.getEditor()) |
| | | .set(ApplyDetail::getEditDate, update.getEditDate()) |
| | | .eq(ApplyDetail::getId, oldModel.getId()); |
| | | |
| | | .eq(ApplyDetail::getId, oldModel.getId()) |
| | | ); |
| | | if(Constants.equalsInteger(solutions.getDelOnlyReplace(),Constants.ONE) |
| | | && Constants.equalsInteger(solutions.getTimeUnit(),solutions.getInsureCycleUnit())){ |
| | | if(delValidTime.getTime()<=oldModel.getStartTime().getTime()){ |
| | | updateFee = BigDecimal.ZERO; |
| | | updateWrapper.lambda().set(ApplyDetail::getFee,updateFee) |
| | | .set(ApplyDetail::getChangeStatus,Constants.TWO); |
| | | }else{ |
| | | //标记数据已被替换 |
| | | updateWrapper.lambda().set(ApplyDetail::getReduceMoney,solutions.getPrice().multiply(new BigDecimal(-1))) |
| | | .set(ApplyDetail::getChangeStatus,Constants.ONE); |
| | | } |
| | | } |
| | | |
| | | |
| | | applyDetailJoinMapper.update(null, updateWrapper); |
| | | totalFee = totalFee.add(updateFee).subtract(oldModel.getFee()); |
| | | currentFee = currentFee.add(updateCurrentFee); |
| | | |
| | |
| | | member.setEndTime(detail.getEndTime()); |
| | | memberMapper.updateById(member); |
| | | |
| | | } |
| | | }*/ |
| | | |
| | | if (memberInsuranceList != null && memberInsuranceList.size() > 0) { |
| | | memberInsuranceJoinMapper.insertBatchSomeColumn(memberInsuranceList); |
| | | } |
| | |
| | | }else{ |
| | | applyChange.setDelValidTime(applyChange.getValidTime()); |
| | | } |
| | | //仅支持替换 保证加减保日期为同一天 |
| | | if(Constants.equalsInteger(solutions.getDelOnlyReplace(),Constants.ONE)){ |
| | | applyChange.setApplyStartTime( |
| | | applyChange.getDelValidTime() |
| | | ); |
| | | } |
| | | }else{ |
| | | applyChange.setApplyStartTime(applyChange.getValidTime()); |
| | | } |
| | |
| | | )>Constants.ZERO){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "存在进行中的加减保/换厂申请"); |
| | | }; |
| | | |
| | | if(applyChange.getType().equals(Constants.ZERO)){ |
| | | if(Objects.nonNull(solutions.getAddValidDays())){ |
| | | applyChange.setApplyStartTime( |
| | | DateUtil.afterDateByType(applyChange.getValidTime(),0,solutions.getAddValidDays()) |
| | | ); |
| | | }else{ |
| | | applyChange.setApplyStartTime(applyChange.getValidTime()); |
| | | } |
| | | if(Objects.nonNull(solutions.getDelValidDays())){ |
| | | applyChange.setDelValidTime( |
| | | DateUtil.afterDateByType(applyChange.getValidTime(),0,solutions.getDelValidDays()) |
| | | ); |
| | | }else{ |
| | | applyChange.setDelValidTime(applyChange.getValidTime()); |
| | | } |
| | | //仅支持替换 保证加减保日期为同一天 |
| | | if(Constants.equalsInteger(solutions.getDelOnlyReplace(),Constants.ONE)){ |
| | | applyChange.setApplyStartTime( |
| | | applyChange.getDelValidTime() |
| | | ); |
| | | } |
| | | |
| | | }else{ |
| | | applyChange.setApplyStartTime(applyChange.getValidTime()); |
| | | } |
| | | |
| | | applyChange.setEditDate(new Date()); |
| | | applyChange.setEditor(loginUserInfo.getId()); |
| | | applyChange.setApplyStartTime(applyChange.getValidTime()); |
| | | applyChange.setStatus(Constants.ZERO); |
| | | //删除历史数据 |
| | | applyChagneDetailJoinMapper.delete(new QueryWrapper<ApplyChagneDetail>().lambda().eq(ApplyChagneDetail::getApplyChangeId,applyChange.getId())); |
| | |
| | | } |
| | | |
| | | |
| | | public BigDecimal dealApplyChangeData(ApplyChange applyChange,InsuranceApply insuranceApply,CompanySolution companySolution,Solutions solutions,LoginUserInfo loginUserInfo,BigDecimal fee){ |
| | | public BigDecimal dealApplyChangeData(ApplyChange applyChange,InsuranceApply insuranceApply |
| | | ,CompanySolution companySolution,Solutions solutions,LoginUserInfo loginUserInfo,BigDecimal fee){ |
| | | if(Constants.equalsInteger(applyChange.getType(),Constants.ZERO)){ |
| | | if(Objects.nonNull(solutions.getDelOnlyReplace())&& solutions.getDelOnlyReplace().equals(Constants.ONE)){ |
| | | if(applyChange.getDelDetailList().size() > applyChange.getAddDetailList().size()){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "该保险方案仅支持替换(减保人数不得大于加保人数)"); |
| | | } |
| | | } |
| | | } |
| | | //查询保险方案下的所有派遣单位 |
| | |
| | | applyChangeCyclePriceDTO.setApplyId(insuranceApply.getId()); |
| | | |
| | | |
| | | //减保数据 |
| | | List<ApplyChagneDetail> delDetailList = applyChange.getDelDetailList(); |
| | | //加保数据 |
| | | List<ApplyChagneDetail> addDetailList = applyChange.getAddDetailList(); |
| | | |
| | |
| | | throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"对不起,人员录入数据存在相同数据!"); |
| | | } |
| | | |
| | | //加保明细数据 计算金额 根据批单时间 计算 |
| | | // applyChangeCyclePriceDTO.setValidTime(DateUtil.getMontageDate(applyChange.getValidTime(),1)); |
| | | // CountCyclePriceVO countCyclePriceVO = this.getChangeCountCyclePriceVO(applyChangeCyclePriceDTO); |
| | | // BigDecimal detailFee = countCyclePriceVO.getCyclePrice(); |
| | | BigDecimal sumPrice = Objects.isNull(insuranceApply.getServerCost())?solutions.getPrice():solutions.getPrice().add(insuranceApply.getServerCost()); |
| | | BigDecimal detailFee = Constants.addFee(solutions, |
| | | sumPrice |
| | | ,insuranceApply.getStartTime(),insuranceApply.getFinalEndTime(), |
| | | applyChange.getApplyStartTime(),insuranceApply.getEndTime()); |
| | | |
| | | this.addChangeDetail(applyChange,addDetailList,duWorktypeList,duSolutionList,insuranceApply,solutions,loginUserInfo,detailFee); |
| | | this.addChangeDetail(applyChange,addDetailList,duWorktypeList,duSolutionList,insuranceApply,solutions,loginUserInfo,detailFee,delDetailList.size()); |
| | | fee = addDetailList.stream().map(ApplyChagneDetail::getFee).reduce(BigDecimal.ZERO,BigDecimal::add); |
| | | } |
| | | |
| | | //减保数据 |
| | | List<ApplyChagneDetail> delDetailList = applyChange.getDelDetailList(); |
| | | if (CollectionUtils.isNotEmpty(delDetailList)) { |
| | | //验证是否存在重复数据 |
| | | List<String> idcarNo = delDetailList.stream().map(m->m.getIdcardNo()).collect(Collectors.toList()); |
| | |
| | | this.delChangeDetail(applyChange,delDetailList,insuranceApply,solutions,loginUserInfo, BigDecimal.ZERO, |
| | | DateUtil.getMontageDate(applyChange.getDelValidTime(),3)); |
| | | fee = fee.add(delDetailList.stream().map(ApplyChagneDetail::getFee).reduce(BigDecimal.ZERO,BigDecimal::add)); |
| | | // fee = fee.add(delDetailList.stream().map(ApplyChagneDetail::getReduceMoney).reduce(BigDecimal.ZERO,BigDecimal::add)); |
| | | } |
| | | |
| | | |
| | |
| | | if (applyChange.getValidTime().compareTo(applyDetail.getEndTime()) > 0) { |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "减保人员【" + applyChagneDetail.getMemberName() + "】保单保障日期至:【" + applyDetail.getEndTime() + "】无法通过本次申请"); |
| | | } |
| | | if(!Constants.equalsInteger(applyDetail.getChangeStatus(),Constants.ZERO)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"减保人员【" + applyChagneDetail.getMemberName() + "】保单信息异常,数据已被减保无法再次减保"); |
| | | } |
| | | applyChagneDetail.setPrice(applyDetail.getPrice()); |
| | | applyChagneDetail.setCreateDate(new Date()); |
| | | applyChagneDetail.setCreator(loginUserInfo.getId()); |
| | |
| | | */ |
| | | public void addChangeDetail(ApplyChange applyChange ,List<ApplyChagneDetail> addDetailList, |
| | | List<DuWorktype> duWorktypeList,List<DuSolution> duSolutionList, |
| | | InsuranceApply insuranceApply,Solutions solutions,LoginUserInfo loginUserInfo,BigDecimal detailFee){ |
| | | for (ApplyChagneDetail applyChagneDetail : addDetailList) { |
| | | InsuranceApply insuranceApply,Solutions solutions,LoginUserInfo loginUserInfo,BigDecimal detailFee,Integer delSize){ |
| | | for (int i = 0; i < addDetailList.size(); i++) { |
| | | ApplyChagneDetail applyChagneDetail = addDetailList.get(i); |
| | | if ( Objects.isNull(applyChagneDetail.getDuId()) |
| | | || Objects.isNull(applyChagneDetail.getWorktypeId()) |
| | | || StringUtils.isBlank(applyChagneDetail.getIdcardNo()) |
| | | ) { |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "加保人员【" + applyChagneDetail.getMemberName() + "】必填项缺失"); |
| | | } |
| | | //查询人员信息是否存在相同的方案下是否存在 冲突数据 |
| | | InsuranceApplyServiceImpl.checkStaticMemberSolution(solutions.getId(), |
| | | applyChagneDetail.getMemberIdcardNo(),applyChagneDetail.getMemberName(),insuranceApply.getStartTime(),insuranceApply.getEndTime(), |
| | | applyDetailJoinMapper); |
| | | |
| | | //查询加保人员是否存在 冲突的 保单明细数据 |
| | | if(applyDetailJoinMapper.selectCount(new QueryWrapper<ApplyDetail>() |
| | | .lambda() |
| | |
| | | throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(), "【" + applyChagneDetail.getMemberName() + "】员工工种信息未查询到!"); |
| | | } |
| | | applyChagneDetail.setMemberId(member.getId()); |
| | | //如果是减保业务为仅替换 且 方案的扣费周期和总周期相等 则处理减保费用 |
| | | if(Constants.equalsInteger(solutions.getDelOnlyReplace(),Constants.ONE) |
| | | && Constants.equalsInteger(solutions.getTimeUnit(),solutions.getInsureCycleUnit()) && delSize> i){ |
| | | applyChagneDetail.setFee(BigDecimal.ZERO); |
| | | }else{ |
| | | applyChagneDetail.setFee(detailFee); |
| | | } |
| | | applyChagneDetailJoinMapper.insert(applyChagneDetail); |
| | | } |
| | | } |