This commit is contained in:
2024-01-24 16:52:18 +08:00
parent 97151653e2
commit 0e8588b87d
4 changed files with 11 additions and 2 deletions

View File

@@ -756,11 +756,14 @@ public abstract class AbstractProgramLogic implements InitializingBean {
// 订单折扣金额
BigDecimal discountAmount = discountServiceAmount.add(discountElectricityAmount);
orderBasicInfo.setDiscountAmount(discountAmount);
// 更新退款金额 = 退款金额 - 折扣金额
// BigDecimal refundAmount = orderBasicInfo.getRefundAmount().subtract(discountAmount);
// 更新结算金额 结算金额 = 消费金额 - 虚拟金额 - 优惠金额
BigDecimal newSettleAmount = orderBasicInfo.getSettleAmount().subtract(discountAmount);
orderBasicInfo.setSettleAmount(newSettleAmount);
// 总消费金额 = 折扣后电费 + 折扣后服务费
BigDecimal totalConsumeAmount = afterServiceAmountDiscount.add(afterElectricityAmountDiscount);
// 更新退款金额
BigDecimal refundAmount = orderBasicInfo.getPayAmount().subtract(totalConsumeAmount).setScale(2, RoundingMode.DOWN);
orderBasicInfo.setRefundAmount(refundAmount);

View File

@@ -67,6 +67,7 @@ public class OrderDetailInfoVO {
private String createTime; // 订单创建时间
private String startSOC; // 开始SOC
private String endSOC; // 结束SOC
private String discountAmount; // 订单优惠金额
private String settleAmount;// 结算金额
private String settlementTime; // 结算时间
}