携程机票结算加入行程号

This commit is contained in:
lulz1 2024-04-03 13:13:58 +08:00
parent 5ad1e6f6f4
commit 346ea697da
6 changed files with 110 additions and 3 deletions

View File

@ -129,6 +129,11 @@ public class OrderFlightRecord extends OrderBaseRecord {
return this;
}
public OrderFlightRecord loadScheduleNum(String scheduleNum){
this.setScheduleNum(scheduleNum);
return this;
}
// 加载座位细节
public OrderFlightRecord loadSeatInfo(String seatPoint,
String seatPointName,

View File

@ -0,0 +1,37 @@
package com.chint.domain.aggregates.order.order_record.ctrip_order_record;
import cn.hutool.core.bean.BeanUtil;
import com.chint.interfaces.rest.ctrip.dto.order.OrderFlightResponse;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.relational.core.mapping.MappedCollection;
import org.springframework.data.relational.core.mapping.Table;
import java.io.Serial;
import java.io.Serializable;
import java.util.List;
@Data
@Table("c_trip_flight_print_info")
public class CTripFlightPrintInfo implements Serializable {
@Serial
private static final long serialVersionUID = 8423142133557758145L;
@Id
private Long id;
private Long cTripFlightRecordId;
private long OrderID;
private String CorpID;
@MappedCollection(idColumn = "c_trip_flight_print_info_id", keyColumn = "c_trip_flight_print_info_key")
private List<CTripFlightSegmentPrint> FlightOrderSegmentPrintInfoList;
// private List<OrderFlightResponse.FlightOrderExpressInfo> RegularExpressInfoListFieldList;
private String TicketNoSignCode;
public static CTripFlightPrintInfo of(OrderFlightResponse.FlightOrderPrintDetailInfo printDetailInfo) {
List<CTripFlightSegmentPrint> list = printDetailInfo
.getFlightOrderSegmentPrintInfoList().stream()
.map(CTripFlightSegmentPrint::of).toList();
CTripFlightPrintInfo cTripFlightPrintInfo = BeanUtil.copyProperties(printDetailInfo, CTripFlightPrintInfo.class);
cTripFlightPrintInfo.setFlightOrderSegmentPrintInfoList(list);
return cTripFlightPrintInfo;
}
}

View File

@ -28,6 +28,8 @@ public class CTripFlightRecord implements Serializable {
private CTripFlightBaseInfo cTripFlightBaseInfo;
@MappedCollection(idColumn = "c_trip_flight_record_id")
private CTripFlightTripInfo cTripFlightTripInfo;
@MappedCollection(idColumn = "c_trip_flight_record_id")
private CTripFlightPrintInfo cTripFlightPrintInfo;
public static CTripFlightRecord of(CTripFlightRecordBase cTripFlightRecordBase,
CTripFlightInfo cTripFlightInfo,
@ -42,4 +44,9 @@ public class CTripFlightRecord implements Serializable {
cTripFlightRecord.setCTripFlightTripInfo(cTripFlightTripInfo);
return cTripFlightRecord;
}
public CTripFlightRecord printInfo(CTripFlightPrintInfo cTripFlightPrintInfo) {
this.setCTripFlightPrintInfo(cTripFlightPrintInfo);
return this;
}
}

View File

@ -0,0 +1,35 @@
package com.chint.domain.aggregates.order.order_record.ctrip_order_record;
import cn.hutool.core.bean.BeanUtil;
import com.chint.interfaces.rest.ctrip.dto.order.OrderFlightResponse;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.relational.core.mapping.Table;
import java.io.Serial;
import java.io.Serializable;
@Data
@Table("c_trip_flight_segment_print")
public class CTripFlightSegmentPrint implements Serializable {
@Serial
private static final long serialVersionUID = 8454314678965758235L;
@Id
private Long id;
private Long cTripFlightPrintInfoId;
private Integer cTripFlightPrintInfoKey;
private Long OrderID;
private String ExpressNo;
private String CorpId;
private Integer PrintType;
private String PassengerName;
private String TicketNo;
private String PrintNo;
private Double SegmentPrintPrice;
private Long PrintTime;
private String AirLineCode;
public static CTripFlightSegmentPrint of(OrderFlightResponse.FlightOrderSegmentPrintInfo printInfo) {
return BeanUtil.copyProperties(printInfo, CTripFlightSegmentPrint.class);
}
}

View File

@ -111,7 +111,7 @@ public class CTripOrderRecordExtensionFactory implements OrderRecordExtensionFac
String.valueOf(cTripCarRecordBase.getRealAmountHasPost()));
// 加载费用细节, 未税金额税费服务费取消费额外费用额外费用名称 , 携程马上用车产品没有税费和额外费用字段
orderCarRecord.loadFeeDetails(String.valueOf(cTripCarRecordBase.getAmount()),
orderCarRecord.loadFeeDetails("",
"",
String.valueOf(cTripCarRecordBase.getServerFee()),
String.valueOf(cTripCarRecordBase.getPenaltyFee()),
@ -262,6 +262,26 @@ public class CTripOrderRecordExtensionFactory implements OrderRecordExtensionFac
cTripFlightInfo.getClassName(),
String.valueOf(cTripFlightInfo.getPriceRate()));
CTripFlightPrintInfo cTripFlightPrintInfo = cTripFlightRecord.getCTripFlightPrintInfo();
if (cTripFlightPrintInfo != null &&
cTripFlightPrintInfo.getFlightOrderSegmentPrintInfoList() != null &&
!cTripFlightPrintInfo.getFlightOrderSegmentPrintInfoList().isEmpty()) {
//获取最新的行程号
Optional<CTripFlightSegmentPrint> print = cTripFlightRecord
.getCTripFlightPrintInfo()
.getFlightOrderSegmentPrintInfoList()
.stream()
.reduce((a, b) -> {
if (a.getPrintTime() > b.getPrintTime()) {
return a;
} else {
return b;
}
});
orderFlightRecord.loadScheduleNum(print.isPresent() ? print.get().getPrintNo() : "");
}
if (cTripFlightTripInfo != null) {
orderFlightRecord.loadTicketInfo(cTripFlightRecordBase.getCreateTime(),
String.valueOf(cTripFlightRecordBase.getPrice()),

View File

@ -58,13 +58,13 @@ public class CTripOrderRecordAutoSave {
OrderFlightResponse.FlightTripRecordInfo flightTripRecordInfo = it.getFlightTripRecordInfo();
CTripFlightRecord record = cTripOrderDetailRepository.findFlightRecordByRecordId(
String.valueOf(orderSettlementBaseInfo.getRecordID()));
if (record == null) {
record = CTripFlightRecord.of(
CTripFlightRecordBase.changeInfo(orderSettlementBaseInfo),
CTripFlightInfo.of(it.getOrderFlightInfo()),
CTripFlightBaseInfo.of(it.getOrderBaseInfo()),
CTripFlightTripInfo.of(flightTripRecordInfo)
);
CTripFlightTripInfo.of(flightTripRecordInfo));
} else {
Long originId = record.getId();
record = CTripFlightRecord.of(
@ -74,6 +74,9 @@ public class CTripOrderRecordAutoSave {
CTripFlightTripInfo.of(flightTripRecordInfo));
record.setId(originId);
}
if (it.getOrderPrintDetailInfo() != null) {
record.printInfo(CTripFlightPrintInfo.of(it.getOrderPrintDetailInfo()));
}
//补充额外的字段
OrderFlightResponse.FlightOrderBaseInfo orderBaseInfo = it.getOrderBaseInfo();
record.setRouteOrderNo(orderBaseInfo.getJourneyID());