修复同程火车超标回推

This commit is contained in:
lulz1 2024-03-26 15:37:06 +08:00
parent 8f0aa3bc82
commit dc7fe144ac
9 changed files with 46 additions and 7 deletions

View File

@ -52,6 +52,7 @@ public class OrderDetail implements Serializable {
private LocalDateTime endTime; private LocalDateTime endTime;
private LocalDateTime createTime; private LocalDateTime createTime;
private LocalDateTime updateTime; private LocalDateTime updateTime;
private Integer ifOrigin; //是否只根订单 只有根订单挂载了订单结算流水
// 根据需要添加构造函数gettersetter等 // 根据需要添加构造函数gettersetter等
@MappedCollection(idColumn = "order_id", keyColumn = "order_key") @MappedCollection(idColumn = "order_id", keyColumn = "order_key")

View File

@ -6,6 +6,6 @@ import java.time.LocalDateTime;
@Data @Data
public class OrderBaseRecord { public class OrderBaseRecord {
private LocalDateTime createTime; private LocalDateTime createDataTime;
private LocalDateTime updateTime; private LocalDateTime updateDataTime;
} }

View File

@ -3,8 +3,9 @@ package com.chint.domain.aggregates.order.order_record;
import lombok.Data; import lombok.Data;
@Data @Data
public class OrderCarRecord { public class OrderCarRecord extends OrderBaseRecord {
private Long id; private Long id;
private Long orderDetailId;
private String trvaleSysType; // 数据来源商旅平台 XC携程 TC同程 private String trvaleSysType; // 数据来源商旅平台 XC携程 TC同程
private String belongSysType; // 对应所属系统 GF_FK股份费控 XN_FK新能费控 AN_FK安能费控 JT_BPM集团BPM NOT无系统标识 private String belongSysType; // 对应所属系统 GF_FK股份费控 XN_FK新能费控 AN_FK安能费控 JT_BPM集团BPM NOT无系统标识
private String detailId; // 结算明细唯一标识 private String detailId; // 结算明细唯一标识

View File

@ -5,6 +5,7 @@ import lombok.Data;
@Data @Data
public class OrderFlightRecord extends OrderBaseRecord{ public class OrderFlightRecord extends OrderBaseRecord{
private Long id; private Long id;
private Long orderDetailId;
private String trvaleSysType; // 数据来源商旅平台 XC携程 TC同程 private String trvaleSysType; // 数据来源商旅平台 XC携程 TC同程
private String belongSysType; // 对应所属系统 GF_FK股份费控 XN_FK新能费控 AN_FK安能费控 JT_BPM集团BPM NOT无系统标识 private String belongSysType; // 对应所属系统 GF_FK股份费控 XN_FK新能费控 AN_FK安能费控 JT_BPM集团BPM NOT无系统标识
private String detailId; // 结算明细唯一标识 private String detailId; // 结算明细唯一标识

View File

@ -5,6 +5,7 @@ import lombok.Data;
@Data @Data
public class OrderHotelRecord extends OrderBaseRecord{ public class OrderHotelRecord extends OrderBaseRecord{
private Long id; private Long id;
private Long orderDetailId;
private String trvaleSysType; // 数据来源商旅平台 XC携程 TC同程 private String trvaleSysType; // 数据来源商旅平台 XC携程 TC同程
private String belongSysType; // 对应所属系统 GF_FK股份费控 XN_FK新能费控 AN_FK安能费控 JT_BPM集团BPM NOT无系统标识 private String belongSysType; // 对应所属系统 GF_FK股份费控 XN_FK新能费控 AN_FK安能费控 JT_BPM集团BPM NOT无系统标识
private String detailId; // 结算明细唯一标识 private String detailId; // 结算明细唯一标识

View File

@ -5,6 +5,7 @@ import lombok.Data;
@Data @Data
public class OrderTrainRecord extends OrderBaseRecord{ public class OrderTrainRecord extends OrderBaseRecord{
private Long id; private Long id;
private Long orderDetailId;
private String trvaleSysType; // 数据来源商旅平台 XC携程 TC同程 private String trvaleSysType; // 数据来源商旅平台 XC携程 TC同程
private String belongSysType; // 对应所属系统 GF_FK股份费控 XN_FK新能费控 AN_FK安能费控 JT_BPM集团BPM NOT无系统标识 private String belongSysType; // 对应所属系统 GF_FK股份费控 XN_FK新能费控 AN_FK安能费控 JT_BPM集团BPM NOT无系统标识
private String detailId; // 结算明细唯一标识 private String detailId; // 结算明细唯一标识

View File

@ -1,7 +1,5 @@
package com.chint.interfaces.rest.base; 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.alibaba.fastjson.JSON;
import com.google.gson.Gson; import com.google.gson.Gson;
import lombok.Data; 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 @Data
public static class CachedUrl { public static class CachedUrl {

View File

@ -54,6 +54,7 @@ public class CTripLoginRequest {
private String C_TRIP_APP_SECURITY; private String C_TRIP_APP_SECURITY;
private String loginUrl; private String loginUrl;
//PC单点登录 //PC单点登录
private String authLoginUrl; private String authLoginUrl;
@ -218,6 +219,7 @@ public class CTripLoginRequest {
hSingleLoginParam.setSignature(finallySign); hSingleLoginParam.setSignature(finallySign);
HttpPost httpPost = new HttpPost(hSinngleLoginUrl); HttpPost httpPost = new HttpPost(hSinngleLoginUrl);
List entitys = new ArrayList<>(); List entitys = new ArrayList<>();
entitys.add(new BasicNameValuePair("accessUserId", accessUserId)); entitys.add(new BasicNameValuePair("accessUserId", accessUserId));
entitys.add(new BasicNameValuePair("employeeId", employeeId)); entitys.add(new BasicNameValuePair("employeeId", employeeId));
@ -243,6 +245,18 @@ public class CTripLoginRequest {
} catch (UnsupportedEncodingException e) { } catch (UnsupportedEncodingException e) {
throw new RuntimeException(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) { private static boolean isContainsChinese(String input) {
@ -294,7 +308,6 @@ public class CTripLoginRequest {
String regexPattern = "var config = \\{\"url\":\"(.*?)\",\"appid\":"; String regexPattern = "var config = \\{\"url\":\"(.*?)\",\"appid\":";
Pattern pattern = Pattern.compile(regexPattern); Pattern pattern = Pattern.compile(regexPattern);
Matcher matcher = pattern.matcher(htmlContent); Matcher matcher = pattern.matcher(htmlContent);
if (matcher.find()) { if (matcher.find()) {
return matcher.group(1); return matcher.group(1);
} else { } else {

View File

@ -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.filght.FlightOrderResponse;
import com.chint.interfaces.rest.ly.dto.search.response.hotel.HotelDetailResponse; import com.chint.interfaces.rest.ly.dto.search.response.hotel.HotelDetailResponse;
import com.chint.interfaces.rest.ly.dto.search.response.train.TrainDetailResponse; import com.chint.interfaces.rest.ly.dto.search.response.train.TrainDetailResponse;
import com.google.gson.Gson;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
@ -62,7 +63,8 @@ public class LYETAController {
return LYNoteResponse.error("推送类型错误"); return LYNoteResponse.error("推送类型错误");
} }
String notifyDataJson = lyETAPush.getNotifyData(); 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.setNotifyDataObject(data);
LyETAPush.NotifyData notifyData = lyETAPush.getNotifyDataObject(); LyETAPush.NotifyData notifyData = lyETAPush.getNotifyDataObject();