|
@@ -89,8 +89,7 @@ public class UserWithdrawalServiceImpl extends ServiceImpl<UserWithdrawalDao, Us
|
|
|
BigDecimal withdrawalServiceFee = getWithdrawalServiceFee();
|
|
|
withdrawalInfoRes.setWithdrawalServiceFee(withdrawalServiceFee);
|
|
|
//获取用户可用于提现余额
|
|
|
- withdrawalInfoRes.setAmountWithdrawal(getAmountUsable(userId).subtract(withdrawalServiceFee)
|
|
|
- .setScale(2, RoundingMode.HALF_UP));
|
|
|
+ withdrawalInfoRes.setAmountWithdrawal(getAmountUsable(userId));
|
|
|
return HttpResponseResult.succeed(withdrawalInfoRes);
|
|
|
}
|
|
|
|
|
@@ -168,15 +167,14 @@ public class UserWithdrawalServiceImpl extends ServiceImpl<UserWithdrawalDao, Us
|
|
|
userWithdrawal.setBankFlowNo(data.getBankFlowNo());
|
|
|
userWithdrawal.setStatus(data.getStatus());
|
|
|
userWithdrawal.setVerifyReason(data.getVerifyReason());
|
|
|
- userWithdrawal.setVerifyUserId(userId);
|
|
|
- userWithdrawal.setTransferTime(new Date());
|
|
|
+
|
|
|
userWithdrawal.setUpdateTime(new Date());
|
|
|
userWithdrawalList.add(userWithdrawal);
|
|
|
}
|
|
|
if (!CollectionUtils.isEmpty(errMsgList)) {
|
|
|
throw new ExcelException("导入异常", errMsgList);
|
|
|
}
|
|
|
- authWithdrawalBancth(userWithdrawalList);
|
|
|
+ authWithdrawalBancth(userWithdrawalList, userId);
|
|
|
}
|
|
|
|
|
|
/***
|
|
@@ -185,37 +183,38 @@ public class UserWithdrawalServiceImpl extends ServiceImpl<UserWithdrawalDao, Us
|
|
|
* @param: userWithdrawalList
|
|
|
* @updateTime 2022/4/20 11:18
|
|
|
*/
|
|
|
- private void authWithdrawalBancth(List<UserWithdrawal> userWithdrawalList) {
|
|
|
+ private void authWithdrawalBancth(List<UserWithdrawal> userWithdrawalList, Long userId) {
|
|
|
for (UserWithdrawal userWithdrawal : userWithdrawalList) {
|
|
|
UserWithdrawal old = baseMapper.selectById(userWithdrawal.getId());
|
|
|
- if (null == old) {
|
|
|
+ if (null == old || !AuthStatusEnum.DOING.equals(old.getStatus()) || AuthStatusEnum.DOING.equals(userWithdrawal.getStatus())) {
|
|
|
continue;
|
|
|
}
|
|
|
- if (!AuthStatusEnum.PASS.equals(old.getStatus())
|
|
|
- && !old.getStatus().equals(userWithdrawal.getStatus())) {
|
|
|
- baseMapper.updateById(userWithdrawal);
|
|
|
+ userWithdrawal.setUpdateTime(new Date());
|
|
|
|
|
|
- if (AuthStatusEnum.PASS.equals(userWithdrawal.getStatus())) {
|
|
|
- //审核通过,账户解冻,入账户明细
|
|
|
- UserAccountRecordDto accountRecordDto = new UserAccountRecordDto(
|
|
|
- old.getUserId(), old.getAmount(), InOrOutEnum.OUT, AccountBizTypeEnum.WITHDRAWAL,
|
|
|
- userWithdrawal.getId(), "老师提现", null
|
|
|
- );
|
|
|
- accountRecordDto.setFrozenType(FrozenTypeEnum.FROZEN_DEDUCT);
|
|
|
- accountRecordDto.setSaveRecord(true);
|
|
|
- userAccountService.accountChange(accountRecordDto);
|
|
|
- } else if (AuthStatusEnum.UNPASS.equals(userWithdrawal.getStatus())) {
|
|
|
- //审核不通过,账户解冻
|
|
|
- UserAccountRecordDto accountRecordDto = new UserAccountRecordDto(
|
|
|
- old.getUserId(), old.getAmount(), InOrOutEnum.OUT, AccountBizTypeEnum.WITHDRAWAL,
|
|
|
- userWithdrawal.getId(), "老师提现", null
|
|
|
- );
|
|
|
- accountRecordDto.setFrozenType(FrozenTypeEnum.FROZEN_BACK);
|
|
|
- accountRecordDto.setSaveRecord(false);
|
|
|
- userAccountService.accountChange(accountRecordDto);
|
|
|
- }
|
|
|
- }
|
|
|
+ if (AuthStatusEnum.PASS.equals(userWithdrawal.getStatus())) {
|
|
|
+ userWithdrawal.setVerifyUserId(userId);
|
|
|
|
|
|
+ //审核通过,账户解冻,入账户明细
|
|
|
+ UserAccountRecordDto accountRecordDto = new UserAccountRecordDto(
|
|
|
+ old.getUserId(), old.getAmount(), InOrOutEnum.OUT, AccountBizTypeEnum.WITHDRAWAL,
|
|
|
+ userWithdrawal.getId(), "老师提现", null
|
|
|
+ );
|
|
|
+ accountRecordDto.setFrozenType(FrozenTypeEnum.FROZEN_DEDUCT);
|
|
|
+ accountRecordDto.setSaveRecord(true);
|
|
|
+ userAccountService.accountChange(accountRecordDto);
|
|
|
+
|
|
|
+ userWithdrawal.setTransferTime(new Date());
|
|
|
+ } else if (AuthStatusEnum.UNPASS.equals(userWithdrawal.getStatus())) {
|
|
|
+ //审核不通过,账户解冻
|
|
|
+ UserAccountRecordDto accountRecordDto = new UserAccountRecordDto(
|
|
|
+ old.getUserId(), old.getAmount(), InOrOutEnum.OUT, AccountBizTypeEnum.WITHDRAWAL,
|
|
|
+ userWithdrawal.getId(), "老师提现", null
|
|
|
+ );
|
|
|
+ accountRecordDto.setFrozenType(FrozenTypeEnum.FROZEN_BACK);
|
|
|
+ accountRecordDto.setSaveRecord(false);
|
|
|
+ userAccountService.accountChange(accountRecordDto);
|
|
|
+ }
|
|
|
+ baseMapper.updateById(userWithdrawal);
|
|
|
}
|
|
|
}
|
|
|
|