Compare commits

..

No commits in common. "41e0ee390680cdef901f0e3bcce2851c4c545b15" and "dfa1248fe04b0b2895f3fb5fbf8943a4daebe12d" have entirely different histories.

33 changed files with 119 additions and 725 deletions

View File

@ -69,7 +69,7 @@ public class AutoWorkController {
public Result<String> autoSaveLYRecord() { public Result<String> autoSaveLYRecord() {
//同步拉取上月数据 //同步拉取上月数据
lyStatementOrder.saveAll(); lyStatementOrder.saveAll();
//未转换的结算数据生成为财务共享需要的数据 //上月的结算数据生成为财务共享需要的数据
Command.of(LYOrderRecordGenerateCommand.class).sendToQueue(); Command.of(LYOrderRecordGenerateCommand.class).sendToQueue();
return Result.Success(SUCCESS); return Result.Success(SUCCESS);
} }

View File

@ -57,12 +57,15 @@ public class OrderDetailQuery {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
LocalDateTime targetTimeBegin = LocalDateTime.parse(authenticationDto.getStartTime(), formatter); LocalDateTime targetTimeBegin = LocalDateTime.parse(authenticationDto.getStartTime(), formatter);
LocalDateTime targetTimeEnd = LocalDateTime.parse(authenticationDto.getEndTime(), formatter); LocalDateTime targetTimeEnd = LocalDateTime.parse(authenticationDto.getEndTime(), formatter);
//只获取账期号为上个月的结算数据
return switch (productType) { return switch (productType) {
case 1 -> orderFlightRecordRepository.findBySystemTypeAndLastMonth(pageSize, pageNum, systemType); case 1 -> orderFlightRecordRepository.findByUpdateDataTime(targetTimeBegin,
case 2 -> orderHotelRecordRepository.findBySystemTypeAndLastMonth(pageSize, pageNum, systemType); targetTimeEnd, pageSize, pageNum, systemType);
case 3 -> orderTrainRecordRepository.findBySystemTypeAndLastMonth(pageSize, pageNum, systemType); case 2 -> orderHotelRecordRepository.findByUpdateDataTime(targetTimeBegin,
case 4 -> orderCarRecordRepository.findBySystemTypeAndLastMonth(pageSize, pageNum, systemType); targetTimeEnd, pageSize, pageNum, systemType);
case 3 -> orderTrainRecordRepository.findByUpdateDataTime(targetTimeBegin,
targetTimeEnd, pageSize, pageNum, systemType);
case 4 -> orderCarRecordRepository.findByUpdateDataTime(targetTimeBegin,
targetTimeEnd, pageSize, pageNum, systemType);
default -> throw new NotFoundException("错误产品类型"); default -> throw new NotFoundException("错误产品类型");
}; };
} }

View File

