| | |
| | | import com.doumee.core.utils.DateUtil; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.dao.business.*; |
| | | import com.doumee.dao.business.dto.ApplyChangeCyclePriceDTO; |
| | | import com.doumee.dao.business.dto.ApplyChangeOptDTO; |
| | | import com.doumee.dao.business.dto.CountCyclePriceDTO; |
| | | import com.doumee.dao.business.dto.InsuranceApplyOptDTO; |
| | | import com.doumee.dao.business.join.ApplyChagneDetailJoinMapper; |
| | | import com.doumee.dao.business.join.ApplyChangeJoinMapper; |
| | | import com.doumee.dao.business.join.ApplyDetailJoinMapper; |
| | | import com.doumee.dao.business.join.DuSolutionJoinMapper; |
| | | import com.doumee.dao.business.model.*; |
| | | import com.doumee.dao.business.vo.CountCyclePriceVO; |
| | | import com.doumee.service.business.ApplyChangeService; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | |
| | | @Autowired |
| | | private ApplyChangeMapper applyChangeMapper; |
| | | |
| | | @Autowired |
| | | private DuSolutionJoinMapper duSolutionJoinMapper; |
| | | @Autowired |
| | | private InsuranceApplyMapper insuranceApplyMapper; |
| | | |
| | |
| | | || Objects.isNull(applyChange.getApplyId()) |
| | | || Objects.isNull(applyChange.getValidTime()) |
| | | || Objects.isNull(applyChange.getType()) |
| | | || !(applyChange.getType().equals(Constants.ZERO) || applyChange.getType().equals(Constants.TWO)) |
| | | || !(applyChange.getType().equals(Constants.ZERO) || applyChange.getType().equals(Constants.ONE)) |
| | | ) { |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | |
| | | if (Objects.isNull(insuranceApply)) { |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | if (insuranceApply.getStatus().equals(Constants.InsuranceApplyStatus.UPLOAD_INSURANCE.getKey())) { |
| | | System.out.println(Constants.InsuranceApplyStatus.UPLOAD_INSURANCE.getKey()); |
| | | if (!Constants.equalsInteger(insuranceApply.getStatus(),Constants.InsuranceApplyStatus.UPLOAD_INSURANCE.getKey())) { |
| | | throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(), "ä¿åç¶æé误"); |
| | | } |
| | | if (DateUtil.compareDate(new Date(), insuranceApply.getEndTime()) >= Constants.ZERO |
| | | if (DateUtil.compareDate(insuranceApply.getEndTime(),new Date()) >= Constants.ZERO |
| | | ) { |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "ä¿åå·²è¿ä¿ï¼æ æ³è¿è¡è¯¥æä½"); |
| | | } |
| | |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"æªæ¥è¯¢å°ä¼ä¸åé
ä¿é©æ¹æ¡ä¿¡æ¯"); |
| | | } |
| | | //ç³è¯·æ¶é´å¿
é¡»å¤äºä¿åçæ¶é´èå´å
|
| | | if (!(DateUtil.compareDate(applyChange.getValidTime(), insuranceApply.getStartTime()) >= Constants.ZERO |
| | | && DateUtil.compareDate(insuranceApply.getEndTime(), applyChange.getValidTime()) >= Constants.ZERO)) { |
| | | if (!(DateUtil.compareDate( insuranceApply.getStartTime(),applyChange.getValidTime()) >= Constants.ZERO |
| | | && DateUtil.compareDate( applyChange.getValidTime(),insuranceApply.getEndTime()) >= Constants.ZERO)) { |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "ç³è¯·æ¥ææªå¤äºä¿åæ¥æå
ï¼æ æ³è¿è¡è¯¥æä½"); |
| | | } |
| | | applyChange.setCreateDate(new Date()); |
| | | applyChange.setCreator(loginUserInfo.getId()); |
| | | applyChange.setIsdeleted(Constants.ZERO); |
| | | applyChange.setApplyStartTime(applyChange.getValidTime()); |
| | | applyChange.setStatus(Constants.ZERO); |
| | | applyChangeMapper.insert(applyChange); |
| | | |
| | | |
| | | List<DuSolution> duSolutionList = duSolutionMapper.selectList(new QueryWrapper<DuSolution>().lambda() |
| | | .eq(DuSolution::getIsdeleted, Constants.ZERO) |
| | | .eq(DuSolution::getStatus, Constants.ONE) |
| | | .eq(DuSolution::getSolutionId, insuranceApply.getSolutionId())); |
| | | if (!CollectionUtils.isNotEmpty(duSolutionList)) { |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "æ°æ®å¼å¸¸ï¼ä¿é©æ¹æ¡ä¸æªæ¥è¯¢å°æ´¾é£åä½"); |
| | | //æ¥è¯¢ä¿é©æ¹æ¡ä¸çæææ´¾é£åä½ |
| | | List<DuSolution> duSolutionList = duSolutionJoinMapper.selectJoinList(DuSolution.class,new MPJLambdaWrapper<DuSolution>() |
| | | .selectAll(DuSolution.class) |
| | | .innerJoin(DispatchUnit.class,DispatchUnit::getId,DuSolution::getDispatchUnitId) |
| | | .eq(DispatchUnit::getCompanyId,insuranceApply.getCompanyId()) |
| | | .eq(DispatchUnit::getIsdeleted,Constants.ZERO) |
| | | .eq(DispatchUnit::getUnitStatus,Constants.ONE) |
| | | .eq(DuSolution::getIsdeleted,Constants.ZERO) |
| | | .eq(DuSolution::getStatus,Constants.ONE) |
| | | .eq(DuSolution::getSolutionId,insuranceApply.getSolutionId())); |
| | | if(!CollectionUtils.isNotEmpty(duSolutionList)){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"æ°æ®å¼å¸¸ï¼ä¿é©æ¹æ¡ä¸æªæ¥è¯¢å°æ´¾é£åä½"); |
| | | } |
| | | |
| | | //æ¥è¯¢æææ´¾é£åä½ä¸çå·¥ç§ |
| | | List<Integer> duSolutionIdList = duSolutionList.stream().map(i -> i.getId()).collect(Collectors.toList()); |
| | | List<Integer> duSolutionIdList = duSolutionList.stream().map(i->i.getId()).collect(Collectors.toList()); |
| | | List<DuWorktype> duWorktypeList = duWorktypeMapper.selectList(new QueryWrapper<DuWorktype>().lambda() |
| | | .eq(DuWorktype::getIsdeleted, Constants.ZERO) |
| | | .eq(DuWorktype::getStatus, Constants.ONE) |
| | | .in(DuWorktype::getDuSolutionId, duSolutionIdList)); |
| | | .eq(DuWorktype::getIsdeleted,Constants.ZERO) |
| | | .eq(DuWorktype::getStatus,Constants.ONE) |
| | | .in(DuWorktype::getDuSolutionId,duSolutionIdList)); |
| | | if (!CollectionUtils.isNotEmpty(duWorktypeList)) { |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "æ°æ®å¼å¸¸ï¼ä¿é©æ¹æ¡ä¸æªæ¥è¯¢å°å·¥ç§ä¿¡æ¯"); |
| | | } |
| | | BigDecimal fee = BigDecimal.ZERO; |
| | | //å ä¿æ°æ® |
| | | List<ApplyChagneDetail> addDetailList = applyChange.getAddDetailList(); |
| | | if (CollectionUtils.isNotEmpty(addDetailList)) { |
| | |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "该ä¼ä¸åé
ä¿é©æ¹æ¡æ æ³è¿è¡å ä¿"); |
| | | } |
| | | this.addChangeDetail(applyChange,addDetailList,duWorktypeList,duSolutionList,insuranceApply,solutions,loginUserInfo); |
| | | |
| | | fee = addDetailList.stream().map(ApplyChagneDetail::getFee).reduce(BigDecimal.ZERO,BigDecimal::add); |
| | | |
| | | } |
| | | |
| | | //åä¿æ°æ® |
| | | List<ApplyChagneDetail> delDetailList = applyChange.getDelDetailList(); |
| | | if (CollectionUtils.isNotEmpty(delDetailList)) { |
| | | if(companySolution.getCanReduce().equals(Constants.ZERO)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "该ä¼ä¸åé
ä¿é©æ¹æ¡æ æ³è¿è¡å ä¿"); |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "该ä¼ä¸åé
ä¿é©æ¹æ¡æ æ³è¿è¡åä¿"); |
| | | } |
| | | this.delChangeDetail(applyChange,delDetailList,insuranceApply,solutions,loginUserInfo); |
| | | this.delChangeDetail(applyChange,delDetailList,insuranceApply,solutions,loginUserInfo); |
| | | fee = fee.add(delDetailList.stream().map(ApplyChagneDetail::getFee).reduce(BigDecimal.ZERO,BigDecimal::add)); |
| | | } |
| | | ApplyChange applyChangeFee = new ApplyChange(); |
| | | applyChangeFee.setId(applyChange.getId()); |
| | | applyChangeFee.setFee(fee); |
| | | applyChangeMapper.updateById(applyChangeFee); |
| | | |
| | | //æ¢åä¸å¡ |
| | | List<ApplyChagneDetail> changeDetailList = applyChange.getChangeDetailList(); |
| | | if (CollectionUtils.isNotEmpty(changeDetailList)) { |
| | |
| | | applyLog.setIsdeleted(Constants.ZERO); |
| | | applyLog.setApplyId(applyChange.getApplyId()); |
| | | applyLog.setTitle(applyChangeLogStatus.getName()); |
| | | applyLog.setContent(applyChangeLogStatus.getInfo().replace("${param}",content)); |
| | | if(StringUtils.isNotBlank(content)){ |
| | | applyLog.setContent(applyChangeLogStatus.getInfo().replace("${param}",content)); |
| | | }else{ |
| | | applyLog.setContent(applyChangeLogStatus.getInfo()); |
| | | } |
| | | applyLog.setObjType(applyChangeLogStatus.getKey()); |
| | | applyLog.setObjId( applyChange.getId()); |
| | | applyLog.setStatus(applyChange.getStatus()); |
| | |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "åä¿äººåã" + applyChagneDetail.getMemberName() + "ãä¿åä¿¡æ¯å¼å¸¸ï¼åå¨å¤æ¡æ°æ®"); |
| | | } |
| | | ApplyDetail applyDetail = applyDetailList.get(Constants.ZERO); |
| | | if (applyChange.getValidTime().compareTo(applyDetail.getEndTime()) <= 0) { |
| | | if (applyChange.getValidTime().compareTo(applyDetail.getEndTime()) > 0) { |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "åä¿äººåã" + applyChagneDetail.getMemberName() + "ãä¿åä¿éæ¥æè³ï¼ã" + applyDetail.getEndTime() + "ãæ æ³éè¿æ¬æ¬¡ç³è¯·"); |
| | | } |
| | | applyChagneDetail.setCreateDate(new Date()); |
| | |
| | | applyChagneDetail.setIsdeleted(Constants.ZERO); |
| | | applyChagneDetail.setApplyChangeId(applyChange.getId()); |
| | | applyChagneDetail.setType(Constants.ONE); |
| | | |
| | | System.out.println(DateUtil.dateToString(applyDetail.getEndTime(),"yyyy-MM-dd")); |
| | | System.out.println(DateUtil.dateToString(applyDetail.getStartTime(),"yyyy-MM-dd")); |
| | | System.out.println(DateUtil.dateToString(applyChange.getValidTime(),"yyyy-MM-dd")); |
| | | |
| | | BigDecimal sumFee = Constants.countDetailFee(solutions, applyDetail.getEndTime(),applyDetail.getStartTime()); |
| | | BigDecimal useFee = Constants.countDetailFee(solutions, applyChange.getValidTime(),applyDetail.getStartTime()); |
| | | |
| | | applyChagneDetail.setFee( |
| | | Constants.countDetailFee(solutions, applyDetail.getEndTime(),applyDetail.getStartTime()) |
| | | .subtract(Constants.countDetailFee(solutions,applyChange.getValidTime(), applyDetail.getStartTime())) |
| | | .subtract(Constants.countDetailFee(solutions,applyChange.getValidTime(), applyDetail.getStartTime())).multiply(new BigDecimal(-1)) |
| | | ); |
| | | applyChagneDetailJoinMapper.insert(applyChagneDetail); |
| | | } |
| | |
| | | */ |
| | | public void addChangeDetail(ApplyChange applyChange ,List<ApplyChagneDetail> addDetailList,List<DuWorktype> duWorktypeList,List<DuSolution> duSolutionList,InsuranceApply insuranceApply,Solutions solutions,LoginUserInfo loginUserInfo){ |
| | | for (ApplyChagneDetail applyChagneDetail : addDetailList) { |
| | | if (Objects.isNull(applyChagneDetail.getMemberId()) |
| | | || Objects.isNull(applyChagneDetail.getDuId()) |
| | | if ( Objects.isNull(applyChagneDetail.getDuId()) |
| | | || Objects.isNull(applyChagneDetail.getWorktypeId()) |
| | | || StringUtils.isBlank(applyChagneDetail.getIdcardNo()) |
| | | ) { |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "å ä¿äººåã" + applyChagneDetail.getMemberName() + "ãå¿
填项缺失"); |
| | | } |
| | | Member member = memberMapper.selectById(applyChagneDetail.getMemberId()); |
| | | if (Objects.isNull(member)) { |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "å ä¿äººåã" + applyChagneDetail.getMemberName() + "ãæªæ¥è¯¢å°ç³»ç»äººåä¿¡æ¯"); |
| | | |
| | | |
| | | Member member = new Member(); |
| | | if(Objects.isNull(applyChagneDetail.getMemberId())){ |
| | | //æ¥è¯¢æ¯å¦åå¨è¯¥ç¨æ· |
| | | member = memberMapper.selectOne(new QueryWrapper<Member>().lambda() |
| | | .eq(Member::getCompanyId,insuranceApply.getCompanyId()) |
| | | .eq(Member::getIsdeleted,Constants.ZERO) |
| | | .eq(Member::getIdcardNo,applyChagneDetail.getIdcardNo()) |
| | | .last(" limit 1") |
| | | ); |
| | | if(Objects.isNull(member)){ |
| | | member = new Member(); |
| | | member.setCreateDate(new Date()); |
| | | member.setCreator(loginUserInfo.getId()); |
| | | member.setIsdeleted(Constants.ZERO); |
| | | member.setName(applyChagneDetail.getMemberName()); |
| | | member.setCompanyId(insuranceApply.getCompanyId()); |
| | | member.setSex(Constants.getSexByIdCard(applyChagneDetail.getIdcardNo())); |
| | | member.setIdcardNo(applyChagneDetail.getIdcardNo()); |
| | | member.setApplyId(insuranceApply.getId()); |
| | | member.setDuId(applyChagneDetail.getDuId()); |
| | | member.setWorktypeId(applyChagneDetail.getWorktypeId()); |
| | | memberMapper.insert(member); |
| | | }else{ |
| | | member.setApplyId(insuranceApply.getId()); |
| | | member.setDuId(applyChagneDetail.getDuId()); |
| | | member.setWorktypeId(applyChagneDetail.getWorktypeId()); |
| | | memberMapper.updateById(member); |
| | | } |
| | | }else{ |
| | | member = memberMapper.selectById(applyChagneDetail.getMemberId()); |
| | | if(Objects.isNull(member)){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "å ä¿äººåã" + applyChagneDetail.getMemberName() + "ãæªæ¥è¯¢å°ç³»ç»äººåä¿¡æ¯"); |
| | | } |
| | | member.setApplyId(insuranceApply.getId()); |
| | | member.setDuId(applyChagneDetail.getDuId()); |
| | | member.setWorktypeId(applyChagneDetail.getWorktypeId()); |
| | | memberMapper.updateById(member); |
| | | } |
| | | //æ¥è¯¢åå·¥æ¯å¦åå¨ 0å¾
ç¾ç½² 1å·²ç¾ç« çæ¤ç±»ä¸å¡ä¿æ°æ® åä¸ä¸»åä¸ |
| | | if (applyChagneDetailJoinMapper.selectJoinCount( |
| | |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "å ä¿äººåã" + applyChagneDetail.getMemberName() + "ãåå¨ç³è¯·ä¸çå åä¿/æ¢ååæ®"); |
| | | } |
| | | //æ¥è¯¢åå·¥æ¯å¨ä¸»åä¸ æ¯å¦åå¨çæä¸çæ°æ® |
| | | if (applyDetailJoinMapper.selectCount(new QueryWrapper<ApplyDetail>().lambda() |
| | | .eq(ApplyDetail::getApplyId, applyChange.getApplyId()) |
| | | .eq(ApplyDetail::getMemberId, applyChagneDetail.getMemberId()) |
| | | .le(ApplyDetail::getStartTime, "now()") |
| | | .ge(ApplyDetail::getEndTime, "now()") |
| | | ) > Constants.ZERO) { |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "å ä¿äººåã" + applyChagneDetail.getMemberName() + "ãåå¨ä¿éä¸çä¿åä¿¡æ¯ï¼æ æ³è¿è¡å ä¿"); |
| | | if(!Objects.isNull(applyChagneDetail.getMemberId())){ |
| | | if (applyDetailJoinMapper.selectCount(new QueryWrapper<ApplyDetail>().lambda() |
| | | .eq(ApplyDetail::getApplyId, applyChange.getApplyId()) |
| | | .eq(ApplyDetail::getMemberId, applyChagneDetail.getMemberId()) |
| | | .le(ApplyDetail::getStartTime, "now()") |
| | | .ge(ApplyDetail::getEndTime, "now()") |
| | | ) > Constants.ZERO) { |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "å ä¿äººåã" + applyChagneDetail.getMemberName() + "ãåå¨ä¿éä¸çä¿åä¿¡æ¯ï¼æ æ³è¿è¡å ä¿"); |
| | | } |
| | | } |
| | | |
| | | //éªè¯æ´¾é£åä½ä¿¡æ¯ ä¸å·¥ç§ä¿¡æ¯ æ¯å¦åå¨ |
| | | if (duSolutionList.stream().filter(d -> d.getDispatchUnitId().equals(applyChagneDetail.getDuId())).collect(Collectors.toList()).size() <= Constants.ZERO) { |
| | | throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(), "ã" + applyChagneDetail.getMemberName() + "ãå工派é£å使ªæ¥è¯¢å°ï¼"); |
| | | } |
| | | if (duWorktypeList.stream().filter(d -> d.getDuSolutionId().equals(applyChagneDetail.getDuId()) && d.getWorkTypeId().equals(applyChagneDetail.getWorktypeId())) |
| | | if (duWorktypeList.stream().filter(d -> d.getWorkTypeId().equals(applyChagneDetail.getWorktypeId())) |
| | | .collect(Collectors.toList()).size() <= Constants.ZERO) { |
| | | throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(), "ã" + applyChagneDetail.getMemberName() + "ãå工工ç§ä¿¡æ¯æªæ¥è¯¢å°ï¼"); |
| | | } |
| | | applyChagneDetail.setMemberId(member.getId()); |
| | | applyChagneDetail.setCreateDate(new Date()); |
| | | applyChagneDetail.setCreator(loginUserInfo.getId()); |
| | | applyChagneDetail.setIsdeleted(Constants.ZERO); |
| | | applyChagneDetail.setApplyChangeId(applyChange.getId()); |
| | | applyChagneDetail.setType(Constants.ZERO); |
| | | applyChagneDetail.setFee( |
| | | |
| | | Constants.countDetailFee(solutions,insuranceApply.getEndTime(),applyChange.getValidTime()) |
| | | ); |
| | | applyChagneDetailJoinMapper.insert(applyChagneDetail); |
| | |
| | | List<ApplyDetail> applyDetailList = applyDetailJoinMapper.selectList(new QueryWrapper<ApplyDetail>().lambda() |
| | | .eq(ApplyDetail::getApplyId, applyChange.getApplyId()) |
| | | .eq(ApplyDetail::getMemberId, applyChagneDetail.getMemberId()) |
| | | .le(ApplyDetail::getStartTime, "now()") |
| | | .ge(ApplyDetail::getEndTime, "now()")); |
| | | .le(ApplyDetail::getStartTime, DateUtil.getDate(new Date(),"yyyy-MM-dd HH:mm:ss")) |
| | | .ge(ApplyDetail::getEndTime, DateUtil.getDate(new Date(),"yyyy-MM-dd HH:mm:ss"))); |
| | | if(applyDetailList.size()>Constants.ONE){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "æ¢å人åã" + applyChagneDetail.getMemberName() + "ãä¿åä¿¡æ¯å¼å¸¸ï¼åå¨å¤æ¡æ°æ®"); |
| | | } |
| | | ApplyDetail applyDetail = applyDetailList.get(Constants.ZERO); |
| | | if(applyChange.getValidTime().compareTo( applyDetail.getEndTime())<=0){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "æ¢å人åã" + applyChagneDetail.getMemberName() + "ãä¿åä¿éæ¥æè³ï¼ã"+applyDetail.getEndTime()+"ãæ æ³éè¿æ¬æ¬¡ç³è¯·"); |
| | | if(applyChange.getValidTime().compareTo( applyDetail.getEndTime())>0){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "æ¢å人åã" + applyChagneDetail.getMemberName() + "ãä¿åä¿éæ¥æè³ï¼ã"+DateUtil.getDate(applyDetail.getEndTime(),"yyyy-MM-dd HH:mm:ss")+"ãæ æ³éè¿æ¬æ¬¡ç³è¯·"); |
| | | } |
| | | //éªè¯æ´¾é£åä½ä¿¡æ¯ ä¸å·¥ç§ä¿¡æ¯ æ¯å¦åå¨ |
| | | if (duSolutionList.stream().filter(d -> d.getDispatchUnitId().equals(applyChagneDetail.getDuId())).collect(Collectors.toList()).size() <= Constants.ZERO) { |
| | | throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(), "æ¢å人åã" + applyChagneDetail.getMemberName() + "ãå工派é£å使ªæ¥è¯¢å°ï¼"); |
| | | } |
| | | if (duWorktypeList.stream().filter(d -> d.getDuSolutionId().equals(applyChagneDetail.getDuId()) && d.getWorkTypeId().equals(applyChagneDetail.getWorktypeId())) |
| | | if (duWorktypeList.stream().filter(d -> d.getWorkTypeId().equals(applyChagneDetail.getWorktypeId())) |
| | | .collect(Collectors.toList()).size() <= Constants.ZERO) { |
| | | throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(), "æ¢å人åã" + applyChagneDetail.getMemberName() + "ãå工工ç§ä¿¡æ¯æªæ¥è¯¢å°ï¼"); |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public CountCyclePriceVO getChangeCountCyclePriceVO(ApplyChangeCyclePriceDTO applyChangeCyclePriceDTO){ |
| | | if(Objects.isNull(applyChangeCyclePriceDTO) |
| | | || Objects.isNull(applyChangeCyclePriceDTO.getApplyId()) |
| | | || Objects.isNull(applyChangeCyclePriceDTO.getValidTime())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | |
| | | InsuranceApply insuranceApply = insuranceApplyMapper.selectById(applyChangeCyclePriceDTO.getApplyId()); |
| | | if(Objects.isNull(insuranceApply)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"æªæ¥è¯¢å°ä¿å"); |
| | | } |
| | | Solutions solutions = solutionsMapper.selectById(insuranceApply.getSolutionId()); |
| | | if(Objects.isNull(solutions)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"æªæ¥è¯¢æ¹æ¡ä¿¡æ¯"); |
| | | } |
| | | CountCyclePriceVO countCyclePriceVO = new CountCyclePriceVO(); |
| | | countCyclePriceVO.setCyclePrice(Constants.countDetailFee(solutions,insuranceApply.getEndTime(),applyChangeCyclePriceDTO.getValidTime())); |
| | | return countCyclePriceVO; |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |