优化orderSplitRecord中金额计算方式

This commit is contained in:
Guoqs
2025-07-25 16:18:11 +08:00
parent 6510b849bc
commit 66eb6a7fbd

View File

@@ -491,10 +491,16 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
orderInfoDetailVO.setRefundAmount(orderBasicInfo.getRefundAmount());
orderInfoDetailVO.setRefundStatus(orderBasicInfo.getRefundStatus());
orderInfoDetailVO.setTotalUsedElectricity(orderDetail.getTotalUsedElectricity());
orderInfoDetailVO.setTotalOrderAmount(orderDetail.getTotalOrderAmount());
orderInfoDetailVO.setTotalElectricityAmount(orderDetail.getTotalElectricityAmount());
// 总订单金额
// orderInfoDetailVO.setTotalOrderAmount(orderDetail.getTotalOrderAmount());
orderInfoDetailVO.setTotalOrderAmount(orderBasicInfo.getSettleAmount()); // 使用订单主表中已经保留两位小数后的结算金额
// 总电费金额
// orderInfoDetailVO.setTotalElectricityAmount(orderDetail.getTotalElectricityAmount());
orderInfoDetailVO.setTotalElectricityAmount(orderDetail.getTotalElectricityAmount().setScale(2, RoundingMode.DOWN));
orderInfoDetailVO.setDiscountElectricityAmount(orderDetail.getDiscountElectricityAmount());
orderInfoDetailVO.setTotalServiceAmount(orderDetail.getTotalServiceAmount());
// 总服务费金额
// orderInfoDetailVO.setTotalServiceAmount(orderDetail.getTotalServiceAmount());
orderInfoDetailVO.setTotalServiceAmount(orderInfoDetailVO.getTotalOrderAmount().subtract(orderDetail.getTotalElectricityAmount()));
orderInfoDetailVO.setDiscountServiceAmount(orderDetail.getDiscountServiceAmount());
orderInfoDetailVO.setSharpPrice(orderDetail.getSharpPrice());
orderInfoDetailVO.setSharpUsedElectricity(orderDetail.getSharpUsedElectricity());