@ -118,23 +118,15 @@ public class OrderFlightRecord extends OrderBaseRecord {
} }
// 加载机票信息 // 加载机票信息
public OrderFlightRecord loadTicketInfo( public OrderFlightRecord loadTicketInfo(String issueTicketTime,
String ticketNo,
String facePrice, String facePrice,
String useStatus) { String useStatus) {
this.setIssueTicketTime(issueTicketTime);
this.setTicketNo(ticketNo);
this.setFacePrice(facePrice); this.setFacePrice(facePrice);
this.setUseStatus(useStatus); this.setUseStatus(useStatus);
return this; return this;
} }
public OrderFlightRecord loadScheduleNum(String issueTicketTime,String scheduleNum){
this.setScheduleNum(scheduleNum);
this.setIssueTicketTime(issueTicketTime);
return this;
}
// 加载座位细节 // 加载座位细节
public OrderFlightRecord loadSeatInfo(String seatPoint, public OrderFlightRecord loadSeatInfo(String seatPoint,
String seatPointName, String seatPointName,

View File

@ -79,7 +79,6 @@ public class OrderHotelRecord extends OrderBaseRecord {
private String orderStatus; private String orderStatus;
private String createTime; private String createTime;
private String receiptsNumOrigin;//支付总金额 private String receiptsNumOrigin;//支付总金额
// 加载基础订单信息 // 加载基础订单信息
public OrderHotelRecord loadBasicOrderInfo(String orderNo, public OrderHotelRecord loadBasicOrderInfo(String orderNo,
String orderStatus, String orderStatus,
@ -91,9 +90,10 @@ public class OrderHotelRecord extends OrderBaseRecord {
} }
// 加载酒店和入住信息 // 加载酒店和入住信息
public OrderHotelRecord loadHotelInfo(String hotelName, String checkInDate, String departureDate, public OrderHotelRecord loadHotelInfo(String hotelName, String hotelAddress, String checkInDate, String departureDate,
int roomCount, String roomTypeName) { int roomCount, String roomTypeName) {
this.setHotelName(hotelName); this.setHotelName(hotelName);
this.setHotelAddress(hotelAddress);
this.setCheckInDate(checkInDate); this.setCheckInDate(checkInDate);
this.setDepartureDate(departureDate); this.setDepartureDate(departureDate);
this.setRoomCount(roomCount); this.setRoomCount(roomCount);
@ -102,11 +102,10 @@ public class OrderHotelRecord extends OrderBaseRecord {
} }
// 加载地理信息位置 // 加载地理信息位置
public OrderHotelRecord loadLocationInfo(String country, String province, String checkInCity, String hotelAddress) { public OrderHotelRecord loadLocationInfo(String country, String province, String checkInCity) {
this.setCountry(country); this.setCountry(country);
this.setProvince(province); this.setProvince(province);
this.setCheckInCity(checkInCity); this.setCheckInCity(checkInCity);
this.setHotelAddress(hotelAddress);
return this; return this;
} }
@ -240,4 +239,6 @@ public class OrderHotelRecord extends OrderBaseRecord {
this.setTaxCusFee(taxCusFee); this.setTaxCusFee(taxCusFee);
return this; return this;
} }
} }

View File

@ -63,7 +63,6 @@ public class OrderTrainRecord extends OrderBaseRecord{
private String bookOrgCode3; // 出行人组织架构信息3 private String bookOrgCode3; // 出行人组织架构信息3
private String projectOrderNo; // 项目订单号 private String projectOrderNo; // 项目订单号
private String offlineCcomyCode; // 成本中心 private String offlineCcomyCode; // 成本中心
private String payAmount;//支付总金额
private String travelUserBirthday; // 生日 private String travelUserBirthday; // 生日
private String travelUserPhone; // 出行人手机号 private String travelUserPhone; // 出行人手机号
private String travelUserSex; // 性别 0保密不展示 1男 2女 private String travelUserSex; // 性别 0保密不展示 1男 2女

View File

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

View File

@ -20,34 +20,20 @@ public class CTripFlightRecord implements Serializable {
private String recordId; private String recordId;
public LocalDateTime createTime; public LocalDateTime createTime;
private String routeOrderNo; private String routeOrderNo;
private String ticketNo;
@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")
private CTripFlightInfo cTripFlightInfo; private CTripFlightInfo cTripFlightInfo;
@MappedCollection(idColumn = "c_trip_flight_record_id") @MappedCollection(idColumn = "c_trip_flight_record_id")
private CTripFlightBaseInfo cTripFlightBaseInfo; private CTripFlightBaseInfo cTripFlightBaseInfo;
@MappedCollection(idColumn = "c_trip_flight_record_id")
private CTripFlightTripInfo cTripFlightTripInfo;
@MappedCollection(idColumn = "c_trip_flight_record_id")
private CTripFlightPrintInfo cTripFlightPrintInfo;
public static CTripFlightRecord of(CTripFlightRecordBase cTripFlightRecordBase, public static CTripFlightRecord of(CTripFlightRecordBase cTripFlightRecordBase, CTripFlightInfo cTripFlightInfo,CTripFlightBaseInfo cTripOrderBaseInfo) {
CTripFlightInfo cTripFlightInfo,
CTripFlightBaseInfo cTripOrderBaseInfo,
CTripFlightTripInfo cTripFlightTripInfo) {
CTripFlightRecord cTripFlightRecord = new CTripFlightRecord(); CTripFlightRecord cTripFlightRecord = new CTripFlightRecord();
cTripFlightRecord.setCTripFlightRecordBase(cTripFlightRecordBase); cTripFlightRecord.setCTripFlightRecordBase(cTripFlightRecordBase);
cTripFlightRecord.setCTripFlightInfo(cTripFlightInfo); cTripFlightRecord.setCTripFlightInfo(cTripFlightInfo);
cTripFlightRecord.setRecordId(String.valueOf(cTripFlightRecordBase.getRecordId())); cTripFlightRecord.setRecordId(String.valueOf(cTripFlightRecordBase.getRecordId()));
cTripFlightRecord.setCreateTime(DateTimeUtil.strToTimeMM(cTripFlightRecordBase.getCreateTime())); cTripFlightRecord.setCreateTime(DateTimeUtil.strToTimeMM(cTripFlightRecordBase.getCreateTime()));
cTripFlightRecord.setCTripFlightBaseInfo(cTripOrderBaseInfo); cTripFlightRecord.setCTripFlightBaseInfo(cTripOrderBaseInfo);
cTripFlightRecord.setCTripFlightTripInfo(cTripFlightTripInfo);
return cTripFlightRecord; return cTripFlightRecord;
} }
public CTripFlightRecord printInfo(CTripFlightPrintInfo cTripFlightPrintInfo) {
this.setCTripFlightPrintInfo(cTripFlightPrintInfo);
return this;
}
} }

View File

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

View File

@ -1,90 +0,0 @@
package com.chint.domain.aggregates.order.order_record.ctrip_order_record;
import cn.hutool.core.bean.BeanUtil;
import com.chint.interfaces.rest.ctrip.dto.order.OrderFlightResponse;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.relational.core.mapping.Table;
import java.io.Serial;
import java.io.Serializable;
@Data
@Table("c_trip_flight_trip_info")
public class CTripFlightTripInfo implements Serializable {
@Serial
private static final long serialVersionUID = -2541232534673683466L;
@Id
private Long id;
private Long cTripFlightRecordId;
private Long TripId;
private Integer SectorId;
private String PassengerName;
private String RecordStatus;
private Integer ValidFlag;//
private String FlightClass;
private String Flight;
private String ClassGrade;
private String SubClass;
private String TakeOffTime;
private String ArrivalTime;
private Integer DCity;
private String DepartureDistrictCode;
private String DPort;
private String DPortBuilding;
private Integer DPortBuildingId;
private Integer ACity;
private String ArrivalDistrictCode;
private String APort;
private String APortBuilding;
private Integer APortBuildingId;
private Integer OpenTranFlag;//
private Double PrintPrice;
private Double Oil;
private Double Tax;
private String RecordNo;
private String AirlineRecordNo;
private Integer SharedFlag;//
private String SharedFlight;
private Integer SurfaceFlag; //
private String AirLineCode;
private String TicketNo;
private Integer TicketNoStatus;
private String TicketNoStatusName;
private String DCityName;
private String DPortName;
private String ACityName;
private String APortName;
// private OrderFlightResponse.StandardGeoInfo StandardGeoInfo;
private String ClassTypeName;
private String AirlineName;
public static CTripFlightTripInfo of(OrderFlightResponse.FlightTripRecordInfo flightTripRecordInfo) {
CTripFlightTripInfo cTripFlightTripInfo = BeanUtil.copyProperties(flightTripRecordInfo, CTripFlightTripInfo.class);
cTripFlightTripInfo.setValidFlag(flightTripRecordInfo.isValidFlag() ? 1 : 0);
cTripFlightTripInfo.setOpenTranFlag(flightTripRecordInfo.isOpenTranFlag() ? 1 : 0);
cTripFlightTripInfo.setSharedFlag(flightTripRecordInfo.isSharedFlag() ? 1 : 0);
cTripFlightTripInfo.setSurfaceFlag(flightTripRecordInfo.isSurfaceFlag() ? 1 : 0);
cTripFlightTripInfo.setTicketNoStatusName(translateTicketStatus(flightTripRecordInfo.getTicketNoStatus()));
return cTripFlightTripInfo;
}
private static String translateTicketStatus(Integer ticketNoStatus) {
return switch (ticketNoStatus) {
case -2 -> "未知";
case -1 -> "未知";
case 1 -> "待使用";
case 2 -> "已使用";
case 3 -> "已经办理登记";
case 4 -> "已离港";
case 5 -> "已作废";
case 6 -> "已退票";
case 7 -> "换开";
case 8 -> "挂起";
case 9 -> "机场控制";
case 10 -> "机场控制";
case 11 -> "未查到";
default -> "未知";
};
}
}

View File

@ -4,7 +4,6 @@ import cn.hutool.core.bean.BeanUtil;
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;
import org.springframework.data.relational.core.mapping.MappedCollection;
import org.springframework.data.relational.core.mapping.Table; import org.springframework.data.relational.core.mapping.Table;
import java.io.Serial; import java.io.Serial;
@ -20,8 +19,6 @@ public class CTripHotelOrderDetail implements Serializable {
private Long id; private Long id;
private Long cTripHotelRecordId; private Long cTripHotelRecordId;
private Long OrderId; private Long OrderId;
@MappedCollection(idColumn = "c_trip_hotel_order_detail_id", keyColumn = "c_trip_hotel_order_detail_key")
private List<CTripHotelRoomDetail> cTripHotelRoomDetailList;
private String EmployeeName; private String EmployeeName;
private String EmployeeID; private String EmployeeID;
private String WorkCity; private String WorkCity;
@ -103,13 +100,8 @@ public class CTripHotelOrderDetail implements Serializable {
private Double TPConfigMaxPrice; private Double TPConfigMaxPrice;
private String ReservationType; private String ReservationType;
private String PreEmail; private String PreEmail;
public static CTripHotelOrderDetail of(OrderHotelResponse.SettlementOrderDetail data) { public static CTripHotelOrderDetail of(OrderHotelResponse.SettlementOrderDetail data) {
CTripHotelOrderDetail cTripHotelOrderDetail = BeanUtil.copyProperties(data, CTripHotelOrderDetail.class); return BeanUtil.copyProperties(data, CTripHotelOrderDetail.class);
List<OrderHotelResponse.SettlementRoomDetail> roomDetailList = data.getRoomDetailList();
List<CTripHotelRoomDetail> res = roomDetailList.stream().map(CTripHotelRoomDetail::of).toList();
cTripHotelOrderDetail.setCTripHotelRoomDetailList(res);
return cTripHotelOrderDetail;
} }
} }

View File

@ -1,35 +0,0 @@
package com.chint.domain.aggregates.order.order_record.ctrip_order_record;
import cn.hutool.core.bean.BeanUtil;
import com.chint.interfaces.rest.ctrip.dto.order.OrderHotelResponse;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.relational.core.mapping.Table;
import java.io.Serial;
import java.io.Serializable;
@Data
@Table("c_trip_hotel_room_detail")
public class CTripHotelRoomDetail implements Serializable {
@Serial
private static final long serialVersionUID = 1027124557206346513L;
@Id
private Long id;
private Long cTripHotelOrderDetailId;
private Integer cTripHotelOrderDetailKey;
private String BasicRoomTypeName;
private String BasicRoomTypeEnName;
private Integer Breakfast;
private Integer AddBreakfast;
private Integer Meals;
private String ETA;
private String ETD;
private Double Price;
private Integer remainQuantity;
private Integer refundQuantity;
public static CTripHotelRoomDetail of(OrderHotelResponse.SettlementRoomDetail roomDetail) {
return BeanUtil.copyProperties(roomDetail, CTripHotelRoomDetail.class);
}
}

View File

@ -6,6 +6,7 @@ import com.chint.domain.aggregates.system.FsscSystem;
import com.chint.domain.value_object.UserLoginParam; import com.chint.domain.value_object.UserLoginParam;
import com.chint.infrastructure.constant.AuthMessageConstant; import com.chint.infrastructure.constant.AuthMessageConstant;
import com.chint.interfaces.rest.base.PostRequest; import com.chint.interfaces.rest.base.PostRequest;
import com.chint.interfaces.rest.user.PushUser;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken; import com.google.gson.reflect.TypeToken;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
@ -46,7 +47,7 @@ public class User implements Serializable {
private String password; private String password;
private LocalDateTime syncTime; private LocalDateTime syncTime;
@MappedCollection(idColumn = "user_id", keyColumn = "user_key") @MappedCollection(idColumn = "user_id", keyColumn = "user_key")
private List<UserDepartmentInfo> userDepartmentInfoList; private List<UserDepartmentInfo> userDepartmentInfo;
@Transient @Transient
private List<FsscSystem> fsscSystemList; private List<FsscSystem> fsscSystemList;
@Transient @Transient
@ -72,16 +73,9 @@ public class User implements Serializable {
} }
public User addDeptInfo(UserDepartmentInfo userDepartmentInfo) { // public User addDeptInfo(){
if (this.userDepartmentInfoList == null) { //
this.userDepartmentInfoList = new ArrayList<>(); // }
}
if (userDepartmentInfo.getIfPrimary().equals(1) && !this.userDepartmentInfoList.isEmpty()) {
this.userDepartmentInfoList.forEach(it -> it.setIfPrimary(0));
}
this.userDepartmentInfoList.add(userDepartmentInfo);
return this;
}
public User(Long userId, String employeeNo, Integer employeeLevel, String name, String email, String phoneNumber, UserLoginParam userLoginParam, String standardLevel, String companyCode) { public User(Long userId, String employeeNo, Integer employeeLevel, String name, String email, String phoneNumber, UserLoginParam userLoginParam, String standardLevel, String companyCode) {
this.userId = userId; this.userId = userId;
@ -115,6 +109,7 @@ public class User implements Serializable {
} }
public User addFssc(String CompanyName, String sysCode) { public User addFssc(String CompanyName, String sysCode) {
FsscSystem fsscSystem = new FsscSystem(CompanyName, sysCode); FsscSystem fsscSystem = new FsscSystem(CompanyName, sysCode);
this.addFsscSystemToList(fsscSystem); this.addFsscSystemToList(fsscSystem);

View File

@ -34,137 +34,6 @@ public class UserDepartmentInfo implements Serializable {
private String departmentNameSeven; private String departmentNameSeven;
private Integer ifPrimary; private Integer ifPrimary;
public Builder start(User user) { // Builder static inner class
return new Builder(user);
}
public UserDepartmentInfo(String companyCode, String companyName, String departmentCodeOne,
String departmentNameOne, String departmentCodeTwo, String departmentNameTwo,
String departmentCodeThree, String departmentNameThree, String departmentCodeFour,
String departmentNameFour, String departmentCodeFive, String departmentNameFive,
String departmentCodeSix, String departmentNameSix, String departmentCodeSeven,
String departmentNameSeven, Integer ifPrimary) {
this.companyCode = companyCode;
this.companyName = companyName;
this.departmentCodeOne = departmentCodeOne;
this.departmentNameOne = departmentNameOne;
this.departmentCodeTwo = departmentCodeTwo;
this.departmentNameTwo = departmentNameTwo;
this.departmentCodeThree = departmentCodeThree;
this.departmentNameThree = departmentNameThree;
this.departmentCodeFour = departmentCodeFour;
this.departmentNameFour = departmentNameFour;
this.departmentCodeFive = departmentCodeFive;
this.departmentNameFive = departmentNameFive;
this.departmentCodeSix = departmentCodeSix;
this.departmentNameSix = departmentNameSix;
this.departmentCodeSeven = departmentCodeSeven;
this.departmentNameSeven = departmentNameSeven;
this.ifPrimary = ifPrimary;
}
@Data
public static class Builder {
private User user;
private String companyCode;
private String companyName;
private String departmentCodeOne;
private String departmentNameOne;
private String departmentCodeTwo;
private String departmentNameTwo;
private String departmentCodeThree;
private String departmentNameThree;
private String departmentCodeFour;
private String departmentNameFour;
private String departmentCodeFive;
private String departmentNameFive;
private String departmentCodeSix;
private String departmentNameSix;
private String departmentCodeSeven;
private String departmentNameSeven;
private Integer ifPrimary;
public Builder(User user) {
this.user = user;
}
public Builder companyInfo(String companyCode, String companyName) {
this.companyCode = companyCode;
this.companyName = companyName;
return this;
}
public Builder deptOne(String departmentCodeOne, String departmentNameOne) {
this.departmentCodeOne = departmentCodeOne;
this.departmentNameOne = departmentNameOne;
return this;
}
public Builder deptTwo(String departmentCodeTwo, String departmentNameTwo) {
this.departmentCodeTwo = departmentCodeTwo;
this.departmentNameTwo = departmentNameTwo;
return this;
}
public Builder deptThree(String departmentCodeThree, String departmentNameThree) {
this.departmentCodeThree = departmentCodeThree;
this.departmentNameThree = departmentNameThree;
return this;
}
public Builder deptFour(String departmentCodeFour, String departmentNameFour) {
this.departmentCodeFour = departmentCodeFour;
this.departmentNameFour = departmentNameFour;
return this;
}
public Builder deptFive(String departmentCodeFive, String departmentNameFive) {
this.departmentCodeFive = departmentCodeFive;
this.departmentNameFive = departmentNameFive;
return this;
}
public Builder deptSix(String departmentCodeSix, String departmentNameSix) {
this.departmentCodeSix = departmentCodeSix;
this.departmentNameSix = departmentNameSix;
return this;
}
public Builder primary() {
this.ifPrimary = 1;
return this;
}
public Builder deptSeven(String departmentCodeSeven, String departmentNameSeven) {
this.departmentCodeSeven = departmentCodeSeven;
this.departmentNameSeven = departmentNameSeven;
return this;
}
public UserDepartmentInfo addToUser() {
UserDepartmentInfo userDepartmentInfo = new UserDepartmentInfo(companyCode,
companyName,
departmentCodeOne,
departmentNameOne,
departmentCodeTwo,
departmentNameTwo,
departmentCodeThree,
departmentNameThree,
departmentCodeFour,
departmentNameFour,
departmentCodeFive,
departmentNameFive,
departmentCodeSix,
departmentNameSix,
departmentCodeSeven,
departmentNameSeven,
ifPrimary);
if (userDepartmentInfo.getIfPrimary() == null || userDepartmentInfo.getIfPrimary() != 1) {
userDepartmentInfo.setIfPrimary(0);
}
user.addDeptInfo(userDepartmentInfo);
return userDepartmentInfo;
}
}
} }

View File

@ -11,7 +11,6 @@ import com.chint.domain.repository.LocationRepository;
import com.chint.domain.repository.RouteRepository; import com.chint.domain.repository.RouteRepository;
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 com.chint.infrastructure.util.DateTimeUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@ -47,20 +46,19 @@ public class CTripOrderRecordExtensionFactory implements OrderRecordExtensionFac
orderRecordBasic.setTrvaleSysType(TRAVAL_SYS_TYPE_CTRIP); orderRecordBasic.setTrvaleSysType(TRAVAL_SYS_TYPE_CTRIP);
orderRecordBasic.setAccountCompanyId(cTripCarPassengerInfo.getCostCenter1()); orderRecordBasic.setAccountCompanyId(cTripCarPassengerInfo.getCostCenter1());
orderRecordBasic.setAccountCompanyName(cTripCarPassengerInfo.getCostCenter2()); orderRecordBasic.setAccountCompanyName(cTripCarPassengerInfo.getCostCenter2());
orderRecordBasic.setOfflineCcomyCode(cTripCarPassengerInfo.getCostCenter1());
orderRecordBasic.setProjectOrderNo(cTripCarPassengerInfo.getCostCenter5()); orderRecordBasic.setProjectOrderNo(cTripCarPassengerInfo.getCostCenter5());
String sysCode = cTripCarPassengerInfo.getCostCenter3(); String sysCode = cTripCarPassengerInfo.getCostCenter3();
if (sysCode != null) { if (sysCode != null) {
if (sysCode.contains(BELONG_SYS_CODE_FSSC)) { if (sysCode.equals(BELONG_SYS_CODE_FSSC)) {
orderRecordBasic.setBelongSysType(BELONG_SYS_TYPE_FSSC); orderRecordBasic.setBelongSysType(BELONG_SYS_TYPE_FSSC);
} }
if (sysCode.contains(BELONG_SYS_CODE_H3BPM)) { if (sysCode.equals(BELONG_SYS_CODE_H3BPM)) {
orderRecordBasic.setBelongSysType(BELONG_SYS_TYPE_H3BPM); orderRecordBasic.setBelongSysType(BELONG_SYS_TYPE_H3BPM);
} }
if (sysCode.contains(BELONG_SYS_CODE_XNFSSC)) { if (sysCode.equals(BELONG_SYS_CODE_XNFSSC)) {
orderRecordBasic.setBelongSysType(BELONG_SYS_TYPE_XNFSSC); orderRecordBasic.setBelongSysType(BELONG_SYS_TYPE_XNFSSC);
} }
if (sysCode.contains(BELONG_SYS_CODE_ANFSSC)) { if (sysCode.equals(BELONG_SYS_CODE_ANFSSC)) {
orderRecordBasic.setBelongSysType(BELONG_SYS_TYPE_ANFSSC); orderRecordBasic.setBelongSysType(BELONG_SYS_TYPE_ANFSSC);
} }
} else { } else {
@ -113,7 +111,7 @@ public class CTripOrderRecordExtensionFactory implements OrderRecordExtensionFac
String.valueOf(cTripCarRecordBase.getRealAmountHasPost())); String.valueOf(cTripCarRecordBase.getRealAmountHasPost()));
// 加载费用细节, 未税金额税费服务费取消费额外费用额外费用名称 , 携程马上用车产品没有税费和额外费用字段 // 加载费用细节, 未税金额税费服务费取消费额外费用额外费用名称 , 携程马上用车产品没有税费和额外费用字段
orderCarRecord.loadFeeDetails("", orderCarRecord.loadFeeDetails(String.valueOf(cTripCarRecordBase.getAmount()),
"", "",
String.valueOf(cTripCarRecordBase.getServerFee()), String.valueOf(cTripCarRecordBase.getServerFee()),
String.valueOf(cTripCarRecordBase.getPenaltyFee()), String.valueOf(cTripCarRecordBase.getPenaltyFee()),
@ -207,20 +205,19 @@ public class CTripOrderRecordExtensionFactory implements OrderRecordExtensionFac
orderRecordBasic.setTrvaleSysType(TRAVAL_SYS_TYPE_CTRIP); orderRecordBasic.setTrvaleSysType(TRAVAL_SYS_TYPE_CTRIP);
orderRecordBasic.setAccountCompanyId(cTripFlightBaseInfo.getCostCenter()); orderRecordBasic.setAccountCompanyId(cTripFlightBaseInfo.getCostCenter());
orderRecordBasic.setAccountCompanyName(cTripFlightBaseInfo.getCostCenter2()); orderRecordBasic.setAccountCompanyName(cTripFlightBaseInfo.getCostCenter2());
orderRecordBasic.setOfflineCcomyCode(cTripFlightBaseInfo.getCostCenter());
orderRecordBasic.setProjectOrderNo(cTripFlightBaseInfo.getCostCenter5()); orderRecordBasic.setProjectOrderNo(cTripFlightBaseInfo.getCostCenter5());
String sysCode = cTripFlightBaseInfo.getCostCenter3(); String sysCode = cTripFlightBaseInfo.getCostCenter3();
if (sysCode != null) { if (sysCode != null) {
if (sysCode.contains(BELONG_SYS_CODE_FSSC)) { if (sysCode.equals(BELONG_SYS_CODE_FSSC)) {
orderRecordBasic.setBelongSysType(BELONG_SYS_TYPE_FSSC); orderRecordBasic.setBelongSysType(BELONG_SYS_TYPE_FSSC);
} }
if (sysCode.contains(BELONG_SYS_CODE_H3BPM)) { if (sysCode.equals(BELONG_SYS_CODE_H3BPM)) {
orderRecordBasic.setBelongSysType(BELONG_SYS_TYPE_H3BPM); orderRecordBasic.setBelongSysType(BELONG_SYS_TYPE_H3BPM);
} }
if (sysCode.contains(BELONG_SYS_CODE_XNFSSC)) { if (sysCode.equals(BELONG_SYS_CODE_XNFSSC)) {
orderRecordBasic.setBelongSysType(BELONG_SYS_TYPE_XNFSSC); orderRecordBasic.setBelongSysType(BELONG_SYS_TYPE_XNFSSC);
} }
if (sysCode.contains(BELONG_SYS_CODE_ANFSSC)) { if (sysCode.equals(BELONG_SYS_CODE_ANFSSC)) {
orderRecordBasic.setBelongSysType(BELONG_SYS_TYPE_ANFSSC); orderRecordBasic.setBelongSysType(BELONG_SYS_TYPE_ANFSSC);
} }
} else { } else {
@ -234,7 +231,6 @@ public class CTripOrderRecordExtensionFactory implements OrderRecordExtensionFac
public OrderFlightRecord createFlightOrderRecord(Object orderFlightRecordData) { public OrderFlightRecord createFlightOrderRecord(Object orderFlightRecordData) {
CTripFlightRecord cTripFlightRecord = (CTripFlightRecord) orderFlightRecordData; CTripFlightRecord cTripFlightRecord = (CTripFlightRecord) orderFlightRecordData;
CTripFlightBaseInfo cTripFlightBaseInfo = cTripFlightRecord.getCTripFlightBaseInfo(); CTripFlightBaseInfo cTripFlightBaseInfo = cTripFlightRecord.getCTripFlightBaseInfo();
CTripFlightTripInfo cTripFlightTripInfo = cTripFlightRecord.getCTripFlightTripInfo();
String routeOrderNo = cTripFlightRecord.getRouteOrderNo(); String routeOrderNo = cTripFlightRecord.getRouteOrderNo();
Optional<RouteOrder> byOrderNo = Optional.ofNullable(routeRepository.findByOrderNo(routeOrderNo)); Optional<RouteOrder> byOrderNo = Optional.ofNullable(routeRepository.findByOrderNo(routeOrderNo));
OrderFlightRecord orderFlightRecord = buildWithRecord(cTripFlightRecord) OrderFlightRecord orderFlightRecord = buildWithRecord(cTripFlightRecord)
@ -261,47 +257,14 @@ public class CTripOrderRecordExtensionFactory implements OrderRecordExtensionFac
"", "",
cTripFlightInfo.getACityCode(), cTripFlightInfo.getACityCode(),
"") "")
.loadTicketInfo(cTripFlightRecordBase.getCreateTime(),
String.valueOf(cTripFlightRecordBase.getPrice()),
"")
.loadSeatInfo(cTripFlightInfo.getClassName(), .loadSeatInfo(cTripFlightInfo.getClassName(),
cTripFlightInfo.getClassName(), cTripFlightInfo.getClassName(),
String.valueOf(cTripFlightInfo.getPriceRate())); String.valueOf(cTripFlightInfo.getPriceRate()));
CTripFlightPrintInfo cTripFlightPrintInfo = cTripFlightRecord.getCTripFlightPrintInfo();
if (cTripFlightPrintInfo != null &&
cTripFlightPrintInfo.getFlightOrderSegmentPrintInfoList() != null &&
!cTripFlightPrintInfo.getFlightOrderSegmentPrintInfoList().isEmpty()) {
//获取最新的行程号
Optional<CTripFlightSegmentPrint> print = cTripFlightRecord
.getCTripFlightPrintInfo()
.getFlightOrderSegmentPrintInfoList()
.stream()
.reduce((a, b) -> {
if (a.getPrintTime() > b.getPrintTime()) {
return a;
} else {
return b;
}
});
orderFlightRecord.loadScheduleNum(print.map(cTripFlightSegmentPrint -> DateTimeUtil.timeFromInstant(cTripFlightSegmentPrint.getPrintTime())).orElse(""),
print.isPresent() ? print.get().getPrintNo() : "");
}
// 加载机票信息
if (cTripFlightTripInfo != null) {
String ticketNo = cTripFlightRecord.getTicketNo();
if (ticketNo != null) {
ticketNo = ticketNo.replace("-", "");
}
orderFlightRecord.loadTicketInfo(ticketNo,
String.valueOf(cTripFlightRecordBase.getPrice()),
cTripFlightTripInfo.getTicketNoStatusName());
} else {
orderFlightRecord.loadTicketInfo(cTripFlightRecord.getTicketNo(),
String.valueOf(cTripFlightRecordBase.getPrice()),
"无机票信息");
}
// 加载财务与价格信息 // 加载财务与价格信息
String batchNo = cTripFlightRecordBase.getBatchStartDate().substring(0, 6); String batchNo = cTripFlightRecordBase.getBatchStartDate().substring(0, 6);
orderFlightRecord.loadFinancialAndPricingInfo(batchNo, orderFlightRecord.loadFinancialAndPricingInfo(batchNo,
@ -321,9 +284,9 @@ public class CTripOrderRecordExtensionFactory implements OrderRecordExtensionFac
// 加载费用信息, 服务费 改签费 退票费 , 升舱费 // 加载费用信息, 服务费 改签费 退票费 , 升舱费
orderFlightRecord.loadExtraFeeInfo(String.valueOf(cTripFlightRecordBase.getPostServiceFee()), orderFlightRecord.loadExtraFeeInfo(String.valueOf(cTripFlightRecordBase.getPostServiceFee()),
String.valueOf(cTripFlightRecordBase.getDateChangeFee()), String.valueOf(cTripFlightRecordBase.getRebookQueryFee()),
String.valueOf(cTripFlightRecordBase.getRefund()), String.valueOf(cTripFlightRecordBase.getRefund()),
String.valueOf(cTripFlightRecordBase.getPriceDifferential()), cTripFlightRecordBase.getOrderDetailType().equals("改签") ? String.valueOf(cTripFlightRecordBase.getAmount()) : KEEP_TWO_DECIMAL_ZERO,
String.valueOf(cTripFlightRecordBase.getSettItineraryFee())); String.valueOf(cTripFlightRecordBase.getSettItineraryFee()));
// 加载来源 // 加载来源
@ -383,20 +346,19 @@ public class CTripOrderRecordExtensionFactory implements OrderRecordExtensionFac
orderRecordBasic.setTrvaleSysType(TRAVAL_SYS_TYPE_CTRIP); orderRecordBasic.setTrvaleSysType(TRAVAL_SYS_TYPE_CTRIP);
orderRecordBasic.setAccountCompanyId(cTripHotelOrderDetail.getCostCenter()); orderRecordBasic.setAccountCompanyId(cTripHotelOrderDetail.getCostCenter());
orderRecordBasic.setAccountCompanyName(cTripHotelOrderDetail.getCostCenter2()); orderRecordBasic.setAccountCompanyName(cTripHotelOrderDetail.getCostCenter2());
orderRecordBasic.setOfflineCcomyCode(cTripHotelOrderDetail.getCostCenter());
orderRecordBasic.setProjectOrderNo(cTripHotelOrderDetail.getCostCenter5()); orderRecordBasic.setProjectOrderNo(cTripHotelOrderDetail.getCostCenter5());
String sysCode = cTripHotelOrderDetail.getCostCenter3(); String sysCode = cTripHotelOrderDetail.getCostCenter3();
if (sysCode != null) { if (sysCode != null) {
if (sysCode.contains(BELONG_SYS_CODE_FSSC)) { if (sysCode.equals(BELONG_SYS_CODE_FSSC)) {
orderRecordBasic.setBelongSysType(BELONG_SYS_TYPE_FSSC); orderRecordBasic.setBelongSysType(BELONG_SYS_TYPE_FSSC);
} }
if (sysCode.contains(BELONG_SYS_CODE_H3BPM)) { if (sysCode.equals(BELONG_SYS_CODE_H3BPM)) {
orderRecordBasic.setBelongSysType(BELONG_SYS_TYPE_H3BPM); orderRecordBasic.setBelongSysType(BELONG_SYS_TYPE_H3BPM);
} }
if (sysCode.contains(BELONG_SYS_CODE_XNFSSC)) { if (sysCode.equals(BELONG_SYS_CODE_XNFSSC)) {
orderRecordBasic.setBelongSysType(BELONG_SYS_TYPE_XNFSSC); orderRecordBasic.setBelongSysType(BELONG_SYS_TYPE_XNFSSC);
} }
if (sysCode.contains(BELONG_SYS_CODE_ANFSSC)) { if (sysCode.equals(BELONG_SYS_CODE_ANFSSC)) {
orderRecordBasic.setBelongSysType(BELONG_SYS_TYPE_ANFSSC); orderRecordBasic.setBelongSysType(BELONG_SYS_TYPE_ANFSSC);
} }
} else { } else {
@ -424,6 +386,7 @@ public class CTripOrderRecordExtensionFactory implements OrderRecordExtensionFac
// 加载酒店和入住信息 // 加载酒店和入住信息
orderHotelRecord.loadHotelInfo(cTripHotelInfo.getHotelName(), orderHotelRecord.loadHotelInfo(cTripHotelInfo.getHotelName(),
cTripHotelInfo.getHotelName(),
cTripHotelOrderDetail.getStartTime(), cTripHotelOrderDetail.getStartTime(),
cTripHotelOrderDetail.getEndTime(), cTripHotelOrderDetail.getEndTime(),
cTripHotelOrderDetail.getRoomQuantity(), cTripHotelOrderDetail.getRoomQuantity(),
@ -436,15 +399,7 @@ public class CTripOrderRecordExtensionFactory implements OrderRecordExtensionFac
} else { } else {
isAgreement = ""; isAgreement = "";
} }
List<CTripHotelRoomDetail> roomDetails = cTripHotelOrderDetail.getCTripHotelRoomDetailList(); orderHotelRecord.loadRoomAndBreakfastInfo("",
Integer averageMeals;
if (roomDetails != null && !roomDetails.isEmpty()) {
averageMeals = roomDetails.stream().map(CTripHotelRoomDetail::getBreakfast).reduce(Integer::sum).get();
} else {
averageMeals = 0;
}
orderHotelRecord.loadRoomAndBreakfastInfo(String.valueOf(averageMeals),
isAgreement, isAgreement,
cTripHotelRecordBase.getQuantity(), cTripHotelRecordBase.getQuantity(),
cTripHotelRecordBase.getQuantity(), cTripHotelRecordBase.getQuantity(),
@ -458,19 +413,10 @@ public class CTripOrderRecordExtensionFactory implements OrderRecordExtensionFac
if (locations != null && !locations.isEmpty()) { if (locations != null && !locations.isEmpty()) {
Location location = locations.get(0); Location location = locations.get(0);
LocationRes locationRes = LocationRes.copyFrom(location); LocationRes locationRes = LocationRes.copyFrom(location);
String address = locationRes.getCountry() + locationRes.getProvince() + cTripHotelInfo.getCityName(); orderHotelRecord.loadLocationInfo(locationRes.getCountry(), locationRes.getProvince(), cTripHotelInfo.getCityName());
if (cTripHotelInfo.getDistrictName() != null) {
address = address + cTripHotelInfo.getDistrictName();
}
address = address + cTripHotelInfo.getHotelName();
orderHotelRecord.loadLocationInfo(
address,
locationRes.getCountry(),
locationRes.getProvince(),
cTripHotelInfo.getCityName());
} else { } else {
//如果找不到该地区那么只能先用空的 //如果找不到该地区那么只能先用空的
orderHotelRecord.loadLocationInfo("", "", cTripHotelInfo.getCityName(), cTripHotelInfo.getHotelName()); orderHotelRecord.loadLocationInfo("", "", cTripHotelInfo.getCityName());
} }
// 加载酒店品牌和星级信息 // 加载酒店品牌和星级信息
@ -512,17 +458,11 @@ public class CTripOrderRecordExtensionFactory implements OrderRecordExtensionFac
cTripHotelRecordBase.getCreateTime())); cTripHotelRecordBase.getCreateTime()));
// 加载财务信息 // 加载财务信息
String invoiceType = cTripHotelOrderDetail.getIsHasSpecialInvoice().equals("T") ? "增值税专用发票" : "增值税普通发票"; //发票类型
orderHotelRecord.loadFinancialInfo(cTripHotelRecordBase.getBatchStartDate().substring(0, 6), orderHotelRecord.loadFinancialInfo(cTripHotelRecordBase.getBatchStartDate().substring(0, 6),
cTripHotelRecordBase.getSubAccCheckBatchNo(), cTripHotelRecordBase.getSubAccCheckBatchNo(),
String.valueOf(cTripHotelRecordBase.getAmount()), String.valueOf(cTripHotelRecordBase.getAmount()),
"", "",
cTripHotelRecordBase.getPaidAmount()) cTripHotelRecordBase.getPaidAmount());
.loadInvoiceAndFeeInfo(invoiceType,
String.valueOf(cTripHotelRecordBase.getExtraCharge()),
String.valueOf(cTripHotelRecordBase.getServiceFee()),
"",
"");
// 加载付款 付款方式公司付款金额, 个人付款金额 // 加载付款 付款方式公司付款金额, 个人付款金额

View File

@ -14,8 +14,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
import java.util.Optional; import java.util.Optional;
@ -96,12 +94,12 @@ public class LyOrderRecordExtensionFactory implements OrderRecordExtensionFactor
flightFieldCheck(orderFlightRecord, lyOrderFlightRecord); flightFieldCheck(orderFlightRecord, lyOrderFlightRecord);
orderFlightRecord.setDetailId(lyOrderFlightRecord.getBillOrderNo())//防重标识 orderFlightRecord.setDetailId(lyOrderFlightRecord.getBillOrderNo())//防重标识
.setTicketClerk(lyOrderFlightRecord.getReserveManName())//票务员 .setTicketClerk(lyOrderFlightRecord.getReserveManName())//票务员
.setAccountPeriod(getAccountPeriod(lyOrderFlightRecord.getStatementCode()))//账期号 .setAccountPeriod(lyOrderFlightRecord.getStatementCode())//账期号
.setBillNo(lyOrderFlightRecord.getBillOrderNo())//账单号 .setBillNo(lyOrderFlightRecord.getBillOrderNo())//账单号
.setOrderNo(lyOrderFlightRecord.getOrderSerialNo())//订单号 .setOrderNo(lyOrderFlightRecord.getOrderSerialNo())//订单号
.setParentOrderNo(flightOrderDetail.getParentOrderNo())//父级订单号 .setParentOrderNo(flightOrderDetail.getParentOrderNo())//父级订单号
.setOriginalOrderNo(lyOrderFlightRecord.getOriginOrderSerialNo())//原始订单号 .setOriginalOrderNo(lyOrderFlightRecord.getOriginOrderSerialNo())//原始订单号
.setTicketNo(StringUtils.isBlank(lyOrderFlightRecord.getTicketNo()) ? null : lyOrderFlightRecord.getTicketNo().replace("-", ""));//票号 .setTicketNo(lyOrderFlightRecord.getTicketNo());//票号
//行程单号 //行程单号
List<OrderTravel> byOrderNo = orderTravelRepository.findByOrderNo(orderSerialNo); List<OrderTravel> byOrderNo = orderTravelRepository.findByOrderNo(orderSerialNo);
String travelNo = byOrderNo.isEmpty() ? "" : byOrderNo.get(0).getTravelNo(); String travelNo = byOrderNo.isEmpty() ? "" : byOrderNo.get(0).getTravelNo();
@ -110,7 +108,7 @@ public class LyOrderRecordExtensionFactory implements OrderRecordExtensionFactor
.setReceiptsNumOrigin(lyOrderFlightRecord.getOutApplayOrderNo())//原关联申请单号 .setReceiptsNumOrigin(lyOrderFlightRecord.getOutApplayOrderNo())//原关联申请单号
.setUserName(lyOrderFlightRecord.getPassengerName())//出行人姓名 .setUserName(lyOrderFlightRecord.getPassengerName())//出行人姓名
.setUserCode(lyOrderFlightRecord.getPassengerExternalId())//出行人编码 .setUserCode(lyOrderFlightRecord.getPassengerExternalId())//出行人编码
.setOverStandard(lyOrderFlightRecord.getOverStandardStatus())//"是否违规超标0否 ,1是" .setOverStandard("".equals(lyOrderFlightRecord.getOverStandardStatus()) ? "1" : "0")//"是否违规超标0否 ,1是"
.setOverStandardReason(lyOrderFlightRecord.getViolationReason())//违规原因超标原因 .setOverStandardReason(lyOrderFlightRecord.getViolationReason())//违规原因超标原因
.setStartAirportName(flightOrderDetail.getStartAirportName())//起飞机场名称 .setStartAirportName(flightOrderDetail.getStartAirportName())//起飞机场名称
.setStartCityCode(flightOrderDetail.getStartCityCode())//起飞城市编码 .setStartCityCode(flightOrderDetail.getStartCityCode())//起飞城市编码
@ -143,17 +141,17 @@ public class LyOrderRecordExtensionFactory implements OrderRecordExtensionFactor
.setSeatDiscount(lyOrderFlightRecord.getDiscount())//折扣率 .setSeatDiscount(lyOrderFlightRecord.getDiscount())//折扣率
.setSeatPoint(lyOrderFlightRecord.getSeatClass())//舱位 .setSeatPoint(lyOrderFlightRecord.getSeatClass())//舱位
.setSeatPointName(lyOrderFlightRecord.getSeatClass())//舱位名称 .setSeatPointName(lyOrderFlightRecord.getSeatClass())//舱位名称
.setUseStatus(lyOrderFlightRecord.getTicketStatus())//机票使用情况 .setUseStatus(lyOrderFlightRecord.getTicketStatus()) //机票使用情况
.setOrderSource(StringUtils.isNotBlank(lyOrderFlightRecord.getOutApplayOrderNo()) ? "Y" : "N") //预订来源线上/线下 .setOrderSource(lyOrderFlightRecord.getBookingPlat()) //预订来源线上/线下
.setNotLowReason("正泰机票无超标") //未预订最低价原因 .setNotLowReason("正泰机票无超标") //未预订最低价原因
.setBookOrgCode1(lyOrderFlightRecord.getPassengerDepartment()) //出行人组织架构信息1 .setBookOrgCode1(lyOrderFlightRecord.getPassengerDepartment()) //出行人组织架构信息1
.setBookOrgCode2(lyOrderFlightRecord.getPassengerDepartment()) //出行人组织架构信息2 .setBookOrgCode2(lyOrderFlightRecord.getPassengerDepartment()) //出行人组织架构信息2
.setBookOrgCode3(lyOrderFlightRecord.getPassengerDepartment()) //出行人组织架构信息3 .setBookOrgCode3(lyOrderFlightRecord.getPassengerDepartment()) //出行人组织架构信息3
.setOfflineCcomyCode(lyOrderFlightRecord.getPassengerCostCenter()) //成本中心 .setOfflineCcomyCode(lyOrderFlightRecord.getPassengerCostCenter()) //成本中心
.setOrderStatus("") //结算状态 .setOrderStatus("") //结算状态
// .setExpenseOrderAmount("") //订单金额 /* .setExpenseOrderAmount("") //订单金额
// .setSettleOrderFlag() //订单对账状态 .setSettleOrderFlag() //订单对账状态
.setPayAmount(String.valueOf(lyOrderFlightRecord.getToBePayAmount() + lyOrderFlightRecord.getServiceAmount()))//支付金额 .setPayAmount() //支付金额*/
; ;
} }
@ -172,14 +170,14 @@ public class LyOrderRecordExtensionFactory implements OrderRecordExtensionFactor
hotelFieldCheck(orderHotelRecord, lyOrderHotelRecord); hotelFieldCheck(orderHotelRecord, lyOrderHotelRecord);
orderHotelRecord.setDetailId(lyOrderHotelRecord.getBillOrderNo())//防重标识 orderHotelRecord.setDetailId(lyOrderHotelRecord.getBillOrderNo())//防重标识
.setTicketClerk(lyOrderHotelRecord.getReserveManName()) //票务员 .setTicketClerk(lyOrderHotelRecord.getReserveManName()) //票务员
.setAccountPeriod(getAccountPeriod(lyOrderHotelRecord.getStatementCode())) //账期号 .setAccountPeriod(lyOrderHotelRecord.getStatementCode()) //账期号
.setBillNo(lyOrderHotelRecord.getBillOrderNo()) //账单号结算单号 .setBillNo(lyOrderHotelRecord.getBillOrderNo()) //账单号结算单号
.setOrderNo(lyOrderHotelRecord.getOrderSerialNo()) //订单号 .setOrderNo(lyOrderHotelRecord.getOrderSerialNo()) //订单号
.setParentOrderNo("") //父级订单号 .setParentOrderNo("") //父级订单号
.setOriginalOrderNo(lyOrderHotelRecord.getOriginOrderSerialNo())//原始订单号 .setOriginalOrderNo(lyOrderHotelRecord.getOriginOrderSerialNo())//原始订单号
.setBrandGroup("") //酒店品牌集团 .setBrandGroup("") //酒店品牌集团
.setBrandName("") //酒店品牌 .setBrandName("") //酒店品牌
.setOverStandard(lyOrderHotelRecord.getOverStandardStatus()) //"是否违规(超标) 0否,1是" .setOverStandard("".equals(lyOrderHotelRecord.getOverStandardStatus()) ? "1" : "0") //"是否违规(超标) 0否,1是"
.setOverStandardReason(lyOrderHotelRecord.getViolationReason());//违规原因超标原因 .setOverStandardReason(lyOrderHotelRecord.getViolationReason());//违规原因超标原因
orderHotelRecord.setReceiptsNum(getReceiptsNum(lyOrderHotelRecord.getOutApplayOrderNo(), routeOrder))//关联申请单号 orderHotelRecord.setReceiptsNum(getReceiptsNum(lyOrderHotelRecord.getOutApplayOrderNo(), routeOrder))//关联申请单号
@ -216,15 +214,16 @@ public class LyOrderRecordExtensionFactory implements OrderRecordExtensionFactor
.setTaxCusFee("") //托管费税费 .setTaxCusFee("") //托管费税费
.setRoomTypeName(lyOrderHotelRecord.getBedType()) //房型 .setRoomTypeName(lyOrderHotelRecord.getBedType()) //房型
.setStarRate(hotelOrderDetail.getStarRate()) //星级 .setStarRate(hotelOrderDetail.getStarRate()) //星级
.setOrderSource(StringUtils.isNotBlank(lyOrderHotelRecord.getOutApplayOrderNo()) ? "Y" : "N") //预订来源线上/线下 .setOrderSource(lyOrderHotelRecord.getBookingPlat()) //预订来源线上/线下
.setBookOrgCode1(lyOrderHotelRecord.getPassengerDepartment()) //入住人组织架构信息1 .setBookOrgCode1(lyOrderHotelRecord.getPassengerDepartment()) //入住人组织架构信息1
.setBookOrgCode2(hotelOrderDetail.getBOOK_ORG_STRUCT_2()) //入住人组织架构信息2 .setBookOrgCode2(hotelOrderDetail.getBOOK_ORG_STRUCT_2()) //入住人组织架构信息2
.setBookOrgCode3(hotelOrderDetail.getBOOK_ORG_STRUCT_3()) //入住人组织架构信息3 .setBookOrgCode3(hotelOrderDetail.getBOOK_ORG_STRUCT_3()) //入住人组织架构信息3
.setOfflineCcomyCode(lyOrderHotelRecord.getPassengerCostCenter()) //成本中心 .setOfflineCcomyCode(lyOrderHotelRecord.getPassengerCostCenter()) //成本中心
.setOrderStatus("") //结算状态 /* .setOrderStatus() //结算状态
// .setExpenseOrderAmount("") //订单金额 .setExpenseOrderAmount() //订单金额
// .setSettleOrderFlag() //订单对账状态 .setSettleOrderFlag() //订单对账状态
.setPayAmount(String.valueOf(lyOrderHotelRecord.getToBePayAmount() + lyOrderHotelRecord.getServiceAmount())) //支付金额 .setPayAmount() //支付金额
*/
; ;
} }
@ -242,7 +241,7 @@ public class LyOrderRecordExtensionFactory implements OrderRecordExtensionFactor
trainFieldCheck(orderTrainRecord, lyOrderTrainRecord); trainFieldCheck(orderTrainRecord, lyOrderTrainRecord);
orderTrainRecord.setDetailId(lyOrderTrainRecord.getBillOrderNo())//防重标识 orderTrainRecord.setDetailId(lyOrderTrainRecord.getBillOrderNo())//防重标识
.setTicketClerk(lyOrderTrainRecord.getReserveManName()) //票务员 .setTicketClerk(lyOrderTrainRecord.getReserveManName()) //票务员
.setAccountPeriod(getAccountPeriod(lyOrderTrainRecord.getStatementCode())) //账期号 .setAccountPeriod(lyOrderTrainRecord.getStatementCode()) //账期号
.setBillNo(lyOrderTrainRecord.getBillOrderNo()) //账单号 .setBillNo(lyOrderTrainRecord.getBillOrderNo()) //账单号
.setOrderNo(lyOrderTrainRecord.getOrderSerialNo()) //订单号 .setOrderNo(lyOrderTrainRecord.getOrderSerialNo()) //订单号
.setParentOrderNo(trainOrderDetail.getParentOrderNo()) //父级订单号 .setParentOrderNo(trainOrderDetail.getParentOrderNo()) //父级订单号
@ -251,7 +250,7 @@ public class LyOrderRecordExtensionFactory implements OrderRecordExtensionFactor
.setReceiptsNumOrigin(lyOrderTrainRecord.getOutApplayOrderNo()) //原关联申请单号 .setReceiptsNumOrigin(lyOrderTrainRecord.getOutApplayOrderNo()) //原关联申请单号
.setStartDate(lyOrderTrainRecord.getPlanBeginDate()) //出发日期 .setStartDate(lyOrderTrainRecord.getPlanBeginDate()) //出发日期
.setArriveDate(lyOrderTrainRecord.getPlanEndDate()) //到达日期 .setArriveDate(lyOrderTrainRecord.getPlanEndDate()) //到达日期
.setOverStandard(lyOrderTrainRecord.getOverStandardStatus()) //"是否违规超标0否 1是" .setOverStandard("".equals(lyOrderTrainRecord.getOverStandardStatus()) ? "1" : "0") //"是否违规超标0否 1是"
.setOverStandardReason(lyOrderTrainRecord.getViolationReason()) //违规原因超标原因 .setOverStandardReason(lyOrderTrainRecord.getViolationReason()) //违规原因超标原因
.setChangeAddAmount(String.valueOf(lyOrderTrainRecord.getToBePayAmount())) //改签收款 .setChangeAddAmount(String.valueOf(lyOrderTrainRecord.getToBePayAmount())) //改签收款
.setChangeCost(String.valueOf(lyOrderTrainRecord.getChangeFee())) //改签手续费 .setChangeCost(String.valueOf(lyOrderTrainRecord.getChangeFee())) //改签手续费
@ -276,16 +275,16 @@ public class LyOrderRecordExtensionFactory implements OrderRecordExtensionFactor
.setTrainNo(lyOrderTrainRecord.getTrainNo()) //车次 .setTrainNo(lyOrderTrainRecord.getTrainNo()) //车次
.setUserCode(lyOrderTrainRecord.getPassengerNo())//出行人编码 .setUserCode(lyOrderTrainRecord.getPassengerNo())//出行人编码
.setUserName(lyOrderTrainRecord.getPassengerName())//出行人姓名 .setUserName(lyOrderTrainRecord.getPassengerName())//出行人姓名
.setOrderSource(StringUtils.isNotBlank(lyOrderTrainRecord.getOutApplayOrderNo()) ? "Y" : "N")//预订来源线上 / 线下 .setOrderSource(lyOrderTrainRecord.getBookingPlat())//预订来源线上 / 线下
// .setOrderSource(lyOrderTrainRecord.getBookingPlat())//预订来源线上 / 线下
.setBookOrgCode1(lyOrderTrainRecord.getPassengerDepartment())//出行人组织架构信息1 .setBookOrgCode1(lyOrderTrainRecord.getPassengerDepartment())//出行人组织架构信息1
.setBookOrgCode2(trainOrderDetail.getBOOK_ORG_STRUCT_2())//出行人组织架构信息2 .setBookOrgCode2(trainOrderDetail.getBOOK_ORG_STRUCT_2())//出行人组织架构信息2
.setBookOrgCode3(trainOrderDetail.getBOOK_ORG_STRUCT_3())//出行人组织架构信息3 .setBookOrgCode3(trainOrderDetail.getBOOK_ORG_STRUCT_3())//出行人组织架构信息3
.setOfflineCcomyCode(lyOrderTrainRecord.getPassengerCostCenter())//成本中心 .setOfflineCcomyCode(lyOrderTrainRecord.getPassengerCostCenter())//成本中心
// .setOrderStatus() //结算状态 /* .setOrderStatus() //结算状态
// .setExpenseOrderAmount() //订单金额 .setExpenseOrderAmount() //订单金额
// .setSettleOrderFlag() //订单对账状态 .setSettleOrderFlag() //订单对账状态
.setPayAmount(String.valueOf(lyOrderTrainRecord.getToBePayAmount() + lyOrderTrainRecord.getServiceAmount())) //支付金额 .setPayAmount() //支付金额
*/
/* .setTravelUserBirthday("")//生日 /* .setTravelUserBirthday("")//生日
.setTravelUserPhone("") //出行人手机号 .setTravelUserPhone("") //出行人手机号
@ -312,11 +311,11 @@ public class LyOrderRecordExtensionFactory implements OrderRecordExtensionFactor
carFieldCheck(orderCarRecord, lyOrderCarRecord); carFieldCheck(orderCarRecord, lyOrderCarRecord);
orderCarRecord.setDetailId(lyOrderCarRecord.getBillOrderNo())//防重标识 orderCarRecord.setDetailId(lyOrderCarRecord.getBillOrderNo())//防重标识
.setTicketClerk(lyOrderCarRecord.getReserveManName()) //票务员 .setTicketClerk(lyOrderCarRecord.getReserveManName()) //票务员
.setAccountPeriod(getAccountPeriod(lyOrderCarRecord.getStatementCode())) //账期号 .setAccountPeriod(lyOrderCarRecord.getStatementCode()) //账期号
.setBillNo(lyOrderCarRecord.getBillOrderNo()); //账单号 .setBillNo(lyOrderCarRecord.getBillOrderNo()); //账单号
orderCarRecord.setReceiptsNum(getReceiptsNum(lyOrderCarRecord.getOutApplayOrderNo(), routeOrder))//关联申请单号 orderCarRecord.setReceiptsNum(getReceiptsNum(lyOrderCarRecord.getOutApplayOrderNo(), routeOrder))//关联申请单号
.setReceiptsNumOrigin(lyOrderCarRecord.getOutApplayOrderNo()) //原关联申请单号 .setReceiptsNumOrigin(lyOrderCarRecord.getOutApplayOrderNo()) //原关联申请单号
.setOverStandard("") //"是否违规超标0否 1是" .setOverStandard("0") //"是否违规超标0否 1是"
.setOverStandardReason("")//违规原因超标原因 .setOverStandardReason("")//违规原因超标原因
.setOrderNo(lyOrderCarRecord.getOrderSerialNo()) //订单号 .setOrderNo(lyOrderCarRecord.getOrderSerialNo()) //订单号
.setParentOrderNo(carOrderDetail.getParentOrderNo())//父级订单号 .setParentOrderNo(carOrderDetail.getParentOrderNo())//父级订单号
@ -349,10 +348,10 @@ public class LyOrderRecordExtensionFactory implements OrderRecordExtensionFactor
.setBookOrgCode3(carOrderDetail.getBOOK_ORG_STRUCT_3()) //用车人组织架构信息3 .setBookOrgCode3(carOrderDetail.getBOOK_ORG_STRUCT_3()) //用车人组织架构信息3
.setPaymentType(String.valueOf(getPaymentType(lyOrderCarRecord.getPayType()))) //"付款方式0公司统付 1个人付 2混付" .setPaymentType(String.valueOf(getPaymentType(lyOrderCarRecord.getPayType()))) //"付款方式0公司统付 1个人付 2混付"
.setOfflineCcomyCode(lyOrderCarRecord.getPassengerDepartment()) //成本中心 .setOfflineCcomyCode(lyOrderCarRecord.getPassengerDepartment()) //成本中心
.setOrderSource(StringUtils.isNotBlank(lyOrderCarRecord.getOutApplayOrderNo()) ? "Y" : "N") //预订来源线上/线下 .setOrderSource(lyOrderCarRecord.getBookingPlat()) //预订来源线上/线下
// .setExpenseOrderAmount() //订单金额 /* .setExpenseOrderAmount() //订单金额
// .setSettleOrderFlag() //订单对账状态 .setSettleOrderFlag() //订单对账状态
.setPayAmount(String.valueOf(lyOrderCarRecord.getToBePayAmount() + lyOrderCarRecord.getServiceAmount()))// 支付金额 .setPayAmount()// 支付金额*/
; ;
} }
@ -374,23 +373,6 @@ public class LyOrderRecordExtensionFactory implements OrderRecordExtensionFactor
return orderRecordFactory.buildWithRouteOrder(routeOrder); return orderRecordFactory.buildWithRouteOrder(routeOrder);
} }
//获取账期号 202403
public String getAccountPeriod(String statementCode) {
LocalDate currentDate = LocalDate.now();
String nowDate = currentDate.format(DateTimeFormatter.ofPattern("yyyyMMdd"));
if (StringUtils.isBlank(statementCode)) {
//如果为空获取上月赋值
LocalDate lastMonthDate = currentDate.minusMonths(1);
return lastMonthDate.format(DateTimeFormatter.ofPattern("yyyyMM"));
}
String dateSuffix = statementCode.substring(2, 6);
String datePrefix = nowDate.substring(0, 2);
System.out.println(datePrefix + dateSuffix);
return datePrefix + dateSuffix;
}
public void flightFieldCheck(OrderFlightRecord orderFlightRecord, LyOrderFlightRecord lyOrderFlightRecord) { public void flightFieldCheck(OrderFlightRecord orderFlightRecord, LyOrderFlightRecord lyOrderFlightRecord) {
orderFlightRecord.setTrvaleSysType(TRAVAL_SYS_TYPE_LY)//数据来源商旅平台 XC携程 TC同程 orderFlightRecord.setTrvaleSysType(TRAVAL_SYS_TYPE_LY)//数据来源商旅平台 XC携程 TC同程
.setBookingName(lyOrderFlightRecord.getReserveManName()) //预订人姓名 .setBookingName(lyOrderFlightRecord.getReserveManName()) //预订人姓名
@ -484,7 +466,7 @@ public class LyOrderRecordExtensionFactory implements OrderRecordExtensionFactor
} }
//对应所属系统 //对应所属系统
public String findBelongSysType(List<TripSubmitItemList> itemList, String outApplayOrderNo) { private static String findBelongSysType(List<TripSubmitItemList> itemList, String outApplayOrderNo) {
return itemList.stream() return itemList.stream()
.filter(item -> LY_CUSTOM1.equals(item.getCode())) .filter(item -> LY_CUSTOM1.equals(item.getCode()))
.findFirst() .findFirst()
@ -495,7 +477,7 @@ public class LyOrderRecordExtensionFactory implements OrderRecordExtensionFactor
} }
//核算企业code //核算企业code
public Optional<String> findAccountCompanyId(List<TripSubmitItemList> tripSubmitItemList) { private static Optional<String> findAccountCompanyId(List<TripSubmitItemList> tripSubmitItemList) {
return tripSubmitItemList.stream() return tripSubmitItemList.stream()
.filter(item -> LY_CUSTOM2.equals(item.getCode())) .filter(item -> LY_CUSTOM2.equals(item.getCode()))
.findFirst() .findFirst()
@ -503,7 +485,7 @@ public class LyOrderRecordExtensionFactory implements OrderRecordExtensionFactor
} }
////核算企业名称 ////核算企业名称
public Optional<String> findAccountCompanyName(List<TripSubmitItemList> tripSubmitItemList) { private static Optional<String> findAccountCompanyName(List<TripSubmitItemList> tripSubmitItemList) {
return tripSubmitItemList.stream() return tripSubmitItemList.stream()
.filter(item -> LY_CUSTOM3.equals(item.getCode())) .filter(item -> LY_CUSTOM3.equals(item.getCode()))
.findFirst() .findFirst()
@ -511,7 +493,7 @@ public class LyOrderRecordExtensionFactory implements OrderRecordExtensionFactor
} }
//项目订单号 //项目订单号
public Optional<String> findProjectOrderNo(List<TripSubmitItemList> tripSubmitItemList) { private static Optional<String> findProjectOrderNo(List<TripSubmitItemList> tripSubmitItemList) {
return tripSubmitItemList.stream() return tripSubmitItemList.stream()
.filter(item -> LY_CUSTOM4.equals(item.getCode())) .filter(item -> LY_CUSTOM4.equals(item.getCode()))
.findFirst() .findFirst()
@ -519,6 +501,21 @@ public class LyOrderRecordExtensionFactory implements OrderRecordExtensionFactor
} }
private void flightReceiptsNum(OrderFlightRecord orderFlightRecord, LyOrderFlightRecord lyOrderFlightRecord, RouteOrder routeOrder) {
ApproveOrderNo approveOrderNo = routeOrder.getApproveOrderNo();
String outApplayOrderNo = lyOrderFlightRecord.getOutApplayOrderNo();
String receiptsNum = "";
if (Objects.isNull(approveOrderNo) && StringUtils.isNotBlank(outApplayOrderNo)) {
String[] receiptsNums = outApplayOrderNo.split("-");
if (receiptsNums.length > 1) {
receiptsNum = receiptsNums[1];
}
} else {
receiptsNum = approveOrderNo.getActualOrderNo();
}
orderFlightRecord.setReceiptsNum(receiptsNum);
}
//获取财务共享单号 //获取财务共享单号
private String getReceiptsNum(String outApplayOrderNo, RouteOrder routeOrder) { private String getReceiptsNum(String outApplayOrderNo, RouteOrder routeOrder) {
ApproveOrderNo approveOrderNo = routeOrder.getApproveOrderNo(); ApproveOrderNo approveOrderNo = routeOrder.getApproveOrderNo();

View File

@ -9,7 +9,6 @@ import com.chint.infrastructure.repository.jdbc.JdbcLyOrderFlightRecord;
import com.chint.infrastructure.repository.jdbc.JdbcLyOrderHotelRecord; import com.chint.infrastructure.repository.jdbc.JdbcLyOrderHotelRecord;
import com.chint.infrastructure.repository.jdbc.JdbcLyOrderTrainRecord; import com.chint.infrastructure.repository.jdbc.JdbcLyOrderTrainRecord;
import com.chint.infrastructure.util.BeanCopyUtils; import com.chint.infrastructure.util.BeanCopyUtils;
import com.chint.interfaces.rest.ly.LYSearchRequest;
import com.chint.interfaces.rest.ly.reconciliation.dto.BaseDetailParam; import com.chint.interfaces.rest.ly.reconciliation.dto.BaseDetailParam;
import com.chint.interfaces.rest.ly.reconciliation.dto.DetailResponse.CarStatement; import com.chint.interfaces.rest.ly.reconciliation.dto.DetailResponse.CarStatement;
import com.chint.interfaces.rest.ly.reconciliation.dto.DetailResponse.FlightStatement; import com.chint.interfaces.rest.ly.reconciliation.dto.DetailResponse.FlightStatement;
@ -48,8 +47,6 @@ public class LyStatementOrder {
@Autowired @Autowired
private JdbcLyOrderCarRecord jdbcLyOrderCarRecord; private JdbcLyOrderCarRecord jdbcLyOrderCarRecord;
@Autowired
private LYSearchRequest lySearchRequest;
/** /**
* 拉取保存数据 * 拉取保存数据
@ -120,7 +117,6 @@ public class LyStatementOrder {
!orderSerialNoList.contains(o.getBillOrderNo()) !orderSerialNoList.contains(o.getBillOrderNo())
).toList(); ).toList();
List<LyOrderFlightRecord> lyOrderFlightRecords = BeanCopyUtils.copyBeanList(statementOrderListNew, LyOrderFlightRecord.class); List<LyOrderFlightRecord> lyOrderFlightRecords = BeanCopyUtils.copyBeanList(statementOrderListNew, LyOrderFlightRecord.class);
//保存结算明细数据
jdbcLyOrderFlightRecord.saveAll(lyOrderFlightRecords); jdbcLyOrderFlightRecord.saveAll(lyOrderFlightRecords);
flightCount++; flightCount++;
} while (flightCount < flightPageCount); } while (flightCount < flightPageCount);
@ -145,13 +141,11 @@ public class LyStatementOrder {
!orderSerialNoList.contains(o.getBillOrderNo()) !orderSerialNoList.contains(o.getBillOrderNo())
).toList(); ).toList();
List<LyOrderHotelRecord> lyOrderHotelRecords = BeanCopyUtils.copyBeanList(statementOrderListNew, LyOrderHotelRecord.class); List<LyOrderHotelRecord> lyOrderHotelRecords = BeanCopyUtils.copyBeanList(statementOrderListNew, LyOrderHotelRecord.class);
//保存结算明细数据
jdbcLyOrderHotelRecord.saveAll(lyOrderHotelRecords); jdbcLyOrderHotelRecord.saveAll(lyOrderHotelRecords);
hotelCount++; hotelCount++;
} while (hotelCount < hotelPageCount); } while (hotelCount < hotelPageCount);
} }
/** /**
* 火车账单同步 * 火车账单同步
*/ */
@ -171,7 +165,6 @@ public class LyStatementOrder {
!orderSerialNoList.contains(o.getBillOrderNo()) !orderSerialNoList.contains(o.getBillOrderNo())
).toList(); ).toList();
List<LyOrderTrainRecord> lyOrderTrainRecords = BeanCopyUtils.copyBeanList(statementOrderListNew, LyOrderTrainRecord.class); List<LyOrderTrainRecord> lyOrderTrainRecords = BeanCopyUtils.copyBeanList(statementOrderListNew, LyOrderTrainRecord.class);
//保存结算明细数据
jdbcLyOrderTrainRecord.saveAll(lyOrderTrainRecords); jdbcLyOrderTrainRecord.saveAll(lyOrderTrainRecords);
trainCount++; trainCount++;
} while (trainCount < trainPageCount); } while (trainCount < trainPageCount);
@ -197,44 +190,10 @@ public class LyStatementOrder {
!orderSerialNoList.contains(o.getBillOrderNo()) !orderSerialNoList.contains(o.getBillOrderNo())
).toList(); ).toList();
List<LyOrderCarRecord> lyOrderCarRecords = BeanCopyUtils.copyBeanList(statementOrderListNew, LyOrderCarRecord.class); List<LyOrderCarRecord> lyOrderCarRecords = BeanCopyUtils.copyBeanList(statementOrderListNew, LyOrderCarRecord.class);
//保存结算明细数据
jdbcLyOrderCarRecord.saveAll(lyOrderCarRecords); jdbcLyOrderCarRecord.saveAll(lyOrderCarRecords);
carCount++; carCount++;
} while (carCount < carPageCount); } while (carCount < carPageCount);
} }
/* //保存需要的机票订单明细字段
private void saveLyOrderFlightDetail(List<LyOrderFlightRecord> lyOrderFlightRecords) {
lyOrderFlightRecords.forEach(lyOrderFlightRecord -> {
lySearchRequest.getFlightOrderDetail(lyOrderFlightRecord.getOrderSerialNo());
});
}
//保存需要的酒店订单明细字段
private void saveLyOrderHotelDetail(List<LyOrderHotelRecord> lyOrderHotelRecords) {
lyOrderHotelRecords.forEach(lyOrderHotelRecord -> {
lySearchRequest.getHotelOrderDetail(lyOrderHotelRecord.getOrderSerialNo());
});
}
//保存需要的火车订单明细字段
private void saveLyOrderTrainDetail(List<LyOrderTrainRecord> lyOrderTrainRecords) {
lyOrderTrainRecords.forEach(lyOrderTrainRecord -> {
lySearchRequest.getTrainOrderDetail(lyOrderTrainRecord.getOrderSerialNo());
});
}
//保存需要的用车订单明细字段
private void saveLyOrderCarDetail(List<LyOrderCarRecord> lyOrderCarRecords) {
lyOrderCarRecords.forEach(lyOrderCarRecord -> {
lySearchRequest.getCarDetailResponse(lyOrderCarRecord.getOrderSerialNo());
});
}*/
} }

