| | |
| | | |
| | | // 1.新增一条余额提现记录 |
| | | WalletWithdrawRecordDO withdrawRecordDO = new WalletWithdrawRecordDO(); |
| | | //原金额 |
| | | withdrawRecordDO.setOriginalAmount(walletDO.getWithdrawableAmount()); |
| | | // 变动金额 |
| | | withdrawRecordDO.setChangeAmount(dto.getAmount()); |
| | | // 余额 |
| | | withdrawRecordDO.setBalance(walletDO.getWithdrawableAmount().subtract(dto.getAmount())); |
| | | withdrawRecordDO.setAmount(dto.getAmount()); |
| | | withdrawRecordDO.setSupplierId(supplierDTO.getId()); |
| | | withdrawRecordDO.setWithdrawState(Constants.WALLET_WITHDRAW_STATE.WAITING.name()); |
| | |
| | | if (Constants.WALLET_APPROVE_STATE.REJECT.name().equals(walletWithdrawRecordDTO.getApproveState())) { |
| | | //更新钱包 |
| | | Supplier s = supplierMapper.selectById(withdrawRecordDO.getSupplierId()); |
| | | WalletDO walletDO = walletService.getBySupplierId(s.getId()); |
| | | WalletDO walletDO = walletService.getOrCreateBySupplierId(s.getId()); |
| | | if(!ObjectUtils.isEmpty(walletDO)){ |
| | | //提现中金额:审核失败体现中金额扣减 |
| | | walletDO.setWithdrawingAmount(walletDO.getWithdrawingAmount().subtract(withdrawRecordDO.getAmount())); |