cloudroam
2024-11-01 e73d51df2fc2fc369c02eff3571a76f75b98a8ba
src/main/java/com/mzl/flower/service/impl/wallet/WalletWithdrawRecordServiceImpl.java
@@ -125,7 +125,7 @@
                    withdrawRecordDO.setBalance(walletDO.getWithdrawableAmount().subtract(dto.getAmount()));
                    withdrawRecordDO.setAmount(dto.getAmount());
                    withdrawRecordDO.setSupplierId(supplierDTO.getId());
                    withdrawRecordDO.setWithdrawState(Constants.WALLET_WITHDRAW_STATE.WAITING.name());
                    withdrawRecordDO.setWithdrawState(Constants.BILL_WITHDRAW_TYPE.start.name());
                    withdrawRecordDO.setMethod(Constants.WALLET_WITHDRAW_METHOD.WEIXIN.name());
                    withdrawRecordDO.setWithdrawType(Constants.WALLET_WITHDRAW_TYPE.BALANCE.name());
                    // 待审核状态
@@ -188,6 +188,7 @@
    public void updateWallet(WalletWithdrawRecordDTO walletWithdrawRecordDTO) {
        WalletWithdrawRecordDO withdrawRecordDO = walletWithdrawRecordMapper.selectById(walletWithdrawRecordDTO.getId());
        final String approveState = withdrawRecordDO.getApproveState();
        if (withdrawRecordDO == null) {
            throw new ValidationException("提现记录信息不存在");
        }
@@ -209,7 +210,7 @@
        withdrawRecordDO.setApproveTime(LocalDateTime.now());
        if(Constants.WALLET_APPROVE_STATE.REJECT.name().equals(walletWithdrawRecordDTO.getApproveState())){
            //如果拒绝直接提现失败
            withdrawRecordDO.setWithdrawState(Constants.WALLET_WITHDRAW_STATE.FAILURE.name());
            withdrawRecordDO.setWithdrawState(Constants.BILL_WITHDRAW_TYPE.fail.name());
        }
        walletWithdrawRecordMapper.updateById(withdrawRecordDO);
@@ -219,7 +220,7 @@
            try {
                if (recordLock.tryLock(10, 30, TimeUnit.SECONDS)) {
                    try {
                        if(!walletWithdrawRecordDTO.getApproveState().equals(Constants.WALLET_APPROVE_STATE.WAITING)){
                        if(!approveState.equals(Constants.WALLET_APPROVE_STATE.WAITING.name())){
                            String msg =  "重复通过";
                            throw new ValidationException(msg);
                        }