View File

@ -1,7 +1,6 @@
package com.chint.domain.repository; package com.chint.domain.repository;
import com.chint.domain.aggregates.order.order_record.OrderCarRecord; import com.chint.domain.aggregates.order.order_record.OrderCarRecord;
import com.chint.domain.aggregates.order.order_record.OrderTrainRecord;
import com.chint.infrastructure.util.PageResult; import com.chint.infrastructure.util.PageResult;
import java.time.LocalDateTime; import java.time.LocalDateTime;
@ -13,9 +12,5 @@ public interface OrderCarRecordRepository {
Optional<OrderCarRecord> findByDetailId(String detailId); Optional<OrderCarRecord> findByDetailId(String detailId);
PageResult<OrderCarRecord> findByUpdateDataTime(LocalDateTime startTime, LocalDateTime endTime, PageResult<OrderCarRecord> findByUpdateDataTime(LocalDateTime startTime, LocalDateTime endTime, Integer pageSize, Integer pageNum ,String systemType);
Integer pageSize, Integer pageNum ,String systemType);
PageResult<OrderCarRecord> findBySystemTypeAndLastMonth(Integer pageSize,
Integer pageNum,
String systemType);
} }

View File

@ -17,8 +17,4 @@ public interface OrderFlightRecordRepository {
Integer pageSize, Integer pageSize,
Integer pageNum, Integer pageNum,
String systemType); String systemType);
PageResult<OrderFlightRecord> findBySystemTypeAndLastMonth(Integer pageSize,
Integer pageNum,
String systemType);
} }

