From a2e90181439f580dc2d885fd89d2d0454941d938 Mon Sep 17 00:00:00 2001 From: lulz1 Date: Wed, 28 Feb 2024 08:27:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../application/out/OrderOutController.java | 31 ++------ .../application/queryies/OrderQuery.java | 25 +++++- .../CTripOrderExtensionFactoryImpl.java | 1 + .../ctrip/dto/search/flight/BasicInfo.java | 77 +++++++++++++++++-- .../ctrip/dto/search/flight/DeliveryInfo.java | 17 ++-- .../search/flight/FlightOrderInfoEntity.java | 10 +-- .../ctrip/dto/search/flight/ItemDetail.java | 9 +++ .../ctrip/dto/search/flight/PaymentItem.java | 9 +++ .../dto/search/flight/ServiceDetailInfo.java | 13 ++++ .../java/com/chint/RouteApplicationTests.java | 6 +- 10 files changed, 151 insertions(+), 47 deletions(-) create mode 100644 src/main/java/com/chint/interfaces/rest/ctrip/dto/search/flight/ItemDetail.java create mode 100644 src/main/java/com/chint/interfaces/rest/ctrip/dto/search/flight/PaymentItem.java create mode 100644 src/main/java/com/chint/interfaces/rest/ctrip/dto/search/flight/ServiceDetailInfo.java diff --git a/src/main/java/com/chint/application/out/OrderOutController.java b/src/main/java/com/chint/application/out/OrderOutController.java index a3f2a15e..3f951b5a 100644 --- a/src/main/java/com/chint/application/out/OrderOutController.java +++ b/src/main/java/com/chint/application/out/OrderOutController.java @@ -1,14 +1,11 @@ package com.chint.application.out; -import com.chint.application.dtos.response.LegRes; -import com.chint.application.dtos.response.OrderDetailRes; import com.chint.application.dtos.response.RouteOrderPageRes; import com.chint.application.dtos.response.RouteOrderRes; import com.chint.application.dtos.trip.TripCallback; import com.chint.application.queryies.OrderQuery; import com.chint.domain.aggregates.order.RouteOrder; -import com.chint.domain.aggregates.user.User; import com.chint.domain.repository.UserRepository; import com.chint.domain.value_object.*; import com.chint.infrastructure.util.PageResult; @@ -21,10 +18,7 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import java.util.List; - import static com.chint.infrastructure.constant.CommonMessageConstant.SUCCESS; -import static com.chint.infrastructure.constant.OrderConstant.*; @RestController @RequestMapping("/order") @@ -40,9 +34,10 @@ public class OrderOutController { @ApiOperation("根据临时单号和系统编码查询订单") @PostMapping("/query/billcode") - public Result queryOrderByBillCodeAndSysCode(@RequestBody OrderQueryData queryData) { - return Result.Success(SUCCESS, orderQuery.queryByBillCodeAndSysCode(queryData.getBillcode(), queryData.getSysCode()) - .reloadStatus()); + public Result queryOrderByBillCodeAndSysCode(@RequestBody OrderQueryData queryData) { + RouteOrder routeOrder = orderQuery.queryByBillCodeAndSysCode(queryData.getBillcode(), queryData.getSysCode()) + .reloadStatus(); + return Result.Success(SUCCESS, orderQuery.queryRouteDetail(routeOrder)); } @@ -50,22 +45,7 @@ public class OrderOutController { @PostMapping("/query") public Result queryOrder(@RequestBody OrderQueryData queryData) { RouteOrder routeOrder = orderQuery.queryById(queryData.getRouteId()).reloadStatus(); - RouteOrderRes routeOrderRes = RouteOrderRes.copyFrom(routeOrder); - List list = routeOrder.getLegItems().stream().map(LegRes::copyFrom).toList(); - routeOrderRes.setLegResList(list); - List orderDetailResList = routeOrder - .getOrderDetails() - .stream() - .map(OrderDetailRes::copyFrom) - .toList(); - User user = userRepository.findByUserEmployeeNo(routeOrder.getUserId()); - routeOrderRes.setUserName(user.getName()); - routeOrderRes.setOrderDetailRes(orderDetailResList); - routeOrderRes.setOrderDetailRes(routeOrderRes - .getOrderDetailRes() - .stream() - .filter(it -> !it.getOrderStatus().equals(ORDER_EVENT_CANCEL_NAME) && !it.getOrderStatus().equals(ORDER_EVENT_PREPARE_NAME)) - .toList()); + RouteOrderRes routeOrderRes = orderQuery.queryRouteDetail(routeOrder); return Result.Success(SUCCESS, routeOrderRes); } @@ -94,7 +74,6 @@ public class OrderOutController { } - @ApiOperation("根据Id查询行程规划单-元年数据") @PostMapping("/query/tripCallback") public Result queryTripCallbackData(@RequestBody OrderQueryData queryData) { diff --git a/src/main/java/com/chint/application/queryies/OrderQuery.java b/src/main/java/com/chint/application/queryies/OrderQuery.java index 7fc44606..452f6817 100644 --- a/src/main/java/com/chint/application/queryies/OrderQuery.java +++ b/src/main/java/com/chint/application/queryies/OrderQuery.java @@ -1,8 +1,7 @@ package com.chint.application.queryies; import cn.hutool.core.bean.BeanUtil; -import com.chint.application.dtos.response.LocationRes; -import com.chint.application.dtos.response.RouteOrderPageRes; +import com.chint.application.dtos.response.*; import com.chint.application.dtos.trip.*; import com.chint.application.queryies.estimate.EstimatePrice; import com.chint.domain.aggregates.location.CityEntity; @@ -32,6 +31,8 @@ import java.util.Objects; import java.util.stream.Collectors; import java.util.stream.Stream; +import static com.chint.infrastructure.constant.OrderConstant.ORDER_EVENT_CANCEL_NAME; +import static com.chint.infrastructure.constant.OrderConstant.ORDER_EVENT_PREPARE_NAME; import static com.chint.infrastructure.constant.SupplierNameConstant.SUPPLIER_C_TRIP; @Service @@ -295,4 +296,24 @@ public class OrderQuery { default -> FSSCConstant.TRIP_CALLBACK_OTHER_TYPE; }; } + + public RouteOrderRes queryRouteDetail(RouteOrder routeOrder){ + RouteOrderRes routeOrderRes = RouteOrderRes.copyFrom(routeOrder); + List list = routeOrder.getLegItems().stream().map(LegRes::copyFrom).toList(); + routeOrderRes.setLegResList(list); + List orderDetailResList = routeOrder + .getOrderDetails() + .stream() + .map(OrderDetailRes::copyFrom) + .toList(); + User user = userRepository.findByUserEmployeeNo(routeOrder.getUserId()); + routeOrderRes.setUserName(user.getName()); + routeOrderRes.setOrderDetailRes(orderDetailResList); + routeOrderRes.setOrderDetailRes(routeOrderRes + .getOrderDetailRes() + .stream() + .filter(it -> !it.getOrderStatus().equals(ORDER_EVENT_CANCEL_NAME) && !it.getOrderStatus().equals(ORDER_EVENT_PREPARE_NAME)) + .toList()); + return routeOrderRes; + } } diff --git a/src/main/java/com/chint/domain/factoriy/order_detail/CTripOrderExtensionFactoryImpl.java b/src/main/java/com/chint/domain/factoriy/order_detail/CTripOrderExtensionFactoryImpl.java index 463a8e53..1e5b9176 100644 --- a/src/main/java/com/chint/domain/factoriy/order_detail/CTripOrderExtensionFactoryImpl.java +++ b/src/main/java/com/chint/domain/factoriy/order_detail/CTripOrderExtensionFactoryImpl.java @@ -85,6 +85,7 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory { flightOrderDetail.setBookingUserPhone(user.getPhoneNumber()); + return null; } diff --git a/src/main/java/com/chint/interfaces/rest/ctrip/dto/search/flight/BasicInfo.java b/src/main/java/com/chint/interfaces/rest/ctrip/dto/search/flight/BasicInfo.java index ba429868..7c449fba 100644 --- a/src/main/java/com/chint/interfaces/rest/ctrip/dto/search/flight/BasicInfo.java +++ b/src/main/java/com/chint/interfaces/rest/ctrip/dto/search/flight/BasicInfo.java @@ -3,13 +3,80 @@ package com.chint.interfaces.rest.ctrip.dto.search.flight; import lombok.Data; +import java.util.List; + @Data public class BasicInfo { - private String orderID; - private String tripID; - private String orderStatus; - private String orderStatusCode; + private String OrderID; + private String TripID; + private String OrderStatus; + private String OrderStatusCode; private String UID; + private String PreEmployName; + private String EmployeeID; + private int AccountID; + private int SubAccountID; + private String CorpPayType; + private String CreateTime; + private String FinishDate; + private String PrintTicketTime; + private String FlightClass; + private String FlightWay; + private String Remarks; + private int PreBookDays; + private ServiceDetailInfo ServiceDetailInfo; + private String NBillingType; + private String TicketStatus; + private String RebookOrderID; + private String ServerFrom; + private String IsOfficialCard; + private String BookingChannel; + private String PlatformOrderID; + private double PayExchangeRate; + private int OperationCode; + private double Amount; + private double TravelMoney; + private double ChangeAmount; + private double RefundAmount; + private double CCardPayFee; + private double SendTicketFee; + private double InsuranceFee; + private String PrepayType; + private double TotalServiceFee; + private String Currency; + private double ForeignAmount; + private boolean Refundable; + private boolean Rebookable; private String JourneyID; - // Other fields and getters/setters + private String CostCenter; + private String CostCenter2; + private String CostCenter3; + private String CostCenter4; + private String CostCenter5; + private String CostCenter6; + private String DefineFlag; + private String DefineFlag2; + private String JourneyReason; + private String Project; + private String AuditStatus; + private String ConfirmPerson; + private String ConfirmPerson2; + private Object ConfirmPersonCC; + private Object ConfirmPersonCC2; + private String ConfirmType; + private String ConfirmType2; + private boolean PayMixed; + private List PaymentItemList; + private String IsOnline; + private String CorporationId; + private int DockingVendorPlatform; + private Object DockingVendorPlatformAccount; + private Object CorpDockingInfoList; + private Object AirlineCountryIdEqualAccount; + private String PreEmployNamePinYin; + private boolean CancelAble; + private double NewTotalServiceFee; + private double PostBasicServiceFee; + private double PostItineraryFee; + private Object NewOrderIdList; } \ No newline at end of file diff --git a/src/main/java/com/chint/interfaces/rest/ctrip/dto/search/flight/DeliveryInfo.java b/src/main/java/com/chint/interfaces/rest/ctrip/dto/search/flight/DeliveryInfo.java index 6cb6c6fb..8dc09e33 100644 --- a/src/main/java/com/chint/interfaces/rest/ctrip/dto/search/flight/DeliveryInfo.java +++ b/src/main/java/com/chint/interfaces/rest/ctrip/dto/search/flight/DeliveryInfo.java @@ -1,12 +1,17 @@ package com.chint.interfaces.rest.ctrip.dto.search.flight; import lombok.Data; +import lombok.extern.slf4j.Slf4j; @Data -class DeliveryInfo { - private String deliveryInfo; - private String contactPhone; - private String contactMobile; - private String contactName; - // Other fields and getters/setters +public class DeliveryInfo { + private String DeliveryInfo; + private String ContactPhone; + private String ContactMobile; + private String ContactName; + private String DeliveryAddress; + private String ContactEmail; + private String ProvideBillType; + + // getters and setters } \ No newline at end of file diff --git a/src/main/java/com/chint/interfaces/rest/ctrip/dto/search/flight/FlightOrderInfoEntity.java b/src/main/java/com/chint/interfaces/rest/ctrip/dto/search/flight/FlightOrderInfoEntity.java index 606c5be3..6ac4587c 100644 --- a/src/main/java/com/chint/interfaces/rest/ctrip/dto/search/flight/FlightOrderInfoEntity.java +++ b/src/main/java/com/chint/interfaces/rest/ctrip/dto/search/flight/FlightOrderInfoEntity.java @@ -7,9 +7,9 @@ import java.util.List; @Data public class FlightOrderInfoEntity { - private BasicInfo basicInfo; - private DeliveryInfo deliveryInfo; - private List flightInfo; - private List passengerInfo; - private List flightOrderFeeDetailList; + private BasicInfo BasicInfo; + private DeliveryInfo DeliveryInfo; + private List FlightInfo; + private List PassengerInfo; + private List FlightOrderFeeDetailList; } diff --git a/src/main/java/com/chint/interfaces/rest/ctrip/dto/search/flight/ItemDetail.java b/src/main/java/com/chint/interfaces/rest/ctrip/dto/search/flight/ItemDetail.java new file mode 100644 index 00000000..85ceb815 --- /dev/null +++ b/src/main/java/com/chint/interfaces/rest/ctrip/dto/search/flight/ItemDetail.java @@ -0,0 +1,9 @@ +package com.chint.interfaces.rest.ctrip.dto.search.flight; + +class ItemDetail { + private int Sequence; + private long PassengerId; + private String PassengerName; + private String FeeCode; + private double FeeAmount; +} \ No newline at end of file diff --git a/src/main/java/com/chint/interfaces/rest/ctrip/dto/search/flight/PaymentItem.java b/src/main/java/com/chint/interfaces/rest/ctrip/dto/search/flight/PaymentItem.java new file mode 100644 index 00000000..61921eec --- /dev/null +++ b/src/main/java/com/chint/interfaces/rest/ctrip/dto/search/flight/PaymentItem.java @@ -0,0 +1,9 @@ +package com.chint.interfaces.rest.ctrip.dto.search.flight; + +import java.util.List; + +class PaymentItem { + private String PayType; + private double PayAmount; + private List ItemDetailList; +} diff --git a/src/main/java/com/chint/interfaces/rest/ctrip/dto/search/flight/ServiceDetailInfo.java b/src/main/java/com/chint/interfaces/rest/ctrip/dto/search/flight/ServiceDetailInfo.java new file mode 100644 index 00000000..4d335471 --- /dev/null +++ b/src/main/java/com/chint/interfaces/rest/ctrip/dto/search/flight/ServiceDetailInfo.java @@ -0,0 +1,13 @@ +package com.chint.interfaces.rest.ctrip.dto.search.flight; + +class ServiceDetailInfo { + private double BaseServiceFee; + private double BindServiceFee; + private double SpecialServiceFee; + private double UnWorkTimeServiceFee; + private double VIPServiceFee; + private double ItineraryFeeForRMB; + private double ItineraryFeeForForeign; + private double TechnicalServiceFee; + private double PresentInsuranceServiceFee; +} \ No newline at end of file diff --git a/src/test/java/com/chint/RouteApplicationTests.java b/src/test/java/com/chint/RouteApplicationTests.java index bbee742c..1479abeb 100644 --- a/src/test/java/com/chint/RouteApplicationTests.java +++ b/src/test/java/com/chint/RouteApplicationTests.java @@ -53,11 +53,11 @@ class RouteApplicationTests { LocalDateTime parse = LocalDateTime.parse("2024-04-15 23:59:00", dateTimeFormatter); System.out.println(parse); } -// @Test + @Test void loginSign() { - String sfno = "170717012"; + String sfno = "230615020"; String syscode = "FSSC"; - String billcode = "CLSQ240225000099"; + String billcode = "CLSQ240226000100"; String companycode = "正泰集团股份有限公司"; String sec = "Superdandan"; String timespan = "1708908662738";