diff --git a/src/main/java/com/chint/domain/aggregates/order/order_record/OrderCarRecord.java b/src/main/java/com/chint/domain/aggregates/order/order_record/OrderCarRecord.java index 158ae546..03b1bd51 100644 --- a/src/main/java/com/chint/domain/aggregates/order/order_record/OrderCarRecord.java +++ b/src/main/java/com/chint/domain/aggregates/order/order_record/OrderCarRecord.java @@ -61,4 +61,115 @@ public class OrderCarRecord extends OrderBaseRecord { private String projectOrderNo; // 项目订单号 private String offlineCcomyCode; // 成本中心 private String orderSource; // 预订来源:线上/线下 + + + //添加行程信息 + public OrderCarRecord loadTravelInfo(String startTime, + String arriveTime, + String fromCity, + String toCity + ) { + // 行程信息 + this.setFromCity(fromCity); + this.setToCity(toCity); + this.setStartTime(startTime); + this.setArriveTime(arriveTime); + return this; + } + + // 加载订单基本信息 + public OrderCarRecord loadBasicOrderInfo(String orderNo, + String orderStatus, + String createTime) { + this.setOrderNo(orderNo); + this.setOrderStatus(orderStatus); + this.setCreateTime(createTime); + return this; + } + + // 加载车型和运行信息 + public OrderCarRecord loadVehicleAndTravelInfo(String carType, + String runTime, + String miles) { + this.setCarType(carType); + this.setRunTime(runTime); + this.setMiles(miles); + return this; + } + + // 加载财务信息 + public OrderCarRecord loadFinancialInfo(String accountCompanyId, + String accountCompanyName, + String accountPeriod, + String billNo, + String orderAmount) { + this.setAccountCompanyId(accountCompanyId); + this.setAccountCompanyName(accountCompanyName); + this.setAccountPeriod(accountPeriod); + this.setBillNo(billNo); + this.setOrderAmount(orderAmount); + return this; + } + + // 加载费用细节 + public OrderCarRecord loadFeeDetails(String noTaxAmt, + String taxAmt, + String serviceCost, + String cancelCost, + String highSpeedAmt, + String highSpeedName) { + this.setNoTaxAmt(noTaxAmt); + this.setTaxAmt(taxAmt); + this.setServiceCost(serviceCost); + this.setCancelCost(cancelCost); + this.setHighSpeedAmt(highSpeedAmt); + this.setHighSpeedName(highSpeedName); + return this; + } + + // 加载付款和项目信息 + public OrderCarRecord loadPaymentAndProjectInfo(String paymentType, + String comyPayAmt) { + this.setPaymentType(paymentType); + this.setComyPayAmt(comyPayAmt); + return this; + } + + // 加载组织架构信息 + public OrderCarRecord loadOrganizationalInfo(String bookOrgCode1, + String bookOrgCode2, + String bookOrgCode3) { + this.setBookOrgCode1(bookOrgCode1); + this.setBookOrgCode2(bookOrgCode2); + this.setBookOrgCode3(bookOrgCode3); + return this; + } + + // 加载来源和系统归属信息, 线上线下 + public OrderCarRecord loadSourceAndSystemInfo(String orderSource) { + this.setOrderSource(orderSource); + return this; + } + + // 加载超标信息 + public OrderCarRecord loadComplianceInfo(String overStandard, + String overStandardReason) { + this.setOverStandard(overStandard); + this.setOverStandardReason(overStandardReason); + return this; + } + + // 加载关联订单信息 + public OrderCarRecord loadRelatedOrderInfo(Long orderDetailId, + String detailId, + String receiptsNum, + String parentOrderNo, + String originalOrderNo) { + this.setOrderDetailId(orderDetailId); + this.setDetailId(detailId); + this.setReceiptsNum(receiptsNum); + this.setParentOrderNo(parentOrderNo); + this.setOriginalOrderNo(originalOrderNo); + return this; + } } \ No newline at end of file diff --git a/src/main/java/com/chint/domain/aggregates/order/order_record/OrderFlightRecord.java b/src/main/java/com/chint/domain/aggregates/order/order_record/OrderFlightRecord.java index c18cdf3c..02b2fde8 100644 --- a/src/main/java/com/chint/domain/aggregates/order/order_record/OrderFlightRecord.java +++ b/src/main/java/com/chint/domain/aggregates/order/order_record/OrderFlightRecord.java @@ -75,4 +75,119 @@ public class OrderFlightRecord extends OrderBaseRecord{ private String bookOrgCode3; // 出行人组织架构信息3 private String projectOrderNo; // 项目订单号 private String offlineCcomyCode; // 成本中心 + + // 加载基础订单信息 + public OrderFlightRecord loadBasicOrderInfo(Long id, String orderNo, String orderStatus, String createTime) { + this.setId(id); + this.setOrderNo(orderNo); +// this.setOrderStatus(orderStatus); +// this.setCreateTime(createTime); + return this; + } + + // 加载航班信息 + public OrderFlightRecord loadFlightInfo(String flightNum, String startAirportName, String endAirportName, + String startCityName, String endCityName, String startTime, String endTime) { + this.setFlightNum(flightNum); + this.setStartAirportName(startAirportName); + this.setEndAirportName(endAirportName); + this.setStartCityName(startCityName); + this.setEndCityName(endCityName); + this.setStartTime(startTime); + this.setEndTime(endTime); + return this; + } + + // 加载预订与乘机人信息 + public OrderFlightRecord loadBookingAndPassengerInfo(String bookingUserCode, String bookingName, String userName, String userCode) { + this.setBookingUserCode(bookingUserCode); + this.setBookingName(bookingName); + this.setUserName(userName); + this.setUserCode(userCode); + return this; + } + + // 加载财务与价格信息 + public OrderFlightRecord loadFinancialAndPricingInfo(String accountCompanyId, String accountCompanyName, + String accountPeriod, String billNo, String orderAmount, + String facePrice, String noTaxAmt, String taxAmt) { + this.setAccountCompanyId(accountCompanyId); + this.setAccountCompanyName(accountCompanyName); + this.setAccountPeriod(accountPeriod); + this.setBillNo(billNo); + this.setOrderAmount(orderAmount); + this.setFacePrice(facePrice); + this.setNoTaxAmt(noTaxAmt); + this.setTaxAmt(taxAmt); + return this; + } + + // 加载额外费用信息 + public OrderFlightRecord loadExtraFeeInfo(String serviceFee, String airportTax, String fuelTax, + String changeFee, String refundFee) { + this.setPreServiceFee(serviceFee); + this.setAirportTax(airportTax); + this.setFuelTax(fuelTax); + this.setChangeFee(changeFee); + this.setRefundFee(refundFee); + return this; + } + + // 加载航班额外细节 + public OrderFlightRecord loadFlightExtraDetails(String ycabinFullPrice, String seatDiscount, String policyLowestPrice, + String issueTicketTime, String flightLowestPrice, String useStatus, + String upFee, String postServiceFee, String endAirportCode, String endTerminal) { + this.setYcabinFullPrice(ycabinFullPrice); + this.setSeatDiscount(seatDiscount); + this.setPolicyLowestPrice(policyLowestPrice); + this.setIssueTicketTime(issueTicketTime); + this.setFlightLowestPrice(flightLowestPrice); + this.setUseStatus(useStatus); + this.setUpFee(upFee); + this.setPostServiceFee(postServiceFee); + this.setEndAirportCode(endAirportCode); + this.setEndTerminal(endTerminal); + return this; + } + + // 加载组织架构与项目信息 + public OrderFlightRecord loadOrganizationalAndProjectInfo(String bookOrgCode1, String bookOrgCode2, String bookOrgCode3, + String projectOrderNo, String offlineCcomyCode) { + this.setBookOrgCode1(bookOrgCode1); + this.setBookOrgCode2(bookOrgCode2); + this.setBookOrgCode3(bookOrgCode3); + this.setProjectOrderNo(projectOrderNo); + this.setOfflineCcomyCode(offlineCcomyCode); + return this; + } + + // 加载来源和系统归属信息 + public OrderFlightRecord loadSourceAndSystemInfo(String trvaleSysType, String belongSysType, String orderSource) { + this.setTrvaleSysType(trvaleSysType); + this.setBelongSysType(belongSysType); + this.setOrderSource(orderSource); + return this; + } + + // 加载违规信息 + public OrderFlightRecord loadComplianceInfo(String overStandard, String overStandardReason) { + this.setOverStandard(overStandard); + this.setOverStandardReason(overStandardReason); + return this; + } + + // 加载航班细节 + public OrderFlightRecord loadFlightDetails(String seatPoint, String seatPointName, String distance, String flightCompName) { + this.setSeatPoint(seatPoint); + this.setSeatPointName(seatPointName); + this.setDistance(distance); + this.setFlightCompName(flightCompName); + return this; + } + + // 加载未预订最低价原因 + public OrderFlightRecord loadNotLowReason(String notLowReason) { + this.setNotLowReason(notLowReason); + return this; + } } \ No newline at end of file diff --git a/src/main/java/com/chint/domain/aggregates/order/order_record/OrderHotelRecord.java b/src/main/java/com/chint/domain/aggregates/order/order_record/OrderHotelRecord.java index 54fdf380..0af6af59 100644 --- a/src/main/java/com/chint/domain/aggregates/order/order_record/OrderHotelRecord.java +++ b/src/main/java/com/chint/domain/aggregates/order/order_record/OrderHotelRecord.java @@ -72,4 +72,132 @@ public class OrderHotelRecord extends OrderBaseRecord{ private String bookOrgCode3; // 入住人组织架构信息3 private String projectOrderNo; // 项目订单号 private String offlineCcomyCode; // 成本中心 + + // 加载基础订单信息 + public OrderHotelRecord loadBasicOrderInfo(Long id, String orderNo, String orderStatus, String createTime) { + this.setId(id); + this.setOrderNo(orderNo); +// this.setOrderStatus(orderStatus); +// this.setCreateTime(createTime); + return this; + } + + // 加载酒店和入住信息 + public OrderHotelRecord loadHotelAndStayInfo(String hotelName, String hotelAddress, String checkInDate, String departureDate, + int roomCount, String roomTypeName, String country, String province, String checkInCity) { + this.setHotelName(hotelName); + this.setHotelAddress(hotelAddress); + this.setCheckInDate(checkInDate); + this.setDepartureDate(departureDate); + this.setRoomCount(roomCount); + this.setRoomTypeName(roomTypeName); + this.setCountry(country); + this.setProvince(province); + this.setCheckInCity(checkInCity); + return this; + } + + // 加载预订人和入住人信息 + public OrderHotelRecord loadBookerAndGuestInfo(String bookingUserCode, String bookingName, String userName, String userCode) { + this.setBookingUserCode(bookingUserCode); + this.setBookingName(bookingName); + this.setUserName(userName); + this.setUserCode(userCode); + return this; + } + + // 加载财务信息 + public OrderHotelRecord loadFinancialInfo(String accountCompanyId, String accountCompanyName, String accountPeriod, String billNo, + String orderAmount, String noTaxAmt, String taxAmt, String companyAmount, String personalAmount) { + this.setAccountCompanyId(accountCompanyId); + this.setAccountCompanyName(accountCompanyName); + this.setAccountPeriod(accountPeriod); + this.setBillNo(billNo); + this.setOrderAmount(orderAmount); + this.setNoTaxAmt(noTaxAmt); + this.setTaxAmt(taxAmt); + this.setCompanyAmount(companyAmount); + this.setPersonalAmount(personalAmount); + return this; + } + + // 加载支付和服务费信息 + public OrderHotelRecord loadPaymentAndServiceFeeInfo(int paymentType, String unifiedPayAmt, String personalPayAmt) { + this.setPaymentType(paymentType); + this.setUnifiedPayAmt(unifiedPayAmt); + this.setPersonalPayAmt(personalPayAmt); + return this; + } + + // 加载酒店品牌和星级信息 + public OrderHotelRecord loadBrandAndStarRateInfo(String brandGroup, String brandName, String starRate) { + this.setBrandGroup(brandGroup); + this.setBrandName(brandName); + this.setStarRate(starRate); + return this; + } + + // 加载订单来源和系统归属信息 + public OrderHotelRecord loadSourceAndSystemInfo(String trvaleSysType, String belongSysType, String orderSource) { + this.setTrvaleSysType(trvaleSysType); + this.setBelongSysType(belongSysType); + this.setOrderSource(orderSource); + return this; + } + + // 加载违规信息 + public OrderHotelRecord loadComplianceInfo(int overStandard, String overStandardReason) { + this.setOverStandard(overStandard); + this.setOverStandardReason(overStandardReason); + return this; + } + + // 加载组织架构和项目信息 + public OrderHotelRecord loadOrganizationalAndProjectInfo(String bookOrgCode1, String bookOrgCode2, String bookOrgCode3, + String projectOrderNo, String offlineCcomyCode) { + this.setBookOrgCode1(bookOrgCode1); + this.setBookOrgCode2(bookOrgCode2); + this.setBookOrgCode3(bookOrgCode3); + this.setProjectOrderNo(projectOrderNo); + this.setOfflineCcomyCode(offlineCcomyCode); + return this; + } + + // 加载订单详情和结算信息 + public OrderHotelRecord loadOrderDetailAndSettlementInfo(Long orderDetailId, String detailId, String ticketClerk, + String receiptsNum, String parentOrderNo, String originalOrderNo) { + this.setOrderDetailId(orderDetailId); + this.setDetailId(detailId); + this.setTicketClerk(ticketClerk); + this.setReceiptsNum(receiptsNum); + this.setParentOrderNo(parentOrderNo); + this.setOriginalOrderNo(originalOrderNo); + return this; + } + + // 加载房间和早餐信息 + public OrderHotelRecord loadRoomAndBreakfastInfo(String includeAmount, int isAgreement, int roomNightCount, + int nightCount, String roomPrice, String roomRate) { + this.setIncludeAmount(includeAmount); + this.setIsAgreement(isAgreement); + this.setRoomNightCount(roomNightCount); + this.setNightCount(nightCount); + this.setRoomPrice(roomPrice); + this.setRoomRate(roomRate); + return this; + } + + // 加载发票和费用信息 + public OrderHotelRecord loadInvoiceAndFeeInfo(String invoiceType, String invoiceFee, String custodayFee, + String noTaxCusFee, String taxCusFee) { + this.setInvoiceType(invoiceType); + this.setInvoiceFee(invoiceFee); + this.setCustodayFee(custodayFee); + this.setNoTaxCusFee(noTaxCusFee); + this.setTaxCusFee(taxCusFee); + return this; + } + + + } \ No newline at end of file diff --git a/src/main/java/com/chint/domain/aggregates/order/order_record/OrderTrainRecord.java b/src/main/java/com/chint/domain/aggregates/order/order_record/OrderTrainRecord.java index 5c50fd5a..3e68a3c7 100644 --- a/src/main/java/com/chint/domain/aggregates/order/order_record/OrderTrainRecord.java +++ b/src/main/java/com/chint/domain/aggregates/order/order_record/OrderTrainRecord.java @@ -71,4 +71,119 @@ public class OrderTrainRecord extends OrderBaseRecord{ private String passportType; // 乘客证件类型 private String trainTime; // 发车时间 yyyy-MM-dd HH:‌mm:ss private String yxId; // 影像比对ID + + // 加载基础订单信息 + public OrderTrainRecord loadBasicOrderInfo(Long id, String orderNo, String orderStatus, String createTime) { + this.setId(id); + this.setOrderNo(orderNo); +// this.setOrderStatus(orderStatus); +// this.setCreateTime(createTime); + return this; + } + + // 加载结算和账户信息 + public OrderTrainRecord loadSettlementAndAccountInfo(String detailId, String accountCompanyId, String accountCompanyName, + String accountPeriod, String billNo) { + this.setDetailId(detailId); + this.setAccountCompanyId(accountCompanyId); + this.setAccountCompanyName(accountCompanyName); + this.setAccountPeriod(accountPeriod); + this.setBillNo(billNo); + return this; + } + + // 加载行程和时间信息 + public OrderTrainRecord loadTravelAndTimeInfo(String startDate, String arriveDate, String fromCity, String toCity, + String fromStationName, String toStationName, String trainNo, String trainTime, String runTime) { + this.setStartDate(startDate); + this.setArriveDate(arriveDate); + this.setFromCity(fromCity); + this.setToCity(toCity); + this.setFromStationName(fromStationName); + this.setToStationName(toStationName); + this.setTrainNo(trainNo); + this.setTrainTime(trainTime); + this.setRunTime(runTime); + return this; + } + + // 加载预订人和出行人信息 + public OrderTrainRecord loadBookingAndTravelerInfo(String bookingUserCode, String bookingName, String userCode, + String userName, String travelUserPhone, String travelUserSex, + String travelUserType, String travelUserBirthday) { + this.setBookingUserCode(bookingUserCode); + this.setBookingName(bookingName); + this.setUserCode(userCode); + this.setUserName(userName); + this.setTravelUserPhone(travelUserPhone); + this.setTravelUserSex(travelUserSex); + this.setTravelUserType(travelUserType); + this.setTravelUserBirthday(travelUserBirthday); + return this; + } + + // 加载费用信息 + public OrderTrainRecord loadFeeInfo(String orderAmount, String noTaxAmt, String taxAmt, String bookFee, + String collFee, String noTaxFeeAmt, String taxFeeAmt) { + this.setOrderAmount(orderAmount); + this.setNoTaxAmt(noTaxAmt); + this.setTaxAmt(taxAmt); + this.setBookFee(bookFee); + this.setCollFee(collFee); + this.setNoTaxFeeAmt(noTaxFeeAmt); + this.setTaxFeeAmt(taxFeeAmt); + return this; + } + + // 加载变更和退款信息 + public OrderTrainRecord loadChangeAndRefundInfo(String changeAddAmount, String changeCost, String changeReturnAmount, + String returnCost, String returnRes, String returnFee) { + this.setChangeAddAmount(changeAddAmount); + this.setChangeCost(changeCost); + this.setChangeReturnAmount(changeReturnAmount); + this.setReturnCost(returnCost); + this.setReturnRes(returnRes); + this.setReturnFee(returnFee); + return this; + } + + // 加载乘客证件信息 + public OrderTrainRecord loadPassengerDocumentInfo(String passportNo, String passportType) { + this.setPassportNo(passportNo); + this.setPassportType(passportType); + return this; + } + + // 加载来源和系统归属信息 + public OrderTrainRecord loadSourceAndSystemInfo(String trvaleSysType, String belongSysType, String orderSource) { + this.setTrvaleSysType(trvaleSysType); + this.setBelongSysType(belongSysType); + this.setOrderSource(orderSource); + return this; + } + + // 加载组织架构和项目信息 + public OrderTrainRecord loadOrganizationalAndProjectInfo(String bookOrgCode1, String bookOrgCode2, String bookOrgCode3, + String projectOrderNo, String offlineCcomyCode) { + this.setBookOrgCode1(bookOrgCode1); + this.setBookOrgCode2(bookOrgCode2); + this.setBookOrgCode3(bookOrgCode3); + this.setProjectOrderNo(projectOrderNo); + this.setOfflineCcomyCode(offlineCcomyCode); + return this; + } + + // 加载违规信息 + public OrderTrainRecord loadComplianceInfo(String overStandard, String overStandardReason) { + this.setOverStandard(overStandard); + this.setOverStandardReason(overStandardReason); + return this; + } + + // 加载座位和额外信息 + public OrderTrainRecord loadSeatAndExtraInfo(String seatType, String yxId) { + this.setSeatType(seatType); + this.setYxId(yxId); + return this; + } } \ No newline at end of file diff --git a/src/main/java/com/chint/domain/factoriy/order_record/CTripOrderRecordExtensionFactory.java b/src/main/java/com/chint/domain/factoriy/order_record/CTripOrderRecordExtensionFactory.java index a11d292f..1c5744b2 100644 --- a/src/main/java/com/chint/domain/factoriy/order_record/CTripOrderRecordExtensionFactory.java +++ b/src/main/java/com/chint/domain/factoriy/order_record/CTripOrderRecordExtensionFactory.java @@ -1,14 +1,13 @@ package com.chint.domain.factoriy.order_record; -import com.chint.domain.aggregates.order.CarOrderDetail; -import com.chint.domain.aggregates.order.FlightOrderDetail; -import com.chint.domain.aggregates.order.HotelOrderDetail; -import com.chint.domain.aggregates.order.TrainOrderDetail; +import cn.hutool.core.bean.BeanUtil; +import com.chint.domain.aggregates.order.*; import com.chint.domain.aggregates.order.order_record.OrderCarRecord; import com.chint.domain.aggregates.order.order_record.OrderFlightRecord; import com.chint.domain.aggregates.order.order_record.OrderHotelRecord; import com.chint.domain.aggregates.order.order_record.OrderTrainRecord; import com.chint.domain.aggregates.order.order_record.ctrip_order_record.CTripCarRecord; +import com.chint.domain.repository.RouteRepository; import com.chint.domain.service.OrderDetailDomainService; import com.chint.infrastructure.repository.jdbc.JdbcCtripHotelOrderDetailRepository; import org.springframework.beans.factory.annotation.Autowired; @@ -21,11 +20,25 @@ public class CTripOrderRecordExtensionFactory implements OrderRecordExtensionFa private OrderDetailDomainService orderDetailDomainService; @Autowired private JdbcCtripHotelOrderDetailRepository jdbcCtripHotelOrderDetailRepository; + @Autowired + private OrderRecordFactory orderRecordFactory; + + @Autowired + private RouteRepository routeRepository; @Override public OrderCarRecord createCarOrderRecord(Object orderCarRecordData) { - CTripCarRecord orderCarRecord = (CTripCarRecord) orderCarRecordData; - return null; + CTripCarRecord cTripCarRecord = (CTripCarRecord) orderCarRecordData; + String routeOrderNo = cTripCarRecord.getRouteOrderNo(); + RouteOrder byOrderNo = routeRepository.findByOrderNo(routeOrderNo); + + OrderCarRecord orderCarRecord = orderRecordFactory + .buildWithRouteOrder(byOrderNo) + .carRecord(); + + + + return orderCarRecord; } @Override diff --git a/src/main/java/com/chint/domain/factoriy/order_record/OrderRecordBasic.java b/src/main/java/com/chint/domain/factoriy/order_record/OrderRecordBasic.java index 91221ae4..8bf696ff 100644 --- a/src/main/java/com/chint/domain/factoriy/order_record/OrderRecordBasic.java +++ b/src/main/java/com/chint/domain/factoriy/order_record/OrderRecordBasic.java @@ -40,6 +40,24 @@ public class OrderRecordBasic { // 成本中心 private String offlineCcomyCode; + private String userName; + + private String userCode; + + // 加载用户和预订信息 + public OrderRecordBasic loadBookingInfo(String bookingUserCode, + String bookingName, + String bookingUserPhone, + String userName, + String userCode) { + this.setBookingUserPhone(bookingUserPhone); + this.setBookingUserCode(bookingUserCode); + this.setBookingName(bookingName); + this.setUserName(userName); + this.setUserCode(userCode); + return this; + } + public OrderCarRecord carRecord() { return BeanUtil.copyProperties(this, OrderCarRecord.class); } diff --git a/src/main/java/com/chint/domain/factoriy/order_record/OrderRecordFactory.java b/src/main/java/com/chint/domain/factoriy/order_record/OrderRecordFactory.java index 17d7244f..384192a1 100644 --- a/src/main/java/com/chint/domain/factoriy/order_record/OrderRecordFactory.java +++ b/src/main/java/com/chint/domain/factoriy/order_record/OrderRecordFactory.java @@ -19,13 +19,16 @@ public class OrderRecordFactory { public OrderRecordBasic buildWithRouteOrder(RouteOrder routeOrder) { routeOrder.reloadStatus(); OrderRecordBasic orderRecordBasic = new OrderRecordBasic(); + //完成身份信息 String userId = routeOrder.getUserId(); User user = userRepository.findByUserEmployeeNo(userId); + orderRecordBasic.loadBookingInfo(user.getEmployeeNo(), + user.getName(), + user.getPhoneNumber(), + user.getEmployeeNo(), + user.getPhoneNumber()); - orderRecordBasic.setBookingUserCode(user.getEmployeeNo()); - orderRecordBasic.setBookingName(user.getName()); - orderRecordBasic.setBookingUserPhone(user.getPhoneNumber()); //配置供应商信息 String supplierName = routeOrder.getSupplierName();