View File

@ -1,7 +1,6 @@
package com.chint.domain.repository; package com.chint.domain.repository;
import com.chint.domain.aggregates.order.order_record.OrderCarRecord; import com.chint.domain.aggregates.order.order_record.OrderCarRecord;
import com.chint.domain.aggregates.order.order_record.OrderFlightRecord;
import com.chint.domain.aggregates.order.order_record.OrderHotelRecord; import com.chint.domain.aggregates.order.order_record.OrderHotelRecord;
import com.chint.infrastructure.util.PageResult; import com.chint.infrastructure.util.PageResult;
@ -14,10 +13,5 @@ public interface OrderHotelRecordRepository {
Optional<OrderHotelRecord> findByDetailId(String detailId); Optional<OrderHotelRecord> findByDetailId(String detailId);
PageResult<OrderHotelRecord> findByUpdateDataTime(LocalDateTime startTime, LocalDateTime endTime, PageResult<OrderHotelRecord> findByUpdateDataTime(LocalDateTime startTime, LocalDateTime endTime, Integer pageSize, Integer pageNum ,String systemType);
Integer pageSize, Integer pageNum ,String systemType);
PageResult<OrderHotelRecord> findBySystemTypeAndLastMonth(Integer pageSize,
Integer pageNum,
String systemType);
} }

