| | |
| | | public void updateWallet(WalletWithdrawRecordDTO walletWithdrawRecordDTO) { |
| | | |
| | | WalletWithdrawRecordDO withdrawRecordDO = walletWithdrawRecordMapper.selectById(walletWithdrawRecordDTO.getId()); |
| | | final String approveState = withdrawRecordDO.getApproveState(); |
| | | if (withdrawRecordDO == null) { |
| | | throw new ValidationException("提现记录信息不存在"); |
| | | } |
| | |
| | | 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); |
| | | } |
| | |
| | | WalletBillRecordDO walletBillRecordDO = new WalletBillRecordDO(); |
| | | walletBillRecordDO.setSupplierId(s.getId()); |
| | | walletBillRecordDO.setType(Constants.BILL_CHANGE_TYPE.withdraw.name()); |
| | | walletBillRecordDO.setWithdrawType(Constants.BILL_WITHDRAW_TYPE.success.name()); |
| | | walletBillRecordDO.setMethod(Constants.BILL_CHANGE_METHOD.reduce.name()); |
| | | walletBillRecordDO.setTransferId(transferReqDTO.getId()); |
| | | walletBillRecordDO.setWithdrawRecordId(withdrawRecordDO.getId()); |