1.携程打车数据详细字段对接

This commit is contained in:
wanglf3 2024-03-14 08:49:34 +08:00
parent 019513cb09
commit a71db7ff4a
3 changed files with 70 additions and 82 deletions

View File

@ -45,18 +45,12 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory {
CarQuickOrderInfoEntity carQuickOrderInfoEntity = (CarQuickOrderInfoEntity) carOrderDetailData;
CarOrderDetail carOrderDetail = new CarOrderDetail();
// CarOrderInfoEntity carOrderInfoEntity = (CarOrderInfoEntity) carOrderDetailData;
// CarBasicInfo carBasicInfo = carOrderInfoEntity.getBasicInfo();
CarBasicInfo carBasicInfo = carQuickOrderInfoEntity.getBasicInfo();
String orderNo = carBasicInfo.getOrderId();
String journeyNo = carBasicInfo.getOrderId();
String journeyNo = carBasicInfo.getJourneyID();
RouteOrder routeOrder = routeRepository.findByOrderNo(journeyNo);
String sysCode = routeOrder.getApproveOrderNo().getSysCode();
Optional<OrderDetail> first = routeOrder
.getOrderDetails()
.stream()
.filter(orderDetail -> orderDetail.getOrderNo().equals(orderNo))
.findFirst();
Optional<OrderDetail> first = routeOrder.getOrderDetails().stream().filter(orderDetail -> orderDetail.getOrderNo().equals(orderNo)).findFirst();
carOrderDetail.setTrvaleSysType(TRAVAL_SYS_TYPE_CTRIP);
if (sysCode != null) {
@ -78,72 +72,75 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory {
carOrderDetail.setDetailId(orderNo);
first.ifPresent(orderDetail -> {
OrderEvent lastEvent = orderDetail.getLastEvent();
if (lastEvent != null) {
carOrderDetail.setOrderStatus(lastEvent.mapToOrderDetailStatus());
}
}
);
String EmployeeNo = routeOrder.getUserId();
User user = userRepository.findByUserEmployeeNo(EmployeeNo);
OrderEvent lastEvent = orderDetail.getLastEvent();
if (lastEvent != null) {
carOrderDetail.setOrderStatus(lastEvent.mapToOrderDetailStatus());
}
});
String employeeNo = routeOrder.getUserId();
User user = userRepository.findByUserEmployeeNo(employeeNo);
if (user != null) {
carOrderDetail.setBookingUserCode(user.getEmployeeNo());
carOrderDetail.setBookingName(user.getName());
carOrderDetail.setBookingUserPhone(user.getPhoneNumber());
}
carOrderDetail.setCreateTime(carBasicInfo.getCreateTime());
CarPassengerInfo passengerInfo = carQuickOrderInfoEntity.getPassengerInfo();
if (passengerInfo != null){
carOrderDetail.setUserName(passengerInfo.getPassengerName());
carOrderDetail.setUserCode(passengerInfo.getIntlCode());
carOrderDetail.setPhone(passengerInfo.getPassengerPhone());
carOrderDetail.setBOOK_ORG_STRUCT_1(passengerInfo.getDept1());
carOrderDetail.setBOOK_ORG_STRUCT_2(passengerInfo.getDept2());
carOrderDetail.setBOOK_ORG_STRUCT_3(passengerInfo.getDept3());
}
carOrderDetail.setReceiptsNum(routeOrder.getRouteOrderNo());
carOrderDetail.setCreateTime(carBasicInfo.getCreateTime());
carOrderDetail.setOrderAmount(String.valueOf(carBasicInfo.getOrderAmount()));
carOrderDetail.setUserName(passengerInfo.getPassengerName());
carOrderDetail.setUserCode(passengerInfo.getIntlCode());
// carOrderDetail.setPhone(passengerInfo.get());
carOrderDetail.setPersonalPaymentAmount(String.valueOf(carBasicInfo.getAccntAmount()));
carOrderDetail.setCompanyPaymentAmount(String.valueOf(carBasicInfo.getPersonAmount()));
carOrderDetail.setPaymentType(String.valueOf(carBasicInfo.getPaymentType())); //
carOrderDetail.setReceiptsNum(routeOrder.getRouteOrderNo());
//
// carOrderDetail.setStartTime(carBasicInfo.getCreateTime());
// carOrderDetail.setArriveTime(carBasicInfo.get());
// carOrderDetail.setFromStationName(carBasicInfo.get());
// carOrderDetail.setToStationName(carBasicInfo.getEndAddress());
// carOrderDetail.setCarModel(String.valueOf(carBasicInfo.getCarType()));
// carOrderDetail.setFromCity(carBasicInfo.getStartCityName());
// carOrderDetail.setToCity(carBasicInfo.getEndCityName());
// carOrderDetail.setRunTime(carBasicInfo.getDuration());
// carOrderDetail.setMileage(carBasicInfo.getMileage());
//
//
// ApproveOrderNo approveOrderNo = routeOrder.getApproveOrderNo();
// if (approveOrderNo != null){
// carOrderDetail.setAccountCompanyId(approveOrderNo.getAccountCompanyCode());
// carOrderDetail.setAccountCompanyName(approveOrderNo.getAccountCompanyName());
// carOrderDetail.setCostCenter(approveOrderNo.getCostCenter());
// carOrderDetail.setProjectOrderNo(approveOrderNo.getProjectName());
// }
OrderProduct orderProduct = carQuickOrderInfoEntity.getOrderProduct();
if (orderProduct != null){
carOrderDetail.setStartTime(orderProduct.getServiceBeginTime());
carOrderDetail.setArriveTime(orderProduct.getServiceEndTime());
carOrderDetail.setMileage(orderProduct.getNormalDistance());
carOrderDetail.setRunTime(orderProduct.getNormalTime());
Address depAddress = orderProduct.getDepartAddress();
Address arrAddress = orderProduct.getArriveAddress();
carOrderDetail.setFromStationName(depAddress.getAddressDetail());
carOrderDetail.setToStationName(arrAddress.getAddressDetail());
carOrderDetail.setFromCity(depAddress.getCityName());
carOrderDetail.setToCity(arrAddress.getCityName());
}
List<ChoosedVehicle> choosedVehicleList = carQuickOrderInfoEntity.getChoosedVehicleList();
if (!choosedVehicleList.isEmpty()) {
ChoosedVehicle choosedVehicle = choosedVehicleList.get(0);
carOrderDetail.setCarModel(choosedVehicle.getVehicleName());
}
ApproveOrderNo approveOrderNo = routeOrder.getApproveOrderNo();
if (approveOrderNo != null) {
carOrderDetail.setAccountCompanyId(approveOrderNo.getAccountCompanyCode());
carOrderDetail.setAccountCompanyName(approveOrderNo.getAccountCompanyName());
carOrderDetail.setReceiptsNum(routeOrder.getRouteOrderNo());
carOrderDetail.setCostCenter(approveOrderNo.getCostCenter());
carOrderDetail.setProjectOrderNo(approveOrderNo.getProjectName());
}
//
// carOrderDetail.setOverStandard(); //
// carOrderDetail.setOverStandardReason(overStandardReason); contactName
// carOrderDetail.setParentOrderNo(parentOrderNo); //
// carOrderDetail.setOriginalOrderNo(originalOrderNo); //
//
// carOrderDetail.setScheduleNum(scheduleNum); //
// carOrderDetail.setBookingName(bookingName); //
// carOrderDetail.setBookingUserPhone(bookingUserPhone);//
//
// carOrderDetail.setCancellationFee(cancellationFee); //
// carOrderDetail.setStandardItems(standardItems); //
//
//
// 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.setTollFee(tollFee); //
return carOrderDetail;
@ -198,11 +195,7 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory {
String journeyNo = flightOrderBasicInfo.getJourneyID();
RouteOrder routeOrder = routeRepository.findByOrderNo(journeyNo);
String sysCode = routeOrder.getApproveOrderNo().getSysCode();
Optional<OrderDetail> first = routeOrder
.getOrderDetails()
.stream()
.filter(orderDetail -> orderDetail.getOrderNo().equals(orderNo))
.findFirst();
Optional<OrderDetail> first = routeOrder.getOrderDetails().stream().filter(orderDetail -> orderDetail.getOrderNo().equals(orderNo)).findFirst();
FlightOrderDetail flightOrderDetail = new FlightOrderDetail();
@ -227,12 +220,17 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory {
flightOrderDetail.setOrderNo(orderNo);
flightOrderDetail.setDetailId(orderNo);
first.ifPresent(orderDetail -> {
OrderEvent lastEvent = orderDetail.getLastEvent();
if (lastEvent != null) {
flightOrderDetail.setOrderStatus(lastEvent.mapToOrderDetailStatus());
}
}
);
OrderEvent lastEvent = orderDetail.getLastEvent();
if (lastEvent != null) {
flightOrderDetail.setOrderStatus(lastEvent.mapToOrderDetailStatus());
}
});
String EmployeeNo = routeOrder.getUserId();
User user = userRepository.findByUserEmployeeNo(EmployeeNo);
flightOrderDetail.setBookingUserCode(user.getEmployeeNo());
flightOrderDetail.setBookingName(user.getName());
flightOrderDetail.setBookingUserPhone(user.getPhoneNumber());
if (flightOrderBasicInfo != null) {
flightOrderDetail.setCreateTime(flightOrderBasicInfo.getCreateTime());
@ -314,11 +312,6 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory {
// .findFirst()).ifPresent(it ->
// flightOrderDetail.setScheduleNum(it.getLegNo()));
String EmployeeNo = routeOrder.getUserId();
User user = userRepository.findByUserEmployeeNo(EmployeeNo);
flightOrderDetail.setBookingUserCode(user.getEmployeeNo());
flightOrderDetail.setBookingName(user.getName());
flightOrderDetail.setBookingUserPhone(user.getPhoneNumber());
if (flightOrderFeeDetail != null) {
flightOrderDetail.setRefundAmount(String.valueOf(flightOrderFeeDetail.getTransactionAmount()));
@ -404,18 +397,13 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory {
user = userRepository.findByUserEmployeeNo(EmployeeNo);
}
Optional<OrderDetail> first = routeOrder
.getOrderDetails()
.stream()
.filter(orderDetail -> orderDetail.getOrderNo().equals(orderNo))
.findFirst();
Optional<OrderDetail> first = routeOrder.getOrderDetails().stream().filter(orderDetail -> orderDetail.getOrderNo().equals(orderNo)).findFirst();
first.ifPresent(orderDetail -> {
OrderEvent lastEvent = orderDetail.getLastEvent();
if (lastEvent != null) {
hotelOrderDetail.setOrderStatus(lastEvent.mapToOrderDetailStatus());
}
}
);
OrderEvent lastEvent = orderDetail.getLastEvent();
if (lastEvent != null) {
hotelOrderDetail.setOrderStatus(lastEvent.mapToOrderDetailStatus());
}
});
if (user != null) {
hotelOrderDetail.setBookingUserCode(String.valueOf(user.getEmployeeNo()));

View File

@ -14,7 +14,7 @@ public class CarQuickOrderInfoEntity {
private CarPassengerInfo PassengerInfo; // 乘客信息
// private List<PaymentInfo> PaymentInfoList; // 支付信息列表
// private List<PaymentSettlement> PaymentSettlementList; // 支付结算列表
// private List<ChoosedVehicle> ChoosedVehicleList; // 选择的车辆列表
private List<ChoosedVehicle> ChoosedVehicleList; // 选择的车辆列表
// private OrderConfigInfo OrderConfigInfo; // 订单配置信息
// private List<PaymentSupply> PaymentSupplyList; // 支付供应列表
// private OrderPaymentInfo OrderPaymentInfo; // 订单支付信息

View File

@ -4,7 +4,7 @@ import lombok.Data;
// 选择的车辆信息类
@Data
class ChoosedVehicle {
public class ChoosedVehicle {
private double EstimateAmount; // 预估金额
private int vehicleId; // 车辆ID
private String vehicleName; // 车辆名称