| | |
| | | cashOutSettingVo = JSONObject.parseObject(dic.getValue(), CashOutSettingVo.class); |
| | | } |
| | | |
| | | if (withdrawalDto.getAmount().compareTo(cashOutSettingVo.getMinCashOut()) < 0) { |
| | | throw new FebsException("最小提现金额为"+cashOutSettingVo.getMinCashOut().setScale(2,BigDecimal.ROUND_DOWN)); |
| | | if (withdrawalDto.getAmount().compareTo(BigDecimal.ZERO) <= 0) { |
| | | throw new FebsException("请输入正确的提现金额"); |
| | | } |
| | | if(ObjectUtil.isEmpty(withdrawalDto.getBankNo())){ |
| | | throw new FebsException("请输入地址"); |
| | | } |
| | | |
| | | MallMemberBank mallMemberBank = mallMemberBankMapper.selectById(withdrawalDto.getBankId()); |
| | | if(ObjectUtil.isEmpty(mallMemberBank)){ |
| | | throw new FebsException("未找到地址信息"); |
| | | } |
| | | |
| | | BigDecimal serviceFee = cashOutSettingVo.getServiceFee().multiply(BigDecimal.valueOf(0.01)); |
| | | BigDecimal serviceFee = cashOutSettingVo.getServiceFee(); |
| | | String orderNo = MallUtils.getOrderNum("W"); |
| | | //减少用户余额 |
| | | memberWalletService.reduce(withdrawalDto.getAmount(), memberId, "balance"); |
| | |
| | | withdraw.setMemberId(memberId); |
| | | withdraw.setAmount(withdrawalDto.getAmount()); |
| | | withdraw.setStatus(1); |
| | | withdraw.setAmountFee(serviceFee.multiply(withdrawalDto.getAmount())); |
| | | withdraw.setWtihdrawTypeId(mallMemberBank.getId()); |
| | | withdraw.setAmountFee(serviceFee); |
| | | // withdraw.setWtihdrawTypeId(mallMemberBank.getId()); |
| | | this.baseMapper.insert(withdraw); |
| | | //生成提现流水记录 |
| | | Long subsidyAmountFlowId = mallMoneyFlowService.addMoneyFlow( |