From f645cebd44de61acc187d5ea6ca3456ed11fc61f Mon Sep 17 00:00:00 2001 From: lulz1 Date: Tue, 14 May 2024 16:24:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=90=BA=E7=A8=8B=E9=85=92?= =?UTF-8?q?=E5=BA=97=E8=AE=A2=E5=8D=95=E4=BB=B7=E6=A0=BC=E5=8F=96=E5=80=BC?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CTripOrderExtensionFactoryImpl.java | 22 +++++++++---------- .../search/hotel/HotelOrderInfoEntity.java | 14 ++++++------ .../java/com/chint/RouteApplicationTests.java | 4 ++-- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/main/java/com/chint/domain/factoriy/order_detail/CTripOrderExtensionFactoryImpl.java b/src/main/java/com/chint/domain/factoriy/order_detail/CTripOrderExtensionFactoryImpl.java index cf03b85d..937243b0 100644 --- a/src/main/java/com/chint/domain/factoriy/order_detail/CTripOrderExtensionFactoryImpl.java +++ b/src/main/java/com/chint/domain/factoriy/order_detail/CTripOrderExtensionFactoryImpl.java @@ -485,22 +485,22 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory { hotelOrderDetail.setRoomCount(hotelOrderInfoEntity.getRoomQuantity()); //退订夜间数 hotelOrderDetail.setRoomTypeName(hotelOrderInfoEntity.getRoomName()); //房型 - if (Double.parseDouble(hotelOrderInfoEntity.getAmount()) > 0) { - HotelOrderInfoEntity.PaymentInfoEntity paymentInfo = hotelOrderInfoEntity.getPaymentInfo(); - if (paymentInfo != null && paymentInfo.getPaymentItemList() != null && !paymentInfo.getPaymentItemList().isEmpty()) { - List paymentItemList = paymentInfo.getPaymentItemList(); - if (hotelOrderDetail.getOrderAmount() == null || hotelOrderDetail.getOrderAmount().isEmpty()) { - hotelOrderDetail.setOrderAmount(KEEP_TWO_DECIMAL_ZERO); - } - for (HotelOrderInfoEntity.PaymentItem paymentItem : paymentItemList) { - hotelOrderDetail.setOrderAmount(BigDecimalCalculator.add(hotelOrderDetail.getOrderAmount(), - String.valueOf(paymentItem.getAmount()))); - } + + HotelOrderInfoEntity.PaymentInfoEntity paymentInfo = hotelOrderInfoEntity.getPaymentInfo(); + if (paymentInfo != null && paymentInfo.getPaymentItemList() != null && !paymentInfo.getPaymentItemList().isEmpty()) { + List paymentItemList = paymentInfo.getPaymentItemList(); + if (hotelOrderDetail.getOrderAmount() == null || hotelOrderDetail.getOrderAmount().isEmpty()) { + hotelOrderDetail.setOrderAmount(KEEP_TWO_DECIMAL_ZERO); + } + for (HotelOrderInfoEntity.PaymentItem paymentItem : paymentItemList) { + hotelOrderDetail.setOrderAmount(BigDecimalCalculator.add(hotelOrderDetail.getOrderAmount(), + String.valueOf(paymentItem.getAmount()))); } } else { hotelOrderDetail.setOrderAmount(KEEP_TWO_DECIMAL_ZERO); } + hotelOrderDetail.setPreServiceFee(hotelOrderInfoEntity.getFrontendServiceFee()); hotelOrderDetail.setPostServiceFee(hotelOrderInfoEntity.getAfterServiceFee()); hotelOrderDetail.setStandardItems(hotelOrderInfoEntity.getTPMaxPrice()); diff --git a/src/main/java/com/chint/interfaces/rest/ctrip/dto/search/hotel/HotelOrderInfoEntity.java b/src/main/java/com/chint/interfaces/rest/ctrip/dto/search/hotel/HotelOrderInfoEntity.java index 15d60444..fc6fa0c7 100644 --- a/src/main/java/com/chint/interfaces/rest/ctrip/dto/search/hotel/HotelOrderInfoEntity.java +++ b/src/main/java/com/chint/interfaces/rest/ctrip/dto/search/hotel/HotelOrderInfoEntity.java @@ -92,17 +92,17 @@ public class HotelOrderInfoEntity { @Data public static class PaymentInfoEntity { - private List paymentItemList; - private Double originalTotalAmountExclude; + private List PaymentItemList; + private Double OriginalTotalAmountExclude; } @Data public static class PaymentItem { - private String prePayType; - private String paymentStatus; - private String currency; - private Double exchange; - private Double amount; + private String PrePayType; + private String PaymentStatus; + private String Currency; + private Double Exchange; + private Double Amount; } } diff --git a/src/test/java/com/chint/RouteApplicationTests.java b/src/test/java/com/chint/RouteApplicationTests.java index c580151c..3c8369fb 100644 --- a/src/test/java/com/chint/RouteApplicationTests.java +++ b/src/test/java/com/chint/RouteApplicationTests.java @@ -350,9 +350,9 @@ class RouteApplicationTests { routeRepository.deleteById(875L); } -// @Test + @Test void deleteOrderDetail() { - orderDetailRepository.deleteById(2609L); + orderDetailRepository.deleteById(3050L); } // @Test