View File

@ -14,10 +14,5 @@ public interface OrderTrainRecordRepository {
Optional<OrderTrainRecord> findByDetailId(String detailId); Optional<OrderTrainRecord> findByDetailId(String detailId);
PageResult<OrderTrainRecord> findByUpdateDataTime(LocalDateTime startTime, LocalDateTime endTime, PageResult<OrderTrainRecord> findByUpdateDataTime(LocalDateTime startTime, LocalDateTime endTime, Integer pageSize, Integer pageNum ,String systemType);
Integer pageSize, Integer pageNum ,String systemType);
PageResult<OrderTrainRecord> findBySystemTypeAndLastMonth(Integer pageSize,
Integer pageNum,
String systemType);
} }

View File

@ -1,23 +0,0 @@
package com.chint.domain.service;
import com.chint.domain.repository.OrderCarRecordRepository;
import com.chint.domain.repository.OrderFlightRecordRepository;
import com.chint.domain.repository.OrderHotelRecordRepository;
import com.chint.domain.repository.OrderTrainRecordRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class OrderRecordDomainService {
@Autowired
private OrderCarRecordRepository orderCarRecordRepository;
@Autowired
private OrderHotelRecordRepository orderHotelRecordRepository;
@Autowired
private OrderFlightRecordRepository orderFlightRecordRepository;
@Autowired
private OrderTrainRecordRepository orderTrainRecordRepository;
}

