update 可提现金额,减去当天申请金额

This commit is contained in:
Guoqs
2025-11-18 13:33:26 +08:00
parent 277fad8918
commit e778d34941
13 changed files with 2077 additions and 36 deletions

View File

@@ -678,8 +678,8 @@ public class AdapayService {
// if (CollectionUtils.isNotEmpty(withdrawInfoVOS)) {
// totalWithdraw = withdrawInfoVOS.stream().map(WithdrawInfoVO::getCashAmt).reduce(BigDecimal.ZERO, BigDecimal::add);
// }
BigDecimal totalWithdraw = clearingWithdrawInfoService.queryTotalWithdraw(merchantId);
vo.setTotalWithdraw(totalWithdraw);
// BigDecimal totalWithdraw = clearingWithdrawInfoService.queryTotalWithdraw(merchantId);
vo.setTotalWithdraw(clearingWithdrawInfoService.queryTotalWithdraw(merchantId));
// 在途金额
BigDecimal pendingAmount = BigDecimal.ZERO;
@@ -692,6 +692,13 @@ public class AdapayService {
.reduce(BigDecimal.ZERO, BigDecimal::add);
}
vo.setPendingAmount(pendingAmount);
// 查询今天的提现金额
BigDecimal todayWithdrawalAmount = clearingWithdrawInfoService.queryTodayWithdrawalAmount(merchantId);
// 如果大于0则重新更新LastAvlBalance
if (todayWithdrawalAmount.compareTo(BigDecimal.ZERO) > 0) {
vo.setLastAvlBalance(BigDecimal.ZERO.max(vo.getLastAvlBalance().subtract(todayWithdrawalAmount)));
}
return vo;
}