修复携程酒店订单价格取值问题
This commit is contained in:
parent
d88eced6a8
commit
f645cebd44
|
@ -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<HotelOrderInfoEntity.PaymentItem> 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<HotelOrderInfoEntity.PaymentItem> 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());
|
||||
|
|
|
@ -92,17 +92,17 @@ public class HotelOrderInfoEntity {
|
|||
|
||||
@Data
|
||||
public static class PaymentInfoEntity {
|
||||
private List<PaymentItem> paymentItemList;
|
||||
private Double originalTotalAmountExclude;
|
||||
private List<PaymentItem> 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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -350,9 +350,9 @@ class RouteApplicationTests {
|
|||
routeRepository.deleteById(875L);
|
||||
}
|
||||
|
||||
// @Test
|
||||
@Test
|
||||
void deleteOrderDetail() {
|
||||
orderDetailRepository.deleteById(2609L);
|
||||
orderDetailRepository.deleteById(3050L);
|
||||
}
|
||||
|
||||
// @Test
|
||||
|
|
Loading…
Reference in New Issue