1.退票酒店数据添加

This commit is contained in:
wanglf3 2024-03-14 21:33:13 +08:00
parent 9accec66ba
commit 3b19067f42
4 changed files with 41 additions and 2 deletions

View File

@ -27,6 +27,8 @@ import com.chint.interfaces.rest.ctrip.dto.search.SearchOrderResponse;
import com.chint.interfaces.rest.ctrip.dto.search.flight.ChangeInfo;
import com.chint.interfaces.rest.ctrip.dto.search.flight.FlightOrderInfoEntity;
import com.chint.interfaces.rest.ctrip.dto.search.flight.FlightRefundInfo;
import com.chint.interfaces.rest.ctrip.dto.search.hotel.HotelOrderInfoEntity;
import com.chint.interfaces.rest.ctrip.dto.search.hotel.RefundInfo;
import com.chint.interfaces.rest.ly.LYSearchRequest;
import com.chint.interfaces.rest.ly.dto.search.response.filght.FlightOrderResponse;
import com.chint.interfaces.rest.ly.dto.search.response.train.TrainDetailResponse;
@ -214,7 +216,9 @@ public class OrderDomainService {
generateRefundAndChangeOrder(orderDetail.getOrderNo());
}
if (!orderEventType.equals(ORDER_EVENT_ETA) && orderDetail.getProductType().equals(LEG_TYPE_HOTEL)) {
generateHotelRefundAndChangeOrder(orderDetail.getOrderNo());
}
}
}
@ -431,4 +435,23 @@ public class OrderDomainService {
}
}
}
private void generateHotelRefundAndChangeOrder(String orderNo) {
SearchOrderResponse response = cTripOrderSearchRequest.searchOrderResponseByOrderId(orderNo);
HotelOrderInfoEntity flightOrderInfoEntity = response.getItineraryList().get(0).getHotelOrderInfoList().get(0);
List<RefundInfo> refundInfo = flightOrderInfoEntity.getRefundInfo();
if (refundInfo != null && !refundInfo.isEmpty()) {
for (RefundInfo flightRefundInfo : refundInfo) {
if (flightOrderInfoEntity.getOrderDetailStatus().equals("Cancelled")) {
Command.of(CTripOrderRefundCommand.class).Info(String.valueOf(flightRefundInfo.getRefundInfoID()),
flightOrderInfoEntity.getOrderID(),
"-" + flightRefundInfo.getRefundCustomerAmount(),
"4",
flightOrderInfoEntity.getCancelTime()).sendToQueue();
}
}
}
}
}

View File

@ -77,4 +77,6 @@ public class HotelOrderInfoEntity {
// 后续字段含义类似可根据实际情况添加注释
private List<ClientInfo> ClientInfo; // 客户信息列表
private List<RefundInfo> RefundInfo; // 客户信息列表
}

View File

@ -0,0 +1,14 @@
package com.chint.interfaces.rest.ctrip.dto.search.hotel;
import lombok.Data;
@Data
public class RefundInfo {
private long RefundInfoID;
private int RefundCustomerAmount;
private String Currency;
private int ExchangeRate;
// private List<RefundPayment> RefundPaymentList;
// private List<RefundDetail> RefundDetailList;
private Long ModifyFormId;
}

View File

@ -201,7 +201,7 @@ public class CTripTest {
System.out.println(gson.toJson(estimate));
}
@Test
// @Test
void search() {
BaseContext.setCurrentUser(user);
SearchOrderResponse response = orderSearchRequest.searchOrderResponseByOrderId("29882203254");