同步代码

This commit is contained in:
lulz1 2024-02-28 08:27:15 +08:00
parent 962c1c448f
commit a2e9018143
10 changed files with 151 additions and 47 deletions

View File

@ -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<RouteOrder> queryOrderByBillCodeAndSysCode(@RequestBody OrderQueryData queryData) {
return Result.Success(SUCCESS, orderQuery.queryByBillCodeAndSysCode(queryData.getBillcode(), queryData.getSysCode())
.reloadStatus());
public Result<RouteOrderRes> 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<RouteOrderRes> queryOrder(@RequestBody OrderQueryData queryData) {
RouteOrder routeOrder = orderQuery.queryById(queryData.getRouteId()).reloadStatus();
RouteOrderRes routeOrderRes = RouteOrderRes.copyFrom(routeOrder);
List<LegRes> list = routeOrder.getLegItems().stream().map(LegRes::copyFrom).toList();
routeOrderRes.setLegResList(list);
List<OrderDetailRes> 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<TripCallback> queryTripCallbackData(@RequestBody OrderQueryData queryData) {

View File

@ -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<LegRes> list = routeOrder.getLegItems().stream().map(LegRes::copyFrom).toList();
routeOrderRes.setLegResList(list);
List<OrderDetailRes> 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;
}
}

View File

@ -85,6 +85,7 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory {
flightOrderDetail.setBookingUserPhone(user.getPhoneNumber());
return null;
}

View File

@ -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<PaymentItem> 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;
}

View File

@ -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
}

View File

@ -7,9 +7,9 @@ import java.util.List;
@Data
public class FlightOrderInfoEntity {
private BasicInfo basicInfo;
private DeliveryInfo deliveryInfo;
private List<FlightInfo> flightInfo;
private List<PassengerInfo> passengerInfo;
private List<FlightOrderFeeDetail> flightOrderFeeDetailList;
private BasicInfo BasicInfo;
private DeliveryInfo DeliveryInfo;
private List<FlightInfo> FlightInfo;
private List<PassengerInfo> PassengerInfo;
private List<FlightOrderFeeDetail> FlightOrderFeeDetailList;
}

View File

@ -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;
}

View File

@ -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<ItemDetail> ItemDetailList;
}

View File

@ -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;
}

View File

@ -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";