用车数据转换

This commit is contained in:
huangxh3 2024-02-28 09:35:24 +08:00
parent 626968a7f0
commit 0654ee094a
5 changed files with 256 additions and 27 deletions

View File

@ -5,6 +5,8 @@ import com.chint.domain.aggregates.user.User;
import com.chint.domain.repository.UserRepository; import com.chint.domain.repository.UserRepository;
import com.chint.domain.value_object.*; import com.chint.domain.value_object.*;
import com.chint.interfaces.rest.ly.dto.hotelorderdatapushbach.Resident; import com.chint.interfaces.rest.ly.dto.hotelorderdatapushbach.Resident;
import com.chint.interfaces.rest.ly.dto.search.response.car.CarDetailResponse;
import com.chint.interfaces.rest.ly.dto.search.response.filght.FlightListResponse;
import com.chint.interfaces.rest.ly.dto.search.response.hotel.HotelDetailResponse; 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.ly.dto.search.response.train.TrainDetailResponse;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -23,7 +25,9 @@ public class LYOrderExtensionFactoryImpl implements OrderExtensionFactory {
@Override @Override
public CarOrderDetail createCarOrderDetail(Object carOrderDetailData) { public CarOrderDetail createCarOrderDetail(Object carOrderDetailData) {
return null; CarDetailResponse carDetailResponse = (CarDetailResponse) carOrderDetailData;
CarOrderDetail carOrderDetail = convertCart(carDetailResponse);
return carOrderDetail;
} }
@Override @Override
@ -66,6 +70,132 @@ public class LYOrderExtensionFactoryImpl implements OrderExtensionFactory {
return null; return null;
} }
private CarOrderDetail convertCart(CarDetailResponse carDetailResponse) {
CarOrderDetail carOrderDetail = new CarOrderDetail();
CarDetailResponse.Data data = carDetailResponse.getData();
// 设置对象的全部属性
carOrderDetail.setOrderNo(data.getOrderSerialNo());
// carOrderDetail.setOverStandard(); //
// carOrderDetail.setParentOrderNo(parentOrderNo); //
// carOrderDetail.setOriginalOrderNo(originalOrderNo); //
carOrderDetail.setOrderStatus(data.getOrderStatus());
// carOrderDetail.setAccountCompanyId(accountCompanyId); //
// carOrderDetail.setAccountCompanyName(accountCompanyName); //
carOrderDetail.setReceiptsNum(data.getTravelData().getTravelApplyNo());
// carOrderDetail.setScheduleNum(scheduleNum); //
carOrderDetail.setBookingUserCode(data.getOutEmployeeId());
// carOrderDetail.setBookingName(bookingName); //
// carOrderDetail.setBookingUserPhone(bookingUserPhone);//
carOrderDetail.setCreateTime(data.getOrder().getCreateTime());
carOrderDetail.setStartTime(data.getOrderExtend().getChargeTime());
carOrderDetail.setArriveTime(data.getOrderExtend().getFinishTime());
carOrderDetail.setFromStationName(data.getOrderExtend().getStartAddress());
carOrderDetail.setToStationName(data.getOrderExtend().getEndAddress());
carOrderDetail.setCarModel(data.getOrderExtend().getCarType());
carOrderDetail.setFromCity(data.getOrderExtend().getStartCityName());
carOrderDetail.setToCity(data.getOrderExtend().getEndCityName());
carOrderDetail.setRunTime(data.getOrderExtend().getDuration());
carOrderDetail.setMileage(data.getOrderExtend().getMileage());
carOrderDetail.setOrderAmount(String.valueOf(data.getTotalAmount()));
// carOrderDetail.setCancellationFee(cancellationFee); //
// carOrderDetail.setStandardItems(standardItems); //
carOrderDetail.setUserName(data.getOrder().getContactName());
carOrderDetail.setUserCode(data.getOrder().getOutEmployeeId());
carOrderDetail.setPhone(data.getOrder().getContactPhone());
// carOrderDetail.setSupplier(supplier); //
carOrderDetail.setPersonalPaymentAmount(String.valueOf(data.getPersonalPrice()));
carOrderDetail.setCompanyPaymentAmount(String.valueOf(data.getCompanyPrice()));
// carOrderDetail.setOverStandardReason(overStandardReason); contactName
// carOrderDetail.setBOOK_ORG_STRUCT_1(BOOK_ORG_STRUCT_1); //
// carOrderDetail.setBOOK_ORG_STRUCT_2(BOOK_ORG_STRUCT_2); //
// carOrderDetail.setBOOK_ORG_STRUCT_3(BOOK_ORG_STRUCT_3); //
// carOrderDetail.setPaymentType(String.valueOf(data.getPaymentType())); //
// carOrderDetail.setProjectOrderNo(projectOrderNo); //
// carOrderDetail.setCostCenter(costCenter); //
// carOrderDetail.setTollFee(tollFee); //
return carOrderDetail;
}
private FlightOrderDetail convertFlight(FlightListResponse flightListResponse) {
FlightOrderDetail flightOrderDetail = new FlightOrderDetail();
FlightListResponse.FlightOrder data = flightListResponse.getData();
// flightOrderDetail.setId(id);
flightOrderDetail.setOrderNo(data.getOriginalOrderNo());
flightOrderDetail.setOverStandard(String.valueOf(data.getRuleViolate()));
flightOrderDetail.setParentOrderNo(data.getParentRefOrderNo());
flightOrderDetail.setOriginalOrderNo(data.getOriginalOrderNo());
flightOrderDetail.setOrderStatus(String.valueOf(data.getOrderStatus()));
// flightOrderDetail.setAccountCompanyId(accountCompanyId);//核算企业id
// flightOrderDetail.setAccountCompanyName(accountCompanyName);//核算企业名称
flightOrderDetail.setReceiptsNum(data.getTravelData().getTravelApplyNo());
flightOrderDetail.setScheduleNum(data.getTravelOrderNo());
flightOrderDetail.setChangedScheduleNum(data.getOriginalOrderNo());
flightOrderDetail.setBookingUserCode(data.getOutEmployeeId());
flightOrderDetail.setBookingName(data.getEmployeeName());
// flightOrderDetail.setBookingUserPhone(data.get); //预订人电话
flightOrderDetail.setCreateTime(data.getBookDate());
// flightOrderDetail.setStartTime(data.getDepar);
/* flightOrderDetail.setArriveTime(arriveTime);
flightOrderDetail.setStartCityName(startCityName);
flightOrderDetail.setStartCityCode(startCityCode);
flightOrderDetail.setStartAirportName(startAirportName);
flightOrderDetail.setStartAirportCode(startAirportCode);
flightOrderDetail.setStartTerminal(startTerminal);
flightOrderDetail.setEndCityName(endCityName);
flightOrderDetail.setEndCityCode(endCityCode);
flightOrderDetail.setEndAirportName(endAirportName);
flightOrderDetail.setEndAirportCode(endAirportCode);
flightOrderDetail.setEndTerminal(endTerminal);
flightOrderDetail.setDistance(distance);
flightOrderDetail.setFlightCompName(flightCompName);
flightOrderDetail.setFlightNum(flightNum);
flightOrderDetail.setSeatPoint(seatPoint);
flightOrderDetail.setSeatPointName(seatPointName);*/
flightOrderDetail.setOrderAmount(String.valueOf(data.getTotalPrice()));
flightOrderDetail.setPreServiceFee(String.valueOf(data.getServicePrice()));
// flightOrderDetail.setPostServiceFee(data.getA);
// flightOrderDetail.setRefundAmount(data.getFlightOrderRefundInfo());
// flightOrderDetail.setTickets(tickets);
/* flightOrderDetail.setFuelTax(data.getFuel);
flightOrderDetail.setAirportTax(airportTax);
flightOrderDetail.setFacePrice(facePrice);
flightOrderDetail.setChangeFee(changeFee);
flightOrderDetail.setRefundFee(refundFee);
flightOrderDetail.setUpFee(upFee);
flightOrderDetail.setStandard(standard);
flightOrderDetail.setTicketNo(ticketNo);
flightOrderDetail.setChangedTicketNo(changedTicketNo);
flightOrderDetail.setUserName(data.getParr);
flightOrderDetail.setUserCode(data.getOutEmployeeId());
flightOrderDetail.setIsOverStandard(isOverStandard);
flightOrderDetail.setPhone(phone);
flightOrderDetail.setPaymentType(paymentType);
flightOrderDetail.setNotBookedLowestPriceReason(notBookedLowestPriceReason);
flightOrderDetail.setSupplier(supplier);
flightOrderDetail.setPersonalPaymentAmount(personalPaymentAmount);
flightOrderDetail.setCompanyPaymentAmount(companyPaymentAmount);
flightOrderDetail.setOverStandardReason(overStandardReason);
flightOrderDetail.setBOOK_ORG_STRUCT_1(BOOK_ORG_STRUCT_1);
flightOrderDetail.setBOOK_ORG_STRUCT_2(BOOK_ORG_STRUCT_2);
flightOrderDetail.setBOOK_ORG_STRUCT_3(BOOK_ORG_STRUCT_3);
flightOrderDetail.setInsuranceFee(insuranceFee);
flightOrderDetail.setProjectOrderNo(projectOrderNo);
flightOrderDetail.setCostCenter(costCenter);
*/
return null;
}
private HotelOrderDetail convertHotel(HotelDetailResponse hotelDetailResponse) { private HotelOrderDetail convertHotel(HotelDetailResponse hotelDetailResponse) {
HotelOrderDetail hotelOrderDetail = new HotelOrderDetail(); HotelOrderDetail hotelOrderDetail = new HotelOrderDetail();
HotelDetailResponse.Data data = hotelDetailResponse.getData(); HotelDetailResponse.Data data = hotelDetailResponse.getData();

View File

@ -36,10 +36,10 @@ public class LYOrderDataAdapter implements OrderDataAdapter {
return Optional.of( return Optional.of(
OrderLegData.builder() OrderLegData.builder()
.productType(LEG_TYPE_TRAIN) .productType(LEG_TYPE_TRAIN)
.outOrderNo(data.getOrderNo()) .outOrderNo(data.getOutOrderNo())
.price(String.valueOf(data.getTotalAmount())) .price(String.valueOf(data.getTotalAmount()))
.actualOrderNo(data.getOutOrderNo()) .actualOrderNo(data.getOutOrderNo())
.trainOrderDetailData(data) .trainOrderDetailData(trainDetailResponse)
.supplierName(SUPPLIER_L_Y) .supplierName(SUPPLIER_L_Y)
.build() .build()
); );
@ -53,7 +53,7 @@ public class LYOrderDataAdapter implements OrderDataAdapter {
.outOrderNo(data.getOrderInfo().getOrderSerialNo()) .outOrderNo(data.getOrderInfo().getOrderSerialNo())
.price(String.valueOf(data.getOrderInfo().getTotalPrice())) .price(String.valueOf(data.getOrderInfo().getTotalPrice()))
.actualOrderNo(data.getOrderInfo().getOrderSerialNo()) .actualOrderNo(data.getOrderInfo().getOrderSerialNo())
.hotelOrderDetailData(data) .hotelOrderDetailData(hotelDetailResponse)
.supplierName(SUPPLIER_L_Y) .supplierName(SUPPLIER_L_Y)
.build() .build()
); );
@ -64,10 +64,10 @@ public class LYOrderDataAdapter implements OrderDataAdapter {
return Optional.of( return Optional.of(
OrderLegData.builder() OrderLegData.builder()
.productType(LEG_TYPE_TAXI) .productType(LEG_TYPE_TAXI)
.outOrderNo(data.getOrderNo()) .outOrderNo(data.getOrderSerialNo())
.price(String.valueOf(data.getTotalAmount())) .price(String.valueOf(data.getTotalAmount()))
.actualOrderNo(data.getOutOrderNo()) .actualOrderNo(data.getOutOrderNo())
.carOrderDetailData(data) .carOrderDetailData(carDetailResponse)
.supplierName(SUPPLIER_L_Y) .supplierName(SUPPLIER_L_Y)
.build() .build()
); );
@ -82,7 +82,7 @@ public class LYOrderDataAdapter implements OrderDataAdapter {
// .orderNo(data.get()) // .orderNo(data.get())
// .price(String.valueOf( data.getTotalAmount())) // .price(String.valueOf( data.getTotalAmount()))
// .actualOrderNo(data.getOutOrderNo()) // .actualOrderNo(data.getOutOrderNo())
.flightOrderDetailData(data) .flightOrderDetailData(flightOrderDetail)
.supplierName(SUPPLIER_L_Y) .supplierName(SUPPLIER_L_Y)
.build() .build()
); );

View File

@ -1,8 +1,10 @@
package com.chint.interfaces.rest.ly.dto.search.response.car; 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.LYBaseResponse;
import com.chint.interfaces.rest.ly.dto.carorderdatapushback.PriceDetail;
import lombok.Data; import lombok.Data;
import java.math.BigDecimal;
import java.util.List; import java.util.List;
@Data @Data
@ -14,7 +16,7 @@ public class CarDetailResponse extends LYBaseResponse {
public static class Data { public static class Data {
private String outEmployeeId; private String outEmployeeId;
private String employeeCode; private String employeeCode;
private String orderNo; private String orderSerialNo;
private String parentOrderSerialNo; private String parentOrderSerialNo;
private int isChangedOrder; private int isChangedOrder;
private String outOrderNo; private String outOrderNo;
@ -46,6 +48,8 @@ public class CarDetailResponse extends LYBaseResponse {
private GarbInfo garbInfo; private GarbInfo garbInfo;
private double totalAmount; private double totalAmount;
private TravelData travelData; private TravelData travelData;
private Order order;
private OrderExtend orderExtend;
private int bookingMethod; private int bookingMethod;
private int paymentType; private int paymentType;
private double personalPrice; private double personalPrice;
@ -57,6 +61,39 @@ public class CarDetailResponse extends LYBaseResponse {
private String relationOrderNo; private String relationOrderNo;
} }
@lombok.Data
public static class OrderExtend {
private Integer serviceType;
private String serviceTypeDesc;
private String departureTime;
private String startCityName;
private String endCityName;
private String carType;
private String carTypeName;
private String startAddress;
private double startLatitude;
private double startLongitude;
private String endAddress;
private double endLatitude;
private double endLongitude;
private Integer passengerCount;
private String chargeTime;
private String finishTime;
private String duration;
private String mileage;
private String flightNo;
private String departAirportCode;
private String arriveAirportCode;
private String departAirportName;
private String arriveAirportName;
private String flightDate;
private String flightArriveTime;
private String departTerminal;
private String arriveTerminal;
private String serviceName;
}
@lombok.Data @lombok.Data
public static class Item { public static class Item {
private int itemId; private int itemId;
@ -139,6 +176,28 @@ public class CarDetailResponse extends LYBaseResponse {
private double companyPrice; private double companyPrice;
} }
@lombok.Data
public static class Order {
private String orderSerialNo;
private String productName;
private String policyRuleName;
private Integer orderStatus;
private String orderStatusDesc;
private BigDecimal totalPrice;
private String createTime;
private BigDecimal servicePrice;
private String contactName;
private String contactPhone;
private boolean isEstimate;
private List<PriceDetail> priceDetailList;
private String outEmployeeId;
private String outEnterpriseId;
private BigDecimal diffPrice;
private Integer carPurposeId;
private String subjectMatter;
private String subjectRemark;
}
@lombok.Data @lombok.Data
public static class ContactInfo { public static class ContactInfo {
private String personName; private String personName;

View File

@ -1,29 +1,69 @@
package com.chint.interfaces.rest.ly.dto.search.response.filght; package com.chint.interfaces.rest.ly.dto.search.response.filght;
import com.chint.interfaces.rest.ly.dto.LYBaseResponse; import com.chint.interfaces.rest.ly.dto.LYBaseResponse;
import com.chint.interfaces.rest.ly.dto.flydatapushback.*;
import lombok.Data; import lombok.Data;
import java.math.BigDecimal;
import java.util.List; import java.util.List;
@Data @Data
public class FlightListResponse extends LYBaseResponse { public class FlightListResponse extends LYBaseResponse {
private List<FlightOrder> data; private FlightOrder data;
@Data
private static class FlightOrder {
private String orderSerialNo; // 机票订单号
private String originalOrderNo; // 原订单号(祖先单)
private String parentOrderSerialNo; // 父订单号
private Integer orderType; // 订单类型 0.国际 1.国内
private String travelApplyNo; // 外部出差申请单号
private Integer travelType; // 差旅类型 1.因公 2.因私
private Integer payType; // 支付方式 1.公司授信 2.个人支付 3.组合支付
private String outEmployeeId; // 外部员工ID
private Double totalPrice; // 订单总价
private Integer orderStatus; // 订单状态
private String orderStatusText; // 订单状态文案
private Boolean isChangeOrder; // 是否改签单
private Boolean isRefundOrder; // 是否退票单
private String bookDate; // 预订时间
}
@lombok.Data
public static class FlightOrder {
private String orderSerialNo;
private String refOrderNo;
private String parentRefOrderNo;
private String originalOrderNo;
private String parentOrderSerialNo;
private String outEmployeeId;
private String outEnterpriseId;
private String relationId;
private Integer orderStatus;
private String orderStatusText;
private String ticketOutLimitTime;
private Integer payStatus;
private List<Contact> contact;
private double totalPrice;
private double servicePrice;
private String pnr;
private String fullPnrNo;
private String memberId;
private String reason;
private Integer travelType;
private String travelOrderNo;
private Integer orderType;
private Integer voyageType;
private String ticketTime;
private Integer payType;
private String bookDate;
private String payTime;
private Boolean isChangeOrder;
private Boolean isRefundOrder;
private Object flightOrderRefundInfo;
private Object protrotolId;
private Object changeInfo;
private String apiNotifyUrl;
private Integer platId;
private Integer refId;
private Boolean ruleViolate;
private RuleViolateDetail ruleViolateDetail;
private TravelData travelData;
private List<Passenger> passengerList;
private List<FlightSegment> flightSegmentList;
private String foulReason;
private String foulReasonCode;
private String foulReasonNote;
private BigDecimal flightMinimumPrice;
private String remarks1;
private String employeeName;
private String updateDate;
private Integer isNeedTransfer;
private boolean gpAgreement;
private boolean priceChanged;
private Integer priceChangeType;
private boolean issueType;
}
} }

View File

@ -39,7 +39,7 @@ public class CarBackController {
if (orderSerialNo != null) { if (orderSerialNo != null) {
CarDetailResponse carDetailResponse = lySearchRequest.getCarDetailResponse(orderSerialNo); CarDetailResponse carDetailResponse = lySearchRequest.getCarDetailResponse(orderSerialNo);
String outEmployeeId = carDetailResponse.getData().getOutEmployeeId(); //外部员工id String outEmployeeId = carDetailResponse.getData().getOutEmployeeId(); //外部员工id
String serialNo = carDetailResponse.getData().getOrderNo();//订单号 String serialNo = carDetailResponse.getData().getOrderSerialNo();//订单号
SupplierCallbackData supplierCallbackData = SupplierCallbackData supplierCallbackData =
SupplierCallbackData.of(SupplierNameConstant.SUPPLIER_L_Y, outEmployeeId); SupplierCallbackData.of(SupplierNameConstant.SUPPLIER_L_Y, outEmployeeId);
supplierCallbackData.data(carDetailResponse); supplierCallbackData.data(carDetailResponse);