View File

@ -23,13 +23,11 @@ import com.chint.infrastructure.constant.LegConstant;
import com.chint.infrastructure.constant.RouteConstant; import com.chint.infrastructure.constant.RouteConstant;
import com.chint.infrastructure.echo_framework.dispatch.ResultContainer; import com.chint.infrastructure.echo_framework.dispatch.ResultContainer;
import com.chint.infrastructure.util.BaseContext; import com.chint.infrastructure.util.BaseContext;
import com.chint.infrastructure.util.OrderNo;
import com.chint.interfaces.rest.bpm.BPMRequest; import com.chint.interfaces.rest.bpm.BPMRequest;
import com.chint.interfaces.rest.bpm.dto.JTH3ChangeDto; import com.chint.interfaces.rest.bpm.dto.JTH3ChangeDto;
import com.chint.interfaces.rest.bpm.dto.XNChangeDto; import com.chint.interfaces.rest.bpm.dto.XNChangeDto;
import com.chint.interfaces.rest.bpm.dto.ZWChangeDto; import com.chint.interfaces.rest.bpm.dto.ZWChangeDto;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -88,10 +86,6 @@ public class LegEventHandler implements LegEventService {
@Autowired @Autowired
private OrderDomainService orderDomainService; private OrderDomainService orderDomainService;
@Value("${chint.envMark}")
private String envMark;
private DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); private DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
private DateTimeFormatter formatterWithT = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'hh:mm"); private DateTimeFormatter formatterWithT = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'hh:mm");
@ -136,16 +130,6 @@ public class LegEventHandler implements LegEventService {
String startTime = data.getStartTime(); String startTime = data.getStartTime();
String endTime = data.getEndTime(); String endTime = data.getEndTime();
//当sysCode为H3BPM的时候 实用单号更新行程规划单的单号
if (data.getSysCode().equals(H3_BPM)) {
String generate = OrderNo.generate(H3_BPM, data.getActualOrderNo());
if (!envMark.equals("prod")) {
routeOrder.setRouteOrderNo(generate + envMark);
} else {
routeOrder.setRouteOrderNo(generate);
}
}
if (startTime != null && endTime != null) { if (startTime != null && endTime != null) {
if (startTime.contains("T") && endTime.contains("T")) { if (startTime.contains("T") && endTime.contains("T")) {
//如果包含T就截取时间信息前10位 //如果包含T就截取时间信息前10位

View File

@ -3,7 +3,6 @@ package com.chint.infrastructure.repository;
import com.chint.domain.aggregates.order.order_record.OrderCarRecord; import com.chint.domain.aggregates.order.order_record.OrderCarRecord;
import com.chint.domain.repository.OrderCarRecordRepository; import com.chint.domain.repository.OrderCarRecordRepository;
import com.chint.infrastructure.repository.jdbc.JdbcOrderCarRecordRepository; import com.chint.infrastructure.repository.jdbc.JdbcOrderCarRecordRepository;
import com.chint.infrastructure.util.DateTimeUtil;
import com.chint.infrastructure.util.PageResult; import com.chint.infrastructure.util.PageResult;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
@ -41,17 +40,7 @@ public class OrderCarRecordRepositoryImpl implements OrderCarRecordRepository {
String systemType) { String systemType) {
PageRequest pageRequest = PageRequest.of(pageNum - 1, pageSize, Sort.by("update_data_time").descending()); PageRequest pageRequest = PageRequest.of(pageNum - 1, pageSize, Sort.by("update_data_time").descending());
Page<OrderCarRecord> byUpdateDataTimeBetween = orderCarRecordRepository Page<OrderCarRecord> byUpdateDataTimeBetween = orderCarRecordRepository
.findByBelongSysTypeAndUpdateDataTimeBetweenOrBelongSysTypeIsNullAndUpdateDataTimeBetween(systemType, .findByBelongSysTypeAndUpdateDataTimeBetween(systemType, startTime, endTime, pageRequest);
startTime, endTime, startTime, endTime, pageRequest);
return PageResult.totalPageNum(byUpdateDataTimeBetween.getTotalElements(), byUpdateDataTimeBetween.getContent()); return PageResult.totalPageNum(byUpdateDataTimeBetween.getTotalElements(), byUpdateDataTimeBetween.getContent());
} }
@Override
public PageResult<OrderCarRecord> findBySystemTypeAndLastMonth(Integer pageSize, Integer pageNum, String systemType) {
PageRequest pageRequest = PageRequest.of(pageNum - 1, pageSize, Sort.by("update_data_time").descending());
String lastMonth = DateTimeUtil.lastMonthStr();
Page<OrderCarRecord> res = orderCarRecordRepository.
findByBelongSysTypeAndAccountPeriodOrBelongSysTypeIsNullAndAccountPeriod(systemType, lastMonth, lastMonth, pageRequest);
return PageResult.totalPageNum(res.getTotalElements(), res.getContent());
}
} }

View File

@ -3,7 +3,6 @@ package com.chint.infrastructure.repository;
import com.chint.domain.aggregates.order.order_record.OrderFlightRecord; import com.chint.domain.aggregates.order.order_record.OrderFlightRecord;
import com.chint.domain.repository.OrderFlightRecordRepository; import com.chint.domain.repository.OrderFlightRecordRepository;
import com.chint.infrastructure.repository.jdbc.JdbcOrderFlightRecordRepository; import com.chint.infrastructure.repository.jdbc.JdbcOrderFlightRecordRepository;
import com.chint.infrastructure.util.DateTimeUtil;
import com.chint.infrastructure.util.PageResult; import com.chint.infrastructure.util.PageResult;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
@ -38,17 +37,8 @@ public class OrderFlightRecordRepositoryImpl implements OrderFlightRecordReposit
public PageResult<OrderFlightRecord> findByUpdateDataTime(LocalDateTime startTime, LocalDateTime endTime, Integer pageSize, Integer pageNum, String systemType) { public PageResult<OrderFlightRecord> findByUpdateDataTime(LocalDateTime startTime, LocalDateTime endTime, Integer pageSize, Integer pageNum, String systemType) {
PageRequest pageRequest = PageRequest.of(pageNum - 1, pageSize, Sort.by("update_data_time").descending()); PageRequest pageRequest = PageRequest.of(pageNum - 1, pageSize, Sort.by("update_data_time").descending());
Page<OrderFlightRecord> byUpdateDataTimeBetween = jdbcOrderFlightRecordRepository Page<OrderFlightRecord> byUpdateDataTimeBetween = jdbcOrderFlightRecordRepository
.findByBelongSysTypeAndUpdateDataTimeBetweenOrBelongSysTypeIsNullAndUpdateDataTimeBetween(systemType, .findByBelongSysTypeAndUpdateDataTimeBetween(systemType, startTime, endTime, pageRequest);
startTime, endTime, startTime, endTime, pageRequest);
return PageResult.totalPageNum(byUpdateDataTimeBetween.getTotalElements(), byUpdateDataTimeBetween.getContent()); return PageResult.totalPageNum(byUpdateDataTimeBetween.getTotalElements(), byUpdateDataTimeBetween.getContent());
} }
@Override
public PageResult<OrderFlightRecord> findBySystemTypeAndLastMonth(Integer pageSize, Integer pageNum, String systemType) {
PageRequest pageRequest = PageRequest.of(pageNum - 1, pageSize, Sort.by("update_data_time").descending());
String lastMonth = DateTimeUtil.lastMonthStr();
Page<OrderFlightRecord> res = jdbcOrderFlightRecordRepository.
findByBelongSysTypeAndAccountPeriodOrBelongSysTypeIsNullAndAccountPeriod(systemType, lastMonth, lastMonth, pageRequest);
return PageResult.totalPageNum(res.getTotalElements(), res.getContent());
}
} }

