diff --git a/src/main/java/com/chint/application/in/OrderController.java b/src/main/java/com/chint/application/in/OrderController.java index ca0ec507..180720d8 100644 --- a/src/main/java/com/chint/application/in/OrderController.java +++ b/src/main/java/com/chint/application/in/OrderController.java @@ -8,6 +8,7 @@ import com.chint.application.services.OrderApplicationService; import com.chint.domain.aggregates.order.RouteOrder; import com.chint.domain.service.OrderDetailDomainService; import com.chint.domain.service.OrderDomainService; +import com.chint.domain.service.RouteRequestDomainService; import com.chint.domain.value_object.OrderSaveData; import com.chint.domain.value_object.SyncLegData; import com.chint.domain.value_object.UpdateLegData; @@ -38,6 +39,8 @@ public class OrderController { @Autowired private OrderDomainService orderDomainService; + @Autowired + private RouteRequestDomainService routeRequestDomainService; @Transactional @ApiOperation("保存行程规划单") @@ -73,7 +76,7 @@ public class OrderController { syncLegDataItem.setRouteId(routeId); syncLegDataItem.setSupplierName(syncLegData.getSupplierName()); return syncLegDataItem; - }).toList().forEach(data -> orderApplicationService.sync(data)); + }).toList().forEach(data -> routeRequestDomainService.syncRouteRequestToSupplier(data)); return Result.Success(SUCCESS); } diff --git a/src/main/java/com/chint/application/queryies/OrderDetailQuery.java b/src/main/java/com/chint/application/queryies/OrderDetailQuery.java index b01cd839..12dea0b8 100644 --- a/src/main/java/com/chint/application/queryies/OrderDetailQuery.java +++ b/src/main/java/com/chint/application/queryies/OrderDetailQuery.java @@ -140,6 +140,7 @@ public class OrderDetailQuery { public File exportOrderDetailToFile(AuthenticationSignDto authenticationDto) { List orderDetailList = queryOrderDetail(authenticationDto).stream().filter(Objects::nonNull).toList(); + Integer productType = authenticationDto.getProductType(); return OrderDetailWriter.exportReport( switch (productType) { diff --git a/src/main/java/com/chint/application/queryies/OrderQuery.java b/src/main/java/com/chint/application/queryies/OrderQuery.java index 371cf390..8cfc907b 100644 --- a/src/main/java/com/chint/application/queryies/OrderQuery.java +++ b/src/main/java/com/chint/application/queryies/OrderQuery.java @@ -545,7 +545,9 @@ public class OrderQuery { Stream stream = routeOrders.stream(); if (queryData.getSupplierName() != null) { stream = stream - .filter(it -> it.getSupplierName() == null || it.getSupplierName().equals(queryData.getSupplierName())); + .filter(it-> it.getRouteRequestList() + .stream() + .anyMatch(routeRequest -> !routeRequest.getSupplier().equals(queryData.getSupplierName()))); } return stream .filter(order -> order.reloadStatus().getOrderStatus().equals(ORDER_STATUS_APPROVAL)) 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 98e11365..9d2f45fb 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 @@ -24,7 +24,6 @@ import java.util.List; import java.util.Optional; import static com.chint.infrastructure.constant.BelongSystemConstant.*; -import static com.chint.infrastructure.constant.LegConstant.LEG_TYPE_HOTEL; import static com.chint.infrastructure.constant.UtilConstant.KEEP_TWO_DECIMAL_ZERO; @Component @@ -179,16 +178,29 @@ 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(), - translateCarCTripStatusToRecordStatus(cTripCarRecordBase.getDelType()), - cTripCarRecord.getOrderDate()); + if (carOrderDetail != null) { + orderCarRecord.loadComplianceInfo(it) + .loadRelatedOrderInfo(it.getOrderId(), + cTripCarRecord.getRecordId(), + byOrderNo.isPresent() ? byOrderNo.get().getApproveOrderNo().getActualOrderNo() : orderNo, //兼容测试环境和正式环境的数据 + carOrderDetail.getReceiptsNum(), + carOrderDetail.getParentOrderNo(), + carOrderDetail.getOriginalOrderNo()) + .loadBasicOrderInfo(carOrderDetail.getOrderNo(), + translateCarCTripStatusToRecordStatus(cTripCarRecordBase.getDelType()), + cTripCarRecord.getOrderDate()); + } else { + orderCarRecord.loadComplianceInfoNot() + .loadRelatedOrderInfo(cTripCarRecordBase.getOrderId(), + cTripCarRecord.getRecordId(), + orderNo, + cTripCarRecord.getRouteOrderNo(), + String.valueOf(cTripCarRecordBase.getOrderId()), + String.valueOf(cTripCarRecordBase.getOrderId())) + .loadBasicOrderInfo(String.valueOf(cTripCarRecordBase.getOrderId()), + translateCarCTripStatusToRecordStatus(cTripCarRecordBase.getDelType()), + cTripCarRecord.getOrderDate()); + } }, () -> orderCarRecord.loadComplianceInfoNot() .loadRelatedOrderInfo(cTripCarRecordBase.getOrderId(), cTripCarRecord.getRecordId(), @@ -398,16 +410,29 @@ public class CTripOrderRecordExtensionFactory implements OrderRecordExtensionFac String orderNo = getOrderNoForCTrip(cTripFlightRecord.getRouteOrderNo()); orderDetail.ifPresentOrElse(it -> { FlightOrderDetail flightOrderDetail = it.getFlightOrderDetail(); - orderFlightRecord.loadComplianceInfo(it) - .loadBasicOrderInfo(String.valueOf(cTripFlightRecordBase.getOrderId()), - translateFlightCTripStatusToRecordStatus(cTripFlightRecordBase.getOrderDetailType()), - cTripFlightRecordBase.getCreateTime()) - .loadRelatedOrderInfo(cTripFlightRecordBase.getOrderId(), - String.valueOf(cTripFlightRecordBase.getRecordId()), - byOrderNo.isPresent() ? byOrderNo.get().getApproveOrderNo().getActualOrderNo() : orderNo, //兼容测试环境和正式环境的数据 - flightOrderDetail.getReceiptsNum(), - flightOrderDetail.getParentOrderNo(), - it.getOrderNo()); + if (flightOrderDetail != null) { + orderFlightRecord.loadComplianceInfo(it) + .loadBasicOrderInfo(String.valueOf(cTripFlightRecordBase.getOrderId()), + translateFlightCTripStatusToRecordStatus(cTripFlightRecordBase.getOrderDetailType()), + cTripFlightRecordBase.getCreateTime()) + .loadRelatedOrderInfo(cTripFlightRecordBase.getOrderId(), + String.valueOf(cTripFlightRecordBase.getRecordId()), + byOrderNo.isPresent() ? byOrderNo.get().getApproveOrderNo().getActualOrderNo() : orderNo, //兼容测试环境和正式环境的数据 + flightOrderDetail.getReceiptsNum(), + flightOrderDetail.getParentOrderNo(), + it.getOrderNo()); + } else { + orderFlightRecord.loadComplianceInfoNot() + .loadRelatedOrderInfo(cTripFlightRecordBase.getOrderId(), //兼容测试环境没有申请单的情况 + String.valueOf(cTripFlightRecordBase.getRecordId()), + orderNo, + cTripFlightBaseInfo.getJourneyID(), + String.valueOf(cTripFlightRecordBase.getOrderId()), + String.valueOf(cTripFlightRecordBase.getOrderId())) + .loadBasicOrderInfo(String.valueOf(cTripFlightRecordBase.getOrderId()), + translateFlightCTripStatusToRecordStatus(cTripFlightRecordBase.getOrderDetailType()), + cTripFlightRecordBase.getCreateTime()); + } }, () -> orderFlightRecord.loadComplianceInfoNot() .loadRelatedOrderInfo(cTripFlightRecordBase.getOrderId(), //兼容测试环境没有申请单的情况 String.valueOf(cTripFlightRecordBase.getRecordId()), @@ -561,15 +586,28 @@ public class CTripOrderRecordExtensionFactory implements OrderRecordExtensionFac orderDetailOptional.ifPresentOrElse(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(), // 加载基础订单信息 - translateHotelCTripStatusToRecordStatus(cTripHotelRecordBase.getDetailType()), - cTripHotelRecordBase.getCreateTime()); + if (hotelOrderDetail != null) { + orderHotelRecord.loadOrderNoInfo(it.getOrderId(), // 加载订单关联号信息 + cTripHotelRecord.getRecordId(), + byOrderNo.isPresent() ? byOrderNo.get().getApproveOrderNo().getActualOrderNo() : orderNo, //兼容测试环境和正式环境的数据 + hotelOrderDetail.getReceiptsNum(), + hotelOrderDetail.getOrderNo(), + hotelOrderDetail.getOrderNo()) + .loadBasicOrderInfo(String.valueOf(cTripHotelRecordBase.getOrderId()), // 加载基础订单信息 + translateHotelCTripStatusToRecordStatus(cTripHotelRecordBase.getDetailType()), + cTripHotelRecordBase.getCreateTime()); + } else { + orderHotelRecord.loadComplianceInfo(Optional.empty()) + .loadOrderNoInfo(cTripHotelRecordBase.getOrderId(), //兼容测试环境不存在行程规划单的情况 // 加载订单关联号信息 + cTripHotelRecord.getRecordId(), + orderNo, + cTripHotelRecord.getRouteOrderNo(), + String.valueOf(cTripHotelRecordBase.getOrderId()), + String.valueOf(cTripHotelRecordBase.getOrderId())) + .loadBasicOrderInfo(String.valueOf(cTripHotelRecordBase.getOrderId()), // 加载基础订单信息 + translateHotelCTripStatusToRecordStatus(cTripHotelRecordBase.getDetailType()), + cTripHotelRecordBase.getCreateTime()); + } }, () -> orderHotelRecord.loadComplianceInfo(Optional.empty()) .loadOrderNoInfo(cTripHotelRecordBase.getOrderId(), //兼容测试环境不存在行程规划单的情况 // 加载订单关联号信息 cTripHotelRecord.getRecordId(), @@ -656,7 +694,6 @@ public class CTripOrderRecordExtensionFactory implements OrderRecordExtensionFac orderHotelRecord.setOrderStatus("0"); } }, () -> orderHotelRecord.setOrderStatus("0")); - return orderHotelRecord; } diff --git a/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcRouteRepository.java b/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcRouteRepository.java index 49a1463d..8f21a75e 100644 --- a/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcRouteRepository.java +++ b/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcRouteRepository.java @@ -27,13 +27,10 @@ public interface JdbcRouteRepository extends CrudRepository { RouteOrder findByRouteOrderNo(String routeOrderNo); - Page findByUserIdAndRouteOrderNoContainingAndApproveOrderNo_ActualOrderNoNotNullOrApproveOrderNo_CreatorAndRouteOrderNoContainingAndApproveOrderNo_ActualOrderNoNotNull(String userId, String routeOrderNo, String approveOrderNo_creator, String routeOrderNo2, Pageable pageable); - Page findByUserIdAndApproveOrderNo_InstructionsContainingAndApproveOrderNo_ActualOrderNoNotNullOrApproveOrderNo_CreatorAndApproveOrderNo_InstructionsContainingAndApproveOrderNo_ActualOrderNoNotNull(String userId, String approveOrderNo_instructions, String approveOrderNo_creator, String approveOrderNo_instructions2, Pageable pageable); - Page findByUserIdAndApproveOrderNo_ActualOrderNoNotNullOrApproveOrderNo_CreatorAndApproveOrderNo_ActualOrderNoNotNull(String userId, String approveOrderNo_creator, Pageable pageable); void deleteByUserId(String userId); diff --git a/src/main/java/com/chint/interfaces/rest/ctrip/dto/search/hotel/HotelOrderInfoEntity.java b/src/main/java/com/chint/interfaces/rest/ctrip/dto/search/hotel/HotelOrderInfoEntity.java index 349d23c8..5cacf76c 100644 --- a/src/main/java/com/chint/interfaces/rest/ctrip/dto/search/hotel/HotelOrderInfoEntity.java +++ b/src/main/java/com/chint/interfaces/rest/ctrip/dto/search/hotel/HotelOrderInfoEntity.java @@ -78,6 +78,7 @@ public class HotelOrderInfoEntity { private String LowPriceRCInfo; //超标原因 可能是一个对象 private String LowPriceRC_VV;//超标原因是:其它 超标原因 private String AgreementRCInfo; //超标原因 可能是一个对象 + private String LowPriceRC_W; //超标原因 可能是一个对象 private String TPMaxPrice; //入离日期内差标 // 后续字段含义类似,可根据实际情况添加注释 diff --git a/src/main/java/com/chint/interfaces/rest/ctrip/in/CTripNoteController.java b/src/main/java/com/chint/interfaces/rest/ctrip/in/CTripNoteController.java index 85b1ea43..c276c495 100644 --- a/src/main/java/com/chint/interfaces/rest/ctrip/in/CTripNoteController.java +++ b/src/main/java/com/chint/interfaces/rest/ctrip/in/CTripNoteController.java @@ -163,7 +163,12 @@ public class CTripNoteController { etaReason = hotelOrderInfoEntity.getLowPriceRC_VV();//超标原因 } if (etaReason == null) { - etaReason = hotelOrderInfoEntity.getAgreementRCInfo(); + String agreementRCInfo = hotelOrderInfoEntity.getAgreementRCInfo(); + if(agreementRCInfo.startsWith("其他")){ + etaReason = hotelOrderInfoEntity.getLowPriceRC_W(); + } else { + etaReason = agreementRCInfo; + } } yield etaReason != null ? etaReason : NO_ETA_AVAILABLE; } else { diff --git a/src/test/java/com/chint/CTripTest.java b/src/test/java/com/chint/CTripTest.java index ac1e8af3..d71b656a 100644 --- a/src/test/java/com/chint/CTripTest.java +++ b/src/test/java/com/chint/CTripTest.java @@ -247,7 +247,7 @@ public class CTripTest { @Test void search() { BaseContext.setCurrentUser(user); - SearchOrderResponse response = orderSearchRequest.searchOrderResponseByOrderId("30686209959"); + SearchOrderResponse response = orderSearchRequest.searchOrderResponseByOrderId("30386062604"); System.out.println(response); }