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