Compare commits

...

10 Commits

Author SHA1 Message Date
lulz1 dfa1248fe0 备份代码 2024-04-02 17:06:27 +08:00
dengwc 56f89260fc Merge remote-tracking branch 'origin/dev' into dev 2024-04-02 14:58:02 +08:00
dengwc 5bb2c31ddc 结算明细字段映射调整 2024-04-02 14:57:44 +08:00
lulz1 040dbacfa2 机票结算添加总付款字段 2024-04-02 14:19:32 +08:00
lulz1 ff18fd425f 结算数据添加一个财务共享单号字段 2024-04-02 13:37:58 +08:00
lulz1 8677651456 完成携程按月获取结算 2024-04-02 10:19:30 +08:00
lulz1 ca0c50bec5 完成携程按月获取结算 2024-04-02 09:57:53 +08:00
lulz1 684e8c7fac Merge remote-tracking branch 'origin/dev' into dev 2024-04-02 09:46:28 +08:00
dengwc fed270e71a Merge remote-tracking branch 'origin/dev' into dev 2024-04-01 17:14:40 +08:00
dengwc ba25eed951 结算明细字段映射调整 2024-04-01 17:14:24 +08:00
29 changed files with 631 additions and 150 deletions

View File

@ -0,0 +1,12 @@
package com.chint.application.commands;
import com.chint.infrastructure.echo_framework.command.Command;
import lombok.Data;
//将上月的结算数据生成为财务共享需要的数据
@Data
public class LYOrderRecordGenerateCommand extends Command {
}

View File

@ -1,6 +1,7 @@
package com.chint.application.in;
import com.chint.application.commands.LYOrderRecordGenerateCommand;
import com.chint.application.dtos.CTripRecordMonthSaveDTO;
import com.chint.domain.factoriy.order_record.LyStatementOrder;
import com.chint.infrastructure.echo_framework.command.Command;
@ -69,7 +70,7 @@ public class AutoWorkController {
//同步拉取上月数据
lyStatementOrder.saveAll();
//将上月的结算数据生成为财务共享需要的数据
Command.of(OrderRecordGenerateCommand.class).sendToQueue();
Command.of(LYOrderRecordGenerateCommand.class).sendToQueue();
return Result.Success(SUCCESS);
}

View File

@ -112,10 +112,10 @@ public class OrderEvent implements Serializable {
public static String mapToHotelOrderDetailStatus(Integer eventType){
return switch (eventType) {
case ORDER_EVENT_PREPARE -> FSSC_HOTEL_STATUS_REFUND; //未下单 改成3
case ORDER_EVENT_PREPARE -> FSSC_HOTEL_STATUS_SUCCESS; //未下单 改成3
case ORDER_EVENT_PAYED -> FSSC_HOTEL_STATUS_SUCCESS;
case ORDER_EVENT_CHANGE -> FSSC_HOTEL_STATUS_SUCCESS;
case ORDER_EVENT_CANCEL -> FSSC_HOTEL_STATUS_SUCCESS; //e额外生成的单子为3 退票虽然是3 返回为1
case ORDER_EVENT_CANCEL -> FSSC_ORDER_STATUS_CANCEL; //e额外生成的单子为3 退票虽然是3 返回为1
case ORDER_EVENT_ORDERED -> FSSC_HOTEL_STATUS_SUCCESS;
case ORDER_EVENT_REFUND -> FSSC_HOTEL_STATUS_SUCCESS;
case ORDER_EVENT_UNKNOWN -> FSSC_ORDER_STATUS_CANCEL;

View File

@ -70,7 +70,7 @@ public class OrderCarRecord extends OrderBaseRecord {
private String offlineCcomyCode; // 成本中心
private String orderSource; // 预订来源线上/线下
private String payAmount;//支付总金额
private String receiptsNumOrigin;//支付总金额
//添加行程信息
@ -173,10 +173,17 @@ public class OrderCarRecord extends OrderBaseRecord {
return this;
}
public OrderCarRecord loadComplianceInfoNot() {
this.setOverStandard("");
this.setOverStandardReason("");
return this;
}
// 加载关联订单信息
public OrderCarRecord loadRelatedOrderInfo(Long orderDetailId,
String detailId,
String receiptsNum,
String receiptsNumOrigin,
String parentOrderNo,
String originalOrderNo) {
this.setOrderDetailId(orderDetailId);
@ -184,6 +191,7 @@ public class OrderCarRecord extends OrderBaseRecord {
this.setReceiptsNum(receiptsNum);
this.setParentOrderNo(parentOrderNo);
this.setOriginalOrderNo(originalOrderNo);
this.setReceiptsNumOrigin(receiptsNumOrigin);
return this;
}
}

View File

@ -78,6 +78,8 @@ public class OrderFlightRecord extends OrderBaseRecord {
private String offlineCcomyCode; // 成本中心
private String orderStatus;
private String createTime;
private String receiptsNumOrigin;//原差旅申请单单号
private String payAmount;
// 加载基础订单信息
public OrderFlightRecord loadBasicOrderInfo(String orderNo,
@ -152,13 +154,14 @@ public class OrderFlightRecord extends OrderBaseRecord {
public OrderFlightRecord loadFinancialAndPricingInfo(String accountPeriod,
String billNo,
String orderAmount,
String payAmount,
String ycabinFullPrice,
String policyLowestPrice,
String flightLowestPrice) {
this.setAccountPeriod(accountPeriod);
this.setBillNo(billNo);
this.setOrderAmount(orderAmount);
this.setPayAmount(payAmount);
this.setYcabinFullPrice(ycabinFullPrice); //经济舱全价
this.setPolicyLowestPrice(policyLowestPrice); // 比价范围最低价
this.setFlightLowestPrice(flightLowestPrice); // 航班最低价
@ -210,16 +213,22 @@ public class OrderFlightRecord extends OrderBaseRecord {
// 加载违规信息
public OrderFlightRecord loadComplianceInfo(OrderDetail orderDetail) {
orderDetail.getETAEvent().ifPresentOrElse(it->{
orderDetail.getETAEvent().ifPresentOrElse(it -> {
this.setOverStandard("");
this.setOverStandardReason(it.getExtension());
},()->{
}, () -> {
this.setOverStandard("");
this.setOverStandardReason("");
});
return this;
}
public OrderFlightRecord loadComplianceInfoNot() {
this.setOverStandard("");
this.setOverStandardReason("");
return this;
}
// 加载未预订最低价原因
public OrderFlightRecord loadNotLowReason(String notLowReason) {
@ -231,6 +240,7 @@ public class OrderFlightRecord extends OrderBaseRecord {
public OrderFlightRecord loadRelatedOrderInfo(Long orderDetailId,
String detailId,
String receiptsNum,
String receiptsNumOrigin,
String parentOrderNo,
String originalOrderNo) {
this.setOrderDetailId(orderDetailId);
@ -238,6 +248,7 @@ public class OrderFlightRecord extends OrderBaseRecord {
this.setReceiptsNum(receiptsNum);
this.setParentOrderNo(parentOrderNo);
this.setOriginalOrderNo(originalOrderNo);
this.setReceiptsNumOrigin(receiptsNumOrigin);
return this;
}
}

View File

@ -8,6 +8,8 @@ import lombok.experimental.Accessors;
import org.springframework.data.annotation.Id;
import org.springframework.data.relational.core.mapping.Table;
import java.util.Optional;
@Data
@Table("order_hotel_record")
@NoArgsConstructor
@ -30,7 +32,7 @@ public class OrderHotelRecord extends OrderBaseRecord {
private String originalOrderNo; // 原始订单号
private String brandGroup; // 酒店品牌集团
private String brandName; // 酒店品牌
private int overStandard; // 是否违规超标 0否 1是
private String overStandard; // 是否违规超标 0否 1是
private String overStandardReason; // 违规原因超标原因
private String receiptsNum; // 关联申请单号
private String bookingName; // 预订人姓名
@ -45,7 +47,7 @@ public class OrderHotelRecord extends OrderBaseRecord {
private String hotelAddress; // 酒店地址
private String hotelName; // 酒店名称
private String includeAmount; // 含早情况XX份
private int isAgreement; // 是否协议酒店0否1是
private String isAgreement; // 是否协议酒店0否1是
private int paymentType; // 付款方式 0-公司统付 1-个人付 2-混付
private String orderAmount; // 订单总额
private String companyAmount; // 企业统付总额
@ -76,7 +78,7 @@ public class OrderHotelRecord extends OrderBaseRecord {
private String payAmount; // 支付总金额
private String orderStatus;
private String createTime;
private String receiptsNumOrigin;//支付总金额
// 加载基础订单信息
public OrderHotelRecord loadBasicOrderInfo(String orderNo,
String orderStatus,
@ -168,12 +170,15 @@ public class OrderHotelRecord extends OrderBaseRecord {
}
// 加载违规信息
public OrderHotelRecord loadComplianceInfo(OrderDetail orderDetail) {
orderDetail.getETAEvent().ifPresentOrElse(it -> {
this.setOverStandard(1);
this.setOverStandardReason(it.getExtension());
public OrderHotelRecord loadComplianceInfo(Optional<OrderDetail> orderDetail) {
orderDetail.ifPresentOrElse(it -> it.getETAEvent().ifPresentOrElse(orderEvent -> {
this.setOverStandard("");
this.setOverStandardReason(orderEvent.getExtension());
}, () -> {
this.setOverStandard(0);
this.setOverStandard("");
this.setOverStandardReason("");
}), () -> {
this.setOverStandard("");
this.setOverStandardReason("");
});
return this;
@ -193,6 +198,7 @@ public class OrderHotelRecord extends OrderBaseRecord {
public OrderHotelRecord loadOrderNoInfo(Long orderDetailId,
String detailId,
String receiptsNum,
String receiptsNumOrigin,
String parentOrderNo,
String originalOrderNo) {
this.setOrderDetailId(orderDetailId);
@ -200,12 +206,13 @@ public class OrderHotelRecord extends OrderBaseRecord {
this.setReceiptsNum(receiptsNum);
this.setParentOrderNo(parentOrderNo);
this.setOriginalOrderNo(originalOrderNo);
this.setReceiptsNumOrigin(receiptsNumOrigin);
return this;
}
// 加载房间和早餐信息
public OrderHotelRecord loadRoomAndBreakfastInfo(String includeAmount,
int isAgreement,
String isAgreement,
int roomNightCount,
int nightCount,
String roomPrice,
@ -220,8 +227,11 @@ public class OrderHotelRecord extends OrderBaseRecord {
}
// 加载发票和费用信息
public OrderHotelRecord loadInvoiceAndFeeInfo(String invoiceType, String invoiceFee, String custodayFee,
String noTaxCusFee, String taxCusFee) {
public OrderHotelRecord loadInvoiceAndFeeInfo(String invoiceType,
String invoiceFee,
String custodayFee,
String noTaxCusFee,
String taxCusFee) {
this.setInvoiceType(invoiceType);
this.setInvoiceFee(invoiceFee);
this.setCustodayFee(custodayFee);

View File

@ -71,7 +71,7 @@ public class OrderTrainRecord extends OrderBaseRecord{
private String passportType; // 乘客证件类型
private String trainTime; // 发车时间 yyyy-MM-dd HH:mm:ss
private String yxId; // 影像比对ID
private String receiptsNumOrigin;//原差旅申请单单号
// 加载基础订单信息
public OrderTrainRecord loadBasicOrderInfo(Long id, String orderNo, String orderStatus, String createTime) {
this.setId(id);

View File

@ -52,7 +52,7 @@ public class LyOrderCarRecord implements Serializable {
private String subjectRemark;
@MappedCollection(idColumn = "ly_record_id", keyColumn = "ly_record_key")
private List<TripSubmitItemList> tripSubmitItemList;
private List<TripSubmitItemCarList> tripSubmitItemList;
//出行人职级
private String passengerPositionLevelName;

View File

@ -92,7 +92,7 @@ public class LyOrderFlightRecord implements Serializable {
private String overStandardStatus;
@MappedCollection(idColumn = "ly_record_id", keyColumn = "ly_record_key")
private List<TripSubmitItemList> tripSubmitItemList;
private List<TripSubmitItemFlightList> tripSubmitItemList;
//出行人职级
private String passengerPositionLevelName;

View File

@ -64,7 +64,7 @@ public class LyOrderHotelRecord implements Serializable {
private String overStandardStatus;
@MappedCollection(idColumn = "ly_record_id", keyColumn = "ly_record_key")
private List<TripSubmitItemList> tripSubmitItemList;
private List<TripSubmitItemHotelList> tripSubmitItemList;
//出行人职级
private String passengerPositionLevelName;

View File

@ -58,7 +58,7 @@ public class LyOrderTrainRecord implements Serializable {
private String overStandardStatus;
@MappedCollection(idColumn = "ly_record_id", keyColumn = "ly_record_key")
private List<TripSubmitItemList> tripSubmitItemList;
private List<TripSubmitItemTrainList> tripSubmitItemList;
//出行人职级
private String passengerPositionLevelName;

View File

@ -0,0 +1,45 @@
package com.chint.domain.aggregates.order.order_record.ly_order_record;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.relational.core.mapping.Table;
import java.io.Serial;
import java.io.Serializable;
/**
* 行程提交项目(TripSubmitItem)表实体类
*
* @author dengweichao
* @since 2024-03-27 10:17:58
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Table("trip_submit_item_car_list")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class TripSubmitItemCarList implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@Id
private Integer id;
//父id
private Integer lyRecordId;
private Integer lyRecordKey;
//编码
private String code;
//名称
private String name;
//内容
private String content;
}

View File

@ -0,0 +1,46 @@
package com.chint.domain.aggregates.order.order_record.ly_order_record;
import java.io.Serial;
import java.io.Serializable;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import com.fasterxml.jackson.annotation.JsonInclude;
import org.springframework.data.annotation.Id;
import org.springframework.data.relational.core.mapping.Table;
/**
* 行程提交项目(TripSubmitItem)表实体类
*
* @author dengweichao
* @since 2024-03-27 10:17:58
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Table("trip_submit_item_flight_list")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class TripSubmitItemFlightList implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@Id
private Integer id;
//父id
private Integer lyRecordId;
private Integer lyRecordKey;
//编码
private String code;
//名称
private String name;
//内容
private String content;
}

View File

@ -0,0 +1,45 @@
package com.chint.domain.aggregates.order.order_record.ly_order_record;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.relational.core.mapping.Table;
import java.io.Serial;
import java.io.Serializable;
/**
* 行程提交项目(TripSubmitItem)表实体类
*
* @author dengweichao
* @since 2024-03-27 10:17:58
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Table("trip_submit_item_hotel_list")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class TripSubmitItemHotelList implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@Id
private Integer id;
//父id
private Integer lyRecordId;
private Integer lyRecordKey;
//编码
private String code;
//名称
private String name;
//内容
private String content;
}

View File

@ -1,19 +1,18 @@
package com.chint.domain.aggregates.order.order_record.ly_order_record;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.relational.core.mapping.Table;
import java.io.Serial;
import java.io.Serializable;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import com.fasterxml.jackson.annotation.JsonInclude;
import org.springframework.data.annotation.Id;
import org.springframework.data.relational.core.mapping.Table;
/**
* 行程提交项目(TripSubmitItem)表实体类
* 行程提交项目
*
* @author dengweichao
* @since 2024-03-27 10:17:58
@ -21,20 +20,15 @@ import org.springframework.data.relational.core.mapping.Table;
@Data
@AllArgsConstructor
@NoArgsConstructor
@Table("trip_submit_item_list")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class TripSubmitItemList implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@Id
private Integer id;
//父id
private Integer lyRecordId;
private Integer lyRecordKey;
//编码
private String code;

View File

@ -0,0 +1,45 @@
package com.chint.domain.aggregates.order.order_record.ly_order_record;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.relational.core.mapping.Table;
import java.io.Serial;
import java.io.Serializable;
/**
* 行程提交项目(TripSubmitItem)表实体类
*
* @author dengweichao
* @since 2024-03-27 10:17:58
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Table("trip_submit_item_train_list")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class TripSubmitItemTrainList implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@Id
private Integer id;
//父id
private Integer lyRecordId;
private Integer lyRecordKey;
//编码
private String code;
//名称
private String name;
//内容
private String content;
}

View File

@ -6,6 +6,7 @@ import com.chint.domain.aggregates.system.FsscSystem;
import com.chint.domain.value_object.UserLoginParam;
import com.chint.infrastructure.constant.AuthMessageConstant;
import com.chint.interfaces.rest.base.PostRequest;
import com.chint.interfaces.rest.user.PushUser;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import lombok.AllArgsConstructor;
@ -71,6 +72,7 @@ public class User implements Serializable {
this.employeeNo = employeeNo;
}
// public User addDeptInfo(){
//
// }
@ -106,6 +108,8 @@ public class User implements Serializable {
this.companyCode = companyCode;
}
public User addFssc(String CompanyName, String sysCode) {
FsscSystem fsscSystem = new FsscSystem(CompanyName, sysCode);
this.addFsscSystemToList(fsscSystem);
@ -184,4 +188,9 @@ public class User implements Serializable {
public String generateXNFsscUrlPath() {
return XN_FSSC_REDIRECT_PATH_APPROVAL_ONE + employeeNo + FSSC_REDIRECT_PATH_APPROVAL_TWO;
}
// public User startAddDept(){
//
//
// }
}

View File

@ -33,4 +33,7 @@ public class UserDepartmentInfo implements Serializable {
private String departmentCodeSeven;
private String departmentNameSeven;
private Integer ifPrimary;
// Builder static inner class
}

View File

@ -146,29 +146,47 @@ public class CTripOrderRecordExtensionFactory implements OrderRecordExtensionFac
}
// 加载超标信息, 加载订单关联信息 加载订单状态 单号创建时间等信息
// 当测试环境没有行程规划单 只能去回传的差旅申请单
String orderNo = getOrderNoForCTrip(cTripCarRecord.getRouteOrderNo());
orderDetail.ifPresentOrElse(it -> {
CarOrderDetail carOrderDetail = it.getCarOrderDetail();
orderCarRecord.loadComplianceInfo(it)
.loadRelatedOrderInfo(it.getOrderId(),
cTripCarRecord.getRecordId(),
byOrderNo.isPresent() ? byOrderNo.get().getApproveOrderNo().getActualOrderNo() : orderNo, //兼容测试环境和正式环境的数据
carOrderDetail.getReceiptsNum(),
carOrderDetail.getParentOrderNo(),
carOrderDetail.getOriginalOrderNo())
.loadBasicOrderInfo(carOrderDetail.getOrderNo(),
carOrderDetail.getOrderStatus(),
carOrderDetail.getCreateTime());
}, () -> orderCarRecord.loadRelatedOrderInfo(cTripCarRecordBase.getOrderId(),
}, () -> orderCarRecord.loadComplianceInfoNot()
.loadRelatedOrderInfo(cTripCarRecordBase.getOrderId(),
cTripCarRecord.getRecordId(),
orderNo,
cTripCarRecord.getRouteOrderNo(),
String.valueOf(cTripCarRecordBase.getOrderId()),
String.valueOf(cTripCarRecordBase.getOrderId()))
.loadBasicOrderInfo( String.valueOf(cTripCarRecordBase.getOrderId()),
.loadBasicOrderInfo(String.valueOf(cTripCarRecordBase.getOrderId()),
"",
cTripCarRecordBase.getCreateTime()));
return orderCarRecord;
}
private String getOrderNoForCTrip(String inputOrderNo) {
// 当测试环境没有行程规划单 只能去回传的差旅申请单
String orderNo;
if (inputOrderNo.contains("-")) {
String[] split = inputOrderNo.split("-");
orderNo = split[1];
} else {
orderNo = inputOrderNo;
}
return orderNo;
}
@Override
public OrderTrainRecord createTrainOrderRecord(Object orderTrainRecordData) {
@ -251,7 +269,8 @@ public class CTripOrderRecordExtensionFactory implements OrderRecordExtensionFac
String batchNo = cTripFlightRecordBase.getBatchStartDate().substring(0, 6);
orderFlightRecord.loadFinancialAndPricingInfo(batchNo,
cTripFlightRecordBase.getSubAccCheckBatchNo(),
String.valueOf(cTripFlightRecordBase.getPrice()),
String.valueOf(cTripFlightRecordBase.getAmount()),
String.valueOf(cTripFlightRecordBase.getRealAmountWithPostServiceFee()),
String.valueOf(cTripFlightInfo.getEClassStandardPrice()),
String.valueOf(cTripFlightInfo.getLowPrice()),
String.valueOf(cTripFlightInfo.getLowPrice()));
@ -267,7 +286,7 @@ public class CTripOrderRecordExtensionFactory implements OrderRecordExtensionFac
orderFlightRecord.loadExtraFeeInfo(String.valueOf(cTripFlightRecordBase.getPostServiceFee()),
String.valueOf(cTripFlightRecordBase.getRebookQueryFee()),
String.valueOf(cTripFlightRecordBase.getRefund()),
String.valueOf(cTripFlightRecordBase.getAmount()),
cTripFlightRecordBase.getOrderDetailType().equals("改签") ? String.valueOf(cTripFlightRecordBase.getAmount()) : KEEP_TWO_DECIMAL_ZERO,
String.valueOf(cTripFlightRecordBase.getSettItineraryFee()));
// 加载来源
@ -288,6 +307,7 @@ public class CTripOrderRecordExtensionFactory implements OrderRecordExtensionFac
cTripFlightBaseInfo.getDept3());
// 加载关联票价原因
String orderNo = getOrderNoForCTrip(cTripFlightRecord.getRouteOrderNo());
orderDetail.ifPresentOrElse(it -> {
FlightOrderDetail flightOrderDetail = it.getFlightOrderDetail();
orderFlightRecord.loadComplianceInfo(it)
@ -296,11 +316,14 @@ public class CTripOrderRecordExtensionFactory implements OrderRecordExtensionFac
cTripFlightRecordBase.getCreateTime())
.loadRelatedOrderInfo(cTripFlightRecordBase.getOrderId(),
String.valueOf(cTripFlightRecordBase.getRecordId()),
byOrderNo.isPresent() ? byOrderNo.get().getApproveOrderNo().getActualOrderNo() : orderNo, //兼容测试环境和正式环境的数据
flightOrderDetail.getReceiptsNum(),
flightOrderDetail.getParentOrderNo(),
it.getOrderNo());
}, () -> orderFlightRecord.loadRelatedOrderInfo(cTripFlightRecordBase.getOrderId(), //兼容测试环境没有申请单的情况
}, () -> orderFlightRecord.loadComplianceInfoNot()
.loadRelatedOrderInfo(cTripFlightRecordBase.getOrderId(), //兼容测试环境没有申请单的情况
String.valueOf(cTripFlightRecordBase.getRecordId()),
orderNo,
cTripFlightBaseInfo.getJourneyID(),
String.valueOf(cTripFlightRecordBase.getOrderId()),
String.valueOf(cTripFlightRecordBase.getOrderId()))
@ -372,12 +395,12 @@ public class CTripOrderRecordExtensionFactory implements OrderRecordExtensionFac
// 加载房间和早餐信息 , 含早分数先为空
String isAgreement;
if (cTripHotelRecordBase.getOrderType().equals(4) || cTripHotelRecordBase.getOrderType().equals(6)) {
isAgreement = "1";
isAgreement = "";
} else {
isAgreement = "0";
isAgreement = "";
}
orderHotelRecord.loadRoomAndBreakfastInfo("",
Integer.parseInt(isAgreement),
isAgreement,
cTripHotelRecordBase.getQuantity(),
cTripHotelRecordBase.getQuantity(),
String.valueOf(cTripHotelRecordBase.getPrice()),
@ -410,20 +433,23 @@ public class CTripOrderRecordExtensionFactory implements OrderRecordExtensionFac
}
orderHotelRecord.loadSourceInfo(sourceInfo);
String orderNo = getOrderNoForCTrip(cTripHotelRecord.getRouteOrderNo());
orderDetailOptional.ifPresentOrElse(it -> {
orderHotelRecord.loadComplianceInfo(it); // 加载违规信息
orderHotelRecord.loadComplianceInfo(Optional.of(it)); // 加载违规信息
HotelOrderDetail hotelOrderDetail = it.getHotelOrderDetail();
orderHotelRecord.loadOrderNoInfo(it.getOrderId(), // 加载订单关联号信息
cTripHotelRecord.getRecordId(),
byOrderNo.isPresent() ? byOrderNo.get().getApproveOrderNo().getActualOrderNo() : orderNo, //兼容测试环境和正式环境的数据
hotelOrderDetail.getReceiptsNum(),
hotelOrderDetail.getOrderNo(),
hotelOrderDetail.getOrderNo());
orderHotelRecord.loadBasicOrderInfo(hotelOrderDetail.getOrderNo(), // 加载基础订单信息
hotelOrderDetail.getOrderStatus(),
cTripHotelRecordBase.getCreateTime());
}, () -> orderHotelRecord.loadOrderNoInfo(cTripHotelRecordBase.getOrderId(), //兼容测试环境不存在行程规划单的情况 // 加载订单关联号信息
}, () -> orderHotelRecord.loadComplianceInfo(Optional.empty())
.loadOrderNoInfo(cTripHotelRecordBase.getOrderId(), //兼容测试环境不存在行程规划单的情况 // 加载订单关联号信息
cTripHotelRecord.getRecordId(),
orderNo,
cTripHotelRecord.getRouteOrderNo(),
String.valueOf(cTripHotelRecordBase.getOrderId()),
String.valueOf(cTripHotelRecordBase.getOrderId()))
@ -432,8 +458,8 @@ public class CTripOrderRecordExtensionFactory implements OrderRecordExtensionFac
cTripHotelRecordBase.getCreateTime()));
// 加载财务信息
orderHotelRecord.loadFinancialInfo(cTripHotelRecordBase.getSubAccCheckBatchNo(),
cTripHotelRecordBase.getBatchStartDate().substring(0, 6),
orderHotelRecord.loadFinancialInfo(cTripHotelRecordBase.getBatchStartDate().substring(0, 6),
cTripHotelRecordBase.getSubAccCheckBatchNo(),
String.valueOf(cTripHotelRecordBase.getAmount()),
"",
cTripHotelRecordBase.getPaidAmount());
@ -459,8 +485,8 @@ public class CTripOrderRecordExtensionFactory implements OrderRecordExtensionFac
// 加载预订人和入住人信息
orderHotelRecord.loadBookerAndGuestInfo(cTripHotelOrderDetail.getEmployeeID(),
cTripHotelOrderDetail.getEmployeeName(),
cTripHotelOrderDetail.getEmployeeID(),
cTripHotelOrderDetail.getEmployeeName());
cTripHotelOrderDetail.getEmployeeName(),
cTripHotelOrderDetail.getEmployeeID());
// 加载组织架构
orderHotelRecord.loadOrganizationalAndProjectInfo(cTripHotelOrderDetail.getDept1(),

View File

@ -1,25 +1,27 @@
package com.chint.domain.factoriy.order_record;
import com.chint.domain.aggregates.order.OrderDetail;
import com.chint.domain.aggregates.order.RouteOrder;
import com.chint.domain.aggregates.order.*;
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.OrderHotelRecord;
import com.chint.domain.aggregates.order.order_record.OrderTrainRecord;
import com.chint.domain.aggregates.order.order_record.ly_order_record.LyOrderCarRecord;
import com.chint.domain.aggregates.order.order_record.ly_order_record.LyOrderFlightRecord;
import com.chint.domain.aggregates.order.order_record.ly_order_record.LyOrderHotelRecord;
import com.chint.domain.aggregates.order.order_record.ly_order_record.LyOrderTrainRecord;
import com.chint.domain.repository.UserRepository;
import com.chint.domain.service.OrderDetailDomainService;
import com.chint.domain.aggregates.order.order_record.ly_order_record.*;
import com.chint.infrastructure.repository.jdbc.*;
import com.chint.infrastructure.util.BeanCopyUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.math.BigDecimal;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.concurrent.atomic.AtomicReference;
import java.util.function.Consumer;
import static com.chint.infrastructure.constant.BelongSystemConstant.TRAVAL_SYS_TYPE_LY;
import static com.chint.infrastructure.constant.OrderRecordConstant.*;
/**
* 同程数据转换
@ -37,6 +39,9 @@ public class LyOrderRecordExtensionFactory implements OrderRecordExtensionFactor
@Autowired
private OrderRecordFactory orderRecordFactory;
@Autowired
private JdbcOrderTravelRepository orderTravelRepository;
@Override
public OrderFlightRecord createFlightOrderRecord(Object orderFlightRecordData) {
OrderFlightRecord orderFlightRecord = new OrderFlightRecord();
@ -77,35 +82,47 @@ public class LyOrderRecordExtensionFactory implements OrderRecordExtensionFactor
private void createFlightOrder(OrderFlightRecord orderFlightRecord, LyOrderFlightRecord lyOrderFlightRecord) {
String orderSerialNo = lyOrderFlightRecord.getOrderSerialNo();//订单号
OrderRecordBasic orderRecordBasic = getOrderRecordBasic(orderSerialNo);
AtomicReference<OrderDetail> orderDetailRef = new AtomicReference<>();
AtomicReference<RouteOrder> routeOrderRef = new AtomicReference<>();
OrderRecordBasic orderRecordBasic = getOrderRecordBasic(orderSerialNo, orderDetailRef::set, routeOrderRef::set);
BeanUtils.copyProperties(orderRecordBasic, orderFlightRecord);
OrderDetail orderDetail = orderDetailRef.get();//获取订单明细
RouteOrder routeOrder = routeOrderRef.get();//获取财务共享订单
FlightOrderDetail flightOrderDetail = orderDetail.getFlightOrderDetail() == null ? new FlightOrderDetail() : orderDetail.getFlightOrderDetail();//机票订单明细
orderFlightRecord.setOrderDetailId(orderDetail.getOrderId() == null ? -1L : orderDetail.getOrderId());
//公共字段校验
flightFieldCheck(orderFlightRecord, lyOrderFlightRecord);
orderFlightRecord.setDetailId(lyOrderFlightRecord.getBillOrderNo())//防重标识
.setTicketClerk(lyOrderFlightRecord.getReserveManName())//票务员
.setAccountPeriod(lyOrderFlightRecord.getStatementCode())//账期号
.setBillNo(lyOrderFlightRecord.getBillOrderNo())//账单号
.setOrderNo(lyOrderFlightRecord.getOrderSerialNo())//订单号
.setParentOrderNo("")//父级订单号
.setParentOrderNo(flightOrderDetail.getParentOrderNo())//父级订单号
.setOriginalOrderNo(lyOrderFlightRecord.getOriginOrderSerialNo())//原始订单号
.setTicketNo(lyOrderFlightRecord.getTicketNo())//票号
.setScheduleNum("")//行程单号
.setReceiptsNum(lyOrderFlightRecord.getOutApplayOrderNo())//关联申请单号
.setTicketNo(lyOrderFlightRecord.getTicketNo());//票号
//行程单号
List<OrderTravel> byOrderNo = orderTravelRepository.findByOrderNo(orderSerialNo);
String travelNo = byOrderNo.isEmpty() ? "" : byOrderNo.get(0).getTravelNo();
orderFlightRecord.setScheduleNum(travelNo);//行程单号
orderFlightRecord.setReceiptsNum(getReceiptsNum(lyOrderFlightRecord.getOutApplayOrderNo(), routeOrder))//关联申请单号
.setReceiptsNumOrigin(lyOrderFlightRecord.getOutApplayOrderNo())//原关联申请单号
.setUserName(lyOrderFlightRecord.getPassengerName())//出行人姓名
.setUserCode(lyOrderFlightRecord.getPassengerExternalId())//出行人编码
.setOverStandard("".equals(lyOrderFlightRecord.getOverStandardStatus()) ? "1" : "0")//"是否违规超标0否 ,1是"
.setOverStandardReason(lyOrderFlightRecord.getViolationReason())//违规原因超标原因
.setStartAirportName("")//起飞机场名称
.setStartCityCode("")//起飞城市编码
.setStartCityName("")//起飞城市名称
.setStartAirportName(flightOrderDetail.getStartAirportName())//起飞机场名称
.setStartCityCode(flightOrderDetail.getStartCityCode())//起飞城市编码
.setStartCityName(flightOrderDetail.getStartCityName())//起飞城市名称
.setStartTime(lyOrderFlightRecord.getPlanBeginDate())//起飞时间 yyyy-MM-dd HH:mm:ss
.setEndAirportCode("")//到达机场三字码
.setEndAirportName("")//到达机场名称
.setEndCityCode("")//到达城市编码
.setEndCityName("")//到达城市名称
.setEndTerminal("")//到达航站楼
.setEndAirportCode(flightOrderDetail.getEndAirportCode())//到达机场三字码
.setEndAirportName(flightOrderDetail.getEndAirportName())//到达机场名称
.setEndCityCode(flightOrderDetail.getEndCityCode())//到达城市编码
.setEndCityName(flightOrderDetail.getEndCityName())//到达城市名称
.setEndTerminal(flightOrderDetail.getEndTerminal())//到达航站楼
.setEndTime(lyOrderFlightRecord.getPlanEndDate())//到达时间 yyyy-MM-dd HH:mm:ss
.setFlightCompName(lyOrderFlightRecord.getAirlineCompanyName())//航空公司名称
.setFlightLowestPrice(String.valueOf(lyOrderFlightRecord.getFligthMinPrice()))//航班最低价
.setFlightNum(lyOrderFlightRecord.getFligthNo())//
.setFlightNum(lyOrderFlightRecord.getFligthNo())//航班号
.setOrderAmount(String.valueOf(lyOrderFlightRecord.getToBePayAmount())) //结算总额
.setFacePrice(String.valueOf(lyOrderFlightRecord.getTicketOutAmount())) //票面价
.setNoTaxAmt(String.valueOf(BigDecimal.valueOf(lyOrderFlightRecord.getTicketTotalAmount() == null ? 0 : lyOrderFlightRecord.getTicketTotalAmount())
@ -125,24 +142,32 @@ public class LyOrderRecordExtensionFactory implements OrderRecordExtensionFactor
.setSeatPoint(lyOrderFlightRecord.getSeatClass())//舱位
.setSeatPointName(lyOrderFlightRecord.getSeatClass())//舱位名称
.setUseStatus(lyOrderFlightRecord.getTicketStatus()) //机票使用情况
.setOrderSource("") //预订来源线上/线下
.setOrderSource(lyOrderFlightRecord.getBookingPlat()) //预订来源线上/线下
.setNotLowReason("正泰机票无超标") //未预订最低价原因
.setBookOrgCode1(lyOrderFlightRecord.getPassengerDepartment()) //出行人组织架构信息1
.setBookOrgCode2(lyOrderFlightRecord.getPassengerDepartment()) //出行人组织架构信息2
.setBookOrgCode3(lyOrderFlightRecord.getPassengerDepartment()) //出行人组织架构信息3
.setOfflineCcomyCode(lyOrderFlightRecord.getPassengerCostCenter()) //成本中心
/* .setOrderStatus() //结算状态
.setExpenseOrderAmount() //订单金额
.setOrderStatus("") //结算状态
/* .setExpenseOrderAmount("") //订单金额
.setSettleOrderFlag() //订单对账状态
.setPayAmount() //支付金额
*/
.setPayAmount() //支付金额*/
;
}
private void createHotelOrder(OrderHotelRecord orderHotelRecord, LyOrderHotelRecord lyOrderHotelRecord) {
String orderSerialNo = lyOrderHotelRecord.getOrderSerialNo();//订单号
OrderRecordBasic orderRecordBasic = getOrderRecordBasic(orderSerialNo);
AtomicReference<OrderDetail> orderDetailRef = new AtomicReference<>();
AtomicReference<RouteOrder> routeOrderRef = new AtomicReference<>();
OrderRecordBasic orderRecordBasic = getOrderRecordBasic(orderSerialNo, orderDetailRef::set, routeOrderRef::set);
BeanUtils.copyProperties(orderRecordBasic, orderHotelRecord);
OrderDetail orderDetail = orderDetailRef.get();//订单明细
RouteOrder routeOrder = routeOrderRef.get();//财务共享订单数据
HotelOrderDetail hotelOrderDetail = orderDetail.getHotelOrderDetail() == null ? new HotelOrderDetail() : orderDetail.getHotelOrderDetail();//酒店订单明细
orderHotelRecord.setOrderDetailId(orderDetail.getOrderId() == null ? -1L : orderDetail.getOrderId());//订单明细id
//公共字段校验
hotelFieldCheck(orderHotelRecord, lyOrderHotelRecord);
orderHotelRecord.setDetailId(lyOrderHotelRecord.getBillOrderNo())//防重标识
.setTicketClerk(lyOrderHotelRecord.getReserveManName()) //票务员
.setAccountPeriod(lyOrderHotelRecord.getStatementCode()) //账期号
@ -152,9 +177,11 @@ public class LyOrderRecordExtensionFactory implements OrderRecordExtensionFactor
.setOriginalOrderNo(lyOrderHotelRecord.getOriginOrderSerialNo())//原始订单号
.setBrandGroup("") //酒店品牌集团
.setBrandName("") //酒店品牌
.setOverStandard("".equals(lyOrderHotelRecord.getOverStandardStatus()) ? 1 : 0) //"是否违规(超标) 0否,1是"
.setOverStandardReason(lyOrderHotelRecord.getViolationReason()) //违规原因超标原因
.setReceiptsNum(lyOrderHotelRecord.getOutApplayOrderNo()) //关联申请单号
.setOverStandard("".equals(lyOrderHotelRecord.getOverStandardStatus()) ? "1" : "0") //"是否违规(超标) 0否,1是"
.setOverStandardReason(lyOrderHotelRecord.getViolationReason());//违规原因超标原因
orderHotelRecord.setReceiptsNum(getReceiptsNum(lyOrderHotelRecord.getOutApplayOrderNo(), routeOrder))//关联申请单号
.setReceiptsNumOrigin(lyOrderHotelRecord.getOutApplayOrderNo()) //原关联申请单号
.setUserName(lyOrderHotelRecord.getPassengerName()) //入住人姓名
.setUserCode(lyOrderHotelRecord.getPassengerNo()) //入住人编码
.setCheckInCity(lyOrderHotelRecord.getCityName()) //入住城市
@ -162,10 +189,10 @@ public class LyOrderRecordExtensionFactory implements OrderRecordExtensionFactor
.setCountry(lyOrderHotelRecord.getCountryName()) //国家
.setCustomerServiceName("") //客服处理人
.setDepartureDate(lyOrderHotelRecord.getLeaveTime()) //离店日期yyyy - MM - dd
.setHotelAddress("") //酒店地址
.setHotelAddress(hotelOrderDetail.getHotelAddress()) //酒店地址
.setHotelName(lyOrderHotelRecord.getHotelName()) //酒店名称
.setIncludeAmount("") //含早情况XX份
.setIsAgreement(0) //是否协议酒店0否1是
.setIsAgreement("".equals(hotelOrderDetail.getAgreementHotel()) ? "1" : "0") //是否协议酒店0否1是
.setPaymentType(getPaymentType(lyOrderHotelRecord.getPayType()))//"付款方式0-公司统付 1-个人付 2-混付"
.setOrderAmount(String.valueOf(lyOrderHotelRecord.getToBePayAmount())) //结算总额
.setCompanyAmount(String.valueOf(lyOrderHotelRecord.getToBePayAmount())) //企业统付总额
@ -173,9 +200,9 @@ public class LyOrderRecordExtensionFactory implements OrderRecordExtensionFactor
.setUnifiedPayAmt(String.valueOf(lyOrderHotelRecord.getServiceAmount())) //统付服务费
.setPersonalPayAmt("") //个人服务费
.setProvince("") //省份
.setRoomCount(1) //房间数
.setRoomCount(Integer.parseInt(StringUtils.isBlank(hotelOrderDetail.getRoomCount()) ? "1" : hotelOrderDetail.getRoomCount())) //房间数
.setRoomNightCount(lyOrderHotelRecord.getHotelNights()) //夜间数
.setNightCount(1) //间夜数
.setNightCount(lyOrderHotelRecord.getHotelNights()) //间夜数
.setRoomPrice("") //房价房间单价不包含服务费
.setRoomRate(String.valueOf(lyOrderHotelRecord.getTotalRoomPrice())) //房费订单总额减总服务费
.setNoTaxAmt("") //不含税价
@ -186,11 +213,11 @@ public class LyOrderRecordExtensionFactory implements OrderRecordExtensionFactor
.setNoTaxCusFee("") //托管费不含税
.setTaxCusFee("") //托管费税费
.setRoomTypeName(lyOrderHotelRecord.getBedType()) //房型
.setStarRate("") //星级
.setStarRate(hotelOrderDetail.getStarRate()) //星级
.setOrderSource(lyOrderHotelRecord.getBookingPlat()) //预订来源线上/线下
.setBookOrgCode1(lyOrderHotelRecord.getPassengerDepartment()) //入住人组织架构信息1
.setBookOrgCode2("") //入住人组织架构信息2
.setBookOrgCode3("") //入住人组织架构信息3
.setBookOrgCode2(hotelOrderDetail.getBOOK_ORG_STRUCT_2()) //入住人组织架构信息2
.setBookOrgCode3(hotelOrderDetail.getBOOK_ORG_STRUCT_3()) //入住人组织架构信息3
.setOfflineCcomyCode(lyOrderHotelRecord.getPassengerCostCenter()) //成本中心
/* .setOrderStatus() //结算状态
.setExpenseOrderAmount() //订单金额
@ -202,16 +229,25 @@ public class LyOrderRecordExtensionFactory implements OrderRecordExtensionFactor
private void createTrainOrder(OrderTrainRecord orderTrainRecord, LyOrderTrainRecord lyOrderTrainRecord) {
String orderSerialNo = lyOrderTrainRecord.getOrderSerialNo();//订单号
OrderRecordBasic orderRecordBasic = getOrderRecordBasic(orderSerialNo);
AtomicReference<OrderDetail> orderDetailRef = new AtomicReference<>();
AtomicReference<RouteOrder> routeOrderRef = new AtomicReference<>();
OrderRecordBasic orderRecordBasic = getOrderRecordBasic(orderSerialNo, orderDetailRef::set, routeOrderRef::set);
BeanUtils.copyProperties(orderRecordBasic, orderTrainRecord);
OrderDetail orderDetail = orderDetailRef.get();//订单明细
RouteOrder routeOrder = routeOrderRef.get();//财务共享订单数据
TrainOrderDetail trainOrderDetail = orderDetail.getTrainOrderDetail() == null ? new TrainOrderDetail() : orderDetail.getTrainOrderDetail();//火车订单明细
orderTrainRecord.setOrderDetailId(orderDetail.getOrderId() == null ? -1L : orderDetail.getOrderId());//订单明细id
//公共字段校验
trainFieldCheck(orderTrainRecord, lyOrderTrainRecord);
orderTrainRecord.setDetailId(lyOrderTrainRecord.getBillOrderNo())//防重标识
.setTicketClerk(lyOrderTrainRecord.getReserveManName()) //票务员
.setAccountPeriod(lyOrderTrainRecord.getStatementCode()) //账期号
.setBillNo(lyOrderTrainRecord.getBillOrderNo()) //账单号
.setOrderNo(lyOrderTrainRecord.getOrderSerialNo()) //订单号
.setParentOrderNo("") //父级订单号
.setOriginalOrderNo(lyOrderTrainRecord.getOriginOrderSerialNo()) //原始订单号
.setReceiptsNum(lyOrderTrainRecord.getOutApplayOrderNo()) //关联申请单号
.setParentOrderNo(trainOrderDetail.getParentOrderNo()) //父级订单号
.setOriginalOrderNo(lyOrderTrainRecord.getOriginOrderSerialNo());//原始订单号
orderTrainRecord.setReceiptsNum(getReceiptsNum(lyOrderTrainRecord.getOutApplayOrderNo(), routeOrder))//关联申请单号
.setReceiptsNumOrigin(lyOrderTrainRecord.getOutApplayOrderNo()) //原关联申请单号
.setStartDate(lyOrderTrainRecord.getPlanBeginDate()) //出发日期
.setArriveDate(lyOrderTrainRecord.getPlanEndDate()) //到达日期
.setOverStandard("".equals(lyOrderTrainRecord.getOverStandardStatus()) ? "1" : "0") //"是否违规超标0否 1是"
@ -234,15 +270,15 @@ public class LyOrderRecordExtensionFactory implements OrderRecordExtensionFactor
.setToCity(lyOrderTrainRecord.getTripName()) //到达城市
.setToStationName(lyOrderTrainRecord.getTripName()) //到达站
.setIssueTicketTime(lyOrderTrainRecord.getEnterAccount()) //出票时间 yyyy-MM-dd HH:mm:ss
.setRunTime("") //时长
.setSeatType("")// 座位等级
.setRunTime(trainOrderDetail.getRunTime()) //时长
.setSeatType(trainOrderDetail.getSeatType())// 座位等级
.setTrainNo(lyOrderTrainRecord.getTrainNo()) //车次
.setUserCode(lyOrderTrainRecord.getPassengerNo())//出行人编码
.setUserName(lyOrderTrainRecord.getPassengerName())//出行人姓名
.setOrderSource(lyOrderTrainRecord.getBookingPlat())//预订来源线上 / 线下
.setBookOrgCode1(lyOrderTrainRecord.getPassengerDepartment())//出行人组织架构信息1
.setBookOrgCode2("")//出行人组织架构信息2
.setBookOrgCode3("")//出行人组织架构信息3
.setBookOrgCode2(trainOrderDetail.getBOOK_ORG_STRUCT_2())//出行人组织架构信息2
.setBookOrgCode3(trainOrderDetail.getBOOK_ORG_STRUCT_3())//出行人组织架构信息3
.setOfflineCcomyCode(lyOrderTrainRecord.getPassengerCostCenter())//成本中心
/* .setOrderStatus() //结算状态
.setExpenseOrderAmount() //订单金额
@ -263,29 +299,38 @@ public class LyOrderRecordExtensionFactory implements OrderRecordExtensionFactor
private void createCarOrder(OrderCarRecord orderCarRecord, LyOrderCarRecord lyOrderCarRecord) {
String orderSerialNo = lyOrderCarRecord.getOrderSerialNo();//订单号
OrderRecordBasic orderRecordBasic = getOrderRecordBasic(orderSerialNo);
AtomicReference<OrderDetail> orderDetailRef = new AtomicReference<>();
AtomicReference<RouteOrder> routeOrderRef = new AtomicReference<>();
OrderRecordBasic orderRecordBasic = getOrderRecordBasic(orderSerialNo, orderDetailRef::set, routeOrderRef::set);
BeanUtils.copyProperties(orderRecordBasic, orderCarRecord);
OrderDetail orderDetail = orderDetailRef.get();//订单明细
RouteOrder routeOrder = routeOrderRef.get();//财务共享订单数据
CarOrderDetail carOrderDetail = orderDetail.getCarOrderDetail() == null ? new CarOrderDetail() : orderDetail.getCarOrderDetail();//用车订单明细
orderCarRecord.setOrderDetailId(orderDetail.getOrderId() == null ? -1L : orderDetail.getOrderId());//订单明细id
//公共字段校验
carFieldCheck(orderCarRecord, lyOrderCarRecord);
orderCarRecord.setDetailId(lyOrderCarRecord.getBillOrderNo())//防重标识
.setTicketClerk(lyOrderCarRecord.getReserveManName()) //票务员
.setAccountPeriod(lyOrderCarRecord.getStatementCode()) //账期号
.setBillNo(lyOrderCarRecord.getBillOrderNo()) //账单号
.setReceiptsNum(lyOrderCarRecord.getOrderSerialNo()) //关联申请单号
.setBillNo(lyOrderCarRecord.getBillOrderNo()); //账单号
orderCarRecord.setReceiptsNum(getReceiptsNum(lyOrderCarRecord.getOutApplayOrderNo(), routeOrder))//关联申请单号
.setReceiptsNumOrigin(lyOrderCarRecord.getOutApplayOrderNo()) //原关联申请单号
.setOverStandard("0") //"是否违规超标0否 1是"
.setOverStandardReason("")//违规原因超标原因
.setOrderNo(lyOrderCarRecord.getOrderSerialNo()) //订单号
.setParentOrderNo("")//父级订单号
.setParentOrderNo(carOrderDetail.getParentOrderNo())//父级订单号
.setOriginalOrderNo(lyOrderCarRecord.getOriginOrderSerialNo())//原始订单号
.setOrderStatus("") //"结算状态"
.setCreateTime(lyOrderCarRecord.getBookingDate()) //"订单创建时间格式2023-04-26 13:15:17"
.setStartTime(lyOrderCarRecord.getPlanBeginDate()) //"出发时间格式2023-04-26 13:15:17"
.setArriveTime("") //"到达时间格式2023-04-26 13:15:17"
.setArriveTime(carOrderDetail.getArriveTime()) //"到达时间格式2023-04-26 13:15:17"
.setFromStationName(lyOrderCarRecord.getCarStartPlaceActual()) //出发地
.setToStationName(lyOrderCarRecord.getCarEndPlaceActual()) //到达地
.setCarType("") //车型
.setCarType(carOrderDetail.getCarModel()) //车型
.setFromCity(lyOrderCarRecord.getStartCityName()) //出发城市
.setToCity("") //到达城市
.setRunTime("") //运行时长
.setMiles("") //里程数
.setToCity(carOrderDetail.getToCity()) //到达城市
.setRunTime(carOrderDetail.getRunTime()) //运行时长
.setMiles(carOrderDetail.getMileage()) //里程数
.setNoTaxAmt("") //未税金额
.setTaxAmt("") //税费
.setOrderAmount(String.valueOf(lyOrderCarRecord.getToBePayAmount())) //结算总额(含前收服务费)
@ -296,11 +341,11 @@ public class LyOrderRecordExtensionFactory implements OrderRecordExtensionFactor
.setCancelCost(String.valueOf(lyOrderCarRecord.getToBePayAmount())) //取消费
.setUserName(String.valueOf(lyOrderCarRecord.getPassengerName())) //用车人姓名
.setUserCode(lyOrderCarRecord.getPassengerNo()) //用车人code
// .setOwnPayAmt() //个人支付金额
.setOwnPayAmt(carOrderDetail.getPersonalPaymentAmount()) //个人支付金额
.setComyPayAmt(String.valueOf(lyOrderCarRecord.getToBePayAmount())) //公司统付金额
.setBookOrgCode1(lyOrderCarRecord.getPassengerDepartment()) //用车人组织架构信息1
.setBookOrgCode2("") //用车人组织架构信息2
.setBookOrgCode3("") //用车人组织架构信息3
.setBookOrgCode2(carOrderDetail.getBOOK_ORG_STRUCT_2()) //用车人组织架构信息2
.setBookOrgCode3(carOrderDetail.getBOOK_ORG_STRUCT_3()) //用车人组织架构信息3
.setPaymentType(String.valueOf(getPaymentType(lyOrderCarRecord.getPayType()))) //"付款方式0公司统付 1个人付 2混付"
.setOfflineCcomyCode(lyOrderCarRecord.getPassengerDepartment()) //成本中心
.setOrderSource(lyOrderCarRecord.getBookingPlat()) //预订来源线上/线下
@ -312,16 +357,181 @@ public class LyOrderRecordExtensionFactory implements OrderRecordExtensionFactor
}
//获取公共对象
public OrderRecordBasic getOrderRecordBasic(String orderSerialNo) {
public OrderRecordBasic getOrderRecordBasic(String orderSerialNo, Consumer<OrderDetail> consumerOrderDetail, Consumer<RouteOrder> consumerRouteOrder) {
OrderDetail orderDetail = jdbcOrderDetailRepository.findByOrderNo(orderSerialNo);
Long routeId = orderDetail == null ? 0L : orderDetail.getRouteId();
consumerOrderDetail.accept(orderDetail == null ? new OrderDetail() : orderDetail);//设置订单明细数据
if (Objects.isNull(orderDetail)) {
consumerRouteOrder.accept(new RouteOrder());
return new OrderRecordBasic();
}
Long routeId = orderDetail.getRouteId();
RouteOrder routeOrder = jdbcRouteRepository.findByRouteId(routeId);
consumerRouteOrder.accept(routeOrder == null ? new RouteOrder() : routeOrder);
if (Objects.isNull(routeOrder)) {
return new OrderRecordBasic();
}
return orderRecordFactory.buildWithRouteOrder(routeOrder);
}
public void flightFieldCheck(OrderFlightRecord orderFlightRecord, LyOrderFlightRecord lyOrderFlightRecord) {
orderFlightRecord.setTrvaleSysType(TRAVAL_SYS_TYPE_LY)//数据来源商旅平台 XC携程 TC同程
.setBookingName(lyOrderFlightRecord.getReserveManName()) //预订人姓名
.setBookingUserCode(lyOrderFlightRecord.getReserveManNo()); //预订人编码
List<TripSubmitItemFlightList> tripSubmitItemFlightList = lyOrderFlightRecord.getTripSubmitItemList();
List<TripSubmitItemList> tripSubmitItemList = BeanCopyUtils.copyBeanList(tripSubmitItemFlightList, TripSubmitItemList.class);
if (StringUtils.isBlank(orderFlightRecord.getBelongSysType())) {
String belongSysType = findBelongSysType(tripSubmitItemList, lyOrderFlightRecord.getOutApplayOrderNo());
orderFlightRecord.setBelongSysType(belongSysType);//对应所属系统
}
if (StringUtils.isBlank(orderFlightRecord.getAccountCompanyId())) {
findAccountCompanyId(tripSubmitItemList).ifPresent(orderFlightRecord::setAccountCompanyId);//核算企业code
}
if (StringUtils.isBlank(orderFlightRecord.getAccountCompanyName())) {
findAccountCompanyName(tripSubmitItemList).ifPresent(orderFlightRecord::setAccountCompanyName);//核算企业名称
}
if (StringUtils.isBlank(orderFlightRecord.getProjectOrderNo())) {
findProjectOrderNo(tripSubmitItemList).ifPresent(orderFlightRecord::setProjectOrderNo);//项目订单号
}
}
public void hotelFieldCheck(OrderHotelRecord orderHotelRecord, LyOrderHotelRecord lyOrderHotelRecord) {
orderHotelRecord.setTrvaleSysType(TRAVAL_SYS_TYPE_LY)//数据来源商旅平台 XC携程 TC同程
.setBookingName(lyOrderHotelRecord.getReserveManName()) //预订人姓名
.setBookingUserCode(lyOrderHotelRecord.getReserveManNo()); //预订人编码
List<TripSubmitItemHotelList> tripSubmitItemHotelList = lyOrderHotelRecord.getTripSubmitItemList();
List<TripSubmitItemList> tripSubmitItemList = BeanCopyUtils.copyBeanList(tripSubmitItemHotelList, TripSubmitItemList.class);
if (StringUtils.isBlank(orderHotelRecord.getBelongSysType())) {
String belongSysType = findBelongSysType(tripSubmitItemList, lyOrderHotelRecord.getOutApplayOrderNo());
orderHotelRecord.setBelongSysType(belongSysType);//对应所属系统
}
if (StringUtils.isBlank(orderHotelRecord.getAccountCompanyId())) {
findAccountCompanyId(tripSubmitItemList).ifPresent(orderHotelRecord::setAccountCompanyId);//核算企业code
}
if (StringUtils.isBlank(orderHotelRecord.getAccountCompanyName())) {
findAccountCompanyName(tripSubmitItemList).ifPresent(orderHotelRecord::setAccountCompanyName);//核算企业名称
}
if (StringUtils.isBlank(orderHotelRecord.getProjectOrderNo())) {
findProjectOrderNo(tripSubmitItemList).ifPresent(orderHotelRecord::setProjectOrderNo);//项目订单号
}
}
public void trainFieldCheck(OrderTrainRecord orderTrainRecord, LyOrderTrainRecord lyOrderTrainRecord) {
orderTrainRecord.setTrvaleSysType(TRAVAL_SYS_TYPE_LY)//数据来源商旅平台 XC携程 TC同程
.setBookingName(lyOrderTrainRecord.getReserveManName()) //预订人姓名
.setBookingUserCode(lyOrderTrainRecord.getReserveManNo()); //预订人编码
List<TripSubmitItemTrainList> tripSubmitItemTrainList = lyOrderTrainRecord.getTripSubmitItemList();
List<TripSubmitItemList> tripSubmitItemList = BeanCopyUtils.copyBeanList(tripSubmitItemTrainList, TripSubmitItemList.class);
if (StringUtils.isBlank(orderTrainRecord.getBelongSysType())) {
String belongSysType = findBelongSysType(tripSubmitItemList, lyOrderTrainRecord.getOutApplayOrderNo());
orderTrainRecord.setBelongSysType(belongSysType);//对应所属系统
}
if (StringUtils.isBlank(orderTrainRecord.getAccountCompanyId())) {
findAccountCompanyId(tripSubmitItemList).ifPresent(orderTrainRecord::setAccountCompanyId);//核算企业code
}
if (StringUtils.isBlank(orderTrainRecord.getAccountCompanyName())) {
findAccountCompanyName(tripSubmitItemList).ifPresent(orderTrainRecord::setAccountCompanyName);//核算企业名称
}
if (StringUtils.isBlank(orderTrainRecord.getProjectOrderNo())) {
findProjectOrderNo(tripSubmitItemList).ifPresent(orderTrainRecord::setProjectOrderNo);//项目订单号
}
}
public void carFieldCheck(OrderCarRecord orderCarRecord, LyOrderCarRecord lyOrderCarRecord) {
orderCarRecord.setTrvaleSysType(TRAVAL_SYS_TYPE_LY)//数据来源商旅平台 XC携程 TC同程
.setBookingName(lyOrderCarRecord.getReserveManName()) //预订人姓名
.setBookingUserCode(lyOrderCarRecord.getReserveManNo()); //预订人编码
List<TripSubmitItemCarList> tripSubmitItemCarList = lyOrderCarRecord.getTripSubmitItemList();
List<TripSubmitItemList> tripSubmitItemList = BeanCopyUtils.copyBeanList(tripSubmitItemCarList, TripSubmitItemList.class);
if (StringUtils.isBlank(orderCarRecord.getBelongSysType())) {
String belongSysType = findBelongSysType(tripSubmitItemList, lyOrderCarRecord.getOutApplayOrderNo());
orderCarRecord.setBelongSysType(belongSysType);//对应所属系统
}
if (StringUtils.isBlank(orderCarRecord.getAccountCompanyId())) {
findAccountCompanyId(tripSubmitItemList).ifPresent(orderCarRecord::setAccountCompanyId);//核算企业code
}
if (StringUtils.isBlank(orderCarRecord.getAccountCompanyName())) {
findAccountCompanyName(tripSubmitItemList).ifPresent(orderCarRecord::setAccountCompanyName);//核算企业名称
}
if (StringUtils.isBlank(orderCarRecord.getProjectOrderNo())) {
findProjectOrderNo(tripSubmitItemList).ifPresent(orderCarRecord::setProjectOrderNo);//项目订单号
}
}
//对应所属系统
private static String findBelongSysType(List<TripSubmitItemList> itemList, String outApplayOrderNo) {
return itemList.stream()
.filter(item -> LY_CUSTOM1.equals(item.getCode()))
.findFirst()
.map(TripSubmitItemList::getContent)
.orElseGet(() -> Optional.ofNullable(outApplayOrderNo)
.map(no -> no.split("-")[0])
.orElse(""));
}
//核算企业code
private static Optional<String> findAccountCompanyId(List<TripSubmitItemList> tripSubmitItemList) {
return tripSubmitItemList.stream()
.filter(item -> LY_CUSTOM2.equals(item.getCode()))
.findFirst()
.map(TripSubmitItemList::getContent);
}
////核算企业名称
private static Optional<String> findAccountCompanyName(List<TripSubmitItemList> tripSubmitItemList) {
return tripSubmitItemList.stream()
.filter(item -> LY_CUSTOM3.equals(item.getCode()))
.findFirst()
.map(TripSubmitItemList::getContent);
}
//项目订单号
private static Optional<String> findProjectOrderNo(List<TripSubmitItemList> tripSubmitItemList) {
return tripSubmitItemList.stream()
.filter(item -> LY_CUSTOM4.equals(item.getCode()))
.findFirst()
.map(TripSubmitItemList::getContent);
}
private void flightReceiptsNum(OrderFlightRecord orderFlightRecord, LyOrderFlightRecord lyOrderFlightRecord, RouteOrder routeOrder) {
ApproveOrderNo approveOrderNo = routeOrder.getApproveOrderNo();
String outApplayOrderNo = lyOrderFlightRecord.getOutApplayOrderNo();
String receiptsNum = "";
if (Objects.isNull(approveOrderNo) && StringUtils.isNotBlank(outApplayOrderNo)) {
String[] receiptsNums = outApplayOrderNo.split("-");
if (receiptsNums.length > 1) {
receiptsNum = receiptsNums[1];
}
} else {
receiptsNum = approveOrderNo.getActualOrderNo();
}
orderFlightRecord.setReceiptsNum(receiptsNum);
}
//获取财务共享单号
private String getReceiptsNum(String outApplayOrderNo, RouteOrder routeOrder) {
ApproveOrderNo approveOrderNo = routeOrder.getApproveOrderNo();
if (Objects.isNull(approveOrderNo)) {
if (StringUtils.isNotBlank(outApplayOrderNo)) {
String[] receiptsNums = outApplayOrderNo.split("-");
if (receiptsNums.length > 1) {
return receiptsNums[1];
}
}
return "";
}
return approveOrderNo.getActualOrderNo();
}
//映射付款方式
//支付类型(1:企业授信 / 2:个人支付 / 3组合支付)
public int getPaymentType(String payType) {

View File

@ -1,5 +1,6 @@
package com.chint.domain.service.order_record;
import com.chint.application.commands.LYOrderRecordGenerateCommand;
import com.chint.application.commands.OrderRecordGenerateCommand;
import com.chint.domain.aggregates.order.order_record.OrderCarRecord;
import com.chint.domain.aggregates.order.order_record.OrderFlightRecord;
@ -12,6 +13,7 @@ import com.chint.domain.aggregates.order.order_record.ly_order_record.LyOrderTra
import com.chint.domain.factoriy.order_record.CTripOrderRecordExtensionFactory;
import com.chint.domain.factoriy.order_record.LyOrderRecordExtensionFactory;
import com.chint.domain.service.OrderDetailDomainService;
import com.chint.infrastructure.echo_framework.annotation.ListenTo;
import com.chint.infrastructure.repository.jdbc.*;
import com.chint.infrastructure.util.PageResult;
import org.springframework.beans.factory.annotation.Autowired;
@ -25,7 +27,7 @@ import java.util.ArrayList;
import java.util.List;
@Component
public class LYOrderRecordDomainService implements OrderRecordDomainService {
public class LYOrderRecordDomainService {
@Autowired
private JdbcLyOrderFlightRecord jdbcLyOrderFlightRecord;
@ -46,9 +48,10 @@ public class LYOrderRecordDomainService implements OrderRecordDomainService {
@Autowired
private OrderDetailDomainService orderDetailDomainService;
@Override
@Transactional
public List<OrderFlightRecord> generateFlightRecord(OrderRecordGenerateCommand command) {
@ListenTo(command = "LYOrderRecordGenerateCommand", order = 0)
public List<OrderFlightRecord> generateFlightRecord(LYOrderRecordGenerateCommand command) {
ArrayList<OrderFlightRecord> orderFlightRecordList = new ArrayList<>();
int count = 0;//初始化变量
int pageSize = 100; // 假设每页大小为10
@ -75,9 +78,10 @@ public class LYOrderRecordDomainService implements OrderRecordDomainService {
return orderFlightRecordList;
}
@Override
@Transactional
public List<OrderHotelRecord> generateHotelRecord(OrderRecordGenerateCommand command) {
@ListenTo(command = "LYOrderRecordGenerateCommand", order = 1)
public List<OrderHotelRecord> generateHotelRecord(LYOrderRecordGenerateCommand command) {
ArrayList<OrderHotelRecord> orderHotelRecordList = new ArrayList<>();
int count = 0;//初始化变量
int pageSize = 100; // 假设每页大小为10
@ -104,9 +108,10 @@ public class LYOrderRecordDomainService implements OrderRecordDomainService {
return orderHotelRecordList;
}
@Override
@Transactional
public List<OrderTrainRecord> generateTrainRecord(OrderRecordGenerateCommand command) {
@ListenTo(command = "LYOrderRecordGenerateCommand", order = 2)
public List<OrderTrainRecord> generateTrainRecord(LYOrderRecordGenerateCommand command) {
ArrayList<OrderTrainRecord> orderTrainRecordsList = new ArrayList<>();
int count = 0;//初始化变量
int pageSize = 100; // 假设每页大小为10
@ -134,9 +139,10 @@ public class LYOrderRecordDomainService implements OrderRecordDomainService {
}
@Override
@Transactional
public List<OrderCarRecord> generateCarRecord(OrderRecordGenerateCommand command) {
@ListenTo(command = "LYOrderRecordGenerateCommand", order = 3)
public List<OrderCarRecord> generateCarRecord(LYOrderRecordGenerateCommand command) {
ArrayList<OrderCarRecord> orderCarRecordsList = new ArrayList<>();
int count = 0;//初始化变量
int pageSize = 100; // 假设每页大小为10

View File

@ -0,0 +1,14 @@
package com.chint.infrastructure.constant;
public class OrderRecordConstant {
// 对应所属系统
public static final String LY_CUSTOM1 = "Custom1";
//核算企业code
public static final String LY_CUSTOM2 = "Custom2";
//核算企业名称
public static final String LY_CUSTOM3 = "Custom3";
//项目订单号
public static final String LY_CUSTOM4 = "Custom4";
}

View File

@ -48,8 +48,6 @@ public class CTripOrderDetailRequest {
private String carOrderUrl;
private DateTimeFormatter formatter =
@PostConstruct
private void init() {
this.flightOrderUrl = C_TRIP_BASE_URL + C_TRIP_ORDER_FLIGHT_PATH;

View File

@ -1,6 +1,6 @@
package com.chint.interfaces.rest.ly.reconciliation.dto.DetailResponse;
import com.chint.domain.aggregates.order.order_record.ly_order_record.TripSubmitItemList;
import com.chint.domain.aggregates.order.order_record.ly_order_record.TripSubmitItemCarList;
import com.chint.interfaces.rest.ly.reconciliation.dto.BaseResponse;
import com.chint.interfaces.rest.ly.reconciliation.dto.PageInfo;
import lombok.AllArgsConstructor;
@ -71,7 +71,7 @@ public class CarStatement extends BaseResponse {
private Double ticketOutAmount;//票面
private Double serviceAmount;//服务费
private Double insuranceAmount;//保险
private List<TripSubmitItemList> tripSubmitItemList;//行程提交项
private List<TripSubmitItemCarList> tripSubmitItemList;//行程提交项
private String orderOperType;//类型 预订/变更/退票
private String payType;//支付类型(1:企业授信 / 2:个人支付 / 3组合支付)
private Double totalShouldPay;//总计应付

View File

@ -1,6 +1,6 @@
package com.chint.interfaces.rest.ly.reconciliation.dto.DetailResponse;
import com.chint.domain.aggregates.order.order_record.ly_order_record.TripSubmitItemList;
import com.chint.domain.aggregates.order.order_record.ly_order_record.TripSubmitItemFlightList;
import com.chint.interfaces.rest.ly.reconciliation.dto.BaseResponse;
import com.chint.interfaces.rest.ly.reconciliation.dto.PageInfo;
import lombok.AllArgsConstructor;
@ -93,7 +93,7 @@ public class FlightStatement extends BaseResponse {
private Double ticketOutAmount;//票面
private Double serviceAmount;//服务费
private Double insuranceAmount;//保险
private List<TripSubmitItemList> tripSubmitItemList;//行程提交项
private List<TripSubmitItemFlightList> tripSubmitItemList;//行程提交项
private String orderOperType;//类型 预订/变更/退票
private String payType;//支付类型(1:企业授信 / 2:个人支付 / 3组合支付)
private Double totalShouldPay;//总计应付

View File

@ -1,6 +1,7 @@
package com.chint.interfaces.rest.ly.reconciliation.dto.DetailResponse;
import com.chint.domain.aggregates.order.order_record.ly_order_record.TripSubmitItemList;
import com.chint.domain.aggregates.order.order_record.ly_order_record.TripSubmitItemHotelList;
import com.chint.interfaces.rest.ly.reconciliation.dto.BaseResponse;
import com.chint.interfaces.rest.ly.reconciliation.dto.PageInfo;
import lombok.AllArgsConstructor;
@ -79,7 +80,7 @@ public class HotelStatement extends BaseResponse {
private Double ticketOutAmount;//票面
private Double serviceAmount;//服务费
private Double insuranceAmount;//保险
private List<TripSubmitItemList> tripSubmitItemList;//行程提交项
private List<TripSubmitItemHotelList> tripSubmitItemList;//行程提交项
private String orderOperType;//类型 预订/变更/退票
private String payType;//支付类型(1:企业授信 / 2:个人支付 / 3组合支付)
private Double totalShouldPay;//总计应付

View File

@ -1,6 +1,7 @@
package com.chint.interfaces.rest.ly.reconciliation.dto.DetailResponse;
import com.chint.domain.aggregates.order.order_record.ly_order_record.TripSubmitItemList;
import com.chint.domain.aggregates.order.order_record.ly_order_record.TripSubmitItemTrainList;
import com.chint.interfaces.rest.ly.reconciliation.dto.BaseResponse;
import com.chint.interfaces.rest.ly.reconciliation.dto.PageInfo;
import lombok.AllArgsConstructor;
@ -77,7 +78,7 @@ public class TrainStatement extends BaseResponse {
private Double ticketOutAmount;//票面
private Double serviceAmount;//服务费
private Double insuranceAmount;//保险
private List<TripSubmitItemList> tripSubmitItemList;//行程提交项
private List<TripSubmitItemTrainList> tripSubmitItemList;//行程提交项
private String orderOperType;//类型 预订/变更/退票
private String payType;//支付类型(1:企业授信 / 2:个人支付 / 3组合支付)
private Double totalShouldPay;//总计应付

View File

@ -48,10 +48,10 @@ logging:
#正式
ly:
appId: zhengtai
account: 4f9cb1080b564dd0a94aa95f7a19c8b5
password: 1fD3SutgzfS48qznYQiq
secret: WOHzCMvHd823iHgH
baseUrl: https://api.qa.dttrip.cn/openapi
account: ab9fe0c19dd64a99b936fded72c3bb94
password: glHRJJ9JMUwNfQ8OwAQi
secret: MnghmYJpM1U2RaLx
baseUrl: https://api.dttrip.cn/openapi
ifForwardRequest: false
forwardRequestBaseUrl: https://secureqrdev-t.chint.com/llz

View File

@ -618,8 +618,4 @@ public class CTripTest {
}
// @Test
void saveFlightRecord(){
cTripOrderRecordAutoSave.cTripFlightRecordAutoSave();
}
}