View File

@ -1,10 +1,11 @@
package com.chint.infrastructure.repository; package com.chint.infrastructure.repository;
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.repository.OrderHotelRecordRepository; import com.chint.domain.repository.OrderHotelRecordRepository;
import com.chint.infrastructure.repository.jdbc.JdbcOrderFlightRecordRepository;
import com.chint.infrastructure.repository.jdbc.JdbcOrderHotelRecordRepository; import com.chint.infrastructure.repository.jdbc.JdbcOrderHotelRecordRepository;
import com.chint.infrastructure.util.DateTimeUtil;
import com.chint.infrastructure.util.PageResult; import com.chint.infrastructure.util.PageResult;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
@ -22,7 +23,6 @@ public class OrderHotelRecordRepositoryImpl implements OrderHotelRecordRepositor
@Autowired @Autowired
private JdbcOrderHotelRecordRepository jdbcOrderHotelRecordRepository; private JdbcOrderHotelRecordRepository jdbcOrderHotelRecordRepository;
@Override @Override
public List<OrderHotelRecord> saveAll(List<OrderHotelRecord> orderHotelRecordList) { public List<OrderHotelRecord> saveAll(List<OrderHotelRecord> orderHotelRecordList) {
List<OrderHotelRecord> res = new ArrayList<>(); List<OrderHotelRecord> res = new ArrayList<>();
@ -36,20 +36,10 @@ public class OrderHotelRecordRepositoryImpl implements OrderHotelRecordRepositor
} }
@Override @Override
public PageResult<OrderHotelRecord> findByUpdateDataTime(LocalDateTime startTime, LocalDateTime endTime, Integer pageSize, Integer pageNum, String systemType) { public PageResult<OrderHotelRecord> findByUpdateDataTime(LocalDateTime startTime, LocalDateTime endTime, Integer pageSize, Integer pageNum ,String systemType) {
PageRequest pageRequest = PageRequest.of(pageNum - 1, pageSize, Sort.by("update_data_time").descending()); PageRequest pageRequest = PageRequest.of(pageNum - 1, pageSize, Sort.by("update_data_time").descending());
Page<OrderHotelRecord> byUpdateDataTimeBetween = jdbcOrderHotelRecordRepository Page<OrderHotelRecord> byUpdateDataTimeBetween = jdbcOrderHotelRecordRepository
.findByBelongSysTypeAndUpdateDataTimeBetweenOrBelongSysTypeIsNullAndUpdateDataTimeBetween(systemType, .findByBelongSysTypeAndUpdateDataTimeBetween(systemType, startTime, endTime, pageRequest);
startTime, endTime, startTime, endTime, pageRequest);
return PageResult.totalPageNum(byUpdateDataTimeBetween.getTotalElements(), byUpdateDataTimeBetween.getContent()); return PageResult.totalPageNum(byUpdateDataTimeBetween.getTotalElements(), byUpdateDataTimeBetween.getContent());
} }
@Override
public PageResult<OrderHotelRecord> findBySystemTypeAndLastMonth(Integer pageSize, Integer pageNum, String systemType) {
PageRequest pageRequest = PageRequest.of(pageNum - 1, pageSize, Sort.by("update_data_time").descending());
String lastMonth = DateTimeUtil.lastMonthStr();
Page<OrderHotelRecord> res = jdbcOrderHotelRecordRepository.
findByBelongSysTypeAndAccountPeriodOrBelongSysTypeIsNullAndAccountPeriod(systemType, lastMonth, lastMonth, pageRequest);
return PageResult.totalPageNum(res.getTotalElements(), res.getContent());
}
} }

View File

@ -1,9 +1,10 @@
package com.chint.infrastructure.repository; package com.chint.infrastructure.repository;
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.repository.OrderTrainRecordRepository; import com.chint.domain.repository.OrderTrainRecordRepository;
import com.chint.infrastructure.repository.jdbc.JdbcOrderHotelRecordRepository;
import com.chint.infrastructure.repository.jdbc.JdbcOrderTrainRecordRepository; import com.chint.infrastructure.repository.jdbc.JdbcOrderTrainRecordRepository;
import com.chint.infrastructure.util.DateTimeUtil;
import com.chint.infrastructure.util.PageResult; import com.chint.infrastructure.util.PageResult;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
@ -20,7 +21,6 @@ import java.util.Optional;
public class OrderTrainRecordRepositoryImpl implements OrderTrainRecordRepository { public class OrderTrainRecordRepositoryImpl implements OrderTrainRecordRepository {
@Autowired @Autowired
private JdbcOrderTrainRecordRepository jdbcOrderTrainRecordRepository; private JdbcOrderTrainRecordRepository jdbcOrderTrainRecordRepository;
@Override @Override
public List<OrderTrainRecord> saveAll(List<OrderTrainRecord> orderTrainRecordList) { public List<OrderTrainRecord> saveAll(List<OrderTrainRecord> orderTrainRecordList) {
List<OrderTrainRecord> res = new ArrayList<>(); List<OrderTrainRecord> res = new ArrayList<>();
@ -34,20 +34,10 @@ public class OrderTrainRecordRepositoryImpl implements OrderTrainRecordRepositor
} }
@Override @Override
public PageResult<OrderTrainRecord> findByUpdateDataTime(LocalDateTime startTime, LocalDateTime endTime, Integer pageSize, Integer pageNum, String systemType) { public PageResult<OrderTrainRecord> findByUpdateDataTime(LocalDateTime startTime, LocalDateTime endTime, Integer pageSize, Integer pageNum ,String systemType) {
PageRequest pageRequest = PageRequest.of(pageNum - 1, pageSize, Sort.by("update_data_time").descending()); PageRequest pageRequest = PageRequest.of(pageNum - 1, pageSize, Sort.by("update_data_time").descending());
Page<OrderTrainRecord> byUpdateDataTimeBetween = jdbcOrderTrainRecordRepository Page<OrderTrainRecord> byUpdateDataTimeBetween = jdbcOrderTrainRecordRepository
.findByBelongSysTypeAndUpdateDataTimeBetweenOrBelongSysTypeIsNullAndUpdateDataTimeBetween(systemType, .findByBelongSysTypeAndUpdateDataTimeBetween(systemType, startTime, endTime, pageRequest);
startTime, endTime, startTime, endTime, pageRequest);
return PageResult.totalPageNum(byUpdateDataTimeBetween.getTotalElements(), byUpdateDataTimeBetween.getContent()); return PageResult.totalPageNum(byUpdateDataTimeBetween.getTotalElements(), byUpdateDataTimeBetween.getContent());
} }
@Override
public PageResult<OrderTrainRecord> findBySystemTypeAndLastMonth(Integer pageSize, Integer pageNum, String systemType) {
PageRequest pageRequest = PageRequest.of(pageNum - 1, pageSize, Sort.by("update_data_time").descending());
String lastMonth = DateTimeUtil.lastMonthStr();
Page<OrderTrainRecord> res = jdbcOrderTrainRecordRepository.
findByBelongSysTypeAndAccountPeriodOrBelongSysTypeIsNullAndAccountPeriod(systemType, lastMonth, lastMonth, pageRequest);
return PageResult.totalPageNum(res.getTotalElements(), res.getContent());
}
} }

