余额支付, 校验消费金额 - 折扣金额 + 退款金额 = 支付金额

This commit is contained in:
Guoqs
2025-03-26 19:58:42 +08:00
parent 063c4f494f
commit 670a35c9a1
2 changed files with 39 additions and 3 deletions

View File

@@ -1911,10 +1911,12 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
return null;
}
// 如果是余额支付, 校验消费金额+ 退款金额 = 支付金额
// 如果是余额支付, 校验消费金额 - 折扣金额 + 退款金额 = 支付金额
if (StringUtils.equals(orderBasicInfo.getPayMode(), "1")) {
if (orderConsumeAmount.add(orderRefundAmount).compareTo(orderPayAmount) != 0) {
logger.info("realTimeOrderSplit-订单:{}, payMode:{}, 支付金额与消费金额+退款金额不相等", afterSettleOrderDTO.getOrderCode(), orderBasicInfo.getPayMode());
// 订单折扣金额 = 电费折扣金额 + 服务费折扣金额
BigDecimal orderDiscountAmount = afterSettleOrderDTO.getOrderElectricityDiscountAmount().add(afterSettleOrderDTO.getOrderServiceDiscountAmount());
if (orderConsumeAmount.subtract(orderDiscountAmount).add(orderRefundAmount).compareTo(orderPayAmount) != 0) {
logger.info("realTimeOrderSplit-订单:{}, payMode:{}, 支付金额与消费金额-折扣金额+退款金额不相等", afterSettleOrderDTO.getOrderCode(), orderBasicInfo.getPayMode());
return null;
}
}