mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-19 18:45:03 +08:00
update 可提现金额减去当天申请金额
This commit is contained in:
@@ -683,18 +683,26 @@ public class AdapayService {
|
||||
|
||||
// 在途金额
|
||||
BigDecimal pendingAmount = BigDecimal.ZERO;
|
||||
BigDecimal todayWithdrawalAmount = BigDecimal.ZERO;
|
||||
List<WithdrawInfoVO> withdrawInfoVOS = clearingWithdrawInfoService.selectByMerchantId(merchantId);
|
||||
log.info("==查询提现在途金额param:{}, result:{}", JSON.toJSONString(withdrawInfoVOS), JSON.toJSONString(pendingAmount));
|
||||
// log.info("==查询提现在途金额param:{}, result:{}", JSON.toJSONString(withdrawInfoVOS), JSON.toJSONString(pendingAmount));
|
||||
if (CollectionUtils.isNotEmpty(withdrawInfoVOS)) {
|
||||
pendingAmount = withdrawInfoVOS.stream()
|
||||
.filter(item -> Constants.ZERO.equals(item.getStatusDesc()))
|
||||
.map(WithdrawInfoVO::getCashAmt)
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
|
||||
// 查询今天的提现金额
|
||||
for (WithdrawInfoVO withdrawInfoVO : withdrawInfoVOS) {
|
||||
// 如果applicationTime在当天,则加到todayWithdrawalAmount中
|
||||
if (DateUtils.isToday(withdrawInfoVO.getApplicationTime())) {
|
||||
todayWithdrawalAmount = todayWithdrawalAmount.add(withdrawInfoVO.getCashAmt());
|
||||
}
|
||||
}
|
||||
}
|
||||
vo.setPendingAmount(pendingAmount);
|
||||
|
||||
// 查询今天的提现金额
|
||||
BigDecimal todayWithdrawalAmount = clearingWithdrawInfoService.queryTodayWithdrawalAmount(merchantId);
|
||||
// BigDecimal todayWithdrawalAmount = clearingWithdrawInfoService.queryTodayWithdrawalAmount(merchantId);
|
||||
// 如果大于0,则重新更新LastAvlBalance
|
||||
if (todayWithdrawalAmount.compareTo(BigDecimal.ZERO) > 0) {
|
||||
vo.setLastAvlBalance(BigDecimal.ZERO.max(vo.getLastAvlBalance().subtract(todayWithdrawalAmount)));
|
||||
|
||||
Reference in New Issue
Block a user