| | |
| | | @Override |
| | | public void withdrawalApply(WithdrawalRequestsDTO params) { |
| | | BigDecimal withdrawalAmount = params.getWithdrawalAmount(); |
| | | if (withdrawalAmount.compareTo(MAX_WITHDRAWAL_AMOUNT) > 0) { |
| | | if (withdrawalAmount.compareTo(MAX_WITHDRAWAL_AMOUNT) > 0 && params.getWithdrawalMethod().equals(1)) { |
| | | throw new ServiceException("提现失败,单次提现金额不能超过200元!"); |
| | | } |
| | | |
| | |
| | | balanceChangeRecord.setVipId(appUser.getVipId()); |
| | | balanceChangeRecord.setOrderId(withdrawalRequests.getId()); |
| | | balanceChangeRecord.setChangeType(2); |
| | | balanceChangeRecord.setBeforeAmount(balance); |
| | | balanceChangeRecord.setChangeAmount(withdrawalAmount); |
| | | balanceChangeRecord.setAfterAmount(appUser.getBalance()); |
| | | balanceChangeRecord.setDelFlag(0); |
| | | balanceChangeRecord.setCreateTime(LocalDateTime.now()); |
| | | balanceChangeRecord.setChangeDirection(-1); |
| | | balanceChangeRecordService.save(balanceChangeRecord); |
| | | } |
| | | |