增加同程的用车和酒店退款订单生成代码

This commit is contained in:
lulz1 2024-03-17 09:56:01 +08:00
parent 1860392c2e
commit 72bb23c525
3 changed files with 86 additions and 14 deletions

View File

@ -32,7 +32,9 @@ import com.chint.interfaces.rest.ctrip.dto.search.flight.*;
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.car.CarDetailResponse;
import com.chint.interfaces.rest.ly.dto.search.response.filght.FlightOrderResponse;
import com.chint.interfaces.rest.ly.dto.search.response.hotel.HotelDetailResponse;
import com.chint.interfaces.rest.ly.dto.search.response.train.TrainDetailResponse;
import com.chint.interfaces.rest.user.UserHttpRequest;
import jakarta.annotation.PostConstruct;
@ -216,14 +218,13 @@ public class OrderDomainService {
if (orderDetail.getSupplierName().equals(SUPPLIER_C_TRIP)) {
if (!orderEventType.equals(ORDER_EVENT_ETA) && orderDetail.getProductType().equals(LEG_TYPE_AIRPLANE)) {
generateRefundAndChangeOrder(orderDetail.getOrderNo());
cTripFlightRefundAndChangeOrder(orderDetail.getOrderNo());
}
if (!orderEventType.equals(ORDER_EVENT_ETA) && orderDetail.getProductType().equals(LEG_TYPE_HOTEL)) {
generateHotelRefundAndChangeOrder(orderDetail.getOrderNo());
cTripHotelRefundAndChangeOrder(orderDetail.getOrderNo());
}
if (!orderEventType.equals(ORDER_EVENT_ETA) && orderDetail.getProductType().equals(LEG_TYPE_TAXI)) {
carRefundChangeOrder(orderDetail.getOrderNo());
cTripCarRefundChangeOrder(orderDetail.getOrderNo());
}
}
@ -231,6 +232,12 @@ public class OrderDomainService {
if (!orderEventType.equals(ORDER_EVENT_ETA) && orderDetail.getProductType().equals(LEG_TYPE_TRAIN)){
lyTrainRefundGenerate(orderDetail.getOrderNo());
}
if(!orderEventType.equals(ORDER_EVENT_ETA) && orderDetail.getProductType().equals(LEG_TYPE_HOTEL)){
lyHotelRefundGenerate(orderDetail.getOrderNo());
}
if(!orderEventType.equals(ORDER_EVENT_ETA) && orderDetail.getProductType().equals(LEG_TYPE_TAXI)){
lyCarRefundGenerate(orderDetail.getOrderNo());
}
}
}
}
@ -438,7 +445,7 @@ public class OrderDomainService {
return false;
}
private void generateRefundAndChangeOrder(String orderNo) {
private void cTripFlightRefundAndChangeOrder(String orderNo) {
SearchOrderResponse response = cTripOrderSearchRequest.searchOrderResponseByOrderId(orderNo);
FlightOrderInfoEntity flightOrderInfoEntity = response.getItineraryList().get(0).getFlightOrderInfoList().get(0);
@ -451,7 +458,7 @@ public class OrderDomainService {
String.valueOf(flightRefundInfo.getRefundOrderID()),
flightOrderInfoEntity.getBasicInfo().getOrderID(),
"-" + flightRefundInfo.getPayCustomerAmount(),
"4",
"3",
flightRefundInfo.getRefundAplyTime()
).sendToQueue();
}
@ -478,7 +485,7 @@ public class OrderDomainService {
String.valueOf(info.getRebookId()),
flightOrderInfoEntity.getBasicInfo().getOrderID(),
String.valueOf(info.getCFee()),
"3",
"2",
info.getRebookedTime()
).sendToQueue();
}
@ -486,7 +493,7 @@ public class OrderDomainService {
}
}
private void generateHotelRefundAndChangeOrder(String orderNo) {
private void cTripHotelRefundAndChangeOrder(String orderNo) {
SearchOrderResponse response = cTripOrderSearchRequest.searchOrderResponseByOrderId(orderNo);
HotelOrderInfoEntity flightOrderInfoEntity = response.getItineraryList().get(0).getHotelOrderInfoList().get(0);
List<RefundInfo> refundInfo = flightOrderInfoEntity.getRefundInfo();
@ -504,7 +511,7 @@ public class OrderDomainService {
}
public void carRefundChangeOrder(String orderNo) {
public void cTripCarRefundChangeOrder(String orderNo) {
SearchOrderResponse searchOrderResponse = cTripOrderSearchRequest.searchOrderResponseByOrderId(orderNo);
List<ItineraryEntity> itineraryList = searchOrderResponse.getItineraryList();
List<CarQuickOrderInfoEntity> carQuickOrderInfoList = itineraryList.get(0).getCarQuickOrderInfoList();
@ -541,4 +548,53 @@ public class OrderDomainService {
).sendToQueue();
}
}
private void lyFlightRefundGenerate(String orderNo){
FlightOrderResponse flightOrderDetail = lySearchRequest.getFlightOrderDetail(orderNo);
}
private void lyHotelRefundGenerate(String orderNo){
HotelDetailResponse hotelOrderDetail = lySearchRequest.getHotelOrderDetail(orderNo);
if(hotelOrderDetail == null){
return;
}
HotelDetailResponse.Data data = hotelOrderDetail.getData();
if(data != null && data.getRefundInfoList() != null && !data.getRefundInfoList().isEmpty()){
List<com.chint.interfaces.rest.ly.dto.hotelorderdatapushbach.RefundInfo> refundInfoList = data.getRefundInfoList();
for (com.chint.interfaces.rest.ly.dto.hotelorderdatapushbach.RefundInfo refundInfo : refundInfoList) {
Command.of(RefundOrderGenerateCommand.class).Info(
refundInfo.getRefundTime().replace(" ", "")
.replace("-", "")
.replace(":", ""),
data.getOrderInfo().getOrderSerialNo(),
"-" + refundInfo.getRefundPrice(),
"3",
refundInfo.getRefundTime()
).sendToQueue();
}
}
}
private void lyCarRefundGenerate(String orderNo){
CarDetailResponse carDetailResponse = lySearchRequest.getCarDetailResponse(orderNo);
if(carDetailResponse == null){
return;
}
CarDetailResponse.DataWrapper data = carDetailResponse.getData();
if (data!= null) {
if(data.getPriceVarList() != null && !data.getPriceVarList().isEmpty()){
for (CarDetailResponse.CarPriceVar carPriceVar : data.getPriceVarList()) {
Command.of(RefundOrderGenerateCommand.class).Info(
carPriceVar.getPriceVarNo(),
data.getCarOrderDetailInfo().getOrderSerialNo(),
carPriceVar.getTotalPriceVar(),
"3",
carPriceVar.getPriceVarTime()
).sendToQueue();
}
}
}
}
}

View File

@ -1,10 +1,8 @@
package com.chint.interfaces.rest.ly.dto.search.response.car;
import com.chint.interfaces.rest.ly.dto.LYBaseResponse;
import com.chint.interfaces.rest.ly.dto.carorderdatapushback.PriceDetail;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
@Data
@ -19,10 +17,11 @@ public class CarDetailResponse extends LYBaseResponse {
private OrderExtendInfo orderExtendInfo;
private OrderDriverInfo orderDriverInfo;
private TravelDataInfo travelDataInfo;
private List<Object> priceVarList;
private List<CarPriceVar> priceVarList;
// Getter and Setter methods
}
@Data
public static class CarOrderDetailInfo {
private String orderSerialNo;
@ -50,6 +49,7 @@ public class CarDetailResponse extends LYBaseResponse {
// Getter and Setter methods
}
@Data
public static class OrderExtendInfo {
private int serviceType;
@ -86,6 +86,7 @@ public class CarDetailResponse extends LYBaseResponse {
// Getter and Setter methods
}
@Data
public static class OrderDriverInfo {
private String driverAvatar;
@ -101,6 +102,7 @@ public class CarDetailResponse extends LYBaseResponse {
// Getter and Setter methods
}
@Data
public static class TravelDataInfo {
private String oaNo;
@ -110,6 +112,7 @@ public class CarDetailResponse extends LYBaseResponse {
// Getter and Setter methods
}
@Data
public static class SubmitItem {
private String itemCode;
@ -120,4 +123,17 @@ public class CarDetailResponse extends LYBaseResponse {
// Getter and Setter methods
}
@Data
public static class CarPriceVar {
private String priceVarNo;
private String totalPriceVar;
private String payType;
private String priceVarType;
private String diffReson;
private String priceVarTime;
private String servicePriceVar;
private String companyPriceVar;
private String personalPriceVar;
}
}

View File

@ -33,7 +33,7 @@ public class LYOrderUtil {
case "0" -> ORDER_EVENT_ORDERED; //待审批
case "3" -> ORDER_EVENT_ORDERED; //待提交
case "4" -> ORDER_EVENT_ORDERED; //占座中
case "22" -> ORDER_EVENT_PREPARE; //出票失败
case "22" -> ORDER_EVENT_CANCEL; //出票失败
case "40" -> ORDER_EVENT_PREPARE; //退票待审批
case "41" -> ORDER_EVENT_PREPARE; //退票待确认
case "42" -> ORDER_EVENT_ORDERED; //退票中
@ -44,7 +44,7 @@ public class LYOrderUtil {
case "63" -> ORDER_EVENT_CHANGE; //改签成功
case "64" -> ORDER_EVENT_CHANGE; //部分改签
case "66" -> ORDER_EVENT_ORDERED; //取消改签
case "67" -> ORDER_EVENT_ORDERED; //改签失败
case "67" -> ORDER_EVENT_CANCEL; //改签失败
case "68" -> ORDER_EVENT_ORDERED; //改签审批不通过
case "92" -> ORDER_EVENT_ORDERED; //待确认
case "93" -> ORDER_EVENT_CHANGE; //改签中