update 更新数据接口

This commit is contained in:
2023-04-18 15:58:55 +08:00
parent 1ea8a90938
commit 05988af02f

View File

@@ -408,16 +408,29 @@ public class OrderService {
orderBasicInfo.setAppointmentTime(DateUtils.parseDate(dto.getAppointmentTime(), DateUtils.YYYY_MM_DD_HH_MM_SS)); orderBasicInfo.setAppointmentTime(DateUtils.parseDate(dto.getAppointmentTime(), DateUtils.YYYY_MM_DD_HH_MM_SS));
} }
// 订单详情 // 订单详情
BillingTemplateVO billingTemplate = dto.getBillingTemplate();
BigDecimal sharpElectricityPrice = billingTemplate.getSharpElectricityPrice() != null ? billingTemplate.getSharpElectricityPrice() : BigDecimal.ZERO;
BigDecimal sharpServicePrice = billingTemplate.getSharpServicePrice() != null ? billingTemplate.getSharpServicePrice() : BigDecimal.ZERO;
BigDecimal peakElectricityPrice = billingTemplate.getPeakElectricityPrice() != null ? billingTemplate.getPeakElectricityPrice() : BigDecimal.ZERO;
BigDecimal peakServicePrice = billingTemplate.getPeakServicePrice() != null ? billingTemplate.getPeakServicePrice() : BigDecimal.ZERO;
BigDecimal flatElectricityPrice = billingTemplate.getFlatElectricityPrice() != null ? billingTemplate.getFlatElectricityPrice() : BigDecimal.ZERO;
BigDecimal flatServicePrice = billingTemplate.getFlatServicePrice() != null ? billingTemplate.getFlatServicePrice() : BigDecimal.ZERO;
BigDecimal valleyElectricityPrice = billingTemplate.getValleyElectricityPrice() != null ? billingTemplate.getValleyElectricityPrice() : BigDecimal.ZERO;
BigDecimal valleyServicePrice = billingTemplate.getValleyServicePrice() != null ? billingTemplate.getValleyServicePrice() : BigDecimal.ZERO;
OrderDetail orderDetail = OrderDetail.builder() OrderDetail orderDetail = OrderDetail.builder()
.orderCode(orderCode) .orderCode(orderCode)
.sharpElectricityPrice(dto.getBillingTemplate().getSharpElectricityPrice()) .sharpPrice(sharpElectricityPrice.add(sharpServicePrice))
.sharpServicePrice(dto.getBillingTemplate().getSharpServicePrice()) .sharpElectricityPrice(sharpElectricityPrice)
.peakElectricityPrice(dto.getBillingTemplate().getPeakElectricityPrice()) .sharpServicePrice(sharpServicePrice)
.peakServicePrice(dto.getBillingTemplate().getPeakServicePrice()) .peakPrice(peakElectricityPrice.add(peakServicePrice))
.flatElectricityPrice(dto.getBillingTemplate().getFlatElectricityPrice()) .peakElectricityPrice(peakElectricityPrice)
.flatServicePrice(dto.getBillingTemplate().getFlatServicePrice()) .peakServicePrice(peakServicePrice)
.valleyElectricityPrice(dto.getBillingTemplate().getValleyElectricityPrice()) .flatPrice(flatElectricityPrice.add(flatServicePrice))
.valleyServicePrice(dto.getBillingTemplate().getValleyServicePrice()) .flatElectricityPrice(flatElectricityPrice)
.flatServicePrice(flatServicePrice)
.valleyPrice(valleyElectricityPrice.add(valleyServicePrice))
.valleyElectricityPrice(valleyElectricityPrice)
.valleyServicePrice(valleyServicePrice)
.build(); .build();
OrderTransactionDTO createOrderTransactionDTO = OrderTransactionDTO.builder() OrderTransactionDTO createOrderTransactionDTO = OrderTransactionDTO.builder()