From dc7fe144ac6bdb96bf797675ed752146e82982c7 Mon Sep 17 00:00:00 2001 From: lulz1 Date: Tue, 26 Mar 2024 15:37:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=90=8C=E7=A8=8B=E7=81=AB?= =?UTF-8?q?=E8=BD=A6=E8=B6=85=E6=A0=87=E5=9B=9E=E6=8E=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/aggregates/order/OrderDetail.java | 1 + .../order/order_record/OrderBaseRecord.java | 4 ++-- .../order/order_record/OrderCarRecord.java | 3 ++- .../order/order_record/OrderFlightRecord.java | 1 + .../order/order_record/OrderHotelRecord.java | 1 + .../order/order_record/OrderTrainRecord.java | 1 + .../interfaces/rest/base/PostRequest.java | 23 +++++++++++++++++-- .../rest/ctrip/CTripLoginRequest.java | 15 +++++++++++- .../rest/ly/in/LYETAController.java | 4 +++- 9 files changed, 46 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/chint/domain/aggregates/order/OrderDetail.java b/src/main/java/com/chint/domain/aggregates/order/OrderDetail.java index ec380d38..24530cae 100644 --- a/src/main/java/com/chint/domain/aggregates/order/OrderDetail.java +++ b/src/main/java/com/chint/domain/aggregates/order/OrderDetail.java @@ -52,6 +52,7 @@ public class OrderDetail implements Serializable { private LocalDateTime endTime; private LocalDateTime createTime; private LocalDateTime updateTime; + private Integer ifOrigin; //是否只根订单 , 只有根订单挂载了订单结算流水 // 根据需要添加构造函数、getter、setter等 @MappedCollection(idColumn = "order_id", keyColumn = "order_key") diff --git a/src/main/java/com/chint/domain/aggregates/order/order_record/OrderBaseRecord.java b/src/main/java/com/chint/domain/aggregates/order/order_record/OrderBaseRecord.java index f80a7149..65a3be19 100644 --- a/src/main/java/com/chint/domain/aggregates/order/order_record/OrderBaseRecord.java +++ b/src/main/java/com/chint/domain/aggregates/order/order_record/OrderBaseRecord.java @@ -6,6 +6,6 @@ import java.time.LocalDateTime; @Data public class OrderBaseRecord { - private LocalDateTime createTime; - private LocalDateTime updateTime; + private LocalDateTime createDataTime; + private LocalDateTime updateDataTime; } 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 d038954f..b5d1ed1f 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 @@ -3,8 +3,9 @@ package com.chint.domain.aggregates.order.order_record; import lombok.Data; @Data -public class OrderCarRecord { +public class OrderCarRecord extends OrderBaseRecord { private Long id; + private Long orderDetailId; private String trvaleSysType; // 数据来源商旅平台 XC:携程 TC:同程 private String belongSysType; // 对应所属系统 GF_FK:股份费控 XN_FK:新能费控 AN_FK:安能费控 JT_BPM:集团BPM NOT:无系统标识 private String detailId; // 结算明细唯一标识 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 36657c3e..ffaf0d6e 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 @@ -5,6 +5,7 @@ import lombok.Data; @Data public class OrderFlightRecord extends OrderBaseRecord{ private Long id; + private Long orderDetailId; private String trvaleSysType; // 数据来源商旅平台 XC:携程 TC:同程 private String belongSysType; // 对应所属系统 GF_FK:股份费控 XN_FK:新能费控 AN_FK:安能费控 JT_BPM:集团BPM NOT:无系统标识 private String detailId; // 结算明细唯一标识 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 bcb1d414..ce21bb90 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 @@ -5,6 +5,7 @@ import lombok.Data; @Data public class OrderHotelRecord extends OrderBaseRecord{ private Long id; + private Long orderDetailId; private String trvaleSysType; // 数据来源商旅平台 XC:携程 TC:同程 private String belongSysType; // 对应所属系统 GF_FK:股份费控 XN_FK:新能费控 AN_FK:安能费控 JT_BPM:集团BPM NOT:无系统标识 private String detailId; // 结算明细唯一标识 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 0db6aa8c..ef397bb9 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 @@ -5,6 +5,7 @@ import lombok.Data; @Data public class OrderTrainRecord extends OrderBaseRecord{ private Long id; + private Long orderDetailId; private String trvaleSysType; // 数据来源商旅平台 XC:携程 TC:同程 private String belongSysType; // 对应所属系统 GF_FK:股份费控 XN_FK:新能费控 AN_FK:安能费控 JT_BPM:集团BPM NOT:无系统标识 private String detailId; // 结算明细唯一标识 diff --git a/src/main/java/com/chint/interfaces/rest/base/PostRequest.java b/src/main/java/com/chint/interfaces/rest/base/PostRequest.java index 0adeed1e..b74adfaa 100644 --- a/src/main/java/com/chint/interfaces/rest/base/PostRequest.java +++ b/src/main/java/com/chint/interfaces/rest/base/PostRequest.java @@ -1,7 +1,5 @@ package com.chint.interfaces.rest.base; -import com.chint.domain.aggregates.user.User; -import com.chint.infrastructure.util.BaseContext; import com.alibaba.fastjson.JSON; import com.google.gson.Gson; import lombok.Data; @@ -172,6 +170,27 @@ public class PostRequest { } } + public String getReDirectUrl(HttpPost request) { + CloseableHttpClient client = HttpClients.createDefault(); + // 配置请求以禁用重定向 + RequestConfig requestConfig = RequestConfig.custom() + .setRedirectsEnabled(false) + .setConnectionRequestTimeout(10000) //申请请求超时时间为10秒 + .build(); + request.setConfig(requestConfig); + HttpResponse response = null; + try { + response = client.execute(request); + } catch (IOException e) { + return REDIRECT_NOT_EXIST; + } + Header location = response.getFirstHeader("Location"); + if (location != null) { + return location.getValue(); + } else { + return REDIRECT_NOT_EXIST; + } + } @Data public static class CachedUrl { diff --git a/src/main/java/com/chint/interfaces/rest/ctrip/CTripLoginRequest.java b/src/main/java/com/chint/interfaces/rest/ctrip/CTripLoginRequest.java index 6cfae701..041f84c1 100644 --- a/src/main/java/com/chint/interfaces/rest/ctrip/CTripLoginRequest.java +++ b/src/main/java/com/chint/interfaces/rest/ctrip/CTripLoginRequest.java @@ -54,6 +54,7 @@ public class CTripLoginRequest { private String C_TRIP_APP_SECURITY; private String loginUrl; + //PC单点登录 private String authLoginUrl; @@ -218,6 +219,7 @@ public class CTripLoginRequest { hSingleLoginParam.setSignature(finallySign); HttpPost httpPost = new HttpPost(hSinngleLoginUrl); + List entitys = new ArrayList<>(); entitys.add(new BasicNameValuePair("accessUserId", accessUserId)); entitys.add(new BasicNameValuePair("employeeId", employeeId)); @@ -243,6 +245,18 @@ public class CTripLoginRequest { } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } +// UrlEncodedFormEntity entity = null; +// try { +// entity = new UrlEncodedFormEntity(entitys, "UTF-8"); +// } catch (UnsupportedEncodingException e) { +// +// } +// httpPost.setEntity(entity); +// String reDirectUrl = postRequest.getReDirectUrl(httpPost); +// H5Response h5Response = new H5Response(); +// h5Response.setSuccess(true); +// h5Response.setRedirectUrl(reDirectUrl); +// return h5Response; } private static boolean isContainsChinese(String input) { @@ -294,7 +308,6 @@ public class CTripLoginRequest { String regexPattern = "var config = \\{\"url\":\"(.*?)\",\"appid\":"; Pattern pattern = Pattern.compile(regexPattern); Matcher matcher = pattern.matcher(htmlContent); - if (matcher.find()) { return matcher.group(1); } else { diff --git a/src/main/java/com/chint/interfaces/rest/ly/in/LYETAController.java b/src/main/java/com/chint/interfaces/rest/ly/in/LYETAController.java index 8c86ac1b..d10b488f 100644 --- a/src/main/java/com/chint/interfaces/rest/ly/in/LYETAController.java +++ b/src/main/java/com/chint/interfaces/rest/ly/in/LYETAController.java @@ -18,6 +18,7 @@ import com.chint.interfaces.rest.ly.dto.eta.LyETAPush; import com.chint.interfaces.rest.ly.dto.search.response.filght.FlightOrderResponse; import com.chint.interfaces.rest.ly.dto.search.response.hotel.HotelDetailResponse; import com.chint.interfaces.rest.ly.dto.search.response.train.TrainDetailResponse; +import com.google.gson.Gson; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; @@ -62,7 +63,8 @@ public class LYETAController { return LYNoteResponse.error("推送类型错误"); } String notifyDataJson = lyETAPush.getNotifyData(); - LyETAPush.NotifyData data = JSON.parseObject(notifyDataJson, LyETAPush.NotifyData.class); + Gson gson = new Gson(); + LyETAPush.NotifyData data = gson.fromJson(notifyDataJson, LyETAPush.NotifyData.class); lyETAPush.setNotifyDataObject(data); LyETAPush.NotifyData notifyData = lyETAPush.getNotifyDataObject();