如果totalElectricityAmount + totalServiceAmount != dataOrderAmount,则totalElectricityAmount = dataOrderAmount - totalServiceAmount

This commit is contained in:
Guoqs
2025-04-02 11:02:01 +08:00
parent 0658e67930
commit 7b88280d14

View File

@@ -613,6 +613,12 @@ public abstract class AbstractProgramLogic implements InitializingBean {
// 退款金额 = 支付金额 - 订单消费金额 剩余需要退回的金额 residue
BigDecimal refundAmount = payAmount.subtract(dataOrderAmount);
// 如果totalElectricityAmount + totalServiceAmount != dataOrderAmount则totalElectricityAmount = dataOrderAmount - totalServiceAmount
if (totalElectricityAmount.add(totalServiceAmount).compareTo(dataOrderAmount) != 0) {
logger.info("updateOrderBasicInfoAndOrderDetail结算订单:【{}】, 电费金额({}) + 服务费金额({}) != 订单金额({}), 电费金额设置为订单金额- 服务费金额", orderCode, totalElectricityAmount, totalServiceAmount, dataOrderAmount);
totalElectricityAmount = dataOrderAmount.subtract(totalServiceAmount);
}
/*
orderBasicInfo需要更新的字段
*/