充值金额

This commit is contained in:
2025-11-22 15:44:45 +08:00
parent 840eb10691
commit 0f53f3363f

View File

@@ -138,16 +138,21 @@ public class ShopOrderStatisticServiceImpl extends ServiceImpl<ShopOrderStatisti
result.setProductCostAmount(productCostAmount);
//会员充值退款 充值退款金额(线上退款+现金退款)
BigDecimal onlineAmount = Objects.requireNonNullElse(
BigDecimal cashRechargeAmount = Objects.requireNonNullElse(result.getCashRechargeAmount(), BigDecimal.ZERO);
BigDecimal onlineRechargeAmount = Objects.requireNonNullElse(result.getOnlineRechargeAmount(), BigDecimal.ZERO);
BigDecimal rechargeAmount = cashRechargeAmount.add(onlineRechargeAmount);
result.setRechargeAmount(rechargeAmount);
//会员充值退款 充值退款金额(线上退款+现金退款)
BigDecimal onlineRefundAmount = Objects.requireNonNullElse(
(onlineStat != null) ? onlineStat.getOnlineRechargeRefundAmount() : null,
BigDecimal.ZERO
);
BigDecimal userFlowAmount = Objects.requireNonNullElse(
BigDecimal userFlowRefundAmount = Objects.requireNonNullElse(
(userFlowStat != null) ? userFlowStat.getCashRechargeRefundAmount() : null,
BigDecimal.ZERO
);
BigDecimal total = onlineAmount.add(userFlowAmount);
result.setRechargeRefundAmount(total);
BigDecimal rechargeRefundAmountTotal = onlineRefundAmount.add(userFlowRefundAmount);
result.setRechargeRefundAmount(rechargeRefundAmountTotal);
//实付金额 (线上付款 现金支付 会员支付 挂账)
BigDecimal onlinePayAmount = (onlineStat != null)
? Objects.requireNonNullElse(onlineStat.getOnlinePayAmount(), BigDecimal.ZERO)