| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | Integer maxDays = DateUtil.calculateBetween(saveUnionApplyDTO.getStartDate(),saveUnionApplyDTO.getEndDate(),0); |
| | | |
| | | List<ApplyDetail> applyDetailList = applyDetailJoinMapper.selectList(new QueryWrapper<ApplyDetail>().lambda().select(ApplyDetail::getId,ApplyDetail::getPrice) |
| | | List<ApplyDetail> applyDetailList = applyDetailJoinMapper.selectList(new QueryWrapper<ApplyDetail>().lambda() |
| | | .select(ApplyDetail::getId,ApplyDetail::getPrice,ApplyDetail::getStartTime,ApplyDetail::getEndTime,ApplyDetail::getFee) |
| | | .in(ApplyDetail::getApplyId,saveUnionApplyDTO.getApplyIds()) |
| | | .eq(ApplyDetail::getIsdeleted,Constants.ZERO)); |
| | | if(applyDetailList.size()==0){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"对不起,存在委托投保申请记录信息有误,请返回查看申请人员是否为空!"); |
| | | } |
| | | unionApply.setFee(applyDetailList.stream().map(i->Constants.formatBigdecimal(i.getPrice()).multiply(new BigDecimal(maxDays))).reduce(BigDecimal.ZERO,BigDecimal::add)); |
| | | BigDecimal fee = BigDecimal.ZERO; |
| | | for (ApplyDetail applyDetail:applyDetailList) { |
| | | Integer oldDays = DateUtil.calculateBetween(applyDetail.getStartTime(),applyDetail.getEndTime(),0); |
| | | fee =fee.add(new BigDecimal(maxDays).multiply( applyDetail.getFee()).divide(new BigDecimal(oldDays),2,RoundingMode.HALF_UP)); |
| | | } |
| | | unionApply.setFee(fee); |
| | | |
| | | // unionApply.setFee(applyDetailList.stream() |
| | | // .map(i->Constants.formatBigdecimal(i.getPrice()).multiply(new BigDecimal(maxDays))).reduce(BigDecimal.ZERO,BigDecimal::add)); |
| | | |
| | | unionApplyMapper.insert(unionApply); |
| | | |
| | |
| | | if(CollectionUtils.isNotEmpty(uploadMultifileDTO.getMultifileList())){ |
| | | List<Multifile> multifileList = uploadMultifileDTO.getMultifileList(); |
| | | for (Multifile multifile:multifileList) { |
| | | if(StringUtils.isBlank(multifile.getName()) |
| | | || StringUtils.isBlank(multifile.getFileurl()) ){ |
| | | continue; |
| | | } |
| | | if(Objects.isNull(multifile.getObjId()) |
| | | ||Objects.isNull(multifile.getName()) |
| | | ||Objects.isNull(multifile.getFileurl())){ |
| | |
| | | public String getSignLink(SmsCheckDTO smsCheckDTO) { |
| | | if(Objects.isNull(smsCheckDTO) |
| | | || Objects.isNull(smsCheckDTO.getBusinessId()) |
| | | || StringUtils.isBlank(smsCheckDTO.getCode()) |
| | | // || StringUtils.isBlank(smsCheckDTO.getCode()) |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | //验证 验证码 |
| | | if(!debugModel){ |
| | | smsEmailService.validateCode(smsCheckDTO.getCode()); |
| | | } |
| | | // if(!debugModel){ |
| | | // smsEmailService.validateCode(smsCheckDTO.getCode()); |
| | | // } |
| | | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | if(!user.getType().equals(Constants.TWO)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"非商户用户,无法进行该操作!"); |
| | |
| | | if(unionApplyBXDDDetailTO.isPresent()){ |
| | | UnionApplyBXDDetailDTO unionApplyBXDDetailDTO = unionApplyBXDDDetailTO.get(); |
| | | serverCost = unionApplyBXDDetailDTO.getServerMoney(); |
| | | BigDecimal dayServerMoney = unionApplyBXDDetailDTO.getServerMoney().divide(new BigDecimal(maxDays),2, RoundingMode.HALF_UP); |
| | | BigDecimal dayServerMoney = unionApplyBXDDetailDTO.getServerMoney().divide(new BigDecimal(maxDays),6, RoundingMode.HALF_UP); |
| | | |
| | | price = Constants.formatBigdecimal(price).add(Constants.formatBigdecimal(dayServerMoney)); |
| | | //上传保单信息 |