测试携程结算代码

This commit is contained in:
Superdandan 2024-04-01 09:26:22 +08:00
parent fdad2e2bec
commit ed3c0484f9
25 changed files with 535 additions and 105 deletions

View File

@ -41,7 +41,7 @@ public class AutoWorkController {
public Result<String> autoSaveCTripRecord() { public Result<String> autoSaveCTripRecord() {
cTripOrderRecordAutoSave.saveAll(); cTripOrderRecordAutoSave.saveAll();
//将昨天的结算数据生成为财务共享需要的数据 //将昨天的结算数据生成为财务共享需要的数据
// Command.of(OrderRecordGenerateCommand.class).sendToQueue(); Command.of(OrderRecordGenerateCommand.class).sendToQueue();
return Result.Success(SUCCESS); return Result.Success(SUCCESS);
} }

View File

@ -521,7 +521,6 @@ public class OrderQuery {
if (legItems != null && !legItems.isEmpty()) { if (legItems != null && !legItems.isEmpty()) {
//这里使用领域事件进行检查leg的订单状态 用户每次想要查看行程都会进行一次检查 //这里使用领域事件进行检查leg的订单状态 用户每次想要查看行程都会进行一次检查
legItems.forEach(leg -> legDomainService.legCheckOrder(leg)); legItems.forEach(leg -> legDomainService.legCheckOrder(leg));
orderDomainService.queryLocation(legItems); orderDomainService.queryLocation(legItems);
List<LegRes> list = legItems.stream().map(LegRes::copyFrom).toList(); List<LegRes> list = legItems.stream().map(LegRes::copyFrom).toList();
routeOrderRes.setLegResList(list); routeOrderRes.setLegResList(list);

View File

@ -164,7 +164,7 @@ public class OrderCarRecord extends OrderBaseRecord {
public OrderCarRecord loadComplianceInfo(OrderDetail orderDetail) { public OrderCarRecord loadComplianceInfo(OrderDetail orderDetail) {
orderDetail.getETAEvent().ifPresentOrElse(it->{ orderDetail.getETAEvent().ifPresentOrElse(it->{
this.setOverStandard(""); this.setOverStandard("");
this.setOverStandardReason(overStandardReason); this.setOverStandardReason(it.getExtension());
},()->{ },()->{
this.setOverStandard(""); this.setOverStandard("");
this.setOverStandardReason(""); this.setOverStandardReason("");

View File

@ -1,5 +1,6 @@
package com.chint.domain.aggregates.order.order_record; package com.chint.domain.aggregates.order.order_record;
import com.chint.domain.aggregates.order.OrderDetail;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
@ -12,7 +13,7 @@ import org.springframework.data.relational.core.mapping.Table;
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@Accessors(chain = true) @Accessors(chain = true)
public class OrderFlightRecord extends OrderBaseRecord{ public class OrderFlightRecord extends OrderBaseRecord {
@Id @Id
private Long id; private Long id;
private Long orderDetailId; private Long orderDetailId;
@ -75,31 +76,71 @@ public class OrderFlightRecord extends OrderBaseRecord{
private String bookOrgCode3; // 出行人组织架构信息3 private String bookOrgCode3; // 出行人组织架构信息3
private String projectOrderNo; // 项目订单号 private String projectOrderNo; // 项目订单号
private String offlineCcomyCode; // 成本中心 private String offlineCcomyCode; // 成本中心
private String orderStatus;
private String createTime;
// 加载基础订单信息 // 加载基础订单信息
public OrderFlightRecord loadBasicOrderInfo(Long id, String orderNo, String orderStatus, String createTime) { public OrderFlightRecord loadBasicOrderInfo(String orderNo,
this.setId(id); String orderStatus,
String createTime) {
this.setOrderNo(orderNo); this.setOrderNo(orderNo);
// this.setOrderStatus(orderStatus); this.setOrderStatus(orderStatus);
// this.setCreateTime(createTime); this.setCreateTime(createTime);
return this; return this;
} }
// 加载航班信息 // 加载航班信息 , 航线
public OrderFlightRecord loadFlightInfo(String flightNum, String startAirportName, String endAirportName, public OrderFlightRecord loadFlightInfo(String flightNum,
String startCityName, String endCityName, String startTime, String endTime) { String flightCompName,
String startAirportName,
String endAirportName,
String startCityName,
String endCityName,
String startTime,
String endTime,
String distance,
String endAirportCode,
String endTerminal) {
this.setDistance(distance);
this.setFlightNum(flightNum); this.setFlightNum(flightNum);
this.setFlightCompName(flightCompName);
this.setStartAirportName(startAirportName); this.setStartAirportName(startAirportName);
this.setEndAirportName(endAirportName);
this.setStartCityName(startCityName); this.setStartCityName(startCityName);
this.setEndCityName(endCityName);
this.setStartTime(startTime); this.setStartTime(startTime);
this.setEndAirportName(endAirportName);
this.setEndCityName(endCityName);
this.setEndTime(endTime); this.setEndTime(endTime);
this.setEndAirportCode(endAirportCode);
this.setEndTerminal(endTerminal);
return this;
}
// 加载机票信息
public OrderFlightRecord loadTicketInfo(String issueTicketTime,
String facePrice,
String useStatus) {
this.setIssueTicketTime(issueTicketTime);
this.setFacePrice(facePrice);
this.setUseStatus(useStatus);
return this;
}
// 加载座位细节
public OrderFlightRecord loadSeatInfo(String seatPoint,
String seatPointName,
String seatDiscount) {
this.setSeatDiscount(seatDiscount);
this.setSeatPoint(seatPoint);
this.setSeatPointName(seatPointName);
return this; return this;
} }
// 加载预订与乘机人信息 // 加载预订与乘机人信息
public OrderFlightRecord loadBookingAndPassengerInfo(String bookingUserCode, String bookingName, String userName, String userCode) { public OrderFlightRecord loadBookingAndPassengerInfo(String bookingUserCode,
String bookingName,
String userName,
String userCode) {
this.setBookingUserCode(bookingUserCode); this.setBookingUserCode(bookingUserCode);
this.setBookingName(bookingName); this.setBookingName(bookingName);
this.setUserName(userName); this.setUserName(userName);
@ -108,86 +149,95 @@ public class OrderFlightRecord extends OrderBaseRecord{
} }
// 加载财务与价格信息 // 加载财务与价格信息
public OrderFlightRecord loadFinancialAndPricingInfo(String accountCompanyId, String accountCompanyName, public OrderFlightRecord loadFinancialAndPricingInfo(String accountPeriod,
String accountPeriod, String billNo, String orderAmount, String billNo,
String facePrice, String noTaxAmt, String taxAmt) { String orderAmount,
this.setAccountCompanyId(accountCompanyId);
this.setAccountCompanyName(accountCompanyName); String ycabinFullPrice,
String policyLowestPrice,
String flightLowestPrice) {
this.setAccountPeriod(accountPeriod); this.setAccountPeriod(accountPeriod);
this.setBillNo(billNo); this.setBillNo(billNo);
this.setOrderAmount(orderAmount); this.setOrderAmount(orderAmount);
this.setFacePrice(facePrice); this.setYcabinFullPrice(ycabinFullPrice); //经济舱全价
this.setPolicyLowestPrice(policyLowestPrice); // 比价范围最低价
this.setFlightLowestPrice(flightLowestPrice); // 航班最低价
return this;
}
// 加载税务信息
public OrderFlightRecord loadTaxInfo(String noTaxAmt,
String taxAmt,
String airportTax,
String fuelTax) {
this.setNoTaxAmt(noTaxAmt); this.setNoTaxAmt(noTaxAmt);
this.setTaxAmt(taxAmt); this.setTaxAmt(taxAmt);
return this;
}
// 加载额外费用信息
public OrderFlightRecord loadExtraFeeInfo(String serviceFee, String airportTax, String fuelTax,
String changeFee, String refundFee) {
this.setPreServiceFee(serviceFee);
this.setAirportTax(airportTax); this.setAirportTax(airportTax);
this.setFuelTax(fuelTax); this.setFuelTax(fuelTax);
return this;
}
// 加载费用信息, 服务费 改签费 退票费 , 升舱费
public OrderFlightRecord loadExtraFeeInfo(String preServiceFee,
String changeFee,
String refundFee,
String upFee,
String postServiceFee) {
this.setPreServiceFee(preServiceFee);
this.setChangeFee(changeFee); this.setChangeFee(changeFee);
this.setRefundFee(refundFee); this.setRefundFee(refundFee);
return this;
}
// 加载航班额外细节
public OrderFlightRecord loadFlightExtraDetails(String ycabinFullPrice, String seatDiscount, String policyLowestPrice,
String issueTicketTime, String flightLowestPrice, String useStatus,
String upFee, String postServiceFee, String endAirportCode, String endTerminal) {
this.setYcabinFullPrice(ycabinFullPrice);
this.setSeatDiscount(seatDiscount);
this.setPolicyLowestPrice(policyLowestPrice);
this.setIssueTicketTime(issueTicketTime);
this.setFlightLowestPrice(flightLowestPrice);
this.setUseStatus(useStatus);
this.setUpFee(upFee); this.setUpFee(upFee);
this.setPostServiceFee(postServiceFee); this.setPostServiceFee(postServiceFee);
this.setEndAirportCode(endAirportCode);
this.setEndTerminal(endTerminal);
return this; return this;
} }
// 加载组织架构与项目信息 // 加载组织架构与项目信息
public OrderFlightRecord loadOrganizationalAndProjectInfo(String bookOrgCode1, String bookOrgCode2, String bookOrgCode3, public OrderFlightRecord loadOrganizationalAndProjectInfo(String bookOrgCode1,
String projectOrderNo, String offlineCcomyCode) { String bookOrgCode2,
String bookOrgCode3) {
this.setBookOrgCode1(bookOrgCode1); this.setBookOrgCode1(bookOrgCode1);
this.setBookOrgCode2(bookOrgCode2); this.setBookOrgCode2(bookOrgCode2);
this.setBookOrgCode3(bookOrgCode3); this.setBookOrgCode3(bookOrgCode3);
this.setProjectOrderNo(projectOrderNo);
this.setOfflineCcomyCode(offlineCcomyCode);
return this; return this;
} }
// 加载来源和系统归属信息 // 加载来源和系统归属信息
public OrderFlightRecord loadSourceAndSystemInfo(String trvaleSysType, String belongSysType, String orderSource) { public OrderFlightRecord loadSourceInfo(String orderSource) {
this.setTrvaleSysType(trvaleSysType);
this.setBelongSysType(belongSysType);
this.setOrderSource(orderSource); this.setOrderSource(orderSource);
return this; return this;
} }
// 加载违规信息 // 加载违规信息
public OrderFlightRecord loadComplianceInfo(String overStandard, String overStandardReason) { public OrderFlightRecord loadComplianceInfo(OrderDetail orderDetail) {
this.setOverStandard(overStandard); orderDetail.getETAEvent().ifPresentOrElse(it->{
this.setOverStandardReason(overStandardReason); this.setOverStandard("");
this.setOverStandardReason(it.getExtension());
},()->{
this.setOverStandard("");
this.setOverStandardReason("");
});
return this; return this;
} }
// 加载航班细节
public OrderFlightRecord loadFlightDetails(String seatPoint, String seatPointName, String distance, String flightCompName) {
this.setSeatPoint(seatPoint);
this.setSeatPointName(seatPointName);
this.setDistance(distance);
this.setFlightCompName(flightCompName);
return this;
}
// 加载未预订最低价原因 // 加载未预订最低价原因
public OrderFlightRecord loadNotLowReason(String notLowReason) { public OrderFlightRecord loadNotLowReason(String notLowReason) {
this.setNotLowReason(notLowReason); this.setNotLowReason(notLowReason);
return this; return this;
} }
// 加载关联订单信息
public OrderFlightRecord loadRelatedOrderInfo(Long orderDetailId,
String detailId,
String receiptsNum,
String parentOrderNo,
String originalOrderNo) {
this.setOrderDetailId(orderDetailId);
this.setDetailId(detailId);
this.setReceiptsNum(receiptsNum);
this.setParentOrderNo(parentOrderNo);
this.setOriginalOrderNo(originalOrderNo);
return this;
}
} }

View File

@ -1,5 +1,6 @@
package com.chint.domain.aggregates.order.order_record; package com.chint.domain.aggregates.order.order_record;
import com.chint.domain.aggregates.order.OrderDetail;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
@ -72,19 +73,23 @@ public class OrderHotelRecord extends OrderBaseRecord {
private String bookOrgCode3; // 入住人组织架构信息3 private String bookOrgCode3; // 入住人组织架构信息3
private String projectOrderNo; // 项目订单号 private String projectOrderNo; // 项目订单号
private String offlineCcomyCode; // 成本中心 private String offlineCcomyCode; // 成本中心
private String payAmount; // 支付总金额
private String orderStatus;
private String createTime;
// 加载基础订单信息 // 加载基础订单信息
public OrderHotelRecord loadBasicOrderInfo(Long id, String orderNo, String orderStatus, String createTime) { public OrderHotelRecord loadBasicOrderInfo(String orderNo,
this.setId(id); String orderStatus,
String createTime) {
this.setOrderNo(orderNo); this.setOrderNo(orderNo);
// this.setOrderStatus(orderStatus); this.setOrderStatus(orderStatus);
// this.setCreateTime(createTime); this.setCreateTime(createTime);
return this; return this;
} }
// 加载酒店和入住信息 // 加载酒店和入住信息
public OrderHotelRecord loadHotelInfo(String hotelName, String hotelAddress, String checkInDate, String departureDate, public OrderHotelRecord loadHotelInfo(String hotelName, String hotelAddress, String checkInDate, String departureDate,
int roomCount, String roomTypeName) { int roomCount, String roomTypeName) {
this.setHotelName(hotelName); this.setHotelName(hotelName);
this.setHotelAddress(hotelAddress); this.setHotelAddress(hotelAddress);
this.setCheckInDate(checkInDate); this.setCheckInDate(checkInDate);
@ -112,22 +117,36 @@ public class OrderHotelRecord extends OrderBaseRecord {
} }
// 加载财务信息 // 加载财务信息
public OrderHotelRecord loadFinancialInfo(String accountCompanyId, String accountCompanyName, String accountPeriod, String billNo, public OrderHotelRecord loadFinancialInfo(String accountPeriod,
String orderAmount, String noTaxAmt, String taxAmt, String companyAmount, String personalAmount) { String billNo,
this.setAccountCompanyId(accountCompanyId); String orderAmount,
this.setAccountCompanyName(accountCompanyName); String ticketClerk,
String payAmount
) {
this.setAccountPeriod(accountPeriod); this.setAccountPeriod(accountPeriod);
this.setBillNo(billNo); this.setBillNo(billNo);
this.setOrderAmount(orderAmount); this.setOrderAmount(orderAmount);
this.setPayAmount(payAmount);
this.setTicketClerk(ticketClerk);
return this;
}
// 加载税类信息
public OrderHotelRecord loadTaxInfo(String noTaxAmt,
String taxAmt) {
this.setNoTaxAmt(noTaxAmt); this.setNoTaxAmt(noTaxAmt);
this.setTaxAmt(taxAmt); this.setTaxAmt(taxAmt);
this.setCompanyAmount(companyAmount);
this.setPersonalAmount(personalAmount);
return this; return this;
} }
// 加载支付和服务费信息 // 加载支付和服务费信息
public OrderHotelRecord loadPaymentAndServiceFeeInfo(int paymentType, String unifiedPayAmt, String personalPayAmt) { public OrderHotelRecord loadPaymentInfo(Integer paymentType,
String unifiedPayAmt,
String personalPayAmt,
String companyAmount,
String personalAmount) {
this.setCompanyAmount(companyAmount);
this.setPersonalAmount(personalAmount);
this.setPaymentType(paymentType); this.setPaymentType(paymentType);
this.setUnifiedPayAmt(unifiedPayAmt); this.setUnifiedPayAmt(unifiedPayAmt);
this.setPersonalPayAmt(personalPayAmt); this.setPersonalPayAmt(personalPayAmt);
@ -143,37 +162,41 @@ public class OrderHotelRecord extends OrderBaseRecord {
} }
// 加载订单来源和系统归属信息 // 加载订单来源和系统归属信息
public OrderHotelRecord loadSourceAndSystemInfo(String trvaleSysType, String belongSysType, String orderSource) { public OrderHotelRecord loadSourceInfo(String orderSource) {
this.setTrvaleSysType(trvaleSysType);
this.setBelongSysType(belongSysType);
this.setOrderSource(orderSource); this.setOrderSource(orderSource);
return this; return this;
} }
// 加载违规信息 // 加载违规信息
public OrderHotelRecord loadComplianceInfo(int overStandard, String overStandardReason) { public OrderHotelRecord loadComplianceInfo(OrderDetail orderDetail) {
this.setOverStandard(overStandard); orderDetail.getETAEvent().ifPresentOrElse(it -> {
this.setOverStandardReason(overStandardReason); this.setOverStandard(1);
this.setOverStandardReason(it.getExtension());
}, () -> {
this.setOverStandard(0);
this.setOverStandardReason("");
});
return this; return this;
} }
// 加载组织架构和项目信息 // 加载组织架构和项目信息
public OrderHotelRecord loadOrganizationalAndProjectInfo(String bookOrgCode1, String bookOrgCode2, String bookOrgCode3, public OrderHotelRecord loadOrganizationalAndProjectInfo(String bookOrgCode1,
String projectOrderNo, String offlineCcomyCode) { String bookOrgCode2,
String bookOrgCode3) {
this.setBookOrgCode1(bookOrgCode1); this.setBookOrgCode1(bookOrgCode1);
this.setBookOrgCode2(bookOrgCode2); this.setBookOrgCode2(bookOrgCode2);
this.setBookOrgCode3(bookOrgCode3); this.setBookOrgCode3(bookOrgCode3);
this.setProjectOrderNo(projectOrderNo);
this.setOfflineCcomyCode(offlineCcomyCode);
return this; return this;
} }
// 加载订单详情和结算信息 // 加载订单关联号信息
public OrderHotelRecord loadOrderDetailAndSettlementInfo(Long orderDetailId, String detailId, String ticketClerk, public OrderHotelRecord loadOrderNoInfo(Long orderDetailId,
String receiptsNum, String parentOrderNo, String originalOrderNo) { String detailId,
String receiptsNum,
String parentOrderNo,
String originalOrderNo) {
this.setOrderDetailId(orderDetailId); this.setOrderDetailId(orderDetailId);
this.setDetailId(detailId); this.setDetailId(detailId);
this.setTicketClerk(ticketClerk);
this.setReceiptsNum(receiptsNum); this.setReceiptsNum(receiptsNum);
this.setParentOrderNo(parentOrderNo); this.setParentOrderNo(parentOrderNo);
this.setOriginalOrderNo(originalOrderNo); this.setOriginalOrderNo(originalOrderNo);
@ -181,8 +204,12 @@ public class OrderHotelRecord extends OrderBaseRecord {
} }
// 加载房间和早餐信息 // 加载房间和早餐信息
public OrderHotelRecord loadRoomAndBreakfastInfo(String includeAmount, int isAgreement, int roomNightCount, public OrderHotelRecord loadRoomAndBreakfastInfo(String includeAmount,
int nightCount, String roomPrice, String roomRate) { int isAgreement,
int roomNightCount,
int nightCount,
String roomPrice,
String roomRate) {
this.setIncludeAmount(includeAmount); this.setIncludeAmount(includeAmount);
this.setIsAgreement(isAgreement); this.setIsAgreement(isAgreement);
this.setRoomNightCount(roomNightCount); this.setRoomNightCount(roomNightCount);

View File

@ -0,0 +1,73 @@
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;
@Data
@Table("c_trip_flight_base_info")
public class CTripFlightBaseInfo {
@Id
private Long id;
private Long cTripFlightRecordId;
private String Uid;
private String Rank;
private String ConfirmType;
private String ConfirmType2;
private String ConfirmPerson;
private String ConfirmPerson2;
private String ConfirmPersonCC;
private String ConfirmPersonCC2;
private String ConfirmPersonName;
private String ConfirmPersonName2;
private String ConfirmPersonCCName;
private String ConfirmPersonCCName2;
private String CostCenter;
private String CostCenter2;
private String CostCenter3;
private String CostCenter4;
private String CostCenter5;
private String CostCenter6;
private String JourneyReason;
private String Project;
private String DefineFlag;
private String DefineFlag2;
private String EmployeeID;
private String WorkCity;
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 CtripCardNo;
private String Name;
private String FlightClass;
private String IsOnline;
private String NickName;
private String JourneyID;
private String PrintTicketTime;
private String OrderDate;
private String PreEmployeeID;
private long RebookOrderID;
private String RankName;
private String RankNameEn;
private String ConfirmPersonEID;
private String ConfirmPerson2EID;
private String OrderStatus;
private String ProjectCode;
private String PrepayType;
private String ReservationType;
private String PreEmail;
public static CTripFlightBaseInfo of(OrderFlightResponse.FlightOrderBaseInfo flightOrderBaseInfo) {
return BeanUtil.copyProperties(flightOrderBaseInfo, CTripFlightBaseInfo.class);
}
}

View File

@ -20,13 +20,16 @@ public class CTripFlightRecord {
private CTripFlightRecordBase cTripFlightRecordBase; private CTripFlightRecordBase cTripFlightRecordBase;
@MappedCollection(idColumn = "c_trip_flight_record_id") @MappedCollection(idColumn = "c_trip_flight_record_id")
private CTripFlightInfo cTripFlightInfo; private CTripFlightInfo cTripFlightInfo;
@MappedCollection(idColumn = "c_trip_flight_record_id")
private CTripFlightBaseInfo cTripOrderBaseInfo;
public static CTripFlightRecord of(CTripFlightRecordBase cTripFlightRecordBase, CTripFlightInfo cTripFlightInfo) { public static CTripFlightRecord of(CTripFlightRecordBase cTripFlightRecordBase, CTripFlightInfo cTripFlightInfo,CTripFlightBaseInfo cTripOrderBaseInfo) {
CTripFlightRecord cTripFlightRecord = new CTripFlightRecord(); CTripFlightRecord cTripFlightRecord = new CTripFlightRecord();
cTripFlightRecord.setCTripFlightRecordBase(cTripFlightRecordBase); cTripFlightRecord.setCTripFlightRecordBase(cTripFlightRecordBase);
cTripFlightRecord.setCTripFlightInfo(cTripFlightInfo); cTripFlightRecord.setCTripFlightInfo(cTripFlightInfo);
cTripFlightRecord.setRecordId(String.valueOf(cTripFlightRecordBase.getRecordId())); cTripFlightRecord.setRecordId(String.valueOf(cTripFlightRecordBase.getRecordId()));
cTripFlightRecord.setCreateTime(DateTimeUtil.strToTimeMM(cTripFlightRecordBase.getCreateTime())); cTripFlightRecord.setCreateTime(DateTimeUtil.strToTimeMM(cTripFlightRecordBase.getCreateTime()));
cTripFlightRecord.setCTripOrderBaseInfo(cTripOrderBaseInfo);
return cTripFlightRecord; return cTripFlightRecord;
} }
} }

View File

@ -13,6 +13,7 @@ import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id; import org.springframework.data.annotation.Id;
import org.springframework.data.annotation.Transient; import org.springframework.data.annotation.Transient;
import org.springframework.data.relational.core.mapping.MappedCollection;
import org.springframework.data.relational.core.mapping.Table; import org.springframework.data.relational.core.mapping.Table;
import java.io.Serial; import java.io.Serial;
@ -44,6 +45,8 @@ public class User implements Serializable {
private String phoneNumber; private String phoneNumber;
private String password; private String password;
private LocalDateTime syncTime; private LocalDateTime syncTime;
@MappedCollection(idColumn = "user_id", keyColumn = "user_key")
private List<UserDepartmentInfo> userDepartmentInfo;
@Transient @Transient
private List<FsscSystem> fsscSystemList; private List<FsscSystem> fsscSystemList;
@Transient @Transient
@ -68,6 +71,10 @@ public class User implements Serializable {
this.employeeNo = employeeNo; this.employeeNo = employeeNo;
} }
// public User addDeptInfo(){
//
// }
public User(Long userId, String employeeNo, Integer employeeLevel, String name, String email, String phoneNumber, UserLoginParam userLoginParam, String standardLevel, String companyCode) { public User(Long userId, String employeeNo, Integer employeeLevel, String name, String email, String phoneNumber, UserLoginParam userLoginParam, String standardLevel, String companyCode) {
this.userId = userId; this.userId = userId;
this.employeeNo = employeeNo; this.employeeNo = employeeNo;

View File

@ -0,0 +1,36 @@
package com.chint.domain.aggregates.user;
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("user_department_info")
public class UserDepartmentInfo implements Serializable {
@Serial
private static final long serialVersionUID = 5602115854952241146L;
@Id
private Long id;
private Long userId;
private Integer userKey;
private String companyCode;
private String companyName;
private String departmentCodeOne;
private String departmentNameOne;
private String departmentCodeTwo;
private String departmentNameTwo;
private String departmentCodeThree;
private String departmentNameThree;
private String departmentCodeFour;
private String departmentNameFour;
private String departmentCodeFive;
private String departmentNameFive;
private String departmentCodeSix;
private String departmentNameSix;
private String departmentCodeSeven;
private String departmentNameSeven;
private Integer ifPrimary;
}

View File

@ -1,10 +1,7 @@
package com.chint.domain.factoriy.order_record; package com.chint.domain.factoriy.order_record;
import com.chint.application.dtos.response.LocationRes; import com.chint.application.dtos.response.LocationRes;
import com.chint.domain.aggregates.order.CarOrderDetail; import com.chint.domain.aggregates.order.*;
import com.chint.domain.aggregates.order.Location;
import com.chint.domain.aggregates.order.OrderDetail;
import com.chint.domain.aggregates.order.RouteOrder;
import com.chint.domain.aggregates.order.order_record.OrderCarRecord; import com.chint.domain.aggregates.order.order_record.OrderCarRecord;
import com.chint.domain.aggregates.order.order_record.OrderFlightRecord; import com.chint.domain.aggregates.order.order_record.OrderFlightRecord;
import com.chint.domain.aggregates.order.order_record.OrderHotelRecord; import com.chint.domain.aggregates.order.order_record.OrderHotelRecord;
@ -20,6 +17,8 @@ import org.springframework.stereotype.Component;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
import static com.chint.infrastructure.constant.UtilConstant.KEEP_TWO_DECIMAL_ZERO;
@Component @Component
public class CTripOrderRecordExtensionFactory implements OrderRecordExtensionFactory { public class CTripOrderRecordExtensionFactory implements OrderRecordExtensionFactory {
@ -44,7 +43,10 @@ public class CTripOrderRecordExtensionFactory implements OrderRecordExtensionFac
.carRecord(); .carRecord();
CTripCarRecordBase cTripCarRecordBase = cTripCarRecord.getCTripCarRecordBase(); CTripCarRecordBase cTripCarRecordBase = cTripCarRecord.getCTripCarRecordBase();
//携程的打车订单可以直接通过订单号获取对应的订单 //携程的打车订单可以直接通过订单号获取对应的订单
Optional<OrderDetail> orderDetail = byOrderNo.getOrderDetails().stream().filter(it -> it.getOrderNo().equals(String.valueOf( Optional<OrderDetail> orderDetail = byOrderNo
.getOrderDetails()
.stream()
.filter(it -> it.getOrderNo().equals(String.valueOf(
cTripCarRecordBase.getOrderId() cTripCarRecordBase.getOrderId()
))).findFirst(); ))).findFirst();
@ -115,7 +117,7 @@ public class CTripOrderRecordExtensionFactory implements OrderRecordExtensionFac
CarOrderDetail carOrderDetail = it.getCarOrderDetail(); CarOrderDetail carOrderDetail = it.getCarOrderDetail();
orderCarRecord.loadComplianceInfo(it) orderCarRecord.loadComplianceInfo(it)
.loadRelatedOrderInfo(it.getOrderId(), .loadRelatedOrderInfo(it.getOrderId(),
carOrderDetail.getDetailId(), cTripCarRecord.getRecordId(),
carOrderDetail.getReceiptsNum(), carOrderDetail.getReceiptsNum(),
carOrderDetail.getParentOrderNo(), carOrderDetail.getParentOrderNo(),
carOrderDetail.getOriginalOrderNo()) carOrderDetail.getOriginalOrderNo())
@ -135,8 +137,91 @@ public class CTripOrderRecordExtensionFactory implements OrderRecordExtensionFac
@Override @Override
public OrderFlightRecord createFlightOrderRecord(Object orderFlightRecordData) { public OrderFlightRecord createFlightOrderRecord(Object orderFlightRecordData) {
CTripFlightRecord cTripFlightRecord = (CTripFlightRecord) orderFlightRecordData;
String routeOrderNo = cTripFlightRecord.getRouteOrderNo();
RouteOrder byOrderNo = routeRepository.findByOrderNo(routeOrderNo);
OrderFlightRecord orderFlightRecord = orderRecordFactory.buildWithRouteOrder(byOrderNo)
.flightRecord();
return null; CTripFlightInfo cTripFlightInfo = cTripFlightRecord.getCTripFlightInfo();
CTripFlightRecordBase cTripFlightRecordBase = cTripFlightRecord.getCTripFlightRecordBase();
//携程的打车订单可以直接通过订单号获取对应的订单
Optional<OrderDetail> orderDetail = byOrderNo.
getOrderDetails()
.stream()
.filter(it -> it.getOrderNo().equals(String.valueOf(cTripFlightRecordBase.getOrderId()
))).findFirst();
// 加载航班信息 , 航线
orderFlightRecord.loadFlightInfo(cTripFlightInfo.getFlight(),
cTripFlightInfo.getAirLineName(),
cTripFlightInfo.getDPortName(),
cTripFlightInfo.getAPortName(),
cTripFlightInfo.getDCityName(),
cTripFlightInfo.getACityName(),
cTripFlightInfo.getTakeOffTime(),
cTripFlightInfo.getArrivalTime(),
"",
cTripFlightInfo.getACityCode(),
"")
.loadTicketInfo(cTripFlightRecordBase.getCreateTime(),
String.valueOf(cTripFlightRecordBase.getPrice()),
"")
.loadSeatInfo(cTripFlightInfo.getClassName(),
cTripFlightInfo.getClassName(),
String.valueOf(cTripFlightInfo.getPriceRate()));
// 加载财务与价格信息
String batchNo = cTripFlightRecordBase.getBatchStartDate().substring(0, 6);
orderFlightRecord.loadFinancialAndPricingInfo(batchNo,
cTripFlightRecordBase.getSubAccCheckBatchNo(),
String.valueOf(cTripFlightRecordBase.getPrice()),
String.valueOf(cTripFlightInfo.getEClassStandardPrice()),
String.valueOf(cTripFlightInfo.getLowPrice()),
String.valueOf(cTripFlightInfo.getLowPrice()));
// 加载税务信息
orderFlightRecord.loadTaxInfo(String.valueOf(cTripFlightRecordBase.getNonDeductibleTax()),
String.valueOf(cTripFlightRecordBase.getDeductibleTax()),
String.valueOf(cTripFlightRecordBase.getTax()),
String.valueOf(cTripFlightRecordBase.getOilFee()));
// 加载费用信息, 服务费 改签费 退票费 , 升舱费
orderFlightRecord.loadExtraFeeInfo(String.valueOf(cTripFlightRecordBase.getPostServiceFee()),
String.valueOf(cTripFlightRecordBase.getRebookQueryFee()),
String.valueOf(cTripFlightRecordBase.getRefund()),
String.valueOf(cTripFlightRecordBase.getAmount()),
String.valueOf(cTripFlightRecordBase.getSettItineraryFee()));
// 加载来源
if (cTripFlightRecord.getRouteOrderNo() == null ||
cTripFlightRecord.getRouteOrderNo().isEmpty() ||
cTripFlightRecord.getRouteOrderNo().isBlank()) {
orderFlightRecord.loadSourceInfo("N");
} else {
orderFlightRecord.loadSourceInfo("Y");
}
// 加载关联票价原因
orderDetail.ifPresent(it -> {
FlightOrderDetail flightOrderDetail = it.getFlightOrderDetail();
orderFlightRecord.loadComplianceInfo(it)
.loadBasicOrderInfo(String.valueOf(cTripFlightRecordBase.getOrderId()),
flightOrderDetail.getOrderStatus(),
cTripFlightRecordBase.getCreateTime())
.loadRelatedOrderInfo(it.getOrderId(),
String.valueOf(cTripFlightRecordBase.getRecordId()),
flightOrderDetail.getReceiptsNum(),
flightOrderDetail.getParentOrderNo(),
it.getOrderNo());
});
// 加载未预订最低价原因
orderFlightRecord.loadNotLowReason(cTripFlightInfo.getReasonDesc());
return orderFlightRecord;
} }
@Override @Override
@ -150,6 +235,7 @@ public class CTripOrderRecordExtensionFactory implements OrderRecordExtensionFac
.hotelRecord(); .hotelRecord();
CTripHotelInfo cTripHotelInfo = cTripHotelRecord.getCTripHotelInfo(); CTripHotelInfo cTripHotelInfo = cTripHotelRecord.getCTripHotelInfo();
CTripHotelRecordBase cTripHotelRecordBase = cTripHotelRecord.getCTripHotelRecordBase();
// 加载酒店和入住信息 // 加载酒店和入住信息
orderHotelRecord.loadHotelInfo(cTripHotelInfo.getHotelName(), orderHotelRecord.loadHotelInfo(cTripHotelInfo.getHotelName(),
cTripHotelInfo.getHotelName(), cTripHotelInfo.getHotelName(),
@ -158,6 +244,21 @@ public class CTripOrderRecordExtensionFactory implements OrderRecordExtensionFac
cTripHotelOrderDetail.getRoomQuantity(), cTripHotelOrderDetail.getRoomQuantity(),
cTripHotelOrderDetail.getRoomName()); cTripHotelOrderDetail.getRoomName());
// 加载房间和早餐信息 , 含早分数先为空
String isAgreement;
if (cTripHotelRecordBase.getOrderType().equals(4) || cTripHotelRecordBase.getOrderType().equals(6)) {
isAgreement = "1";
} else {
isAgreement = "0";
}
orderHotelRecord.loadRoomAndBreakfastInfo("",
Integer.parseInt(isAgreement),
cTripHotelRecordBase.getQuantity(),
cTripHotelRecordBase.getQuantity(),
String.valueOf(cTripHotelRecordBase.getPrice()),
String.valueOf(cTripHotelRecordBase.getAmount()));
// 加载地理信息位置 // 加载地理信息位置
Integer cityID = cTripHotelInfo.getCityID(); Integer cityID = cTripHotelInfo.getCityID();
List<Location> locations = locationRepository.findByCityId(Long.valueOf(cityID)); List<Location> locations = locationRepository.findByCityId(Long.valueOf(cityID));
@ -171,9 +272,73 @@ public class CTripOrderRecordExtensionFactory implements OrderRecordExtensionFac
} }
// 加载酒店品牌和星级信息 // 加载酒店品牌和星级信息
// orderHotelRecord.loadBrandAndStarRateInfo() orderHotelRecord.loadBrandAndStarRateInfo(cTripHotelInfo.getHotelGroupName(),
cTripHotelInfo.getBrandName(),
String.valueOf(cTripHotelInfo.getStar()));
// 加载订单来源和系统归属信息
String sourceInfo;
if (cTripHotelRecord.getRouteOrderNo() == null) {
sourceInfo = "N";
} else {
sourceInfo = "Y";
}
orderHotelRecord.loadSourceInfo(sourceInfo);
Optional<OrderDetail> orderDetailOptional = byOrderNo.getOrderDetails()
.stream()
.filter(it -> it.getOrderNo().equals(String.valueOf(cTripHotelRecordBase.getOrderId())))
.findFirst();
orderDetailOptional.ifPresent(it -> {
orderHotelRecord.loadComplianceInfo(it); // 加载违规信息
HotelOrderDetail hotelOrderDetail = it.getHotelOrderDetail();
orderHotelRecord.loadOrderNoInfo(it.getOrderId(), // 加载订单关联号信息
cTripHotelRecord.getRecordId(),
hotelOrderDetail.getReceiptsNum(),
hotelOrderDetail.getOrderNo(),
hotelOrderDetail.getOrderNo());
orderHotelRecord.loadBasicOrderInfo(hotelOrderDetail.getOrderNo(), // 加载基础订单信息
hotelOrderDetail.getOrderStatus(),
cTripHotelRecordBase.getCreateTime());
});
// 加载财务信息
orderHotelRecord.loadFinancialInfo(cTripHotelRecordBase.getSubAccCheckBatchNo(),
cTripHotelRecordBase.getBatchStartDate().substring(0, 6),
String.valueOf(cTripHotelRecordBase.getAmount()),
"",
cTripHotelRecordBase.getPaidAmount());
return null; // 加载付款 付款方式公司付款金额, 个人付款金额
String paymentType;
Double personAmount = cTripHotelRecordBase.getPersonAmount();
Double paidAmount = Double.parseDouble(cTripHotelRecordBase.getPaidAmount());
if (personAmount > 0 && personAmount < paidAmount) {
paymentType = "2";
} else if (personAmount.equals(paidAmount)) {
paymentType = "1";
} else {
paymentType = "0";
}
orderHotelRecord.loadPaymentInfo(Integer.parseInt(paymentType),
cTripHotelRecordBase.getBookServiceFee(),
KEEP_TWO_DECIMAL_ZERO,
String.valueOf(paidAmount - personAmount),
String.valueOf(personAmount));
// 加载预订人和入住人信息
orderHotelRecord.loadBookerAndGuestInfo(cTripHotelOrderDetail.getEmployeeID(),
cTripHotelOrderDetail.getEmployeeName(),
cTripHotelOrderDetail.getEmployeeID(),
cTripHotelOrderDetail.getEmployeeName());
// 加载组织架构
orderHotelRecord.loadOrganizationalAndProjectInfo(cTripHotelOrderDetail.getDept1(),
cTripHotelOrderDetail.getDept2(),
cTripHotelOrderDetail.getDept3());
return orderHotelRecord;
} }
} }

View File

@ -3,7 +3,10 @@ package com.chint.domain.repository;
import com.chint.domain.aggregates.order.order_record.OrderCarRecord; import com.chint.domain.aggregates.order.order_record.OrderCarRecord;
import java.util.List; import java.util.List;
import java.util.Optional;
public interface OrderCarRecordRepository { public interface OrderCarRecordRepository {
List<OrderCarRecord> saveAll(List<OrderCarRecord> orderCarRecordList); List<OrderCarRecord> saveAll(List<OrderCarRecord> orderCarRecordList);
Optional<OrderCarRecord> findByDetailId(String detailId);
} }

View File

@ -3,9 +3,10 @@ package com.chint.domain.repository;
import com.chint.domain.aggregates.order.order_record.OrderFlightRecord; import com.chint.domain.aggregates.order.order_record.OrderFlightRecord;
import java.util.List; import java.util.List;
import java.util.Optional;
public interface OrderFlightRecordRepository { public interface OrderFlightRecordRepository {
List<OrderFlightRecord> saveAll(List<OrderFlightRecord> orderFlightRecordList); List<OrderFlightRecord> saveAll(List<OrderFlightRecord> orderFlightRecordList);
Optional<OrderFlightRecord> findByDetailId(String detailId);
} }

View File

@ -3,7 +3,10 @@ package com.chint.domain.repository;
import com.chint.domain.aggregates.order.order_record.OrderHotelRecord; import com.chint.domain.aggregates.order.order_record.OrderHotelRecord;
import java.util.List; import java.util.List;
import java.util.Optional;
public interface OrderHotelRecordRepository { public interface OrderHotelRecordRepository {
List<OrderHotelRecord> saveAll(List<OrderHotelRecord> orderHotelRecordList); List<OrderHotelRecord> saveAll(List<OrderHotelRecord> orderHotelRecordList);
Optional<OrderHotelRecord> findByDetailId(String detailId);
} }

View File

@ -4,7 +4,10 @@ import com.chint.domain.aggregates.order.order_record.OrderHotelRecord;
import com.chint.domain.aggregates.order.order_record.OrderTrainRecord; import com.chint.domain.aggregates.order.order_record.OrderTrainRecord;
import java.util.List; import java.util.List;
import java.util.Optional;
public interface OrderTrainRecordRepository { public interface OrderTrainRecordRepository {
List<OrderTrainRecord> saveAll(List<OrderTrainRecord> orderTrainRecordList); List<OrderTrainRecord> saveAll(List<OrderTrainRecord> orderTrainRecordList);
Optional<OrderTrainRecord> findByDetailId(String detailId);
} }

View File

@ -17,6 +17,7 @@ import org.springframework.stereotype.Service;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Optional;
import static com.chint.infrastructure.constant.OrderConstant.ORDER_EVENT_CANCEL; import static com.chint.infrastructure.constant.OrderConstant.ORDER_EVENT_CANCEL;
import static com.chint.infrastructure.constant.SupplierNameConstant.SUPPLIER_C_TRIP; import static com.chint.infrastructure.constant.SupplierNameConstant.SUPPLIER_C_TRIP;
@ -85,15 +86,32 @@ public class OrderDetailDomainService {
} }
public List<OrderCarRecord> saveCarOrderRecordBatch(List<OrderCarRecord> orderCarRecordList) { public List<OrderCarRecord> saveCarOrderRecordBatch(List<OrderCarRecord> orderCarRecordList) {
//如果发现唯一键已经存在 那么就做更新处理
orderCarRecordList.forEach(needSave-> orderCarRecordRepository
.findByDetailId(needSave.getDetailId())
.ifPresent(it->
needSave.setId(it.getId())));
return orderCarRecordRepository.saveAll(orderCarRecordList); return orderCarRecordRepository.saveAll(orderCarRecordList);
} }
public List<OrderFlightRecord> saveFlightOrderRecordBatch(List<OrderFlightRecord> orderFlightRecordList) { public List<OrderFlightRecord> saveFlightOrderRecordBatch(List<OrderFlightRecord> orderFlightRecordList) {
orderFlightRecordList.forEach(needSave-> orderFlightRecordRepository
.findByDetailId(needSave.getDetailId())
.ifPresent(it->
needSave.setId(it.getId())));
return orderFlightRecordRepository.saveAll(orderFlightRecordList); return orderFlightRecordRepository.saveAll(orderFlightRecordList);
} }
public List<OrderTrainRecord> saveTrainOrderRecordBatch(List<OrderTrainRecord> orderTrainRecordList) { public List<OrderTrainRecord> saveTrainOrderRecordBatch(List<OrderTrainRecord> orderTrainRecordList) {
orderTrainRecordList.forEach(needSave-> orderTrainRecordRepository
.findByDetailId(needSave.getDetailId())
.ifPresent(it->
needSave.setId(it.getId())));
return orderTrainRecordRepository.saveAll(orderTrainRecordList); return orderTrainRecordRepository.saveAll(orderTrainRecordList);
} }
public List<OrderHotelRecord> saveHotelOrderRecordBatch(List<OrderHotelRecord> orderHotelRecordList) { public List<OrderHotelRecord> saveHotelOrderRecordBatch(List<OrderHotelRecord> orderHotelRecordList) {
orderHotelRecordList.forEach(needSave-> orderHotelRecordRepository
.findByDetailId(needSave.getDetailId())
.ifPresent(it->
needSave.setId(it.getId())));
return orderHotelRecordRepository.saveAll(orderHotelRecordList); return orderHotelRecordRepository.saveAll(orderHotelRecordList);
} }

View File

@ -17,30 +17,34 @@ import java.util.List;
@Component @Component
public class CTripOrderRecordDomainService implements OrderRecordDomainService{ public class CTripOrderRecordDomainService implements OrderRecordDomainService{
@Autowired
private JdbcCtripHotelOrderDetailRepository jdbcCtripHotelOrderDetailRepository;
@Autowired @Autowired
private CTripOrderRecordExtensionFactory cTripOrderRecordExtensionFactory; private CTripOrderRecordExtensionFactory cTripOrderRecordExtensionFactory;
@Autowired @Autowired
private OrderDetailDomainService orderDetailDomainService; private OrderDetailDomainService orderDetailDomainService;
@Override @Override
public List<OrderHotelRecord> generateHotelRecord(OrderRecordGenerateCommand command) { public List<OrderHotelRecord> generateHotelRecord(OrderRecordGenerateCommand command) {
return null; return null;
} }
@Override @Override
public List<OrderTrainRecord> generateTrainRecord(OrderRecordGenerateCommand command) { public List<OrderTrainRecord> generateTrainRecord(OrderRecordGenerateCommand command) {
return null; return null;
} }
@Override @Override
public List<OrderFlightRecord> generateFlightRecord(OrderRecordGenerateCommand command) { public List<OrderFlightRecord> generateFlightRecord(OrderRecordGenerateCommand command) {
return null; return null;
} }
@Override @Override
public List<OrderCarRecord> generateCarRecord(OrderRecordGenerateCommand command) { public List<OrderCarRecord> generateCarRecord(OrderRecordGenerateCommand command) {
return null; return null;
} }
} }

View File

@ -8,6 +8,7 @@ import org.springframework.stereotype.Repository;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Optional;
@Repository @Repository
public class OrderCarRecordRepositoryImpl implements OrderCarRecordRepository { public class OrderCarRecordRepositoryImpl implements OrderCarRecordRepository {
@ -19,4 +20,9 @@ public class OrderCarRecordRepositoryImpl implements OrderCarRecordRepository {
orderCarRecordRepository.saveAll(orderCarRecordList).forEach(res::add); orderCarRecordRepository.saveAll(orderCarRecordList).forEach(res::add);
return res; return res;
} }
@Override
public Optional<OrderCarRecord> findByDetailId(String detailId) {
return orderCarRecordRepository.findByDetailId(detailId);
}
} }

View File

@ -8,6 +8,7 @@ import org.springframework.stereotype.Repository;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Optional;
@Repository @Repository
public class OrderFlightRecordRepositoryImpl implements OrderFlightRecordRepository { public class OrderFlightRecordRepositoryImpl implements OrderFlightRecordRepository {
@ -22,5 +23,9 @@ public class OrderFlightRecordRepositoryImpl implements OrderFlightRecordReposit
return res; return res;
} }
@Override
public Optional<OrderFlightRecord> findByDetailId(String detailId) {
return jdbcOrderFlightRecordRepository.findByDetailId(detailId);
}
} }

View File

@ -10,6 +10,7 @@ import org.springframework.stereotype.Repository;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Optional;
@Repository @Repository
public class OrderHotelRecordRepositoryImpl implements OrderHotelRecordRepository { public class OrderHotelRecordRepositoryImpl implements OrderHotelRecordRepository {
@ -22,4 +23,9 @@ public class OrderHotelRecordRepositoryImpl implements OrderHotelRecordRepositor
jdbcOrderHotelRecordRepository.saveAll(orderHotelRecordList).forEach(res::add); jdbcOrderHotelRecordRepository.saveAll(orderHotelRecordList).forEach(res::add);
return res; return res;
} }
@Override
public Optional<OrderHotelRecord> findByDetailId(String detailId) {
return jdbcOrderHotelRecordRepository.findByDetailId(detailId);
}
} }

View File

@ -10,6 +10,7 @@ import org.springframework.stereotype.Repository;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Optional;
@Repository @Repository
public class OrderTrainRecordRepositoryImpl implements OrderTrainRecordRepository { public class OrderTrainRecordRepositoryImpl implements OrderTrainRecordRepository {
@ -21,4 +22,9 @@ public class OrderTrainRecordRepositoryImpl implements OrderTrainRecordRepositor
jdbcOrderTrainRecordRepository.saveAll(orderTrainRecordList).forEach(res::add); jdbcOrderTrainRecordRepository.saveAll(orderTrainRecordList).forEach(res::add);
return res; return res;
} }
@Override
public Optional<OrderTrainRecord> findByDetailId(String detailId) {
return jdbcOrderTrainRecordRepository.findByDetailId(detailId);
}
} }

View File

@ -4,6 +4,10 @@ import com.chint.domain.aggregates.order.order_record.OrderCarRecord;
import org.springframework.data.repository.CrudRepository; import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import java.util.Optional;
@Repository @Repository
public interface JdbcOrderCarRecordRepository extends CrudRepository<OrderCarRecord,Long> { public interface JdbcOrderCarRecordRepository extends CrudRepository<OrderCarRecord,Long> {
Optional<OrderCarRecord> findByDetailId(String detailId);
} }

View File

@ -4,6 +4,9 @@ import com.chint.domain.aggregates.order.order_record.OrderFlightRecord;
import org.springframework.data.repository.CrudRepository; import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import java.util.Optional;
@Repository @Repository
public interface JdbcOrderFlightRecordRepository extends CrudRepository<OrderFlightRecord,Long> { public interface JdbcOrderFlightRecordRepository extends CrudRepository<OrderFlightRecord,Long> {
Optional<OrderFlightRecord> findByDetailId(String detailId);
} }

View File

@ -4,6 +4,10 @@ import com.chint.domain.aggregates.order.order_record.OrderHotelRecord;
import org.springframework.data.repository.CrudRepository; import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import java.util.Optional;
@Repository @Repository
public interface JdbcOrderHotelRecordRepository extends CrudRepository<OrderHotelRecord,Long> { public interface JdbcOrderHotelRecordRepository extends CrudRepository<OrderHotelRecord,Long> {
Optional<OrderHotelRecord> findByDetailId(String detailId);
} }

View File

@ -4,6 +4,9 @@ import com.chint.domain.aggregates.order.order_record.OrderTrainRecord;
import org.springframework.data.repository.CrudRepository; import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import java.util.Optional;
@Repository @Repository
public interface JdbcOrderTrainRecordRepository extends CrudRepository<OrderTrainRecord,Long> { public interface JdbcOrderTrainRecordRepository extends CrudRepository<OrderTrainRecord,Long> {
Optional<OrderTrainRecord> findByDetailId(String detailId);
} }

View File

@ -45,9 +45,9 @@ public class CTripOrderRecordAutoSave {
String.valueOf(orderSettlementBaseInfo.getRecordID())); String.valueOf(orderSettlementBaseInfo.getRecordID()));
if (record == null) { if (record == null) {
record = CTripFlightRecord.of( record = CTripFlightRecord.of(
CTripFlightRecordBase.changeInfo( CTripFlightRecordBase.changeInfo(orderSettlementBaseInfo),
orderSettlementBaseInfo CTripFlightInfo.of(it.getOrderFlightInfo()),
), CTripFlightInfo.of(it.getOrderFlightInfo()) CTripFlightBaseInfo.of(it.getOrderBaseInfo())
); );
} }
//补充额外的字段 //补充额外的字段
@ -72,7 +72,8 @@ public class CTripOrderRecordAutoSave {
String.valueOf(settlementDetail.getRecordId())); String.valueOf(settlementDetail.getRecordId()));
if (record == null) { if (record == null) {
record = CTripHotelRecord.of(CTripHotelRecordBase.changeInfo(settlementDetail), record = CTripHotelRecord.of(CTripHotelRecordBase.changeInfo(settlementDetail),
CTripHotelInfo.of(it.getHotelDetail()),CTripHotelOrderDetail.of(it.getOrderDetail())); CTripHotelInfo.of(it.getHotelDetail()),
CTripHotelOrderDetail.of(it.getOrderDetail()));
} }
//补充额外的字段 //补充额外的字段
OrderHotelResponse.SettlementOrderDetail orderDetail = it.getOrderDetail(); OrderHotelResponse.SettlementOrderDetail orderDetail = it.getOrderDetail();