diff --git a/src/main/java/com/chint/domain/aggregates/order/RouteRequest.java b/src/main/java/com/chint/domain/aggregates/order/RouteRequest.java index 70f3f3a6..e2c3a66f 100644 --- a/src/main/java/com/chint/domain/aggregates/order/RouteRequest.java +++ b/src/main/java/com/chint/domain/aggregates/order/RouteRequest.java @@ -32,14 +32,14 @@ public class RouteRequest implements Serializable { private String RouteRequestNo; - private String supplier; - @MappedCollection(idColumn = "route_request_id", keyColumn = "route_request_key") private List routeRequestLegList; @MappedCollection(idColumn = "route_request_id", keyColumn = "route_request_key") private List eventList; + @Transient + private String supplier; @Transient private Integer status; @Transient 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 f078d6ec..e7ad69f9 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 @@ -127,6 +127,12 @@ public class OrderHotelRecord extends OrderBaseRecord { return this; } + public OrderHotelRecord loadBookerAndGuestCode(String bookingUserCode, String userCode) { + this.setBookingUserCode(bookingUserCode); + this.setUserCode(userCode); + return this; + } + // 加载财务信息 public OrderHotelRecord loadFinancialInfo(String accountPeriod, String billNo, 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 09050fda..3b750944 100644 --- a/src/main/java/com/chint/domain/aggregates/user/User.java +++ b/src/main/java/com/chint/domain/aggregates/user/User.java @@ -89,6 +89,7 @@ public class User implements Serializable { public String lowestDeptCode(String companyName) { Optional first = this.userDepartmentInfoList .stream() + .filter(it -> it.getCompanyName() != null) .filter(it -> it.getCompanyName().equals(companyName)) .findFirst(); return first.map(this::lowestDept).orElse(null); 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 e83148bb..0af4dde0 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 @@ -464,10 +464,10 @@ public class CTripOrderRecordExtensionFactory implements OrderRecordExtensionFac } address = address + cTripHotelInfo.getHotelName(); orderHotelRecord.loadLocationInfo( - address, locationRes.getCountry(), locationRes.getProvince(), - cTripHotelInfo.getCityName()); + locationRes.getProvince() + cTripHotelInfo.getCityName(), + address); } else { //如果找不到该地区,那么只能先用空的 orderHotelRecord.loadLocationInfo("", "", cTripHotelInfo.getCityName(), cTripHotelInfo.getHotelName()); @@ -480,7 +480,7 @@ public class CTripOrderRecordExtensionFactory implements OrderRecordExtensionFac // 加载订单来源和系统归属信息 String sourceInfo; - if (cTripHotelRecord.getRouteOrderNo() == null) { + if (routeOrderNo == null || routeOrderNo.isBlank() || routeOrderNo.isEmpty()) { sourceInfo = "N"; } else { sourceInfo = "Y"; @@ -543,10 +543,21 @@ public class CTripOrderRecordExtensionFactory implements OrderRecordExtensionFac String.valueOf(personAmount)); // 加载预订人和入住人信息 - orderHotelRecord.loadBookerAndGuestInfo(cTripHotelOrderDetail.getEmployeeID(), - cTripHotelOrderDetail.getEmployeeName(), - cTripHotelOrderDetail.getEmployeeName(), - cTripHotelOrderDetail.getEmployeeID()); + + if (orderHotelRecord.getOrderSource().equals("Y")) { + orderHotelRecord.loadBookerAndGuestInfo( + cTripHotelOrderDetail.getEmployeeID(), + cTripHotelOrderDetail.getEmployeeName(), + cTripHotelOrderDetail.getClientName(), + cTripHotelOrderDetail.getEmployeeID()); + } else { + orderHotelRecord.loadBookerAndGuestInfo( + "", + cTripHotelOrderDetail.getEmployeeName(), + cTripHotelOrderDetail.getClientName(), + ""); + } + // 加载组织架构 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 fc4069c7..7153f1f5 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 @@ -10,6 +10,7 @@ import com.chint.domain.aggregates.user.User; import com.chint.infrastructure.repository.jdbc.*; import com.chint.infrastructure.util.BeanCopyUtils; import com.chint.interfaces.rest.bpm.dto.BPMResponse; +import com.chint.interfaces.rest.user.UserHttpRequest; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -48,6 +49,9 @@ public class LyOrderRecordExtensionFactory implements OrderRecordExtensionFactor @Autowired private CTripOrderRecordExtensionFactory cTripOrderRecordExtensionFactory; + @Autowired + private UserHttpRequest userHttpRequest; + @Override public OrderFlightRecord createFlightOrderRecord(Object orderFlightRecordData) { OrderFlightRecord orderFlightRecord = new OrderFlightRecord(); @@ -158,7 +162,7 @@ public class LyOrderRecordExtensionFactory implements OrderRecordExtensionFactor .flatMap(it -> Optional.ofNullable(it.getRouterOrderExtensionField())); routerOrderExtensionField.ifPresentOrElse(it -> orderFlightRecord.loadBelongDeport(it.getBelongDeptCode()), () -> orderFlightRecord.loadBelongDeport( - cTripOrderRecordExtensionFactory.belongDeport(orderFlightRecord.getBookingUserCode(), orderFlightRecord.getAccountCompanyName()) + userHttpRequest.belongDeport(orderFlightRecord.getBookingUserCode(), orderFlightRecord.getAccountCompanyName()) )); } @@ -246,7 +250,7 @@ public class LyOrderRecordExtensionFactory implements OrderRecordExtensionFactor .flatMap(it -> Optional.ofNullable(it.getRouterOrderExtensionField())); routerOrderExtensionField.ifPresentOrElse(it -> orderHotelRecord.loadBelongDeport(it.getBelongDeptCode()), () -> orderHotelRecord.loadBelongDeport( - cTripOrderRecordExtensionFactory.belongDeport(orderHotelRecord.getBookingUserCode(), orderHotelRecord.getAccountCompanyName()) + userHttpRequest.belongDeport(orderHotelRecord.getBookingUserCode(), orderHotelRecord.getAccountCompanyName()) )); } @@ -331,7 +335,7 @@ public class LyOrderRecordExtensionFactory implements OrderRecordExtensionFactor .flatMap(it -> Optional.ofNullable(it.getRouterOrderExtensionField())); routerOrderExtensionField.ifPresentOrElse(it -> orderTrainRecord.loadBelongDeport(it.getBelongDeptCode()), () -> orderTrainRecord.loadBelongDeport( - cTripOrderRecordExtensionFactory.belongDeport(orderTrainRecord.getBookingUserCode(), orderTrainRecord.getAccountCompanyName()) + userHttpRequest.belongDeport(orderTrainRecord.getBookingUserCode(), orderTrainRecord.getAccountCompanyName()) )); } @@ -399,7 +403,7 @@ public class LyOrderRecordExtensionFactory implements OrderRecordExtensionFactor .flatMap(it -> Optional.ofNullable(it.getRouterOrderExtensionField())); routerOrderExtensionField.ifPresentOrElse(it -> orderCarRecord.loadBelongDeport(it.getBelongDeptCode()), () -> orderCarRecord.loadBelongDeport( - cTripOrderRecordExtensionFactory.belongDeport(orderCarRecord.getBookingUserCode(), orderCarRecord.getAccountCompanyName()) + userHttpRequest.belongDeport(orderCarRecord.getBookingUserCode(), orderCarRecord.getAccountCompanyName()) )); }