陶杰
2024-10-28 66f57ebef36c03353609ad3b2b6623396b5061a4
src/main/java/com/mzl/flower/service/impl/wallet/WalletWithdrawRecordServiceImpl.java
@@ -117,6 +117,12 @@
                    // 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());
@@ -246,7 +252,7 @@
        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()));