diff --git a/jsowell-pile/src/main/java/com/jsowell/adapay/service/AdapayService.java b/jsowell-pile/src/main/java/com/jsowell/adapay/service/AdapayService.java index 550ba462c..ed1f2b6ae 100644 --- a/jsowell-pile/src/main/java/com/jsowell/adapay/service/AdapayService.java +++ b/jsowell-pile/src/main/java/com/jsowell/adapay/service/AdapayService.java @@ -683,18 +683,26 @@ public class AdapayService { // 在途金额 BigDecimal pendingAmount = BigDecimal.ZERO; + BigDecimal todayWithdrawalAmount = BigDecimal.ZERO; List 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)));