修复同程火车超标回推
This commit is contained in:
parent
8f0aa3bc82
commit
dc7fe144ac
|
@ -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")
|
||||
|
|
|
@ -6,6 +6,6 @@ import java.time.LocalDateTime;
|
|||
|
||||
@Data
|
||||
public class OrderBaseRecord {
|
||||
private LocalDateTime createTime;
|
||||
private LocalDateTime updateTime;
|
||||
private LocalDateTime createDataTime;
|
||||
private LocalDateTime updateDataTime;
|
||||
}
|
||||
|
|
|
@ -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; // 结算明细唯一标识
|
||||
|
|
|
@ -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; // 结算明细唯一标识
|
||||
|
|
|
@ -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; // 结算明细唯一标识
|
||||
|
|
|
@ -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; // 结算明细唯一标识
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue