Compare commits

..

No commits in common. "404847cb07759609b5867be2937d6f13cc78ad5d" and "90a1b6994e73c3e32331cc7a9a6704dff68a545c" have entirely different histories.

47 changed files with 110 additions and 870 deletions

View File

@ -1,10 +1,7 @@
package com.chint.application.commands; package com.chint.application.commands;
import com.chint.infrastructure.echo_framework.command.Command; import com.chint.infrastructure.echo_framework.command.Command;
import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;

View File

@ -1,9 +1,6 @@
package com.chint.application.in; package com.chint.application.in;
import com.chint.domain.factoriy.order_record.LyStatementOrder;
import com.chint.infrastructure.echo_framework.command.Command;
import com.chint.application.commands.OrderRecordGenerateCommand;
import com.chint.domain.factoriy.order_record.LyStatementOrder; import com.chint.domain.factoriy.order_record.LyStatementOrder;
import com.chint.infrastructure.echo_framework.command.Command; import com.chint.infrastructure.echo_framework.command.Command;
import com.chint.infrastructure.util.Result; import com.chint.infrastructure.util.Result;
@ -15,12 +12,6 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.chint.application.commands.OrderRecordGenerateCommand; import com.chint.application.commands.OrderRecordGenerateCommand;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.List;
import static com.chint.infrastructure.constant.CommonMessageConstant.SUCCESS; import static com.chint.infrastructure.constant.CommonMessageConstant.SUCCESS;
@RestController @RestController
@ -38,21 +29,19 @@ public class AutoWorkController {
@Transactional @Transactional
@ApiOperation("自动拉取昨天的流水号每天晚上8点执行") @ApiOperation("自动拉取昨天的流水号每天晚上8点执行")
@PostMapping("/cTrip/record/save") @PostMapping("/cTrip/record/save")
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);
} }
@Transactional @Transactional
@ApiOperation("自动拉取同程上个月的流水号") @ApiOperation("自动拉取同程上个月的流水号")
@PostMapping("/ly/record/save") @PostMapping("/ly/record/save")
public Result<String> autoSaveLYRecord() { public Result<String> autoSaveLYRecord() {
//同步拉取上月数据
lyStatementOrder.saveAll(); lyStatementOrder.saveAll();
//将上月的结算数据生成为财务共享需要的数据
Command.of(OrderRecordGenerateCommand.class).sendToQueue();
return Result.Success(SUCCESS); return Result.Success(SUCCESS);
} }

View File

@ -1,17 +1,11 @@
package com.chint.domain.aggregates.order.order_record; package com.chint.domain.aggregates.order.order_record;
import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.springframework.data.annotation.Id; import org.springframework.data.annotation.Id;
import org.springframework.data.relational.core.mapping.Table; import org.springframework.data.relational.core.mapping.Table;
@Data @Data
@Table("order_car_record") @Table("order_car_record")
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class OrderCarRecord extends OrderBaseRecord { public class OrderCarRecord extends OrderBaseRecord {
@Id @Id
private Long id; private Long id;

View File

@ -1,17 +1,11 @@
package com.chint.domain.aggregates.order.order_record; package com.chint.domain.aggregates.order.order_record;
import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.springframework.data.annotation.Id; import org.springframework.data.annotation.Id;
import org.springframework.data.relational.core.mapping.Table; import org.springframework.data.relational.core.mapping.Table;
@Data @Data
@Table("order_flight_record") @Table("order_flight_record")
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class OrderFlightRecord extends OrderBaseRecord{ public class OrderFlightRecord extends OrderBaseRecord{
@Id @Id
private Long id; private Long id;

View File

@ -1,17 +1,11 @@
package com.chint.domain.aggregates.order.order_record; package com.chint.domain.aggregates.order.order_record;
import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.springframework.data.annotation.Id; import org.springframework.data.annotation.Id;
import org.springframework.data.relational.core.mapping.Table; import org.springframework.data.relational.core.mapping.Table;
@Data @Data
@Table("order_hotel_record") @Table("order_hotel_record")
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class OrderHotelRecord extends OrderBaseRecord{ public class OrderHotelRecord extends OrderBaseRecord{
@Id @Id
private Long id; private Long id;

View File

@ -1,17 +1,11 @@
package com.chint.domain.aggregates.order.order_record; package com.chint.domain.aggregates.order.order_record;
import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.springframework.data.annotation.Id; import org.springframework.data.annotation.Id;
import org.springframework.data.relational.core.mapping.Table; import org.springframework.data.relational.core.mapping.Table;
@Data @Data
@Table("order_train_record") @Table("order_train_record")
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class OrderTrainRecord extends OrderBaseRecord{ public class OrderTrainRecord extends OrderBaseRecord{
@Id @Id
private Long id; private Long id;

View File

@ -1,6 +1,5 @@
package com.chint.domain.aggregates.order.order_record.ctrip_order_record; package com.chint.domain.aggregates.order.order_record.ctrip_order_record;
import com.chint.infrastructure.util.DateTimeUtil;
import lombok.Data; import lombok.Data;
import org.springframework.data.annotation.Id; import org.springframework.data.annotation.Id;
import org.springframework.data.relational.core.mapping.MappedCollection; import org.springframework.data.relational.core.mapping.MappedCollection;
@ -8,7 +7,6 @@ import org.springframework.data.relational.core.mapping.Table;
import java.io.Serial; import java.io.Serial;
import java.io.Serializable; import java.io.Serializable;
import java.time.LocalDateTime;
@Data @Data
@Table("c_trip_car_record") @Table("c_trip_car_record")
@ -18,8 +16,6 @@ public class CTripCarRecord implements Serializable {
@Id @Id
private Long id; private Long id;
private String recordId; private String recordId;
private LocalDateTime createTime;
private String routeOrderNo;
@MappedCollection(idColumn = "c_trip_car_record_id") @MappedCollection(idColumn = "c_trip_car_record_id")
private CTripCarRecordBase cTripCarRecordBase; private CTripCarRecordBase cTripCarRecordBase;
@MappedCollection(idColumn = "c_trip_car_record_id") @MappedCollection(idColumn = "c_trip_car_record_id")
@ -30,7 +26,6 @@ public class CTripCarRecord implements Serializable {
cTripCarRecord.setCTripCarQuickInfo(cTripCarQuickInfo); cTripCarRecord.setCTripCarQuickInfo(cTripCarQuickInfo);
cTripCarRecord.setCTripCarRecordBase(cTripCarRecordBase); cTripCarRecord.setCTripCarRecordBase(cTripCarRecordBase);
cTripCarRecord.setRecordId(String.valueOf(cTripCarRecordBase.getRecordId())); cTripCarRecord.setRecordId(String.valueOf(cTripCarRecordBase.getRecordId()));
cTripCarRecord.setCreateTime(DateTimeUtil.strToTime(cTripCarRecordBase.getCreateTime()));
return cTripCarRecord; return cTripCarRecord;
} }
} }

View File

@ -43,7 +43,7 @@ public class CTripCarRecordBase implements Serializable {
private Double expressFee; private Double expressFee;
private Integer orderType; private Integer orderType;
private String subAccCheckBatchNo; private String subAccCheckBatchNo;
private String tripId; private Long tripId;
private String settlementCurrency; private String settlementCurrency;
private Double postServiceFee; private Double postServiceFee;
private Double realAmountHasPost; private Double realAmountHasPost;
@ -94,7 +94,7 @@ public class CTripCarRecordBase implements Serializable {
ctripCarOrderDetail.setExpressFee(carOrderSettlementBaseInfo.getExpressFee()); ctripCarOrderDetail.setExpressFee(carOrderSettlementBaseInfo.getExpressFee());
ctripCarOrderDetail.setOrderType(carOrderSettlementBaseInfo.getOrderType()); ctripCarOrderDetail.setOrderType(carOrderSettlementBaseInfo.getOrderType());
ctripCarOrderDetail.setSubAccCheckBatchNo(carOrderSettlementBaseInfo.getSubAccCheckBatchNo()); ctripCarOrderDetail.setSubAccCheckBatchNo(carOrderSettlementBaseInfo.getSubAccCheckBatchNo());
ctripCarOrderDetail.setTripId( carOrderSettlementBaseInfo.getTripID()); ctripCarOrderDetail.setTripId(carOrderSettlementBaseInfo.getTripID());
ctripCarOrderDetail.setSettlementCurrency(carOrderSettlementBaseInfo.getSettlementCurrency()); ctripCarOrderDetail.setSettlementCurrency(carOrderSettlementBaseInfo.getSettlementCurrency());
ctripCarOrderDetail.setPostServiceFee(carOrderSettlementBaseInfo.getPostServiceFee()); ctripCarOrderDetail.setPostServiceFee(carOrderSettlementBaseInfo.getPostServiceFee());
ctripCarOrderDetail.setRealAmountHasPost(carOrderSettlementBaseInfo.getRealAmountHasPost()); ctripCarOrderDetail.setRealAmountHasPost(carOrderSettlementBaseInfo.getRealAmountHasPost());

View File

@ -1,21 +1,16 @@
package com.chint.domain.aggregates.order.order_record.ctrip_order_record; package com.chint.domain.aggregates.order.order_record.ctrip_order_record;
import com.chint.infrastructure.util.DateTimeUtil;
import lombok.Data; import lombok.Data;
import org.springframework.data.annotation.Id; import org.springframework.data.annotation.Id;
import org.springframework.data.relational.core.mapping.MappedCollection; 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.time.LocalDateTime;
@Data @Data
@Table("c_trip_flight_record") @Table("c_trip_flight_record")
public class CTripFlightRecord { public class CTripFlightRecord {
@Id @Id
private Long id; private Long id;
private String recordId; private String recordId;
public LocalDateTime createTime;
private String routeOrderNo;
@MappedCollection(idColumn = "c_trip_flight_record_id") @MappedCollection(idColumn = "c_trip_flight_record_id")
private CTripFlightRecordBase cTripFlightRecordBase; private CTripFlightRecordBase cTripFlightRecordBase;
@MappedCollection(idColumn = "c_trip_flight_record_id") @MappedCollection(idColumn = "c_trip_flight_record_id")
@ -26,7 +21,6 @@ public class 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()));
return cTripFlightRecord; return cTripFlightRecord;
} }
} }

View File

@ -1,6 +1,7 @@
package com.chint.domain.aggregates.order.order_record.ctrip_order_record; package com.chint.domain.aggregates.order.order_record.ctrip_order_record;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import com.chint.interfaces.rest.ctrip.dto.order.OrderCarResponse;
import com.chint.interfaces.rest.ctrip.dto.order.OrderHotelResponse; import com.chint.interfaces.rest.ctrip.dto.order.OrderHotelResponse;
import lombok.Data; import lombok.Data;
import org.springframework.data.annotation.Id; import org.springframework.data.annotation.Id;
@ -22,7 +23,7 @@ public class CTripHotelInfo implements Serializable {
private String CityName; private String CityName;
private String CityNameEN; private String CityNameEN;
private Integer Star; private Integer Star;
private Integer IsDomestic; private boolean IsDomestic;
private String ISCU; private String ISCU;
private Integer CityID; private Integer CityID;
private String DistrictCode; private String DistrictCode;
@ -36,8 +37,6 @@ public class CTripHotelInfo implements Serializable {
private String HotelGroupName; private String HotelGroupName;
public static CTripHotelInfo of(OrderHotelResponse.SettlementHotelDetail data) { public static CTripHotelInfo of(OrderHotelResponse.SettlementHotelDetail data) {
CTripHotelInfo cTripHotelInfo = BeanUtil.copyProperties(data, CTripHotelInfo.class); return BeanUtil.copyProperties(data, CTripHotelInfo.class);
cTripHotelInfo.setIsDomestic(data.isIsDomestic() ? 1 : 0);
return cTripHotelInfo;
} }
} }

View File

@ -1,21 +1,16 @@
package com.chint.domain.aggregates.order.order_record.ctrip_order_record; package com.chint.domain.aggregates.order.order_record.ctrip_order_record;
import com.chint.infrastructure.util.DateTimeUtil;
import lombok.Data; import lombok.Data;
import org.springframework.data.annotation.Id; import org.springframework.data.annotation.Id;
import org.springframework.data.relational.core.mapping.MappedCollection; 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.time.LocalDateTime;
@Data @Data
@Table("c_trip_hotel_record") @Table("c_trip_flight_record")
public class CTripHotelRecord { public class CTripHotelRecord {
@Id @Id
private Long id; private Long id;
private String recordId; private String recordId;
private LocalDateTime createTime;
private String routeOrderNo;
@MappedCollection(idColumn = "c_trip_hotel_record_id") @MappedCollection(idColumn = "c_trip_hotel_record_id")
private CTripHotelRecordBase cTripHotelRecordBase; private CTripHotelRecordBase cTripHotelRecordBase;
@MappedCollection(idColumn = "c_trip_hotel_record_id") @MappedCollection(idColumn = "c_trip_hotel_record_id")
@ -26,7 +21,6 @@ public class CTripHotelRecord {
cTripHotelRecord.setRecordId(String.valueOf(cTripHotelRecordBase.getRecordId())); cTripHotelRecord.setRecordId(String.valueOf(cTripHotelRecordBase.getRecordId()));
cTripHotelRecord.setCTripHotelRecordBase(cTripHotelRecordBase); cTripHotelRecord.setCTripHotelRecordBase(cTripHotelRecordBase);
cTripHotelRecord.setCTripHotelInfo(cTripHotelInfo); cTripHotelRecord.setCTripHotelInfo(cTripHotelInfo);
cTripHotelRecord.setCreateTime(DateTimeUtil.strToTimeMM(cTripHotelRecordBase.getCreateTime()));
return cTripHotelRecord; return cTripHotelRecord;
} }
} }

View File

@ -7,6 +7,7 @@ import org.springframework.data.relational.core.mapping.Table;
import java.io.Serial; import java.io.Serial;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal;
/** /**
* @author wanglf3 * @author wanglf3
@ -40,7 +41,7 @@ public class CTripHotelRecordBase implements Serializable {
private String subAccCheckBatchNo; private String subAccCheckBatchNo;
private Long tripId; private Long tripId;
private String settlementCurrency; private String settlementCurrency;
private Integer isChecked; private Boolean isChecked;
private String dailyAvgPriceInfo; private String dailyAvgPriceInfo;
private String invoiceIds; private String invoiceIds;
private String batchStartDate; private String batchStartDate;
@ -57,16 +58,16 @@ public class CTripHotelRecordBase implements Serializable {
private String employeeId; private String employeeId;
private Double insuranceAmount; private Double insuranceAmount;
private Double personAmount; private Double personAmount;
private String channelFee; private BigDecimal channelFee;
private String personalChannelFee; private BigDecimal personalChannelFee;
private String paidAmount; private BigDecimal paidAmount;
private String personalTotalAmount; private BigDecimal personalTotalAmount;
private String personalRemittedTax; private BigDecimal personalRemittedTax;
private String bookServiceFee; private BigDecimal bookServiceFee;
private String modifyServiceFee; private BigDecimal modifyServiceFee;
private String cancelServiceFee; private BigDecimal cancelServiceFee;
private String payDiscountAmount; private BigDecimal payDiscountAmount;
private String averageRoomPrice; private BigDecimal averageRoomPrice;
public static CTripHotelRecordBase changeInfo(OrderHotelResponse.SettlementDetail SettlementDetail) { public static CTripHotelRecordBase changeInfo(OrderHotelResponse.SettlementDetail SettlementDetail) {
@ -90,7 +91,7 @@ public class CTripHotelRecordBase implements Serializable {
ctripHotelOrderDetail.setSubAccCheckBatchNo(SettlementDetail.getSubAccCheckBatchNo()); ctripHotelOrderDetail.setSubAccCheckBatchNo(SettlementDetail.getSubAccCheckBatchNo());
ctripHotelOrderDetail.setTripId(SettlementDetail.getTripID()); ctripHotelOrderDetail.setTripId(SettlementDetail.getTripID());
ctripHotelOrderDetail.setSettlementCurrency(SettlementDetail.getSettlementCurrency()); ctripHotelOrderDetail.setSettlementCurrency(SettlementDetail.getSettlementCurrency());
ctripHotelOrderDetail.setIsChecked(SettlementDetail.isIsChecked() ? 1 : 0); ctripHotelOrderDetail.setIsChecked(SettlementDetail.isIsChecked());
// ctripHotelOrderDetailis.setDailyAvgPriceInfo(SettlementDetail.getDailyAvgPriceInfo()); // ctripHotelOrderDetailis.setDailyAvgPriceInfo(SettlementDetail.getDailyAvgPriceInfo());
// ctripHotelOrderDetailis.setInvoiceIds(SettlementDetail.getInvoiceIds()); // ctripHotelOrderDetailis.setInvoiceIds(SettlementDetail.getInvoiceIds());
ctripHotelOrderDetail.setBatchStartDate(SettlementDetail.getBatchStartDate()); ctripHotelOrderDetail.setBatchStartDate(SettlementDetail.getBatchStartDate());
@ -107,16 +108,16 @@ public class CTripHotelRecordBase implements Serializable {
ctripHotelOrderDetail.setEmployeeId(SettlementDetail.getEmployeeID()); ctripHotelOrderDetail.setEmployeeId(SettlementDetail.getEmployeeID());
ctripHotelOrderDetail.setInsuranceAmount(SettlementDetail.getInsuranceAmount()); ctripHotelOrderDetail.setInsuranceAmount(SettlementDetail.getInsuranceAmount());
ctripHotelOrderDetail.setPersonAmount(SettlementDetail.getPersonAmount()); ctripHotelOrderDetail.setPersonAmount(SettlementDetail.getPersonAmount());
ctripHotelOrderDetail.setChannelFee(String.valueOf(SettlementDetail.getChannelFee())); ctripHotelOrderDetail.setChannelFee(SettlementDetail.getChannelFee());
ctripHotelOrderDetail.setPersonalChannelFee(String.valueOf(SettlementDetail.getPersonalChannelFee())); ctripHotelOrderDetail.setPersonalChannelFee(SettlementDetail.getPersonalChannelFee());
ctripHotelOrderDetail.setPaidAmount(String.valueOf(SettlementDetail.getPaidAmount())); ctripHotelOrderDetail.setPaidAmount(SettlementDetail.getPaidAmount());
ctripHotelOrderDetail.setPersonalTotalAmount(String.valueOf(SettlementDetail.getPersonalTotalAmount())); ctripHotelOrderDetail.setPersonalTotalAmount(SettlementDetail.getPersonalTotalAmount());
ctripHotelOrderDetail.setPersonalRemittedTax(String.valueOf(SettlementDetail.getPersonalRemittedTax())); ctripHotelOrderDetail.setPersonalRemittedTax(SettlementDetail.getPersonalRemittedTax());
ctripHotelOrderDetail.setBookServiceFee(String.valueOf(SettlementDetail.getBookServiceFee())); ctripHotelOrderDetail.setBookServiceFee(SettlementDetail.getBookServiceFee());
ctripHotelOrderDetail.setModifyServiceFee(String.valueOf(SettlementDetail.getModifyServiceFee())); ctripHotelOrderDetail.setModifyServiceFee(SettlementDetail.getModifyServiceFee());
ctripHotelOrderDetail.setCancelServiceFee(String.valueOf(SettlementDetail.getCancelServiceFee())); ctripHotelOrderDetail.setCancelServiceFee(SettlementDetail.getCancelServiceFee());
ctripHotelOrderDetail.setPayDiscountAmount(String.valueOf(SettlementDetail.getPayDiscountAmount())); ctripHotelOrderDetail.setPayDiscountAmount(SettlementDetail.getPayDiscountAmount());
ctripHotelOrderDetail.setAverageRoomPrice(String.valueOf(SettlementDetail.getAverageRoomPrice())); ctripHotelOrderDetail.setAverageRoomPrice(SettlementDetail.getAverageRoomPrice());
return ctripHotelOrderDetail; return ctripHotelOrderDetail;
} }
} }

View File

@ -1,6 +1,5 @@
package com.chint.domain.aggregates.order.order_record.ctrip_order_record; package com.chint.domain.aggregates.order.order_record.ctrip_order_record;
import com.chint.infrastructure.util.DateTimeUtil;
import lombok.Data; import lombok.Data;
import org.springframework.data.annotation.Id; import org.springframework.data.annotation.Id;
import org.springframework.data.relational.core.mapping.MappedCollection; import org.springframework.data.relational.core.mapping.MappedCollection;
@ -8,7 +7,6 @@ import org.springframework.data.relational.core.mapping.Table;
import java.io.Serial; import java.io.Serial;
import java.io.Serializable; import java.io.Serializable;
import java.time.LocalDateTime;
@Data @Data
@Table("c_trip_train_record") @Table("c_trip_train_record")
@ -18,8 +16,6 @@ public class CTripTrainRecord implements Serializable {
@Id @Id
private Long id; private Long id;
private String recordId; private String recordId;
private LocalDateTime createTime;
private String routeOrderNo;
@MappedCollection(idColumn = "c_trip_train_record_id") @MappedCollection(idColumn = "c_trip_train_record_id")
private CTripTrainRecordBase cTripTrainRecordBase; private CTripTrainRecordBase cTripTrainRecordBase;
@MappedCollection(idColumn = "c_trip_train_record_id") @MappedCollection(idColumn = "c_trip_train_record_id")
@ -30,7 +26,6 @@ public class CTripTrainRecord implements Serializable {
cTripTrainRecord.setRecordId(String.valueOf(cTripTrainRecordBase.getRecordId())); cTripTrainRecord.setRecordId(String.valueOf(cTripTrainRecordBase.getRecordId()));
cTripTrainRecord.setCTripTrainRecordBase(cTripTrainRecordBase); cTripTrainRecord.setCTripTrainRecordBase(cTripTrainRecordBase);
cTripTrainRecord.setCTripTrainInfo(cTripTrainInfo); cTripTrainRecord.setCTripTrainInfo(cTripTrainInfo);
cTripTrainRecord.setCreateTime(DateTimeUtil.strToTimeMM(cTripTrainRecordBase.getCreateTime()));
return cTripTrainRecord; return cTripTrainRecord;
} }
} }

View File

@ -9,7 +9,6 @@ import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude;
import org.springframework.data.annotation.Id; import org.springframework.data.annotation.Id;
import org.springframework.data.relational.core.mapping.MappedCollection; import org.springframework.data.relational.core.mapping.MappedCollection;
import org.springframework.data.relational.core.mapping.Table; import org.springframework.data.relational.core.mapping.Table;
@ -138,7 +137,4 @@ public class LyOrderCarRecord implements Serializable {
private String reserveManExpand4; private String reserveManExpand4;
//差旅备注 //差旅备注
private String travelRemark; private String travelRemark;
//状态 默认为null, 1已经转为财务共享数据
private Integer status;
} }

View File

@ -179,6 +179,4 @@ public class LyOrderFlightRecord implements Serializable {
//差旅备注 //差旅备注
private String travelRemark; private String travelRemark;
//状态 默认为null, 1已经转为财务共享数据
private Integer status;
} }

View File

@ -151,6 +151,4 @@ public class LyOrderHotelRecord implements Serializable {
//差旅备注 //差旅备注
private String travelRemark; private String travelRemark;
//状态 默认为null, 1已经转为财务共享数据
private Integer status;
} }

View File

@ -144,7 +144,5 @@ public class LyOrderTrainRecord implements Serializable {
private String reserveManExpand4; private String reserveManExpand4;
//差旅备注 //差旅备注
private String travelRemark; private String travelRemark;
//状态 默认为null, 1已经转为财务共享数据
private Integer status;
} }

View File

@ -8,7 +8,6 @@ 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;
import com.chint.domain.aggregates.order.order_record.OrderTrainRecord; import com.chint.domain.aggregates.order.order_record.OrderTrainRecord;
import com.chint.domain.aggregates.order.order_record.ctrip_order_record.CTripCarRecord;
import com.chint.domain.service.OrderDetailDomainService; import com.chint.domain.service.OrderDetailDomainService;
import com.chint.infrastructure.repository.jdbc.JdbcCtripHotelOrderDetailRepository; import com.chint.infrastructure.repository.jdbc.JdbcCtripHotelOrderDetailRepository;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -24,7 +23,7 @@ public class CTripOrderRecordExtensionFactory implements OrderRecordExtensionFa
@Override @Override
public OrderCarRecord createCarOrderRecord(Object orderCarRecordData) { public OrderCarRecord createCarOrderRecord(Object orderCarRecordData) {
CTripCarRecord orderCarRecord = (CTripCarRecord) orderCarRecordData;
return null; return null;
} }

View File

@ -1,319 +0,0 @@
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.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.infrastructure.repository.jdbc.*;
import com.chint.infrastructure.util.BeanCopyUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.math.BigDecimal;
import java.util.Objects;
/**
* 同程数据转换
*/
@Component
public class LyOrderRecordExtensionFactory implements OrderRecordExtensionFactory {
@Autowired
private JdbcOrderDetailRepository jdbcOrderDetailRepository;
@Autowired
private JdbcRouteRepository jdbcRouteRepository;
@Autowired
private OrderRecordFactory orderRecordFactory;
@Override
public OrderFlightRecord createFlightOrderRecord(Object orderFlightRecordData) {
OrderFlightRecord orderFlightRecord = new OrderFlightRecord();
if (orderFlightRecordData instanceof LyOrderFlightRecord lyOrderFlightRecord) {
createFlightOrder(orderFlightRecord, lyOrderFlightRecord);
}
return orderFlightRecord;
}
@Override
public OrderHotelRecord createHotelOrderRecord(Object orderHotelRecordData) {
OrderHotelRecord orderHotelRecord = new OrderHotelRecord();
if (orderHotelRecordData instanceof LyOrderHotelRecord lyOrderHotelRecord) {
createHotelOrder(orderHotelRecord, lyOrderHotelRecord);
}
return orderHotelRecord;
}
@Override
public OrderTrainRecord createTrainOrderRecord(Object orderTrainRecordData) {
OrderTrainRecord orderTrainRecord = new OrderTrainRecord();
if (orderTrainRecordData instanceof LyOrderTrainRecord lyOrderTrainRecord) {
createTrainOrder(orderTrainRecord, lyOrderTrainRecord);
}
return orderTrainRecord;
}
@Override
public OrderCarRecord createCarOrderRecord(Object orderCarRecordData) {
OrderCarRecord orderCarRecord = new OrderCarRecord();
if (orderCarRecordData instanceof LyOrderCarRecord lyOrderCarRecord) {
createCarOrder(orderCarRecord, lyOrderCarRecord);
}
return orderCarRecord;
}
private void createFlightOrder(OrderFlightRecord orderFlightRecord, LyOrderFlightRecord lyOrderFlightRecord) {
String orderSerialNo = lyOrderFlightRecord.getOrderSerialNo();//订单号
OrderRecordBasic orderRecordBasic = getOrderRecordBasic(orderSerialNo);
BeanUtils.copyProperties(orderRecordBasic, orderFlightRecord);
orderFlightRecord.setDetailId(lyOrderFlightRecord.getBillOrderNo())//防重标识
.setTicketClerk(lyOrderFlightRecord.getReserveManName())//票务员
.setAccountPeriod(lyOrderFlightRecord.getStatementCode())//账期号
.setBillNo(lyOrderFlightRecord.getBillOrderNo())//账单号
.setOrderNo(lyOrderFlightRecord.getOrderSerialNo())//订单号
.setParentOrderNo("")//父级订单号
.setOriginalOrderNo(lyOrderFlightRecord.getOriginOrderSerialNo())//原始订单号
.setTicketNo(lyOrderFlightRecord.getTicketNo())//票号
.setScheduleNum("")//行程单号
.setReceiptsNum(lyOrderFlightRecord.getOutApplayOrderNo())//关联申请单号
.setUserName(lyOrderFlightRecord.getPassengerName())//出行人姓名
.setUserCode(lyOrderFlightRecord.getPassengerExternalId())//出行人编码
.setOverStandard("".equals(lyOrderFlightRecord.getOverStandardStatus()) ? "1" : "0")//"是否违规超标0否 ,1是"
.setOverStandardReason(lyOrderFlightRecord.getViolationReason())//违规原因超标原因
.setStartAirportName("")//起飞机场名称
.setStartCityCode("")//起飞城市编码
.setStartCityName("")//起飞城市名称
.setStartTime(lyOrderFlightRecord.getPlanBeginDate())//起飞时间 yyyy-MM-dd HH:mm:ss
.setEndAirportCode("")//到达机场三字码
.setEndAirportName("")//到达机场名称
.setEndCityCode("")//到达城市编码
.setEndCityName("")//到达城市名称
.setEndTerminal("")//到达航站楼
.setEndTime(lyOrderFlightRecord.getPlanEndDate())//到达时间 yyyy-MM-dd HH:mm:ss
.setFlightCompName(lyOrderFlightRecord.getAirlineCompanyName())//航空公司名称
.setFlightLowestPrice(String.valueOf(lyOrderFlightRecord.getFligthMinPrice()))//航班最低价
.setFlightNum(lyOrderFlightRecord.getFligthNo())//
.setOrderAmount(String.valueOf(lyOrderFlightRecord.getToBePayAmount())) //结算总额
.setFacePrice(String.valueOf(lyOrderFlightRecord.getTicketOutAmount())) //票面价
.setNoTaxAmt(String.valueOf(BigDecimal.valueOf(lyOrderFlightRecord.getTicketTotalAmount() == null ? 0 : lyOrderFlightRecord.getTicketTotalAmount())
.subtract(BigDecimal.valueOf(lyOrderFlightRecord.getTicketDeductibleTax() == null ? 0 : lyOrderFlightRecord.getTicketDeductibleTax())))) //未税金额
.setTaxAmt(String.valueOf(lyOrderFlightRecord.getTicketDeductibleTax())) //税额
.setPreServiceFee(String.valueOf(lyOrderFlightRecord.getServiceAmount())) //服务费
.setPostServiceFee("") //配送服务费
.setAirportTax(String.valueOf(lyOrderFlightRecord.getCapitalCost())) //机建费
.setChangeFee(String.valueOf(lyOrderFlightRecord.getChangeFee())) //改签手续费
.setFuelTax(String.valueOf(lyOrderFlightRecord.getFuelCost())) //燃油费
.setRefundFee(String.valueOf(lyOrderFlightRecord.getRefundFee())) //退票手续费
.setUpFee(String.valueOf(lyOrderFlightRecord.getUpgradeFee())) //改签差价
.setYcabinFullPrice("") //经济舱全价
.setIssueTicketTime(lyOrderFlightRecord.getEnterAccount())//出票时间 yyyy-MM-dd HH:mm:ss
.setPolicyLowestPrice(String.valueOf(lyOrderFlightRecord.getNHoursMinPrice())) //比价范围最低价
.setSeatDiscount(lyOrderFlightRecord.getDiscount())//折扣率
.setSeatPoint(lyOrderFlightRecord.getSeatClass())//舱位
.setSeatPointName(lyOrderFlightRecord.getSeatClass())//舱位名称
.setUseStatus(lyOrderFlightRecord.getTicketStatus()) //机票使用情况
.setOrderSource("") //预订来源线上/线下
.setNotLowReason("正泰机票无超标") //未预订最低价原因
.setBookOrgCode1(lyOrderFlightRecord.getPassengerDepartment()) //出行人组织架构信息1
.setBookOrgCode2(lyOrderFlightRecord.getPassengerDepartment()) //出行人组织架构信息2
.setBookOrgCode3(lyOrderFlightRecord.getPassengerDepartment()) //出行人组织架构信息3
.setOfflineCcomyCode(lyOrderFlightRecord.getPassengerCostCenter()) //成本中心
;
}
private void createHotelOrder(OrderHotelRecord orderHotelRecord, LyOrderHotelRecord lyOrderHotelRecord) {
String orderSerialNo = lyOrderHotelRecord.getOrderSerialNo();//订单号
OrderRecordBasic orderRecordBasic = getOrderRecordBasic(orderSerialNo);
BeanUtils.copyProperties(orderRecordBasic, orderHotelRecord);
orderHotelRecord.setDetailId(lyOrderHotelRecord.getBillOrderNo())//防重标识
.setTicketClerk(lyOrderHotelRecord.getReserveManName()) //票务员
.setAccountPeriod(lyOrderHotelRecord.getStatementCode()) //账期号
.setBillNo(lyOrderHotelRecord.getBillOrderNo()) //账单号结算单号
.setOrderNo(lyOrderHotelRecord.getOrderSerialNo()) //订单号
.setParentOrderNo("") //父级订单号
.setOriginalOrderNo(lyOrderHotelRecord.getOriginOrderSerialNo())//原始订单号
.setBrandGroup("") //酒店品牌集团
.setBrandName("") //酒店品牌
.setOverStandard("".equals(lyOrderHotelRecord.getOverStandardStatus()) ? 1 : 0) //"是否违规(超标) 0否,1是"
.setOverStandardReason(lyOrderHotelRecord.getViolationReason()) //违规原因超标原因
.setReceiptsNum(lyOrderHotelRecord.getOutApplayOrderNo()) //关联申请单号
.setUserName(lyOrderHotelRecord.getPassengerName()) //入住人姓名
.setUserCode(lyOrderHotelRecord.getPassengerNo()) //入住人编码
.setCheckInCity(lyOrderHotelRecord.getCityName()) //入住城市
.setCheckInDate(lyOrderHotelRecord.getCheckInTime()) //入住日期yyyy-MM-dd
.setCountry(lyOrderHotelRecord.getCountryName()) //国家
.setCustomerServiceName("") //客服处理人
.setDepartureDate(lyOrderHotelRecord.getLeaveTime()) //离店日期yyyy - MM - dd
.setHotelAddress("") //酒店地址
.setHotelName(lyOrderHotelRecord.getHotelName()) //酒店名称
.setIncludeAmount("") //含早情况XX份
.setIsAgreement(0) //是否协议酒店0否1是
.setPaymentType(getPaymentType(lyOrderHotelRecord.getPayType()))//"付款方式0-公司统付 1-个人付 2-混付"
.setOrderAmount(String.valueOf(lyOrderHotelRecord.getToBePayAmount())) //结算总额
.setCompanyAmount(String.valueOf(lyOrderHotelRecord.getToBePayAmount())) //企业统付总额
.setPersonalAmount("") //个人支付金额
.setUnifiedPayAmt(String.valueOf(lyOrderHotelRecord.getServiceAmount())) //统付服务费
.setPersonalPayAmt("") //个人服务费
.setProvince("") //省份
.setRoomCount(1) //房间数
.setRoomNightCount(lyOrderHotelRecord.getHotelNights()) //夜间数
.setNightCount(1) //间夜数
.setRoomPrice("") //房价房间单价不包含服务费
.setRoomRate(String.valueOf(lyOrderHotelRecord.getTotalRoomPrice())) //房费订单总额减总服务费
.setNoTaxAmt("") //不含税价
.setTaxAmt("") //税费
.setInvoiceType("") //供应商发票类型
.setInvoiceFee("") //开票手续费
.setCustodayFee("") //托管费
.setNoTaxCusFee("") //托管费不含税
.setTaxCusFee("") //托管费税费
.setRoomTypeName(lyOrderHotelRecord.getBedType()) //房型
.setStarRate("") //星级
.setOrderSource(lyOrderHotelRecord.getBookingPlat()) //预订来源线上/线下
.setBookOrgCode1(lyOrderHotelRecord.getPassengerDepartment()) //入住人组织架构信息1
.setBookOrgCode2("") //入住人组织架构信息2
.setBookOrgCode3("") //入住人组织架构信息3
.setOfflineCcomyCode(lyOrderHotelRecord.getPassengerCostCenter()) //成本中心
;
}
private void createTrainOrder(OrderTrainRecord orderTrainRecord, LyOrderTrainRecord lyOrderTrainRecord) {
String orderSerialNo = lyOrderTrainRecord.getOrderSerialNo();//订单号
OrderRecordBasic orderRecordBasic = getOrderRecordBasic(orderSerialNo);
BeanUtils.copyProperties(orderRecordBasic, orderTrainRecord);
orderTrainRecord.setDetailId(lyOrderTrainRecord.getBillOrderNo())//防重标识
.setTicketClerk(lyOrderTrainRecord.getReserveManName()) //票务员
.setAccountPeriod(lyOrderTrainRecord.getStatementCode()) //账期号
.setBillNo(lyOrderTrainRecord.getBillOrderNo()) //账单号
.setOrderNo(lyOrderTrainRecord.getOrderSerialNo()) //订单号
.setParentOrderNo("") //父级订单号
.setOriginalOrderNo(lyOrderTrainRecord.getOriginOrderSerialNo()) //原始订单号
.setReceiptsNum(lyOrderTrainRecord.getOutApplayOrderNo()) //关联申请单号
.setStartDate(lyOrderTrainRecord.getPlanBeginDate()) //出发日期
.setArriveDate(lyOrderTrainRecord.getPlanEndDate()) //到达日期
.setOverStandard("".equals(lyOrderTrainRecord.getOverStandardStatus()) ? "1" : "0") //"是否违规超标0否 1是"
.setOverStandardReason(lyOrderTrainRecord.getViolationReason()) //违规原因超标原因
.setChangeAddAmount(String.valueOf(lyOrderTrainRecord.getToBePayAmount())) //改签收款
.setChangeCost(String.valueOf(lyOrderTrainRecord.getChangeFee())) //改签手续费
.setChangeReturnAmount(String.valueOf(lyOrderTrainRecord.getToBePayAmount())) //改签退款
.setReturnCost(String.valueOf(lyOrderTrainRecord.getRefundFee())) //退款手续费
.setBookFee(String.valueOf(lyOrderTrainRecord.getServiceAmount())) //订票手续费
.setCollFee("") //取票手续费
.setNoTaxFeeAmt("") //手续费未税金额
.setTaxFeeAmt("") //手续费税费
.setReturnRes(lyOrderTrainRecord.getRefundChangeReason()) //退票原因
.setReturnFee(String.valueOf(lyOrderTrainRecord.getRefundFee())) //退票手续费
.setNoTaxAmt("") //未税金额
.setTaxAmt("") //税额
.setOrderAmount(String.valueOf(lyOrderTrainRecord.getToBePayAmount())) //结算总额
.setFromCity(lyOrderTrainRecord.getTripName()) //出发城市
.setFromStationName(lyOrderTrainRecord.getTripName()) //出发站
.setToCity(lyOrderTrainRecord.getTripName()) //到达城市
.setToStationName(lyOrderTrainRecord.getTripName()) //到达站
.setIssueTicketTime(lyOrderTrainRecord.getEnterAccount()) //出票时间 yyyy-MM-dd HH:mm:ss
.setRunTime("") //时长
.setSeatType("")// 座位等级
.setTrainNo(lyOrderTrainRecord.getTrainNo()) //车次
.setUserCode(lyOrderTrainRecord.getPassengerNo())//出行人编码
.setUserName(lyOrderTrainRecord.getPassengerName())//出行人姓名
.setOrderSource(lyOrderTrainRecord.getBookingPlat())//预订来源线上 / 线下
.setBookOrgCode1(lyOrderTrainRecord.getPassengerDepartment())//出行人组织架构信息1
.setBookOrgCode2("")//出行人组织架构信息2
.setBookOrgCode3("")//出行人组织架构信息3
.setOfflineCcomyCode(lyOrderTrainRecord.getPassengerCostCenter())//成本中心
.setTravelUserBirthday("")//生日
.setTravelUserPhone("") //出行人手机号
.setTravelUserSex("")//"性别0保密不展示 1男 2女"
.setTravelUserType("") //"乘客类型:成人(ADULT) 儿童(CHILDREN) 婴儿(BABY)"
.setPassportNo("")//乘客证件号
.setPassportType("")//乘客证件类型
.setTrainTime("")//发车时间 yyyy - MM - dd HH:mm:ss
.setYxId("")//影像比对ID
;
}
private void createCarOrder(OrderCarRecord orderCarRecord, LyOrderCarRecord lyOrderCarRecord) {
String orderSerialNo = lyOrderCarRecord.getOrderSerialNo();//订单号
OrderRecordBasic orderRecordBasic = getOrderRecordBasic(orderSerialNo);
BeanUtils.copyProperties(orderRecordBasic, orderCarRecord);
orderCarRecord.setDetailId(lyOrderCarRecord.getBillOrderNo())//防重标识
.setTicketClerk(lyOrderCarRecord.getReserveManName()) //票务员
.setAccountPeriod(lyOrderCarRecord.getStatementCode()) //账期号
.setBillNo(lyOrderCarRecord.getBillOrderNo()) //账单号
.setReceiptsNum(lyOrderCarRecord.getOrderSerialNo()) //关联申请单号
.setOverStandard("0") //"是否违规超标0否 1是"
.setOverStandardReason("")//违规原因超标原因
.setOrderNo(lyOrderCarRecord.getOrderSerialNo()) //订单号
.setParentOrderNo("")//父级订单号
.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"
.setFromStationName(lyOrderCarRecord.getCarStartPlaceActual()) //出发地
.setToStationName(lyOrderCarRecord.getCarEndPlaceActual()) //到达地
.setCarType("") //车型
.setFromCity(lyOrderCarRecord.getStartCityName()) //出发城市
.setToCity("") //到达城市
.setRunTime("") //运行时长
.setMiles("") //里程数
.setNoTaxAmt("") //未税金额
.setTaxAmt("") //税费
.setOrderAmount(String.valueOf(lyOrderCarRecord.getToBePayAmount())) //结算总额(含前收服务费)
.setOpenCharge("") //开票手续费
.setHighSpeedAmt("") //额外费用
.setHighSpeedName("") //额外费用名称
.setServiceCost(String.valueOf(lyOrderCarRecord.getServiceAmount())) //服务费
.setCancelCost(String.valueOf(lyOrderCarRecord.getToBePayAmount())) //取消费
.setUserName(String.valueOf(lyOrderCarRecord.getPassengerName())) //用车人姓名
.setUserCode(lyOrderCarRecord.getPassengerNo()) //用车人code
// .setOwnPayAmt() //个人支付金额
.setComyPayAmt(String.valueOf(lyOrderCarRecord.getToBePayAmount())) //公司统付金额
.setBookOrgCode1(lyOrderCarRecord.getPassengerDepartment()) //用车人组织架构信息1
.setBookOrgCode2("") //用车人组织架构信息2
.setBookOrgCode3("") //用车人组织架构信息3
.setPaymentType(String.valueOf(getPaymentType(lyOrderCarRecord.getPayType()))) //"付款方式0公司统付 1个人付 2混付"
.setOfflineCcomyCode(lyOrderCarRecord.getPassengerDepartment()) //成本中心
.setOrderSource(lyOrderCarRecord.getBookingPlat()) //预订来源线上/线下
// .setORDER_AMOUNT() //订单金额
// .setSETTLE_ORDER_FLAG() //订单对账状态
// .setpayAmount()// 支付金额
;
}
//获取公共对象
public OrderRecordBasic getOrderRecordBasic(String orderSerialNo) {
OrderDetail orderDetail = jdbcOrderDetailRepository.findByOrderNo(orderSerialNo);
Long routeId = orderDetail == null ? 0L : orderDetail.getRouteId();
RouteOrder routeOrder = jdbcRouteRepository.findByRouteId(routeId);
if (Objects.isNull(routeOrder)) {
return new OrderRecordBasic();
}
return orderRecordFactory.buildWithRouteOrder(routeOrder);
}
//映射付款方式
//支付类型(1:企业授信 / 2:个人支付 / 3组合支付)
public int getPaymentType(String payType) {
return switch (payType) {
case "企业授信" -> 0;
case "个人支付" -> 1;
case "组合支付" -> 2;
default -> -1;
};
}
}

View File

@ -54,8 +54,6 @@ public class OrderRecordFactory {
if (sysCode.equals(BELONG_SYS_CODE_ANFSSC)) { if (sysCode.equals(BELONG_SYS_CODE_ANFSSC)) {
orderRecordBasic.setBelongSysType(BELONG_SYS_TYPE_ANFSSC); orderRecordBasic.setBelongSysType(BELONG_SYS_TYPE_ANFSSC);
} }
} else {
orderRecordBasic.setBelongSysType(BELONG_SYS_TYPE_NOT);
} }
} }
return orderRecordBasic; return orderRecordBasic;

View File

@ -35,10 +35,10 @@ public class RanksFactoryImpl implements RanksFactory {
Integer level = ranksData.getLevel(); Integer level = ranksData.getLevel();
ranks.setStandardLevel( ranks.setStandardLevel(
switch (level) { switch (level) {
case 1 -> prefix + STANDARD_LEVEL_ONE_COMMON; case 1 -> prefix + RankConstant.STANDARD_LEVEL_ONE;
case 2 -> prefix + STANDARD_LEVEL_TWO_COMMON; case 2 -> prefix + RankConstant.STANDARD_LEVEL_TWO;
case 3 -> prefix + STANDARD_LEVEL_THREE_COMMON; case 3 -> prefix + RankConstant.STANDARD_LEVEL_THREE;
case 4 -> prefix + STANDARD_LEVEL_FOUR_COMMON; case 4 -> prefix + RankConstant.STANDARD_LEVEL_FOUR;
default -> throw new NotFoundException(CommonMessageConstant.NOT_FOUND); default -> throw new NotFoundException(CommonMessageConstant.NOT_FOUND);
} }
); );

View File

@ -38,13 +38,7 @@ public interface CTripOrderDetailRepository {
CTripCarRecordBase findCarByRecordId(Long id); CTripCarRecordBase findCarByRecordId(Long id);
void saveAllCTripFlightRecord(List<CTripFlightRecord> cTripFlightRecordList); void saveAllCTripFlightRecord(List<CTripFlightRecord> cTripFlightRecordList);
CTripFlightRecord findFlightRecordById(Long id);
CTripFlightRecord findFlightRecordByRecordId(String recordId);
void saveAllCTripHotelRecord(List<CTripHotelRecord> cTripHotelRecordList); void saveAllCTripHotelRecord(List<CTripHotelRecord> cTripHotelRecordList);
CTripHotelRecord findHotelRecordById(Long id);
CTripHotelRecord findHotelRecordByRecordId(String recordId);
void saveAllCTripTrainRecord(List<CTripTrainRecord> cTripTrainRecordList); void saveAllCTripTrainRecord(List<CTripTrainRecord> cTripTrainRecordList);
CTripTrainRecord findTrainRecordByRecordId(String recordId);
void saveAllCTripCarRecord(List<CTripCarRecord> cTripCarRecordList); void saveAllCTripCarRecord(List<CTripCarRecord> cTripCarRecordList);
CTripCarRecord findCarRecordByRecordId(String recordId);
} }

View File

@ -9,6 +9,4 @@ public interface CompanyBlackListRepository {
CompanyBlackList findByCompanyName(String companyName); CompanyBlackList findByCompanyName(String companyName);
List<CompanyBlackList> findAll(); List<CompanyBlackList> findAll();
Boolean ifInCompanyList(String companyName);
} }

View File

@ -6,6 +6,4 @@ import java.util.List;
public interface OrderFlightRecordRepository { public interface OrderFlightRecordRepository {
List<OrderFlightRecord> saveAll(List<OrderFlightRecord> orderFlightRecordList); List<OrderFlightRecord> saveAll(List<OrderFlightRecord> orderFlightRecordList);
} }

View File

@ -113,6 +113,7 @@ public class OrderDomainService {
@Autowired @Autowired
private JdbcLegRepository jdbcLegRepository; private JdbcLegRepository jdbcLegRepository;
private Set<String> companyBlackList = new HashSet<>(); private Set<String> companyBlackList = new HashSet<>();
public RouteOrder saveOrder(RouteOrder routeOrder) { public RouteOrder saveOrder(RouteOrder routeOrder) {
@ -129,7 +130,7 @@ public class OrderDomainService {
} }
public boolean checkCompanyNameIfBlack(String companyName) { public boolean checkCompanyNameIfBlack(String companyName) {
if (companyBlackListRepository.ifInCompanyList(companyName)) { if (companyBlackList.contains(companyName)) {
throw new OrderException(COMPANY_NAME_IN_BLACK_LIST); throw new OrderException(COMPANY_NAME_IN_BLACK_LIST);
} else { } else {
return true; return true;
@ -196,16 +197,6 @@ public class OrderDomainService {
ApprovalSimpleData data = command.getData(); ApprovalSimpleData data = command.getData();
Optional.ofNullable(routeRepository.findByActualOrderNoAndSysCode(data.getActualOrderNo(), data.getSysCode())) Optional.ofNullable(routeRepository.findByActualOrderNoAndSysCode(data.getActualOrderNo(), data.getSysCode()))
.ifPresentOrElse(route -> { .ifPresentOrElse(route -> {
//保存提交审批所提供的资料
ApproveOrderNo approveOrderNo = route.getApproveOrderNo();
approveOrderNo.setActualOrderNo(data.getActualOrderNo());
approveOrderNo.setInstructions(data.getInstructions());
approveOrderNo.setCreator(data.getCreator());
approveOrderNo.setAccountCompanyName(data.getAccountCompany());
approveOrderNo.setAccountCompanyCode(data.getAccountCompanyCode());
approveOrderNo.setProjectName(data.getProjectName());
approveOrderNo.setCostCenter(data.getCostCenter());
LegEvent legEvent = legEventFactory.creatLegEvent(command.getLegEventType()); LegEvent legEvent = legEventFactory.creatLegEvent(command.getLegEventType());
route.getLegItems().forEach(leg -> leg.addEvent(legEvent)); route.getLegItems().forEach(leg -> leg.addEvent(legEvent));
ApprovalEvent approvalEvent = routeOrderFactory.createApprovalEvent(APPROVAL_EVENT_ING); ApprovalEvent approvalEvent = routeOrderFactory.createApprovalEvent(APPROVAL_EVENT_ING);

View File

@ -42,9 +42,10 @@ import static com.chint.infrastructure.constant.CommonMessageConstant.LEG_CHANGE
import static com.chint.infrastructure.constant.DataMessageConstant.DATA_NOT_FOUND; import static com.chint.infrastructure.constant.DataMessageConstant.DATA_NOT_FOUND;
import static com.chint.infrastructure.constant.LegConstant.*; import static com.chint.infrastructure.constant.LegConstant.*;
import static com.chint.infrastructure.constant.OrderConstant.*; import static com.chint.infrastructure.constant.OrderConstant.*;
import static com.chint.infrastructure.constant.OrderConstant.ORDER_EVENT_FINISH_NAME;
import static com.chint.infrastructure.constant.RankConstant.ZTZW_COMPANY_CODE; import static com.chint.infrastructure.constant.RankConstant.ZTZW_COMPANY_CODE;
import static com.chint.infrastructure.constant.RankConstant.ZTZW_COMPANY_NAME; import static com.chint.infrastructure.constant.RankConstant.ZTZW_COMPANY_NAME;
import static com.chint.infrastructure.constant.RouteConstant.ORDER_STATUS_PREPARE; import static com.chint.infrastructure.constant.RouteConstant.*;
import static com.chint.infrastructure.constant.UtilConstant.RESULT_ORDER_DETAIL; import static com.chint.infrastructure.constant.UtilConstant.RESULT_ORDER_DETAIL;
@Service @Service
@ -113,7 +114,6 @@ public class LegEventHandler implements LegEventService {
approveOrderNo.setActualOrderNo(data.getActualOrderNo()); approveOrderNo.setActualOrderNo(data.getActualOrderNo());
approveOrderNo.setInstructions(data.getInstructions()); approveOrderNo.setInstructions(data.getInstructions());
approveOrderNo.setCreator(data.getCreator()); approveOrderNo.setCreator(data.getCreator());
approveOrderNo.setAccountCompanyName(data.getAccountCompany());
approveOrderNo.setAccountCompanyCode(data.getAccountCompanyCode()); approveOrderNo.setAccountCompanyCode(data.getAccountCompanyCode());
approveOrderNo.setProjectName(data.getProjectName()); approveOrderNo.setProjectName(data.getProjectName());
approveOrderNo.setCostCenter(data.getCostCenter()); approveOrderNo.setCostCenter(data.getCostCenter());
@ -160,26 +160,15 @@ public class LegEventHandler implements LegEventService {
if (routeOrder.getOrderStatus() >= RouteConstant.ORDER_STATUS_APPROVAL) { if (routeOrder.getOrderStatus() >= RouteConstant.ORDER_STATUS_APPROVAL) {
String supplierName = data.getSupplierName(); String supplierName = data.getSupplierName();
routeOrder.setSupplierName(supplierName); routeOrder.setSupplierName(supplierName);
List<Leg> legItems = routeOrder.getLegItems();
//这里增加一个判断 如果这个订单的行程为空那么就返回给用户提示
if (legItems == null || legItems.isEmpty()) {
throw new CommandException("订单的行程不能为空");
}
List<Leg> needSyncLegs = legItems.stream().filter(it -> !it.getLegType().equals(LEG_TYPE_OTHER)).toList();
if (needSyncLegs.isEmpty()) {
throw new CommandException("有所选的行程规划单不存在需要同步的行程");
}
//这里order所有的leg触发sync事件 //这里order所有的leg触发sync事件
legItems.forEach(leg -> leg.getEventList().add( routeOrder.getLegItems().forEach(leg -> leg.getEventList().add(
legEventFactory.creatLegEvent(command.getLegEventType()) legEventFactory.creatLegEvent(command.getLegEventType())
)); ));
//保存routeOrder的状态 //保存routeOrder的状态
routeRepository.save(routeOrder).reloadStatus(); routeRepository.save(routeOrder).reloadStatus();
routeOrder.setLegItems( routeOrder.setLegItems(
legItems routeOrder
.getLegItems()
.stream() .stream()
.filter(leg -> !leg.getLegType().equals(LegConstant.LEG_TYPE_OTHER)) .filter(leg -> !leg.getLegType().equals(LegConstant.LEG_TYPE_OTHER))
.toList() .toList()
@ -255,8 +244,8 @@ public class LegEventHandler implements LegEventService {
LegEvent legEvent = legEventFactory LegEvent legEvent = legEventFactory
.creatLegEvent(command.getLegEventType()); .creatLegEvent(command.getLegEventType());
leg.addEvent(legEvent); leg.addEvent(legEvent);
} else if (orderStatus.equals(ORDER_EVENT_REFUND_NAME) || } else if(orderStatus.equals(ORDER_EVENT_REFUND_NAME) ||
orderStatus.equals(ORDER_EVENT_CANCEL_NAME)) { orderStatus.equals(ORDER_EVENT_CANCEL_NAME)){
//如果是退款状态那么就创建加入未下单事件 //如果是退款状态那么就创建加入未下单事件
LegEvent legEvent = legEventFactory LegEvent legEvent = legEventFactory
.creatLegEvent(LEG_EVENT_NOT_ORDERED); .creatLegEvent(LEG_EVENT_NOT_ORDERED);

View File

@ -5,161 +5,32 @@ 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;
import com.chint.domain.aggregates.order.order_record.OrderTrainRecord; 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.factoriy.order_record.CTripOrderRecordExtensionFactory;
import com.chint.domain.factoriy.order_record.LyOrderRecordExtensionFactory;
import com.chint.domain.service.OrderDetailDomainService;
import com.chint.infrastructure.repository.jdbc.*;
import com.chint.infrastructure.util.PageResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List; import java.util.List;
@Component public class LYOrderRecordDomainService implements OrderRecordDomainService{
public class LYOrderRecordDomainService implements OrderRecordDomainService {
@Autowired
private JdbcLyOrderFlightRecord jdbcLyOrderFlightRecord;
@Autowired
private JdbcLyOrderHotelRecord jdbcLyOrderHotelRecord;
@Autowired
private JdbcLyOrderTrainRecord jdbcLyOrderTrainRecord;
@Autowired
private JdbcLyOrderCarRecord jdbcLyOrderCarRecord;
@Autowired
private LyOrderRecordExtensionFactory lyOrderRecordExtensionFactory;
@Autowired
private OrderDetailDomainService orderDetailDomainService;
@Override @Override
@Transactional
public List<OrderFlightRecord> generateFlightRecord(OrderRecordGenerateCommand command) {
ArrayList<OrderFlightRecord> orderFlightRecordList = new ArrayList<>();
int count = 0;//初始化变量
int pageSize = 100; // 假设每页大小为10
int LoopNum;//需要的循环数
do {
PageRequest pageResult = PageRequest.of(count, pageSize);
Page<LyOrderFlightRecord> lyOrderFlightRecordPage = jdbcLyOrderFlightRecord.findAllByStatusIsNull(pageResult);
long totalElements = lyOrderFlightRecordPage.getTotalElements();//总数
LoopNum = (int) Math.ceil((double) totalElements / pageSize); // 计算总页数并向上取整
//数据
List<LyOrderFlightRecord> lyOrderFlightRecordPageList = lyOrderFlightRecordPage.toList();
ArrayList<OrderFlightRecord> orderFlightRecords = new ArrayList<>(100);
for (LyOrderFlightRecord lyOrderFlightRecord : lyOrderFlightRecordPageList) {
OrderFlightRecord orderFlightRecord = lyOrderRecordExtensionFactory.createFlightOrderRecord(lyOrderFlightRecord);//转换
orderFlightRecords.add(orderFlightRecord);
}
//保存数据
orderDetailDomainService.saveFlightOrderRecordBatch(orderFlightRecords);
orderFlightRecordList.addAll(orderFlightRecords);
count++;
} while (count < LoopNum);
//修改数据将状态为null的设置为1
jdbcLyOrderFlightRecord.updateStatusByNullStatus();
return orderFlightRecordList;
}
@Override
@Transactional
public List<OrderHotelRecord> generateHotelRecord(OrderRecordGenerateCommand command) { public List<OrderHotelRecord> generateHotelRecord(OrderRecordGenerateCommand command) {
ArrayList<OrderHotelRecord> orderHotelRecordList = new ArrayList<>(); LocalDateTime startTime = command.getStartTime();
int count = 0;//初始化变量
int pageSize = 100; // 假设每页大小为10 return null;
int LoopNum;//需要的循环数
do {
PageRequest pageResult = PageRequest.of(count, pageSize);
Page<LyOrderHotelRecord> lyOrderHotelRecordPage = jdbcLyOrderHotelRecord.findAllByStatusIsNull(pageResult);
long totalElements = lyOrderHotelRecordPage.getTotalElements();//总数
LoopNum = (int) Math.ceil((double) totalElements / pageSize); // 计算总页数并向上取整
//数据
List<LyOrderHotelRecord> lyOrderHotelRecordPageList = lyOrderHotelRecordPage.toList();
ArrayList<OrderHotelRecord> orderHotelRecords = new ArrayList<>(100);
for (LyOrderHotelRecord lyOrderHotelRecord : lyOrderHotelRecordPageList) {
OrderHotelRecord orderHotelRecord = lyOrderRecordExtensionFactory.createHotelOrderRecord(lyOrderHotelRecord);//转换
orderHotelRecords.add(orderHotelRecord);
}
//保存数据
orderDetailDomainService.saveHotelOrderRecordBatch(orderHotelRecords);
orderHotelRecordList.addAll(orderHotelRecords);
count++;
} while (count < LoopNum);
//修改数据将状态为null的设置为1
jdbcLyOrderHotelRecord.updateStatusByNullStatus();
return orderHotelRecordList;
} }
@Override @Override
@Transactional
public List<OrderTrainRecord> generateTrainRecord(OrderRecordGenerateCommand command) { public List<OrderTrainRecord> generateTrainRecord(OrderRecordGenerateCommand command) {
ArrayList<OrderTrainRecord> orderTrainRecordsList = new ArrayList<>(); return null;
int count = 0;//初始化变量
int pageSize = 100; // 假设每页大小为10
int LoopNum;//需要的循环数
do {
PageRequest pageResult = PageRequest.of(count, pageSize);
Page<LyOrderTrainRecord> lyOrderTrainRecordPage = jdbcLyOrderTrainRecord.findAllByStatusIsNull(pageResult);
long totalElements = lyOrderTrainRecordPage.getTotalElements();//总数
LoopNum = (int) Math.ceil((double) totalElements / pageSize); // 计算总页数并向上取整
//数据
List<LyOrderTrainRecord> lyOrderTrainRecordPageList = lyOrderTrainRecordPage.toList();
ArrayList<OrderTrainRecord> orderTrainRecords = new ArrayList<>(100);
for (LyOrderTrainRecord lyOrderTrainRecord : lyOrderTrainRecordPageList) {
OrderTrainRecord orderTrainRecord = lyOrderRecordExtensionFactory.createTrainOrderRecord(lyOrderTrainRecord);//转换
orderTrainRecords.add(orderTrainRecord);
}
//保存数据
orderDetailDomainService.saveTrainOrderRecordBatch(orderTrainRecords);
orderTrainRecordsList.addAll(orderTrainRecords);
count++;
} while (count < LoopNum);
//修改数据将状态为null的设置为1
jdbcLyOrderTrainRecord.updateStatusByNullStatus();
return orderTrainRecordsList;
} }
@Override
public List<OrderFlightRecord> generateFlightRecord(OrderRecordGenerateCommand command) {
return null;
}
@Override @Override
@Transactional
public List<OrderCarRecord> generateCarRecord(OrderRecordGenerateCommand command) { public List<OrderCarRecord> generateCarRecord(OrderRecordGenerateCommand command) {
ArrayList<OrderCarRecord> orderCarRecordsList = new ArrayList<>(); return null;
int count = 0;//初始化变量
int pageSize = 100; // 假设每页大小为10
int LoopNum;//需要的循环数
do {
PageRequest pageResult = PageRequest.of(count, pageSize);
Page<LyOrderCarRecord> lyOrderCarRecordPage = jdbcLyOrderCarRecord.findAllByStatusIsNull(pageResult);
long totalElements = lyOrderCarRecordPage.getTotalElements();//总数
LoopNum = (int) Math.ceil((double) totalElements / pageSize); // 计算总页数并向上取整
//数据
List<LyOrderCarRecord> lyOrderCarRecordPageList = lyOrderCarRecordPage.toList();
ArrayList<OrderCarRecord> orderCarRecords = new ArrayList<>(100);
for (LyOrderCarRecord lyOrderCarRecord : lyOrderCarRecordPageList) {
OrderCarRecord orderCarRecord = lyOrderRecordExtensionFactory.createCarOrderRecord(lyOrderCarRecord);//转换
orderCarRecords.add(orderCarRecord);
}
//保存数据
orderDetailDomainService.saveCarOrderRecordBatch(orderCarRecords);
orderCarRecordsList.addAll(orderCarRecords);
count++;
} while (count < LoopNum);
//修改数据将状态为null的设置为1
jdbcLyOrderCarRecord.updateStatusByNullStatus();
return orderCarRecordsList;
} }
} }

View File

@ -28,7 +28,6 @@ import java.util.stream.Collectors;
import static com.chint.infrastructure.constant.LegConstant.*; import static com.chint.infrastructure.constant.LegConstant.*;
import static com.chint.infrastructure.constant.LocationConstant.LOCATION_LEVEL_COUNTY; import static com.chint.infrastructure.constant.LocationConstant.LOCATION_LEVEL_COUNTY;
import static com.chint.infrastructure.constant.LocationConstant.LOCATION_TYPE_DISTRICT;
@Slf4j @Slf4j
@Component @Component
@ -199,13 +198,7 @@ public class CTripOrderSyncAdapter implements SupplierOrderSync {
} }
locationRepository.saveAll(List.of(location)); locationRepository.saveAll(List.of(location));
} }
//这里的逻辑需要修改
// 如果是县级市的话 取CItyId
// 如果是区的话 要查找地级市 取地级市的Id
// 如果是地级市的话 直接取地级市的ID
if (location.getLocationType().equals(LOCATION_TYPE_DISTRICT)) {
return locationRepository.findById(location.getParentLocationId());
}
return location; return location;
} }
} }

View File

@ -12,6 +12,4 @@ public class BelongSystemConstant {
public static final String BELONG_SYS_TYPE_XNFSSC = "XN_FK"; public static final String BELONG_SYS_TYPE_XNFSSC = "XN_FK";
public static final String BELONG_SYS_TYPE_ANFSSC = "AN_FK"; public static final String BELONG_SYS_TYPE_ANFSSC = "AN_FK";
public static final String BELONG_SYS_TYPE_NOT = "NOT";
} }

View File

@ -29,12 +29,6 @@ public class RankConstant {
public static final String ALTER_APPLY = "3";//变更 public static final String ALTER_APPLY = "3";//变更
//集团差标等级
public static final String STANDARD_LEVEL_ONE_COMMON = "STANDARD_LEVEL_ONE";//差标1
public static final String STANDARD_LEVEL_TWO_COMMON = "STANDARD_LEVEL_TWO";//差标2
public static final String STANDARD_LEVEL_THREE_COMMON = "STANDARD_LEVEL_THREE";//差标3
public static final String STANDARD_LEVEL_FOUR_COMMON = "STANDARD_LEVEL_FOUR";//差标4
//集团差标等级 //集团差标等级
public static final String STANDARD_LEVEL_ONE = "JT_STANDARD_LEVEL_ONE";//差标1 public static final String STANDARD_LEVEL_ONE = "JT_STANDARD_LEVEL_ONE";//差标1
public static final String STANDARD_LEVEL_TWO = "JT_STANDARD_LEVEL_TWO";//差标2 public static final String STANDARD_LEVEL_TWO = "JT_STANDARD_LEVEL_TWO";//差标2

View File

@ -119,50 +119,20 @@ public class CTripOrderDetailImpl implements CTripOrderDetailRepository {
jdbcCTripFlightRecordRepository.saveAll(cTripFlightRecordList); jdbcCTripFlightRecordRepository.saveAll(cTripFlightRecordList);
} }
@Override
public CTripFlightRecord findFlightRecordById(Long id) {
return jdbcCTripFlightRecordRepository.findById(id).get();
}
@Override
public CTripFlightRecord findFlightRecordByRecordId(String recordId) {
return jdbcCTripFlightRecordRepository.findByRecordId(recordId);
}
@Override @Override
public void saveAllCTripHotelRecord(List<CTripHotelRecord> cTripHotelRecordList) { public void saveAllCTripHotelRecord(List<CTripHotelRecord> cTripHotelRecordList) {
jdbcCTripHotelRecordRepository.saveAll(cTripHotelRecordList); jdbcCTripHotelRecordRepository.saveAll(cTripHotelRecordList);
} }
@Override
public CTripHotelRecord findHotelRecordById(Long id) {
return jdbcCTripHotelRecordRepository.findById(id).get();
}
@Override
public CTripHotelRecord findHotelRecordByRecordId(String recordId) {
return jdbcCTripHotelRecordRepository.findByRecordId(recordId);
}
@Override @Override
public void saveAllCTripTrainRecord(List<CTripTrainRecord> cTripTrainRecordList) { public void saveAllCTripTrainRecord(List<CTripTrainRecord> cTripTrainRecordList) {
jdbcCTripTrainRecordRepository.saveAll(cTripTrainRecordList); jdbcCTripTrainRecordRepository.saveAll(cTripTrainRecordList);
} }
@Override
public CTripTrainRecord findTrainRecordByRecordId(String recordId) {
return jdbcCTripTrainRecordRepository.findByRecordId(recordId);
}
@Override @Override
public void saveAllCTripCarRecord(List<CTripCarRecord> cTripCarRecordList) { public void saveAllCTripCarRecord(List<CTripCarRecord> cTripCarRecordList) {
jdbcCTripCarRecordRepository.saveAll(cTripCarRecordList); jdbcCTripCarRecordRepository.saveAll(cTripCarRecordList);
} }
@Override
public CTripCarRecord findCarRecordByRecordId(String recordId) {
return jdbcCTripCarRecordRepository.findByRecordId(recordId);
}
// //
// @Override // @Override
// public Client findByClientId(String clientId){ // public Client findByClientId(String clientId){

View File

@ -4,7 +4,6 @@ import com.chint.domain.aggregates.system.CompanyBlackList;
import com.chint.domain.repository.CompanyBlackListRepository; import com.chint.domain.repository.CompanyBlackListRepository;
import com.chint.infrastructure.repository.jdbc.JdbcCompanyBlackListRepository; import com.chint.infrastructure.repository.jdbc.JdbcCompanyBlackListRepository;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import java.util.ArrayList; import java.util.ArrayList;
@ -21,7 +20,6 @@ public class CompanyBlackListRepositoryImpl implements CompanyBlackListRepositor
return jdbcCompanyBlackListRepository.findByCompanyName(companyName); return jdbcCompanyBlackListRepository.findByCompanyName(companyName);
} }
@Cacheable(value = "CompanyBlack")
@Override @Override
public List<CompanyBlackList> findAll() { public List<CompanyBlackList> findAll() {
List<CompanyBlackList> all = new ArrayList<>(); List<CompanyBlackList> all = new ArrayList<>();
@ -30,11 +28,4 @@ public class CompanyBlackListRepositoryImpl implements CompanyBlackListRepositor
); );
return all; return all;
} }
@Cacheable(value = "CompanyBlack", key = "#companyName")
@Override
public Boolean ifInCompanyList(String companyName) {
CompanyBlackList byCompanyName = jdbcCompanyBlackListRepository.findByCompanyName(companyName);
return byCompanyName != null;
}
} }

View File

@ -21,6 +21,4 @@ public class OrderFlightRecordRepositoryImpl implements OrderFlightRecordReposit
jdbcOrderFlightRecordRepository.saveAll(orderFlightRecordList).forEach(res::add); jdbcOrderFlightRecordRepository.saveAll(orderFlightRecordList).forEach(res::add);
return res; return res;
} }
} }

View File

@ -8,5 +8,4 @@ import org.springframework.stereotype.Repository;
@Repository @Repository
public interface JdbcCTripCarRecordRepository extends CrudRepository<CTripCarRecord,Long> { public interface JdbcCTripCarRecordRepository extends CrudRepository<CTripCarRecord,Long> {
CTripCarRecord findByRecordId(String recordId);
} }

View File

@ -6,6 +6,4 @@ import org.springframework.stereotype.Repository;
@Repository @Repository
public interface JdbcCTripFlightRecordRepository extends CrudRepository<CTripFlightRecord,Long> { public interface JdbcCTripFlightRecordRepository extends CrudRepository<CTripFlightRecord,Long> {
CTripFlightRecord findByRecordId(String recordId);
} }

View File

@ -7,5 +7,4 @@ import org.springframework.stereotype.Repository;
@Repository @Repository
public interface JdbcCTripHotelRecordRepository extends CrudRepository<CTripHotelRecord,Long> { public interface JdbcCTripHotelRecordRepository extends CrudRepository<CTripHotelRecord,Long> {
CTripHotelRecord findByRecordId(String recordId);
} }

View File

@ -7,5 +7,4 @@ import org.springframework.stereotype.Repository;
@Repository @Repository
public interface JdbcCTripTrainRecordRepository extends CrudRepository<CTripTrainRecord,Long> { public interface JdbcCTripTrainRecordRepository extends CrudRepository<CTripTrainRecord,Long> {
CTripTrainRecord findByRecordId(String recordId);
} }

View File

@ -2,10 +2,6 @@ package com.chint.infrastructure.repository.jdbc;
import com.chint.domain.aggregates.order.order_record.ly_order_record.LyOrderCarRecord; 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 org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.jdbc.repository.query.Modifying;
import org.springframework.data.jdbc.repository.query.Query; import org.springframework.data.jdbc.repository.query.Query;
import org.springframework.data.repository.CrudRepository; import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param; import org.springframework.data.repository.query.Param;
@ -17,10 +13,4 @@ import java.util.List;
public interface JdbcLyOrderCarRecord extends CrudRepository<LyOrderCarRecord, Long> { public interface JdbcLyOrderCarRecord extends CrudRepository<LyOrderCarRecord, Long> {
@Query(value = "SELECT bill_order_no FROM ly_order_car_record WHERE enter_account BETWEEN :beginDate AND :endDate") @Query(value = "SELECT bill_order_no FROM ly_order_car_record WHERE enter_account BETWEEN :beginDate AND :endDate")
List<String> queryBillOrderNo(@Param("beginDate") String beginDate, @Param("endDate") String endDate); List<String> queryBillOrderNo(@Param("beginDate") String beginDate, @Param("endDate") String endDate);
Page<LyOrderCarRecord> findAllByStatusIsNull(PageRequest pageResult);
@Modifying
@Query("UPDATE ly_order_car_record l SET l.status = 1 WHERE l.status IS NULL")
void updateStatusByNullStatus();
} }

View File

@ -1,11 +1,9 @@
package com.chint.infrastructure.repository.jdbc; package com.chint.infrastructure.repository.jdbc;
import com.chint.domain.aggregates.order.order_record.ly_order_record.LyOrderFlightRecord; import com.chint.domain.aggregates.order.order_record.ly_order_record.LyOrderFlightRecord;
import com.chint.infrastructure.config.LogConfig.SystemLog;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.jdbc.repository.query.Modifying;
import org.springframework.data.jdbc.repository.query.Query; import org.springframework.data.jdbc.repository.query.Query;
import org.springframework.data.repository.CrudRepository; import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param; import org.springframework.data.repository.query.Param;
@ -17,10 +15,4 @@ import java.util.List;
public interface JdbcLyOrderFlightRecord extends CrudRepository<LyOrderFlightRecord, Long> { public interface JdbcLyOrderFlightRecord extends CrudRepository<LyOrderFlightRecord, Long> {
@Query(value = "SELECT bill_order_no FROM ly_order_flight_record WHERE enter_account BETWEEN :beginDate AND :endDate") @Query(value = "SELECT bill_order_no FROM ly_order_flight_record WHERE enter_account BETWEEN :beginDate AND :endDate")
List<String> queryBillOrderNo(@Param("beginDate") String beginDate, @Param("endDate") String endDate); List<String> queryBillOrderNo(@Param("beginDate") String beginDate, @Param("endDate") String endDate);
Page<LyOrderFlightRecord> findAllByStatusIsNull(PageRequest pageResult);
@Modifying
@Query("UPDATE ly_order_flight_record l SET l.status = 1 WHERE l.status IS NULL")
void updateStatusByNullStatus();
} }

View File

@ -2,11 +2,7 @@ package com.chint.infrastructure.repository.jdbc;
import com.chint.domain.aggregates.order.order_record.ly_order_record.LyOrderCarRecord;
import com.chint.domain.aggregates.order.order_record.ly_order_record.LyOrderHotelRecord; import com.chint.domain.aggregates.order.order_record.ly_order_record.LyOrderHotelRecord;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.jdbc.repository.query.Modifying;
import org.springframework.data.jdbc.repository.query.Query; import org.springframework.data.jdbc.repository.query.Query;
import org.springframework.data.repository.CrudRepository; import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param; import org.springframework.data.repository.query.Param;
@ -18,10 +14,4 @@ import java.util.List;
public interface JdbcLyOrderHotelRecord extends CrudRepository<LyOrderHotelRecord, Long> { public interface JdbcLyOrderHotelRecord extends CrudRepository<LyOrderHotelRecord, Long> {
@Query(value = "SELECT bill_order_no FROM ly_order_hotel_record WHERE enter_account BETWEEN :beginDate AND :endDate") @Query(value = "SELECT bill_order_no FROM ly_order_hotel_record WHERE enter_account BETWEEN :beginDate AND :endDate")
List<String> queryBillOrderNo(@Param("beginDate") String beginDate, @Param("endDate") String endDate); List<String> queryBillOrderNo(@Param("beginDate") String beginDate, @Param("endDate") String endDate);
Page<LyOrderHotelRecord> findAllByStatusIsNull(PageRequest pageResult);
@Modifying
@Query("UPDATE ly_order_hotel_record l SET l.status = 1 WHERE l.status IS NULL")
void updateStatusByNullStatus();
} }

View File

@ -1,11 +1,8 @@
package com.chint.infrastructure.repository.jdbc; package com.chint.infrastructure.repository.jdbc;
import com.chint.domain.aggregates.order.order_record.ly_order_record.LyOrderCarRecord;
import com.chint.domain.aggregates.order.order_record.ly_order_record.LyOrderTrainRecord; import com.chint.domain.aggregates.order.order_record.ly_order_record.LyOrderTrainRecord;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.jdbc.repository.query.Modifying;
import org.springframework.data.jdbc.repository.query.Query; import org.springframework.data.jdbc.repository.query.Query;
import org.springframework.data.repository.CrudRepository; import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param; import org.springframework.data.repository.query.Param;
@ -17,10 +14,4 @@ import java.util.List;
public interface JdbcLyOrderTrainRecord extends CrudRepository<LyOrderTrainRecord, Long> { public interface JdbcLyOrderTrainRecord extends CrudRepository<LyOrderTrainRecord, Long> {
@Query(value = "SELECT bill_order_no FROM ly_order_train_record WHERE enter_account BETWEEN :beginDate AND :endDate") @Query(value = "SELECT bill_order_no FROM ly_order_train_record WHERE enter_account BETWEEN :beginDate AND :endDate")
List<String> queryBillOrderNo(@Param("beginDate") String beginDate, @Param("endDate") String endDate); List<String> queryBillOrderNo(@Param("beginDate") String beginDate, @Param("endDate") String endDate);
Page<LyOrderTrainRecord> findAllByStatusIsNull(PageRequest pageResult);
@Modifying
@Query("UPDATE ly_order_train_record l SET l.status = 1 WHERE l.status IS NULL")
void updateStatusByNullStatus();
} }

View File

@ -5,21 +5,8 @@ import java.time.format.DateTimeFormatter;
public class DateTimeUtil { public class DateTimeUtil {
private final static DateTimeFormatter formatterMM = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS");
private final static DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
private final static DateTimeFormatter formatterDate = DateTimeFormatter.ofPattern("yyyy-MM-dd");
public static String timeToStr(LocalDateTime input) { public static String timeToStr(LocalDateTime input) {
return input.format(formatterDate); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
} return input.format(formatter);
public static LocalDateTime strToTime(String input) {
return LocalDateTime.parse(input.substring(0, 19), formatter);
}
public static LocalDateTime strToTimeMM(String input) {
return LocalDateTime.parse(input.substring(0, 23), formatterMM);
} }
} }

View File

@ -30,7 +30,6 @@ public class OrderCarResponse {
public static class ResponseStatus { public static class ResponseStatus {
private String Message; private String Message;
private Boolean Success; private Boolean Success;
private Integer ErrorCode;
} }
@ -58,7 +57,7 @@ public class OrderCarResponse {
private double ExpressFee; private double ExpressFee;
private int OrderType; private int OrderType;
private String SubAccCheckBatchNo; private String SubAccCheckBatchNo;
private String TripID; private long TripID;
private String SettlementCurrency; private String SettlementCurrency;
private double PostServiceFee; private double PostServiceFee;
private double RealAmountHasPost; private double RealAmountHasPost;
@ -123,7 +122,7 @@ public class OrderCarResponse {
private String ReachTravel; private String ReachTravel;
private String ServerFrom; private String ServerFrom;
private double ServiceFee; private double ServiceFee;
private String TripID; private long TripID;
private String Uid; private String Uid;
private String UserName; private String UserName;
private String PreEmployeeID; private String PreEmployeeID;
@ -143,7 +142,7 @@ public class OrderCarResponse {
} }
@Data @Data
public static class CarOrderCorpInfo { public static class CarOrderCorpInfo {
private String CorpId; private long CorpId;
private String CorpName; private String CorpName;
private int AccountId; private int AccountId;
private int SubAccountId; private int SubAccountId;

View File

@ -38,23 +38,12 @@ public class CTripOrderRecordAutoSave {
List<CTripFlightRecord> cTripFlightRecords = flightOrderAccountSettlementList List<CTripFlightRecord> cTripFlightRecords = flightOrderAccountSettlementList
.stream() .stream()
.flatMap(it -> it.getOrderSettlementList().stream()) .flatMap(it -> it.getOrderSettlementList().stream())
.map(it -> { .map(it -> CTripFlightRecord.of(
//对数据库进行查找 如果发现已经存在 就使用查找出来的 CTripFlightRecordBase.changeInfo(
OrderFlightResponse.FlightOrderSettlementBaseInfo orderSettlementBaseInfo = it.getOrderSettlementBaseInfo(); it.getOrderSettlementBaseInfo()
CTripFlightRecord record = cTripOrderDetailRepository.findFlightRecordByRecordId( ), CTripFlightInfo.of(it.getOrderFlightInfo())
String.valueOf(orderSettlementBaseInfo.getRecordID())); ))
if (record == null) { .toList();
record = CTripFlightRecord.of(
CTripFlightRecordBase.changeInfo(
orderSettlementBaseInfo
), CTripFlightInfo.of(it.getOrderFlightInfo())
);
}
//补充额外的字段
OrderFlightResponse.FlightOrderBaseInfo orderBaseInfo = it.getOrderBaseInfo();
record.setRouteOrderNo(orderBaseInfo.getJourneyID());
return record;
}).toList();
cTripOrderDetailRepository.saveAllCTripFlightRecord(cTripFlightRecords); cTripOrderDetailRepository.saveAllCTripFlightRecord(cTripFlightRecords);
} }
} }
@ -66,19 +55,11 @@ public class CTripOrderRecordAutoSave {
if (lstHtlSettlement != null && !lstHtlSettlement.isEmpty()) { if (lstHtlSettlement != null && !lstHtlSettlement.isEmpty()) {
List<CTripHotelRecord> list = lstHtlSettlement.stream() List<CTripHotelRecord> list = lstHtlSettlement.stream()
.flatMap(it -> it.getLstHotelSettlementDetail().stream()) .flatMap(it -> it.getLstHotelSettlementDetail().stream())
.map(it -> { .map(it ->
OrderHotelResponse.SettlementDetail settlementDetail = it.getSettlementDetail(); CTripHotelRecord.of(CTripHotelRecordBase.changeInfo(it.getSettlementDetail()),
CTripHotelRecord record = cTripOrderDetailRepository.findHotelRecordByRecordId( CTripHotelInfo.of(it.getHotelDetail()))
String.valueOf(settlementDetail.getRecordId())); )
if (record == null) { .toList();
record = CTripHotelRecord.of(CTripHotelRecordBase.changeInfo(settlementDetail),
CTripHotelInfo.of(it.getHotelDetail()));
}
//补充额外的字段
OrderHotelResponse.SettlementOrderDetail orderDetail = it.getOrderDetail();
record.setRecordId(orderDetail.getHotelRelatedJourneyNo());
return record;
}).toList();
cTripOrderDetailRepository.saveAllCTripHotelRecord(list); cTripOrderDetailRepository.saveAllCTripHotelRecord(list);
} }
} }
@ -90,18 +71,11 @@ public class CTripOrderRecordAutoSave {
if (lstTrainSettlement != null && !lstTrainSettlement.isEmpty()) { if (lstTrainSettlement != null && !lstTrainSettlement.isEmpty()) {
List<CTripTrainRecord> list = lstTrainSettlement.stream() List<CTripTrainRecord> list = lstTrainSettlement.stream()
.flatMap(it -> it.getLstTrainSettlementDetail().stream()) .flatMap(it -> it.getLstTrainSettlementDetail().stream())
.map(it -> { .map(it ->
OrderTrainResponse.CorpTrainSettlementDetail trainSettlementDetail = it.getTrainSettlementDetail(); CTripTrainRecord.of(CTripTrainRecordBase.changeInfo(it.getTrainSettlementDetail()),
CTripTrainRecord record = cTripOrderDetailRepository.findTrainRecordByRecordId( CTripTrainInfo.of(it.getTrainSettlementTicket()))
String.valueOf(trainSettlementDetail.getRecordID())); )
if (record == null) { .toList();
record = CTripTrainRecord.of(CTripTrainRecordBase.changeInfo(trainSettlementDetail),
CTripTrainInfo.of(it.getTrainSettlementTicket()));
}
//补充额外的字段
record.setRouteOrderNo(it.getTrainSettlementOrder().getJouneryID());
return record;
}).toList();
cTripOrderDetailRepository.saveAllCTripTrainRecord(list); cTripOrderDetailRepository.saveAllCTripTrainRecord(list);
} }
} }
@ -112,20 +86,10 @@ public class CTripOrderRecordAutoSave {
if (settlementList != null && !settlementList.isEmpty()) { if (settlementList != null && !settlementList.isEmpty()) {
List<CTripCarRecord> list = settlementList.stream() List<CTripCarRecord> list = settlementList.stream()
.flatMap(it -> it.getCarSettlementDetailList().stream()) .flatMap(it -> it.getCarSettlementDetailList().stream())
.map(it -> { .map(it -> CTripCarRecord.of(
OrderCarResponse.CarOrderSettlementBaseInfo settlementBaseInfo = it.getSettlementBaseInfo(); CTripCarRecordBase.changeInfo(it.getSettlementBaseInfo()),
CTripCarRecord record = cTripOrderDetailRepository.findCarRecordByRecordId( CTripCarQuickInfo.of(it.getOrderDetail().getQuickProductInfo())))
String.valueOf(settlementBaseInfo.getRecordId())); .toList();
if (record == null) {
record = CTripCarRecord.of(
CTripCarRecordBase.changeInfo(settlementBaseInfo),
CTripCarQuickInfo.of(it.getOrderDetail().getQuickProductInfo()));
}
//补充额外的字段
OrderCarResponse.CarOrderCorpInfo corpInfo = it.getOrderDetail().getCorpInfo();
record.setRouteOrderNo(corpInfo.getJouneryId());
return record;
}).toList();
cTripOrderDetailRepository.saveAllCTripCarRecord(list); cTripOrderDetailRepository.saveAllCTripCarRecord(list);
} }
} }

View File

@ -5,15 +5,15 @@ import com.chint.domain.aggregates.location.basedata.DistrictPOIInfoEntity;
import com.chint.domain.aggregates.location.basedata.PrefectureLevelCityInfoEntity; import com.chint.domain.aggregates.location.basedata.PrefectureLevelCityInfoEntity;
import com.chint.domain.aggregates.order.Location; import com.chint.domain.aggregates.order.Location;
import com.chint.domain.aggregates.order.RouteOrder; import com.chint.domain.aggregates.order.RouteOrder;
import com.chint.domain.aggregates.order.order_record.OrderFlightRecord; import com.chint.domain.aggregates.order.ctrip.CtripCarOrderDetail;
import com.chint.domain.aggregates.order.order_record.ctrip_order_record.*; import com.chint.domain.aggregates.order.ctrip.CtripFlightOrderDetail;
import com.chint.domain.aggregates.order.ctrip.CtripHotelOrderDetail;
import com.chint.domain.aggregates.order.ctrip.CtripTrainOrderDetail;
import com.chint.domain.aggregates.user.User; import com.chint.domain.aggregates.user.User;
import com.chint.domain.repository.*; import com.chint.domain.repository.*;
import com.chint.domain.service.order_sync.CTripOrderSyncAdapter; import com.chint.domain.service.order_sync.CTripOrderSyncAdapter;
import com.chint.domain.service.supplier.SupplierService; import com.chint.domain.service.supplier.SupplierService;
import com.chint.domain.value_object.SupplierCallbackData; import com.chint.domain.value_object.SupplierCallbackData;
import com.chint.infrastructure.repository.CTripOrderDetailImpl;
import com.chint.infrastructure.repository.OrderFlightRecordRepositoryImpl;
import com.chint.infrastructure.util.BaseContext; import com.chint.infrastructure.util.BaseContext;
import com.chint.infrastructure.util.Digest; import com.chint.infrastructure.util.Digest;
import com.chint.infrastructure.util.PinyinUtil; import com.chint.infrastructure.util.PinyinUtil;
@ -124,12 +124,6 @@ public class CTripTest {
@Value("${cTrip.requestSecret}") @Value("${cTrip.requestSecret}")
private String C_TRIP_REQUEST_SECRET; private String C_TRIP_REQUEST_SECRET;
@Autowired
private OrderFlightRecordRepository orderFlightRecordRepository;
@Autowired
private CTripOrderDetailImpl cTripOrderDetail;
private User user = new User(1L, "230615020", 1, "卢麟哲", "1033719135@qq.com", "15857193365", "A30000001"); private User user = new User(1L, "230615020", 1, "卢麟哲", "1033719135@qq.com", "15857193365", "A30000001");
@ -242,10 +236,10 @@ public class CTripTest {
System.out.println(gson.toJson(estimate)); System.out.println(gson.toJson(estimate));
} }
// @Test @Test
void search() { void search() {
BaseContext.setCurrentUser(user); BaseContext.setCurrentUser(user);
SearchOrderResponse response = orderSearchRequest.searchOrderResponseByOrderId("31288249965"); SearchOrderResponse response = orderSearchRequest.searchOrderResponseByOrderId("31108053999");
System.out.println(response); System.out.println(response);
} }
@ -494,7 +488,7 @@ public class CTripTest {
OrderFlightResponse.FlightOrderSettlementBaseInfo orderSettlementBaseInfo = OrderFlightResponse.FlightOrderSettlementBaseInfo orderSettlementBaseInfo =
flightOrderSettlementInfo.getOrderSettlementBaseInfo(); flightOrderSettlementInfo.getOrderSettlementBaseInfo();
if (orderSettlementBaseInfo != null) { if (orderSettlementBaseInfo != null) {
CTripFlightRecordBase ctripFlightOrderDetail = new CTripFlightRecordBase(); CtripFlightOrderDetail ctripFlightOrderDetail = new CtripFlightOrderDetail();
ctripFlightOrderDetail = ctripFlightOrderDetail.changeInfo(orderSettlementBaseInfo); ctripFlightOrderDetail = ctripFlightOrderDetail.changeInfo(orderSettlementBaseInfo);
ctripOrderDetailRepository.save(ctripFlightOrderDetail); ctripOrderDetailRepository.save(ctripFlightOrderDetail);
} }
@ -516,7 +510,7 @@ public class CTripTest {
OrderTrainResponse.CorpTrainSettlementDetail trainSettlementDetail = OrderTrainResponse.CorpTrainSettlementDetail trainSettlementDetail =
corpTrainSettlementInfo.getTrainSettlementDetail(); corpTrainSettlementInfo.getTrainSettlementDetail();
if (trainSettlementDetail != null) { if (trainSettlementDetail != null) {
CTripTrainRecordBase ctripTrainOrderDetail = new CTripTrainRecordBase(); CtripTrainOrderDetail ctripTrainOrderDetail = new CtripTrainOrderDetail();
ctripTrainOrderDetail = ctripTrainOrderDetail.changeInfo(trainSettlementDetail); ctripTrainOrderDetail = ctripTrainOrderDetail.changeInfo(trainSettlementDetail);
ctripOrderDetailRepository.save(ctripTrainOrderDetail); ctripOrderDetailRepository.save(ctripTrainOrderDetail);
} }
@ -537,7 +531,7 @@ public class CTripTest {
OrderHotelResponse.LstHotelSettlementDetail hotelSettlementDetail = LstHotelSettlementDetail.get(0); OrderHotelResponse.LstHotelSettlementDetail hotelSettlementDetail = LstHotelSettlementDetail.get(0);
OrderHotelResponse.SettlementDetail settlementDetail = hotelSettlementDetail.getSettlementDetail(); OrderHotelResponse.SettlementDetail settlementDetail = hotelSettlementDetail.getSettlementDetail();
if (settlementDetail != null) { if (settlementDetail != null) {
CTripHotelRecordBase ctripFlightOrderDetail = new CTripHotelRecordBase(); CtripHotelOrderDetail ctripFlightOrderDetail = new CtripHotelOrderDetail();
ctripFlightOrderDetail = ctripFlightOrderDetail.changeInfo(settlementDetail); ctripFlightOrderDetail = ctripFlightOrderDetail.changeInfo(settlementDetail);
ctripOrderDetailRepository.save(ctripFlightOrderDetail); ctripOrderDetailRepository.save(ctripFlightOrderDetail);
} }
@ -559,7 +553,7 @@ public class CTripTest {
OrderCarResponse.CarOrderSettlementDetail carOrderSettlementDetail = carSettlementDetailList.get(0); OrderCarResponse.CarOrderSettlementDetail carOrderSettlementDetail = carSettlementDetailList.get(0);
OrderCarResponse.CarOrderSettlementBaseInfo settlementBaseInfo = carOrderSettlementDetail.getSettlementBaseInfo(); OrderCarResponse.CarOrderSettlementBaseInfo settlementBaseInfo = carOrderSettlementDetail.getSettlementBaseInfo();
if (settlementBaseInfo != null) { if (settlementBaseInfo != null) {
CTripCarRecordBase ctripCarOrderDetail = new CTripCarRecordBase(); CtripCarOrderDetail ctripCarOrderDetail = new CtripCarOrderDetail();
ctripCarOrderDetail = ctripCarOrderDetail.changeInfo(settlementBaseInfo); ctripCarOrderDetail = ctripCarOrderDetail.changeInfo(settlementBaseInfo);
ctripOrderDetailRepository.save(ctripCarOrderDetail); ctripOrderDetailRepository.save(ctripCarOrderDetail);
} }
@ -592,25 +586,4 @@ public class CTripTest {
} }
// @Test
void findRecord(){
CTripFlightRecord byId = cTripOrderDetail.findFlightRecordById(14513L);
Gson gson = new Gson();
System.out.println(gson.toJson(byId));
}
// @Test
void findHotelRecord(){
CTripHotelRecord byId = cTripOrderDetail.findHotelRecordByRecordId("97211839");
Gson gson = new Gson();
System.out.println(gson.toJson(byId));
}
// @Test
void findCarRecord(){
CTripCarRecord byId = cTripOrderDetail.findCarRecordByRecordId("50597248");
Gson gson = new Gson();
System.out.println(gson.toJson(byId));
}
} }

View File

@ -18,7 +18,6 @@ import com.chint.infrastructure.echo_framework.command.Command;
import com.chint.infrastructure.repository.jdbc.JdbcOrderDetailRepository; import com.chint.infrastructure.repository.jdbc.JdbcOrderDetailRepository;
import com.chint.infrastructure.repository.jdbc.JdbcOrderTravelRepository; import com.chint.infrastructure.repository.jdbc.JdbcOrderTravelRepository;
import com.chint.infrastructure.util.BaseContext; import com.chint.infrastructure.util.BaseContext;
import com.chint.infrastructure.util.Digest;
import com.chint.interfaces.rest.base.PostRequest; import com.chint.interfaces.rest.base.PostRequest;
import com.chint.interfaces.rest.bpm.BPMRequest; import com.chint.interfaces.rest.bpm.BPMRequest;
import com.chint.interfaces.rest.bpm.XNBPM.ClientFactory; import com.chint.interfaces.rest.bpm.XNBPM.ClientFactory;
@ -887,7 +886,7 @@ public class LYTest {
// @Test // @Test
void sendMsg() { void sendMsg() {
commonController.sendMsg("T24032868351668790"); commonController.sendMsg("T24032167509127504");
} }
@ -921,14 +920,14 @@ public class LYTest {
} }
@Test // @Test
void syncToSupplierOne(){ void syncToSupplierOne(){
RouteOrder routeOrder = routeRepository.queryById(665L); RouteOrder routeOrder = routeRepository.queryById(665L);
lyOrderSyncAdapter.syncSupplierOrder(routeOrder); lyOrderSyncAdapter.syncSupplierOrder(routeOrder);
} }
@Test // @Test
void queryHotelCustom(){ void queryHotelCustom(){
OrderDetail byId = orderDetailRepository.findById(2569L); OrderDetail byId = orderDetailRepository.findById(2569L);
HotelOrderDetailDto hotelOrderDetailDto = HotelOrderDetailDto.copyFrom(byId.getHotelOrderDetail()); HotelOrderDetailDto hotelOrderDetailDto = HotelOrderDetailDto.copyFrom(byId.getHotelOrderDetail());

View File

@ -11,15 +11,11 @@ import com.chint.domain.aggregates.location.basedata.PrefectureLevelCityInfoEnti
import com.chint.domain.aggregates.order.Leg; import com.chint.domain.aggregates.order.Leg;
import com.chint.domain.aggregates.order.Location; import com.chint.domain.aggregates.order.Location;
import com.chint.domain.aggregates.order.RouteOrder; import com.chint.domain.aggregates.order.RouteOrder;
import com.chint.domain.aggregates.order.order_record.ctrip_order_record.CTripHotelRecord;
import com.chint.domain.aggregates.user.User; import com.chint.domain.aggregates.user.User;
import com.chint.domain.repository.*; import com.chint.domain.repository.*;
import com.chint.domain.service.JTCompanyDomainService; import com.chint.domain.service.JTCompanyDomainService;
import com.chint.domain.service.OrderDomainService;
import com.chint.domain.service.order_sync.LYOrderSyncAdapter; import com.chint.domain.service.order_sync.LYOrderSyncAdapter;
import com.chint.domain.value_object.RanksData; import com.chint.domain.value_object.RanksData;
import com.chint.infrastructure.repository.CTripOrderDetailImpl;
import com.chint.infrastructure.util.DateTimeUtil;
import com.chint.infrastructure.util.Digest; import com.chint.infrastructure.util.Digest;
import com.chint.infrastructure.util.PinyinUtil; import com.chint.infrastructure.util.PinyinUtil;
import com.chint.interfaces.rest.base.PostRequest; import com.chint.interfaces.rest.base.PostRequest;
@ -142,12 +138,6 @@ class RouteApplicationTests {
@Autowired @Autowired
private RankController rankController; private RankController rankController;
@Autowired
private CTripOrderDetailImpl cTripOrderDetail;
@Autowired
private OrderDomainService orderDomainService;
void test3() { void test3() {
FlyOkDTO freightDTO = new FlyOkDTO(); FlyOkDTO freightDTO = new FlyOkDTO();
ParamFly param = new ParamFly(); ParamFly param = new ParamFly();
@ -166,7 +156,7 @@ class RouteApplicationTests {
System.out.println(postRequest.getReDirectUrl("http://10.10.100.129:8089" + "/MobileOA/api/FsscSSO?loginUser=230615020&data=%2F%23%2Fexpenseclaim%3FbillDefineId%3Dfcc76666fb1211e98e2019f4db5548fd%26scene%3DWRITE%26isNew%3Dtrue%26goback%3Dfalse")); System.out.println(postRequest.getReDirectUrl("http://10.10.100.129:8089" + "/MobileOA/api/FsscSSO?loginUser=230615020&data=%2F%23%2Fexpenseclaim%3FbillDefineId%3Dfcc76666fb1211e98e2019f4db5548fd%26scene%3DWRITE%26isNew%3Dtrue%26goback%3Dfalse"));
} }
// @Test @Test
void syncUserTo() { void syncUserTo() {
User user = new User(); User user = new User();
user.setCompanyCode("A10000001"); user.setCompanyCode("A10000001");
@ -277,7 +267,7 @@ class RouteApplicationTests {
// log.trace("trace"); // log.trace("trace");
} }
// @Test @Test
void loginSignProd() { void loginSignProd() {
String sfno = "231201060"; String sfno = "231201060";
String syscode = "FSSC"; String syscode = "FSSC";
@ -322,7 +312,7 @@ class RouteApplicationTests {
routeRepository.deleteById(875L); routeRepository.deleteById(875L);
} }
// @Test @Test
void deleteOrderDetail() { void deleteOrderDetail() {
orderDetailRepository.deleteById(2609L); orderDetailRepository.deleteById(2609L);
} }
@ -1010,7 +1000,7 @@ class RouteApplicationTests {
pushUser.getUserSFDataFromOpenApiBatch(); pushUser.getUserSFDataFromOpenApiBatch();
} }
// @Test @Test
void deleteByOrderId() { void deleteByOrderId() {
orderDetailRepository.deleteById(1647L); orderDetailRepository.deleteById(1647L);
orderDetailRepository.deleteById(1648L); orderDetailRepository.deleteById(1648L);
@ -1056,7 +1046,7 @@ class RouteApplicationTests {
locationRepository.saveAll(allLevelThreeAndFour); locationRepository.saveAll(allLevelThreeAndFour);
} }
// @Test @Test
void generateIfAirport() { void generateIfAirport() {
List<Location> airportLocation = new ArrayList<>(); List<Location> airportLocation = new ArrayList<>();
AirportSearchResponse response = cTripAirportRequest.getAirport(); AirportSearchResponse response = cTripAirportRequest.getAirport();
@ -1102,7 +1092,7 @@ class RouteApplicationTests {
locationRepository.saveAll(airportLocation); locationRepository.saveAll(airportLocation);
} }
// @Test @Test
void updateCounty() { void updateCounty() {
List<Location> byLocationType = locationRepository.findByLocationType(5); List<Location> byLocationType = locationRepository.findByLocationType(5);
for (Location location : byLocationType) { for (Location location : byLocationType) {
@ -1113,7 +1103,7 @@ class RouteApplicationTests {
locationRepository.saveAll(byLocationType); locationRepository.saveAll(byLocationType);
} }
// @Test @Test
void updateAirportPath() { void updateAirportPath() {
List<Location> byLocationType = locationRepository.findByLocationType(7); List<Location> byLocationType = locationRepository.findByLocationType(7);
for (Location location : byLocationType) { for (Location location : byLocationType) {
@ -1123,7 +1113,7 @@ class RouteApplicationTests {
locationRepository.saveAll(byLocationType); locationRepository.saveAll(byLocationType);
} }
// @Test @Test
void generateLocationType() { void generateLocationType() {
List<Location> all = locationRepository.findAll(); List<Location> all = locationRepository.findAll();
all.forEach(it -> { all.forEach(it -> {
@ -1193,18 +1183,12 @@ class RouteApplicationTests {
cTripStatusNotification.setStatusIDs(null); cTripStatusNotification.setStatusIDs(null);
} }
@Test
// YB_STANDARD_LEVEL_ONE m2.p2及以下
// YB_STANDARD_LEVEL_TWO m3-m4 p3-p4
// YB_STANDARD_LEVEL_THREE m5-m7 p5-p7
// YB_STANDARD_LEVEL_FOUR m8.p8及以上
//浙江正泰仪器仪表有限责任公司 A10160001
// @Test
void addRanks() { void addRanks() {
RanksData ranksData = new RanksData(); RanksData ranksData = new RanksData();
ranksData.setIndustry("浙江正泰仪器仪表有限责任公司"); ranksData.setIndustry("浙江正泰物联技术有限公司");
ranksData.setCompanyCode("A10160001"); ranksData.setCompanyCode("A70000059");
for (int i = 1; i < 13; i++) { for (int i = 1; i < 13; i++) {
if (i <= 2) { if (i <= 2) {
ranksData.setLevel(4); ranksData.setLevel(4);
@ -1225,27 +1209,10 @@ class RouteApplicationTests {
} }
// @Test @Test
void testQueryCity() { void testQueryCity() {
Location location = locationRepository.findById(373L); Location location = locationRepository.findById(373L);
Location cityLocation = lyOrderSyncAdapter.getCityLocation(location); Location cityLocation = lyOrderSyncAdapter.getCityLocation(location);
System.out.println(cityLocation); System.out.println(cityLocation);
} }
// @Test
void testTimeFor(){
LocalDateTime localDateTime = DateTimeUtil.strToTimeMM("2024-03-04 00:23:26.727");
System.out.println(localDateTime);
}
// @Test
void testFindOrderRecord(){
CTripHotelRecord hotelRecordByRecordId = cTripOrderDetail.findHotelRecordByRecordId("98494942");
System.out.println(hotelRecordByRecordId);
}
// @Test
void testInBlackList(){
orderDomainService.checkCompanyNameIfBlack("乐清正泰电器销售有限公司");
}
} }