同步用车实体类

This commit is contained in:
lulz1 2024-03-13 21:34:51 +08:00
parent 2bc25d354e
commit 10071b2c4c
18 changed files with 218 additions and 100 deletions

View File

@ -10,7 +10,6 @@ import com.chint.domain.value_object.OrderSaveData;
import com.chint.infrastructure.constant.LegConstant;
import com.chint.infrastructure.constant.RouteConstant;
import com.chint.infrastructure.constant.SupplierNameConstant;
import com.chint.infrastructure.constant.UtilConstant;
import com.chint.infrastructure.echo_framework.command.Command;
import com.chint.infrastructure.echo_framework.dispatch.Properties;
import com.chint.infrastructure.echo_framework.dispatch.ResultContainer;
@ -31,6 +30,7 @@ import java.time.LocalDateTime;
import java.util.*;
import java.util.stream.Collectors;
import static com.chint.infrastructure.constant.LegConstant.LEG_TYPE_TAXI;
import static com.chint.infrastructure.constant.LegConstant.LEG_TYPE_TRAIN;
import static com.chint.infrastructure.constant.RouteConstant.*;
import static com.chint.infrastructure.constant.UtilConstant.KEEP_TWO_DECIMAL_ZERO;
@ -401,6 +401,17 @@ public class RouteOrder implements Serializable {
List<Leg> potentialMatches = this.legItems.stream()
.filter(leg -> {
if (leg.getLegType().equals(LEG_TYPE_TAXI) && orderDetail.getProductType().equals(LEG_TYPE_TAXI)) {
if (leg.getLegExtensionField() != null && leg.getLegExtensionField().getLocationIdsAsLong() != null) {
if (leg.getLegExtensionField().getLocationIdsAsLong().contains(orderDetail.getOriginId()) ||
leg.getLegExtensionField().getLocationIdsAsLong().contains(orderDetail.getDestinationId())) {
orderDetail.setLegId(leg.getLegId());
return false;
}
} else {
return false;
}
}
Location originLocation = leg.getOriginLocation();
Location destinationLocation = leg.getDestinationLocation();
Long orderDetailOriginId = orderDetail.getOriginId();

View File

@ -7,6 +7,7 @@ import com.chint.domain.repository.OrderDetailRepository;
import com.chint.domain.repository.RouteRepository;
import com.chint.domain.repository.UserRepository;
import com.chint.infrastructure.constant.BelongSystemConstant;
import com.chint.interfaces.rest.ctrip.dto.search.car.CarQuickOrderInfoEntity;
import com.chint.interfaces.rest.ctrip.dto.search.flight.*;
import com.chint.interfaces.rest.ctrip.dto.search.hotel.ClientInfo;
import com.chint.interfaces.rest.ctrip.dto.search.hotel.HotelOrderInfoEntity;
@ -38,7 +39,7 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory {
@Override
public CarOrderDetail createCarOrderDetail(Object carOrderDetailData) {
CarQuickOrderInfoEntity carQuickOrderInfoEntity = (CarQuickOrderInfoEntity) carOrderDetailData;
return null;
}

View File

@ -14,8 +14,12 @@ public class OrderDetailFactoryImpl implements OrderDetailFactory {
public OrderDetail create(OrderLegData orderLegData) {
OrderDetail orderDetail = OrderDetail.of(orderLegData.getOutOrderNo(), orderLegData.getSupplierName());
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
orderDetail.setStartTime(LocalDateTime.parse(orderLegData.getStartTime(), dateTimeFormatter));
orderDetail.setEndTime(LocalDateTime.parse(orderLegData.getEndTime(), dateTimeFormatter));
if(orderLegData.getStartTime() != null){
orderDetail.setStartTime(LocalDateTime.parse(orderLegData.getStartTime(), dateTimeFormatter));
}
if(orderLegData.getEndTime() != null){
orderDetail.setEndTime(LocalDateTime.parse(orderLegData.getEndTime(), dateTimeFormatter));
}
orderDetail.setOrderDate(LocalDateTime.parse(orderLegData.getOrderTime(), dateTimeFormatter));
// orderDetail.setCurrencyType(CurrencyType.getByCode(orderLegData.getCurrencyCode()));
orderDetail.setDestinationId(orderLegData.getDestinationId());

View File

@ -134,7 +134,7 @@ public class CTripOrderDataAdapter implements OrderDataAdapter {
.originId(departCityName.getLocationId())
.destinationId(arriveCityName.getLocationId())
.price(String.valueOf(basicInfo.getOrderAmount()))
// .selfOrderNo()
.selfOrderNo(basicInfo.getJouneryID())
.outOrderNo(String.valueOf(basicInfo.getOrderId()))
.orderStatus(translateCarOrderStatus(basicInfo.getOrderStatus()))
.originOrderStatus(basicInfo.getOrderStatus());

View File

@ -0,0 +1,17 @@
package com.chint.interfaces.rest.ctrip.dto.search.car;
import lombok.Data;
@Data
public class Address {
private String Address;
private String AddressDetail;
private String CityId;
private String CityName;
private String Latitude;
private String Longitude;
private Integer MapType;
private String DistrictCode;
// Getters, Setters, and Constructors
}

View File

@ -16,5 +16,41 @@ public class BasicInfo {
private String FeeType; // 费用类型
private String UID; // 用户ID
private String CreateTime;
private String PreEmployeeName;
private String PreEmployeeID;
private String PolicyId;
private String CorpId;
private String CorpName;
private Integer AccountId;
private Integer SubAccountId;
private String ContactName;
private String IntlCode;
private String ContactMobile;
private String ContactEmail;
private Boolean NeedInvoice;
private Integer ExtraOrders;
private String CostCenter1;
private String CostCenter2;
private String CostCenter3;
private String CostCenter4;
private String CostCenter5;
private String CostCenter6;
private String JourneyReason;
private String Project;
private String JouneryID;
private String JourneyID;
private String DefineValue1;
private String DefineValue2;
private String ServerFrom;
private Boolean IsOfficialCard;
private Double AccntAmount;
private Double PersonAmount;
private Double WaitPayAmount;
private String PlatformOrderId;
private Integer DockingVendorPlatform;
private String DockingVendorPlatformAccount;
private String CorpDockingInfoList;
private String PreEmployeeNamePinYin;
private String SubProductLine;
// Other fields and getters/setters
}

View File

@ -0,0 +1,11 @@
package com.chint.interfaces.rest.ctrip.dto.search.car;
import lombok.Data;
@Data
public class CancelRuleInfo {
private String CancelRule;
private String CancelRuleEn;
private Integer AutoCancelTime;
// Getters, Setters, and Constructors
}

View File

@ -9,10 +9,10 @@ import java.util.List;
public class CarQuickOrderInfoEntity {
private BasicInfo BasicInfo; // 基本信息
private OrderProduct OrderProduct; // 订单产品
// private List<OrderFee> OrderFeeList; // 订单费用列表
// private OrderInsurance OrderInsurance; // 订单保险信息
// private OrderInvoice OrderInvoice; // 订单发票信息
// private PassengerInfo PassengerInfo; // 乘客信息
private List<OrderFee> OrderFeeList; // 订单费用列表
private OrderInsurance OrderInsurance; // 订单保险信息
private OrderInvoice OrderInvoice; // 订单发票信息
private PassengerInfo PassengerInfo; // 乘客信息
// private List<PaymentInfo> PaymentInfoList; // 支付信息列表
// private List<PaymentSettlement> PaymentSettlementList; // 支付结算列表
// private List<ChoosedVehicle> ChoosedVehicleList; // 选择的车辆列表

View File

@ -0,0 +1,18 @@
package com.chint.interfaces.rest.ctrip.dto.search.car;
import lombok.Data;
@Data
public class Driver {
private String DriverName;
private String DriverMobileIntelCode;
private String DriverMoblie;
private String DriverMobileReal;
private String PlateNumber;
private String DriverVehicleName;
private String DriverImageUrl;
private String CarColor;
// Getters, Setters, and Constructors
}

View File

@ -2,13 +2,19 @@ package com.chint.interfaces.rest.ctrip.dto.search.car;
import lombok.Data;
// 订单费用信息类
@Data
class OrderFee {
private String costScene; // 费用场景
private String feeTypeCode; // 费用类型编码
private String feeName; // 费用名称
private String amount; // 金额
private String orderFeeId; // 订单费用ID
// Other fields and getters/setters
public class OrderFee {
private String CostScene;
private String FeeTypeCode;
private String FeeName;
private Double Amount;
private String OrderFeeId;
private Integer VendorFeeOrgin;
private Double AccntAmount;
private Double PersonAmount;
private Double CnyAmount;
private Double CnyAccountAmount;
private Double CnyPersonAmount;
// Constructors, getters, and setters
}

View File

@ -5,7 +5,16 @@ import lombok.Data;
// 订单保险信息类
@Data
class OrderInsurance {
private String productCode; // 产品编码
private String companyId; // 公司ID
private String ProductCode;
private String CompanyId;
private String PolicyNo;
private String PolicyStatus;
private String PolicyUrl;
private String InsuredName;
private String EffectTime;
private String ExpiryTime;
private String Mark;
private Integer Count;
private Double Premium;
// Other fields and getters/setters
}

View File

@ -5,7 +5,15 @@ import lombok.Data;
// 订单发票信息类
@Data
class OrderInvoice {
private String invoiceId; // 发票ID
private String customerTaxNumber; // 客户税号
private String InvoiceId;
private String CustomerTaxNumber;
private String Detail;
private String EInvoiceInfo; // Assuming EInvoiceInfo is another class, you need to define it separately.
private String InvoiceTitleType;
private String InvoiceType;
private String PaperInvoiceInfo; // Assuming PaperInvoiceInfo is another class, you need to define it separately.
private String Title;
private String Remark;
// Other fields and getters/setters
}

View File

@ -1,12 +1,12 @@
package com.chint.interfaces.rest.ctrip.dto.search.car;
import lombok.Data;
// 订单产品信息类
@Data
public class OrderProduct {
private String VendorOrderId;
private int BookingType;
private Integer BookingType;
private String UseTime;
private Address DepartAddress;
private Position PassengerPosition;
@ -16,78 +16,15 @@ public class OrderProduct {
private Driver Driver;
private String ServiceBeginTime;
private String ServiceEndTime;
private double NormalDistance;
private double NormalTime;
// DelayTimeStart object might be omitted if it's empty
private String NormalDistance;
private String NormalTime;
private String DelayTimeStart;
private String OrderTime;
private int EstimateTimeLength;
private int EstimateDistance;
private Integer EstimateTimeLength;
private Integer EstimateDistance;
private String DriverArriveTime;
private CancelRuleInfo CancelRuleInfo;
private String CancelTime;
@Data
public class Address {
private String Address;
private String AddressDetail;
private String CityId;
private String CityName;
private String Latitude;
private String Longitude;
private int MapType;
// Getters and Setters
}
@Data
public class Position {
private String Latitude;
private String Longitude;
private int MapType;
// Getters and Setters
}
@Data
public class Vendor {
private String VendorCode;
private int VendorId;
private String VendorName;
// Getters and Setters
}
@Data
public class Vehicle {
private int VehicleId;
private String VehicleName;
private String CarColor;
private String PlateNumber;
private int SeatCount;
private int CarRiageNum;
// Getters and Setters
}
@Data
public class Driver {
private String DriverName;
private String DriverMobileIntelCode;
private String DriverMoblie;
private String DriverMobileReal;
private String PlateNumber;
private String DriverVehicleName;
private String DriverImageUrl;
private String CarColor;
// Getters and Setters
}
@Data
public class CancelRuleInfo {
private String CancelRule;
private String CancelRuleEn;
private int AutoCancelTime;
// Getters and Setters
}
// Getters, Setters, and Constructors
}

View File

@ -5,9 +5,29 @@ import lombok.Data;
// 乘客信息类
@Data
class PassengerInfo {
private String corpUserId; // 公司用户ID
private String employeeId; // 员工ID
private String intlCode; // 国际代码
private String passengerId; // 乘客ID
// Other fields and getters/setters
private String CorpUserId;
private String EmployeeId;
private String IntlCode;
private String PassengerId;
private String PassengerName;
private String PassengerPhone;
private String PassengerEmail;
private String CostCenter1;
private String CostCenter2;
private String CostCenter3;
private String CostCenter4;
private String CostCenter5;
private String CostCenter6;
private String Dept1;
private String Dept2;
private String Dept3;
private String Dept4;
private String Dept5;
private String Dept6;
private String Dept7;
private String Dept8;
private String Dept9;
private String Dept10;
private String PassengerNamePinYin;
private Boolean NonEmployee;
}

View File

@ -0,0 +1,13 @@
package com.chint.interfaces.rest.ctrip.dto.search.car;
import lombok.Data;
@Data
public class Position {
private String Latitude;
private String Longitude;
private Integer MapType;
// Getters, Setters, and Constructors
}

View File

@ -0,0 +1,16 @@
package com.chint.interfaces.rest.ctrip.dto.search.car;
import lombok.Data;
@Data
public class Vehicle {
private Integer VehicleId;
private String VehicleName;
private String CarColor;
private String PlateNumber;
private Integer SeatCount;
private Integer CarRiageNum;
// Getters, Setters, and Constructors
}

View File

@ -0,0 +1,13 @@
package com.chint.interfaces.rest.ctrip.dto.search.car;
import lombok.Data;
@Data
public class Vendor {
private String VendorCode;
private Integer VendorId;
private String VendorName;
// Getters, Setters, and Constructors
}

View File

@ -184,7 +184,6 @@ public class CommonController {
//改签
if (subNotifyType == 9){
isOk(ruleViolate,subNotifyType, orderSerialNo);
}
//正常流程
@ -309,7 +308,6 @@ public class CommonController {
TrainChangeParam trainChangeParam = new TrainChangeParam();
trainChangeParam.setOrderNo(orderSerialNo);
trainChangeParam.setApprovalStatus(1);
if (ruleViolate == 0 && subNotifyType == 16){
getTrainOk(trainChangeParam);
return new LYNoteResponse("100", "OK");