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