From ff18fd425fe8eec7686ab66742950e4a74439de7 Mon Sep 17 00:00:00 2001 From: lulz1 Date: Tue, 2 Apr 2024 13:37:58 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=93=E7=AE=97=E6=95=B0=E6=8D=AE=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E4=B8=80=E4=B8=AA=E8=B4=A2=E5=8A=A1=E5=85=B1=E4=BA=AB?= =?UTF-8?q?=E5=8D=95=E5=8F=B7=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../order/order_record/OrderCarRecord.java | 10 +++- .../order/order_record/OrderFlightRecord.java | 25 ++++++--- .../order/order_record/OrderHotelRecord.java | 33 +++++++----- .../order/order_record/OrderTrainRecord.java | 2 +- .../ly_order_record/TripSubmitItemList.java | 1 + .../chint/domain/aggregates/user/User.java | 9 ++++ .../aggregates/user/UserDepartmentInfo.java | 3 ++ .../CTripOrderRecordExtensionFactory.java | 51 ++++++++++++++----- .../LyOrderRecordExtensionFactory.java | 4 +- 9 files changed, 100 insertions(+), 38 deletions(-) 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 19513612..c0df4fcf 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 @@ -70,7 +70,7 @@ public class OrderCarRecord extends OrderBaseRecord { private String offlineCcomyCode; // 成本中心 private String orderSource; // 预订来源:线上/线下 private String payAmount;//支付总金额 - + private String receiptsNumOrigin;//支付总金额 //添加行程信息 @@ -173,10 +173,17 @@ public class OrderCarRecord extends OrderBaseRecord { return this; } + public OrderCarRecord loadComplianceInfoNot() { + this.setOverStandard("否"); + this.setOverStandardReason(""); + return this; + } + // 加载关联订单信息 public OrderCarRecord loadRelatedOrderInfo(Long orderDetailId, String detailId, String receiptsNum, + String receiptsNumOrigin, String parentOrderNo, String originalOrderNo) { this.setOrderDetailId(orderDetailId); @@ -184,6 +191,7 @@ public class OrderCarRecord extends OrderBaseRecord { this.setReceiptsNum(receiptsNum); this.setParentOrderNo(parentOrderNo); this.setOriginalOrderNo(originalOrderNo); + this.setReceiptsNumOrigin(receiptsNumOrigin); return this; } } \ 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 872349fc..ab0360bb 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 @@ -78,6 +78,7 @@ public class OrderFlightRecord extends OrderBaseRecord { private String offlineCcomyCode; // 成本中心 private String orderStatus; private String createTime; + private String receiptsNumOrigin;//原差旅申请单单号 // 加载基础订单信息 public OrderFlightRecord loadBasicOrderInfo(String orderNo, @@ -127,9 +128,9 @@ public class OrderFlightRecord extends OrderBaseRecord { // 加载座位细节 public OrderFlightRecord loadSeatInfo(String seatPoint, - String seatPointName, + String seatPointName, - String seatDiscount) { + String seatDiscount) { this.setSeatDiscount(seatDiscount); this.setSeatPoint(seatPoint); this.setSeatPointName(seatPointName); @@ -210,16 +211,22 @@ public class OrderFlightRecord extends OrderBaseRecord { // 加载违规信息 public OrderFlightRecord loadComplianceInfo(OrderDetail orderDetail) { - orderDetail.getETAEvent().ifPresentOrElse(it->{ + orderDetail.getETAEvent().ifPresentOrElse(it -> { this.setOverStandard("是"); this.setOverStandardReason(it.getExtension()); - },()->{ + }, () -> { this.setOverStandard("否"); this.setOverStandardReason(""); }); return this; } + public OrderFlightRecord loadComplianceInfoNot() { + this.setOverStandard("否"); + this.setOverStandardReason(""); + return this; + } + // 加载未预订最低价原因 public OrderFlightRecord loadNotLowReason(String notLowReason) { @@ -229,15 +236,17 @@ public class OrderFlightRecord extends OrderBaseRecord { // 加载关联订单信息 public OrderFlightRecord loadRelatedOrderInfo(Long orderDetailId, - String detailId, - String receiptsNum, - String parentOrderNo, - String originalOrderNo) { + String detailId, + String receiptsNum, + String receiptsNumOrigin, + String parentOrderNo, + String originalOrderNo) { this.setOrderDetailId(orderDetailId); this.setDetailId(detailId); this.setReceiptsNum(receiptsNum); this.setParentOrderNo(parentOrderNo); this.setOriginalOrderNo(originalOrderNo); + this.setReceiptsNumOrigin(receiptsNumOrigin); 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 4e4c8113..f40ebcd6 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 @@ -8,6 +8,8 @@ import lombok.experimental.Accessors; import org.springframework.data.annotation.Id; import org.springframework.data.relational.core.mapping.Table; +import java.util.Optional; + @Data @Table("order_hotel_record") @NoArgsConstructor @@ -30,7 +32,7 @@ public class OrderHotelRecord extends OrderBaseRecord { private String originalOrderNo; // 原始订单号 private String brandGroup; // 酒店品牌集团 private String brandName; // 酒店品牌 - private int overStandard; // 是否违规(超标): 0否 1是 + private String overStandard; // 是否违规(超标): 0否 1是 private String overStandardReason; // 违规原因(超标原因) private String receiptsNum; // 关联申请单号 private String bookingName; // 预订人姓名 @@ -45,7 +47,7 @@ public class OrderHotelRecord extends OrderBaseRecord { private String hotelAddress; // 酒店地址 private String hotelName; // 酒店名称 private String includeAmount; // 含早情况:XX份 - private int isAgreement; // 是否协议酒店:0否1是 + private String isAgreement; // 是否协议酒店:0否1是 private int paymentType; // 付款方式: 0-公司统付 1-个人付 2-混付 private String orderAmount; // 订单总额 private String companyAmount; // 企业统付总额 @@ -76,7 +78,7 @@ public class OrderHotelRecord extends OrderBaseRecord { private String payAmount; // 支付总金额 private String orderStatus; private String createTime; - + private String receiptsNumOrigin;//支付总金额 // 加载基础订单信息 public OrderHotelRecord loadBasicOrderInfo(String orderNo, String orderStatus, @@ -141,10 +143,10 @@ public class OrderHotelRecord extends OrderBaseRecord { // 加载支付和服务费信息 public OrderHotelRecord loadPaymentInfo(Integer paymentType, - String unifiedPayAmt, - String personalPayAmt, - String companyAmount, - String personalAmount) { + String unifiedPayAmt, + String personalPayAmt, + String companyAmount, + String personalAmount) { this.setCompanyAmount(companyAmount); this.setPersonalAmount(personalAmount); this.setPaymentType(paymentType); @@ -168,12 +170,15 @@ public class OrderHotelRecord extends OrderBaseRecord { } // 加载违规信息 - public OrderHotelRecord loadComplianceInfo(OrderDetail orderDetail) { - orderDetail.getETAEvent().ifPresentOrElse(it -> { - this.setOverStandard(1); - this.setOverStandardReason(it.getExtension()); + public OrderHotelRecord loadComplianceInfo(Optional orderDetail) { + orderDetail.ifPresentOrElse(it -> it.getETAEvent().ifPresentOrElse(orderEvent -> { + this.setOverStandard("是"); + this.setOverStandardReason(orderEvent.getExtension()); }, () -> { - this.setOverStandard(0); + this.setOverStandard("否"); + this.setOverStandardReason(""); + }), () -> { + this.setOverStandard("否"); this.setOverStandardReason(""); }); return this; @@ -193,6 +198,7 @@ public class OrderHotelRecord extends OrderBaseRecord { public OrderHotelRecord loadOrderNoInfo(Long orderDetailId, String detailId, String receiptsNum, + String receiptsNumOrigin, String parentOrderNo, String originalOrderNo) { this.setOrderDetailId(orderDetailId); @@ -200,12 +206,13 @@ public class OrderHotelRecord extends OrderBaseRecord { this.setReceiptsNum(receiptsNum); this.setParentOrderNo(parentOrderNo); this.setOriginalOrderNo(originalOrderNo); + this.setReceiptsNumOrigin(receiptsNumOrigin); return this; } // 加载房间和早餐信息 public OrderHotelRecord loadRoomAndBreakfastInfo(String includeAmount, - int isAgreement, + String isAgreement, int roomNightCount, int nightCount, String roomPrice, 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 3e68a3c7..51f1c664 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,7 +71,7 @@ public class OrderTrainRecord extends OrderBaseRecord{ private String passportType; // 乘客证件类型 private String trainTime; // 发车时间 yyyy-MM-dd HH:‌mm:ss private String yxId; // 影像比对ID - + private String receiptsNumOrigin;//原差旅申请单单号 // 加载基础订单信息 public OrderTrainRecord loadBasicOrderInfo(Long id, String orderNo, String orderStatus, String createTime) { this.setId(id); diff --git a/src/main/java/com/chint/domain/aggregates/order/order_record/ly_order_record/TripSubmitItemList.java b/src/main/java/com/chint/domain/aggregates/order/order_record/ly_order_record/TripSubmitItemList.java index ac7f8234..2f4f451f 100644 --- a/src/main/java/com/chint/domain/aggregates/order/order_record/ly_order_record/TripSubmitItemList.java +++ b/src/main/java/com/chint/domain/aggregates/order/order_record/ly_order_record/TripSubmitItemList.java @@ -35,6 +35,7 @@ public class TripSubmitItemList implements Serializable { //父id private Integer lyRecordId; + private Integer lyRecordKey; //编码 private String code; diff --git a/src/main/java/com/chint/domain/aggregates/user/User.java b/src/main/java/com/chint/domain/aggregates/user/User.java index a99fead0..2f6f8f50 100644 --- a/src/main/java/com/chint/domain/aggregates/user/User.java +++ b/src/main/java/com/chint/domain/aggregates/user/User.java @@ -6,6 +6,7 @@ import com.chint.domain.aggregates.system.FsscSystem; import com.chint.domain.value_object.UserLoginParam; import com.chint.infrastructure.constant.AuthMessageConstant; import com.chint.interfaces.rest.base.PostRequest; +import com.chint.interfaces.rest.user.PushUser; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; import lombok.AllArgsConstructor; @@ -71,6 +72,7 @@ public class User implements Serializable { this.employeeNo = employeeNo; } + // public User addDeptInfo(){ // // } @@ -106,6 +108,8 @@ public class User implements Serializable { this.companyCode = companyCode; } + + public User addFssc(String CompanyName, String sysCode) { FsscSystem fsscSystem = new FsscSystem(CompanyName, sysCode); this.addFsscSystemToList(fsscSystem); @@ -184,4 +188,9 @@ public class User implements Serializable { public String generateXNFsscUrlPath() { return XN_FSSC_REDIRECT_PATH_APPROVAL_ONE + employeeNo + FSSC_REDIRECT_PATH_APPROVAL_TWO; } + +// public User startAddDept(){ +// +// +// } } \ No newline at end of file diff --git a/src/main/java/com/chint/domain/aggregates/user/UserDepartmentInfo.java b/src/main/java/com/chint/domain/aggregates/user/UserDepartmentInfo.java index 34a47136..138a3c24 100644 --- a/src/main/java/com/chint/domain/aggregates/user/UserDepartmentInfo.java +++ b/src/main/java/com/chint/domain/aggregates/user/UserDepartmentInfo.java @@ -33,4 +33,7 @@ public class UserDepartmentInfo implements Serializable { private String departmentCodeSeven; private String departmentNameSeven; private Integer ifPrimary; + + // Builder static inner class + } 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 d0582cd9..5b8fc581 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 @@ -146,29 +146,47 @@ public class CTripOrderRecordExtensionFactory implements OrderRecordExtensionFac } // 加载超标信息, 加载订单关联信息 , 加载订单状态 ,单号,创建时间等信息 + // 当测试环境没有行程规划单 , 只能去回传的差旅申请单 + String orderNo = getOrderNoForCTrip(cTripCarRecord.getRouteOrderNo()); orderDetail.ifPresentOrElse(it -> { CarOrderDetail carOrderDetail = it.getCarOrderDetail(); orderCarRecord.loadComplianceInfo(it) .loadRelatedOrderInfo(it.getOrderId(), cTripCarRecord.getRecordId(), + byOrderNo.isPresent() ? byOrderNo.get().getApproveOrderNo().getActualOrderNo() : orderNo, //兼容测试环境和正式环境的数据 carOrderDetail.getReceiptsNum(), carOrderDetail.getParentOrderNo(), carOrderDetail.getOriginalOrderNo()) .loadBasicOrderInfo(carOrderDetail.getOrderNo(), carOrderDetail.getOrderStatus(), carOrderDetail.getCreateTime()); - }, () -> orderCarRecord.loadRelatedOrderInfo(cTripCarRecordBase.getOrderId(), + }, () -> orderCarRecord.loadComplianceInfoNot() + .loadRelatedOrderInfo(cTripCarRecordBase.getOrderId(), cTripCarRecord.getRecordId(), + orderNo, cTripCarRecord.getRouteOrderNo(), String.valueOf(cTripCarRecordBase.getOrderId()), String.valueOf(cTripCarRecordBase.getOrderId())) - .loadBasicOrderInfo( String.valueOf(cTripCarRecordBase.getOrderId()), + .loadBasicOrderInfo(String.valueOf(cTripCarRecordBase.getOrderId()), "", cTripCarRecordBase.getCreateTime())); return orderCarRecord; } + + private String getOrderNoForCTrip(String inputOrderNo) { + // 当测试环境没有行程规划单 , 只能去回传的差旅申请单 + String orderNo; + if (inputOrderNo.contains("-")) { + String[] split = inputOrderNo.split("-"); + orderNo = split[1]; + } else { + orderNo = inputOrderNo; + } + return orderNo; + } + @Override public OrderTrainRecord createTrainOrderRecord(Object orderTrainRecordData) { @@ -288,6 +306,7 @@ public class CTripOrderRecordExtensionFactory implements OrderRecordExtensionFac cTripFlightBaseInfo.getDept3()); // 加载关联票价原因 + String orderNo = getOrderNoForCTrip(cTripFlightRecord.getRouteOrderNo()); orderDetail.ifPresentOrElse(it -> { FlightOrderDetail flightOrderDetail = it.getFlightOrderDetail(); orderFlightRecord.loadComplianceInfo(it) @@ -296,11 +315,14 @@ public class CTripOrderRecordExtensionFactory implements OrderRecordExtensionFac cTripFlightRecordBase.getCreateTime()) .loadRelatedOrderInfo(cTripFlightRecordBase.getOrderId(), String.valueOf(cTripFlightRecordBase.getRecordId()), + byOrderNo.isPresent() ? byOrderNo.get().getApproveOrderNo().getActualOrderNo() : orderNo, //兼容测试环境和正式环境的数据 flightOrderDetail.getReceiptsNum(), flightOrderDetail.getParentOrderNo(), it.getOrderNo()); - }, () -> orderFlightRecord.loadRelatedOrderInfo(cTripFlightRecordBase.getOrderId(), //兼容测试环境没有申请单的情况 + }, () -> orderFlightRecord.loadComplianceInfoNot() + .loadRelatedOrderInfo(cTripFlightRecordBase.getOrderId(), //兼容测试环境没有申请单的情况 String.valueOf(cTripFlightRecordBase.getRecordId()), + orderNo, cTripFlightBaseInfo.getJourneyID(), String.valueOf(cTripFlightRecordBase.getOrderId()), String.valueOf(cTripFlightRecordBase.getOrderId())) @@ -372,12 +394,12 @@ public class CTripOrderRecordExtensionFactory implements OrderRecordExtensionFac // 加载房间和早餐信息 , 含早分数先为空 String isAgreement; if (cTripHotelRecordBase.getOrderType().equals(4) || cTripHotelRecordBase.getOrderType().equals(6)) { - isAgreement = "1"; + isAgreement = "是"; } else { - isAgreement = "0"; + isAgreement = "否"; } orderHotelRecord.loadRoomAndBreakfastInfo("", - Integer.parseInt(isAgreement), + isAgreement, cTripHotelRecordBase.getQuantity(), cTripHotelRecordBase.getQuantity(), String.valueOf(cTripHotelRecordBase.getPrice()), @@ -410,20 +432,23 @@ public class CTripOrderRecordExtensionFactory implements OrderRecordExtensionFac } orderHotelRecord.loadSourceInfo(sourceInfo); - + String orderNo = getOrderNoForCTrip(cTripHotelRecord.getRouteOrderNo()); orderDetailOptional.ifPresentOrElse(it -> { - orderHotelRecord.loadComplianceInfo(it); // 加载违规信息 + orderHotelRecord.loadComplianceInfo(Optional.of(it)); // 加载违规信息 HotelOrderDetail hotelOrderDetail = it.getHotelOrderDetail(); orderHotelRecord.loadOrderNoInfo(it.getOrderId(), // 加载订单关联号信息 cTripHotelRecord.getRecordId(), + byOrderNo.isPresent() ? byOrderNo.get().getApproveOrderNo().getActualOrderNo() : orderNo, //兼容测试环境和正式环境的数据 hotelOrderDetail.getReceiptsNum(), hotelOrderDetail.getOrderNo(), hotelOrderDetail.getOrderNo()); orderHotelRecord.loadBasicOrderInfo(hotelOrderDetail.getOrderNo(), // 加载基础订单信息 hotelOrderDetail.getOrderStatus(), cTripHotelRecordBase.getCreateTime()); - }, () -> orderHotelRecord.loadOrderNoInfo(cTripHotelRecordBase.getOrderId(), //兼容测试环境不存在行程规划单的情况 // 加载订单关联号信息 + }, () -> orderHotelRecord.loadComplianceInfo(Optional.empty()) + .loadOrderNoInfo(cTripHotelRecordBase.getOrderId(), //兼容测试环境不存在行程规划单的情况 // 加载订单关联号信息 cTripHotelRecord.getRecordId(), + orderNo, cTripHotelRecord.getRouteOrderNo(), String.valueOf(cTripHotelRecordBase.getOrderId()), String.valueOf(cTripHotelRecordBase.getOrderId())) @@ -432,8 +457,8 @@ public class CTripOrderRecordExtensionFactory implements OrderRecordExtensionFac cTripHotelRecordBase.getCreateTime())); // 加载财务信息 - orderHotelRecord.loadFinancialInfo(cTripHotelRecordBase.getSubAccCheckBatchNo(), - cTripHotelRecordBase.getBatchStartDate().substring(0, 6), + orderHotelRecord.loadFinancialInfo(cTripHotelRecordBase.getBatchStartDate().substring(0, 6), + cTripHotelRecordBase.getSubAccCheckBatchNo(), String.valueOf(cTripHotelRecordBase.getAmount()), "", cTripHotelRecordBase.getPaidAmount()); @@ -459,8 +484,8 @@ public class CTripOrderRecordExtensionFactory implements OrderRecordExtensionFac // 加载预订人和入住人信息 orderHotelRecord.loadBookerAndGuestInfo(cTripHotelOrderDetail.getEmployeeID(), cTripHotelOrderDetail.getEmployeeName(), - cTripHotelOrderDetail.getEmployeeID(), - cTripHotelOrderDetail.getEmployeeName()); + cTripHotelOrderDetail.getEmployeeName(), + cTripHotelOrderDetail.getEmployeeID()); // 加载组织架构 orderHotelRecord.loadOrganizationalAndProjectInfo(cTripHotelOrderDetail.getDept1(), diff --git a/src/main/java/com/chint/domain/factoriy/order_record/LyOrderRecordExtensionFactory.java b/src/main/java/com/chint/domain/factoriy/order_record/LyOrderRecordExtensionFactory.java index 9f2f5ff7..a3d0f1cd 100644 --- a/src/main/java/com/chint/domain/factoriy/order_record/LyOrderRecordExtensionFactory.java +++ b/src/main/java/com/chint/domain/factoriy/order_record/LyOrderRecordExtensionFactory.java @@ -168,7 +168,7 @@ public class LyOrderRecordExtensionFactory implements OrderRecordExtensionFactor .setOriginalOrderNo(lyOrderHotelRecord.getOriginOrderSerialNo())//原始订单号 .setBrandGroup("") //酒店品牌集团 .setBrandName("") //酒店品牌 - .setOverStandard("是".equals(lyOrderHotelRecord.getOverStandardStatus()) ? 1 : 0) //"是否违规(超标) 0否,1是" + .setOverStandard("是".equals(lyOrderHotelRecord.getOverStandardStatus()) ? "1" : "0") //"是否违规(超标) 0否,1是" .setOverStandardReason(lyOrderHotelRecord.getViolationReason()) //违规原因(超标原因) .setReceiptsNum(lyOrderHotelRecord.getOutApplayOrderNo()) //关联申请单号 .setUserName(lyOrderHotelRecord.getPassengerName()) //入住人姓名 @@ -181,7 +181,7 @@ public class LyOrderRecordExtensionFactory implements OrderRecordExtensionFactor .setHotelAddress(hotelOrderDetail.getHotelAddress()) //酒店地址 .setHotelName(lyOrderHotelRecord.getHotelName()) //酒店名称 .setIncludeAmount("") //含早情况:XX份 - .setIsAgreement("是".equals(hotelOrderDetail.getAgreementHotel()) ? 1 : 0) //是否协议酒店:0否1是 + .setIsAgreement("是".equals(hotelOrderDetail.getAgreementHotel()) ? "1" : "0") //是否协议酒店:0否1是 .setPaymentType(getPaymentType(lyOrderHotelRecord.getPayType()))//"付款方式:0-公司统付 1-个人付 2-混付" .setOrderAmount(String.valueOf(lyOrderHotelRecord.getToBePayAmount())) //结算总额 .setCompanyAmount(String.valueOf(lyOrderHotelRecord.getToBePayAmount())) //企业统付总额