View File

@ -15,8 +15,4 @@ public interface JdbcOrderCarRecordRepository extends CrudRepository<OrderCarRec
Optional<OrderCarRecord> findByDetailId(String detailId); Optional<OrderCarRecord> findByDetailId(String detailId);
Page<OrderCarRecord> findByBelongSysTypeAndUpdateDataTimeBetween(String belongSysType, LocalDateTime updateDataTime, LocalDateTime updateDataTime2, Pageable pageable); Page<OrderCarRecord> findByBelongSysTypeAndUpdateDataTimeBetween(String belongSysType, LocalDateTime updateDataTime, LocalDateTime updateDataTime2, Pageable pageable);
Page<OrderCarRecord> findByBelongSysTypeAndAccountPeriodOrBelongSysTypeIsNullAndAccountPeriod(String belongSysType, String accountPeriod, String accountPeriod2, Pageable pageable);
Page<OrderCarRecord> findByBelongSysTypeAndUpdateDataTimeBetweenOrBelongSysTypeIsNullAndUpdateDataTimeBetween(String belongSysType, LocalDateTime updateDataTime, LocalDateTime updateDataTime2, LocalDateTime updateDataTime3, LocalDateTime updateDataTime4, Pageable pageable);
} }

View File

@ -14,7 +14,4 @@ public interface JdbcOrderFlightRecordRepository extends CrudRepository<OrderFli
Optional<OrderFlightRecord> findByDetailId(String detailId); Optional<OrderFlightRecord> findByDetailId(String detailId);
Page<OrderFlightRecord> findByBelongSysTypeAndUpdateDataTimeBetween(String belongSysType, LocalDateTime updateDataTime, LocalDateTime updateDataTime2, Pageable pageable); Page<OrderFlightRecord> findByBelongSysTypeAndUpdateDataTimeBetween(String belongSysType, LocalDateTime updateDataTime, LocalDateTime updateDataTime2, Pageable pageable);
Page<OrderFlightRecord> findByBelongSysTypeAndAccountPeriodOrBelongSysTypeIsNullAndAccountPeriod(String belongSysType, String accountPeriod, String accountPeriod2, Pageable pageable);
Page<OrderFlightRecord> findByBelongSysTypeAndUpdateDataTimeBetweenOrBelongSysTypeIsNullAndUpdateDataTimeBetween(String belongSysType, LocalDateTime updateDataTime, LocalDateTime updateDataTime2, LocalDateTime updateDataTime3, LocalDateTime updateDataTime4, Pageable pageable);
} }

View File

@ -15,8 +15,4 @@ public interface JdbcOrderHotelRecordRepository extends CrudRepository<OrderHote
Optional<OrderHotelRecord> findByDetailId(String detailId); Optional<OrderHotelRecord> findByDetailId(String detailId);
Page<OrderHotelRecord> findByBelongSysTypeAndUpdateDataTimeBetween(String belongSysType, LocalDateTime updateDataTime, LocalDateTime updateDataTime2, Pageable pageable); Page<OrderHotelRecord> findByBelongSysTypeAndUpdateDataTimeBetween(String belongSysType, LocalDateTime updateDataTime, LocalDateTime updateDataTime2, Pageable pageable);
Page<OrderHotelRecord> findByBelongSysTypeAndAccountPeriodOrBelongSysTypeIsNullAndAccountPeriod(String belongSysType, String accountPeriod, String accountPeriod2, Pageable pageable);
Page<OrderHotelRecord> findByBelongSysTypeAndUpdateDataTimeBetweenOrBelongSysTypeIsNullAndUpdateDataTimeBetween(String belongSysType, LocalDateTime updateDataTime, LocalDateTime updateDataTime2, LocalDateTime updateDataTime3, LocalDateTime updateDataTime4, Pageable pageable);
} }

View File

@ -14,7 +14,4 @@ public interface JdbcOrderTrainRecordRepository extends CrudRepository<OrderTrai
Optional<OrderTrainRecord> findByDetailId(String detailId); Optional<OrderTrainRecord> findByDetailId(String detailId);
Page<OrderTrainRecord> findByBelongSysTypeAndUpdateDataTimeBetween(String belongSysType, LocalDateTime updateDataTime, LocalDateTime updateDataTime2, Pageable pageable); Page<OrderTrainRecord> findByBelongSysTypeAndUpdateDataTimeBetween(String belongSysType, LocalDateTime updateDataTime, LocalDateTime updateDataTime2, Pageable pageable);
Page<OrderTrainRecord> findByBelongSysTypeAndAccountPeriodOrBelongSysTypeIsNullAndAccountPeriod(String belongSysType, String accountPeriod, String accountPeriod2, Pageable pageable);
Page<OrderTrainRecord> findByBelongSysTypeAndUpdateDataTimeBetweenOrBelongSysTypeIsNullAndUpdateDataTimeBetween(String belongSysType, LocalDateTime updateDataTime, LocalDateTime updateDataTime2, LocalDateTime updateDataTime3, LocalDateTime updateDataTime4, Pageable pageable);
} }

View File

@ -1,9 +1,7 @@
package com.chint.infrastructure.util; package com.chint.infrastructure.util;
import java.time.Instant;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.YearMonth; import java.time.YearMonth;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
public class DateTimeUtil { public class DateTimeUtil {
@ -16,11 +14,6 @@ public class DateTimeUtil {
private final static DateTimeFormatter formatterDateYYYYMMDD = DateTimeFormatter.ofPattern("yyyyMMdd"); private final static DateTimeFormatter formatterDateYYYYMMDD = DateTimeFormatter.ofPattern("yyyyMMdd");
public static String timeFromInstant(Long instant) {
LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(instant), ZoneId.systemDefault());
return formatter.format(localDateTime);
}
public static String timeToStr(LocalDateTime input) { public static String timeToStr(LocalDateTime input) {
return input.format(formatterDate); return input.format(formatterDate);
} }
@ -60,13 +53,4 @@ public class DateTimeUtil {
return yearMonth.atEndOfMonth().atTime(23, 59, 59); return yearMonth.atEndOfMonth().atTime(23, 59, 59);
} }
public static String lastMonthStr() {
// 获取当前日期和时间
LocalDateTime currentDateTime = LocalDateTime.now();
// 获取上个月的同一时间
LocalDateTime lastMonthDateTime = currentDateTime.minusMonths(1);
// 指定所需格式
// 格式化日期时间
return lastMonthDateTime.format(formatterDateYYYYMM);
}
} }

View File

@ -55,35 +55,25 @@ public class CTripOrderRecordAutoSave {
.map(it -> { .map(it -> {
//对数据库进行查找 如果发现已经存在 就使用查找出来的 //对数据库进行查找 如果发现已经存在 就使用查找出来的
OrderFlightResponse.FlightOrderSettlementBaseInfo orderSettlementBaseInfo = it.getOrderSettlementBaseInfo(); OrderFlightResponse.FlightOrderSettlementBaseInfo orderSettlementBaseInfo = it.getOrderSettlementBaseInfo();
OrderFlightResponse.FlightTripRecordInfo flightTripRecordInfo = it.getFlightTripRecordInfo();
CTripFlightRecord record = cTripOrderDetailRepository.findFlightRecordByRecordId( CTripFlightRecord record = cTripOrderDetailRepository.findFlightRecordByRecordId(
String.valueOf(orderSettlementBaseInfo.getRecordID())); String.valueOf(orderSettlementBaseInfo.getRecordID()));
if (record == null) { if (record == null) {
record = CTripFlightRecord.of( record = CTripFlightRecord.of(
CTripFlightRecordBase.changeInfo(orderSettlementBaseInfo), CTripFlightRecordBase.changeInfo(orderSettlementBaseInfo),
CTripFlightInfo.of(it.getOrderFlightInfo()), CTripFlightInfo.of(it.getOrderFlightInfo()),
CTripFlightBaseInfo.of(it.getOrderBaseInfo()), CTripFlightBaseInfo.of(it.getOrderBaseInfo())
CTripFlightTripInfo.of(flightTripRecordInfo)); );
} else { } else {
Long originId = record.getId(); Long originId = record.getId();
record = CTripFlightRecord.of( record = CTripFlightRecord.of(
CTripFlightRecordBase.changeInfo(orderSettlementBaseInfo), CTripFlightRecordBase.changeInfo(orderSettlementBaseInfo),
CTripFlightInfo.of(it.getOrderFlightInfo()), CTripFlightInfo.of(it.getOrderFlightInfo()),
CTripFlightBaseInfo.of(it.getOrderBaseInfo()), CTripFlightBaseInfo.of(it.getOrderBaseInfo()));
CTripFlightTripInfo.of(flightTripRecordInfo));
record.setId(originId); record.setId(originId);
} }
if (it.getOrderPrintDetailInfo() != null) {
record.printInfo(CTripFlightPrintInfo.of(it.getOrderPrintDetailInfo()));
}
//补充额外的字段 //补充额外的字段
OrderFlightResponse.FlightOrderBaseInfo orderBaseInfo = it.getOrderBaseInfo(); OrderFlightResponse.FlightOrderBaseInfo orderBaseInfo = it.getOrderBaseInfo();
record.setRouteOrderNo(orderBaseInfo.getJourneyID()); record.setRouteOrderNo(orderBaseInfo.getJourneyID());
OrderFlightResponse.FlightOrderPassenger orderPassengerInfo = it.getOrderPassengerInfo();
if(orderPassengerInfo != null){
record.setTicketNo(orderPassengerInfo.getTicketNo());
}
return record; return record;
}).toList(); }).toList();
cTripOrderDetailRepository.saveAllCTripFlightRecord(cTripFlightRecords); cTripOrderDetailRepository.saveAllCTripFlightRecord(cTripFlightRecords);
@ -130,7 +120,7 @@ public class CTripOrderRecordAutoSave {
public void cTripTrainRecordAutoSave(Optional<String> date) { public void cTripTrainRecordAutoSave(Optional<String> date) {
OrderTrainResponse trainOrder = date OrderTrainResponse trainOrder = date
.flatMap(it -> Optional.ofNullable(cTripOrderDetailRequest.getTrainOrderByDate(it))) .flatMap(it -> Optional.ofNullable(cTripOrderDetailRequest.getTrainOrderByDate(it)))
.orElseGet(() -> cTripOrderDetailRequest.getTrainOrder()); .orElseGet(() -> cTripOrderDetailRequest.getTrainOrder());
@ -160,7 +150,7 @@ public class CTripOrderRecordAutoSave {
} }
public void cTripCarRecordAutoSave(Optional<String> date) { public void cTripCarRecordAutoSave(Optional<String> date) {
OrderCarResponse carOrder = date OrderCarResponse carOrder = date
.flatMap(it -> Optional.ofNullable(cTripOrderDetailRequest.getCarOrderByDate(it))) .flatMap(it -> Optional.ofNullable(cTripOrderDetailRequest.getCarOrderByDate(it)))
.orElseGet(() -> cTripOrderDetailRequest.getCarOrder()); .orElseGet(() -> cTripOrderDetailRequest.getCarOrder());

View File

@ -55,7 +55,6 @@ import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static com.chint.infrastructure.constant.LocationConstant.*; import static com.chint.infrastructure.constant.LocationConstant.*;
import static com.chint.infrastructure.util.DateTimeUtil.lastMonthStr;
@Slf4j @Slf4j
@SpringBootTest @SpringBootTest
@ -1250,10 +1249,9 @@ class RouteApplicationTests {
orderDomainService.checkCompanyNameIfBlack("乐清正泰电器销售有限公司"); orderDomainService.checkCompanyNameIfBlack("乐清正泰电器销售有限公司");
} }
@Test // @Test
void testSplid(){ void testSplid(){
String str = "20240301"; String str = "20240301";
System.out.println(str.substring(0, 5)); System.out.println(str.substring(0, 5));
System.out.println(lastMonthStr());
} }
} }