修复携程酒店订单价格取值问题

This commit is contained in:
lulz1 2024-05-14 16:24:22 +08:00
parent d88eced6a8
commit f645cebd44
3 changed files with 20 additions and 20 deletions

View File

@ -485,22 +485,22 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory {
hotelOrderDetail.setRoomCount(hotelOrderInfoEntity.getRoomQuantity()); //退订夜间数 hotelOrderDetail.setRoomCount(hotelOrderInfoEntity.getRoomQuantity()); //退订夜间数
hotelOrderDetail.setRoomTypeName(hotelOrderInfoEntity.getRoomName()); //房型 hotelOrderDetail.setRoomTypeName(hotelOrderInfoEntity.getRoomName()); //房型
if (Double.parseDouble(hotelOrderInfoEntity.getAmount()) > 0) {
HotelOrderInfoEntity.PaymentInfoEntity paymentInfo = hotelOrderInfoEntity.getPaymentInfo(); HotelOrderInfoEntity.PaymentInfoEntity paymentInfo = hotelOrderInfoEntity.getPaymentInfo();
if (paymentInfo != null && paymentInfo.getPaymentItemList() != null && !paymentInfo.getPaymentItemList().isEmpty()) { if (paymentInfo != null && paymentInfo.getPaymentItemList() != null && !paymentInfo.getPaymentItemList().isEmpty()) {
List<HotelOrderInfoEntity.PaymentItem> paymentItemList = paymentInfo.getPaymentItemList(); List<HotelOrderInfoEntity.PaymentItem> paymentItemList = paymentInfo.getPaymentItemList();
if (hotelOrderDetail.getOrderAmount() == null || hotelOrderDetail.getOrderAmount().isEmpty()) { if (hotelOrderDetail.getOrderAmount() == null || hotelOrderDetail.getOrderAmount().isEmpty()) {
hotelOrderDetail.setOrderAmount(KEEP_TWO_DECIMAL_ZERO); hotelOrderDetail.setOrderAmount(KEEP_TWO_DECIMAL_ZERO);
} }
for (HotelOrderInfoEntity.PaymentItem paymentItem : paymentItemList) { for (HotelOrderInfoEntity.PaymentItem paymentItem : paymentItemList) {
hotelOrderDetail.setOrderAmount(BigDecimalCalculator.add(hotelOrderDetail.getOrderAmount(), hotelOrderDetail.setOrderAmount(BigDecimalCalculator.add(hotelOrderDetail.getOrderAmount(),
String.valueOf(paymentItem.getAmount()))); String.valueOf(paymentItem.getAmount())));
}
} }
} else { } else {
hotelOrderDetail.setOrderAmount(KEEP_TWO_DECIMAL_ZERO); hotelOrderDetail.setOrderAmount(KEEP_TWO_DECIMAL_ZERO);
} }
hotelOrderDetail.setPreServiceFee(hotelOrderInfoEntity.getFrontendServiceFee()); hotelOrderDetail.setPreServiceFee(hotelOrderInfoEntity.getFrontendServiceFee());
hotelOrderDetail.setPostServiceFee(hotelOrderInfoEntity.getAfterServiceFee()); hotelOrderDetail.setPostServiceFee(hotelOrderInfoEntity.getAfterServiceFee());
hotelOrderDetail.setStandardItems(hotelOrderInfoEntity.getTPMaxPrice()); hotelOrderDetail.setStandardItems(hotelOrderInfoEntity.getTPMaxPrice());

View File

@ -92,17 +92,17 @@ public class HotelOrderInfoEntity {
@Data @Data
public static class PaymentInfoEntity { public static class PaymentInfoEntity {
private List<PaymentItem> paymentItemList; private List<PaymentItem> PaymentItemList;
private Double originalTotalAmountExclude; private Double OriginalTotalAmountExclude;
} }
@Data @Data
public static class PaymentItem { public static class PaymentItem {
private String prePayType; private String PrePayType;
private String paymentStatus; private String PaymentStatus;
private String currency; private String Currency;
private Double exchange; private Double Exchange;
private Double amount; private Double Amount;
} }
} }

View File

@ -350,9 +350,9 @@ class RouteApplicationTests {
routeRepository.deleteById(875L); routeRepository.deleteById(875L);
} }
// @Test @Test
void deleteOrderDetail() { void deleteOrderDetail() {
orderDetailRepository.deleteById(2609L); orderDetailRepository.deleteById(3050L);
} }
// @Test // @Test