Refactor AdxpFlightServiceWebSocketClient and DataProcessingService to remove unused seat handling and streamline Redis parameter retrieval logic,修复contactcross
This commit is contained in:
parent
c7060ce327
commit
900ccdbb02
@ -1012,7 +1012,6 @@ public class AdxpFlightServiceWebSocketClient implements WebSocketHandler {
|
||||
String flightNumber = normalizeFlightNo(flightNumberRaw);
|
||||
String flightId = normalizeFlightNo(flightIdRaw);
|
||||
String contactCross = getTextContent(root, "ContactCross");
|
||||
String seat = getTextContentAny(root, "Seat", "SEAT");
|
||||
String type = getTextContent(root, "Type");
|
||||
long nowMs = System.currentTimeMillis();
|
||||
|
||||
@ -1048,7 +1047,6 @@ public class AdxpFlightServiceWebSocketClient implements WebSocketHandler {
|
||||
dto.setType(routeType);
|
||||
if ("IN".equalsIgnoreCase(routeType)) {
|
||||
dto.setContactCross(contactCross);
|
||||
dto.setSeat(seat);
|
||||
}
|
||||
|
||||
// TISFLIGHT 特殊:可能无 BizKey。无 BizKey 时先 FuId 关联,再按航班号回退。
|
||||
@ -1066,22 +1064,12 @@ public class AdxpFlightServiceWebSocketClient implements WebSocketHandler {
|
||||
updateActiveBizKey(flightKey, normalizedBizKey, nowMs);
|
||||
// contactCross 仅对进港有效,避免进出港参数串用
|
||||
if ("IN".equalsIgnoreCase(routeType)
|
||||
&& canUpdateRouteParams
|
||||
&& contactCross != null && !contactCross.isBlank()) {
|
||||
setValueOnFlightAndBizKeys(flightKey, bizRedisKey, "contactCross", contactCross);
|
||||
setValueOnFlightAndBizKeys(flightKey, bizRedisKey, "contactCrossTs", String.valueOf(nowMs));
|
||||
}
|
||||
// TISFLIGHT 也可提供 seat,作为 CRAFTSEAT 的补充来源
|
||||
if (canUpdateRouteParams
|
||||
&& seat != null && !seat.isBlank()) {
|
||||
setValueOnFlightAndBizKeys(flightKey, bizRedisKey, "seat", seat);
|
||||
setValueOnFlightAndBizKeys(flightKey, bizRedisKey, "seatTs", String.valueOf(nowMs));
|
||||
if ("OUT".equalsIgnoreCase(routeType)) {
|
||||
setValueOnFlightAndBizKeys(flightKey, bizRedisKey, "startSeat", seat);
|
||||
setValueOnFlightAndBizKeys(flightKey, bizRedisKey, "startSeatTs", String.valueOf(nowMs));
|
||||
}
|
||||
}
|
||||
if (!canUpdateRouteParams && (contactCross != null || seat != null)) {
|
||||
if (!canUpdateRouteParams && contactCross != null) {
|
||||
log.warn("TISFLIGHT未建立BizKey关联,跳过contactCross/seat覆盖: flNo={}, flightId={}, fuId={}, bizKey={}, resolvedFlightNo={}",
|
||||
flightNumber, flightId, fuId, bizKey, resolvedFlightNo);
|
||||
}
|
||||
|
||||
@ -1349,19 +1349,25 @@ public class DataProcessingService {
|
||||
}
|
||||
|
||||
private String readRedisParamBySelectedKey(String bizRedisKey, String flightKey, String field) {
|
||||
String sourceKey = bizRedisKey != null ? bizRedisKey : flightKey;
|
||||
if (sourceKey == null) {
|
||||
return null;
|
||||
String value = null;
|
||||
if (bizRedisKey != null) {
|
||||
value = normalizeRedisString(redisCache.getCacheMapValue(bizRedisKey, field));
|
||||
}
|
||||
return normalizeRedisString(redisCache.getCacheMapValue(sourceKey, field));
|
||||
if ((value == null || value.isBlank()) && flightKey != null) {
|
||||
value = normalizeRedisString(redisCache.getCacheMapValue(flightKey, field));
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
private Long readRedisParamLongBySelectedKey(String bizRedisKey, String flightKey, String field) {
|
||||
String sourceKey = bizRedisKey != null ? bizRedisKey : flightKey;
|
||||
if (sourceKey == null) {
|
||||
return null;
|
||||
Long value = null;
|
||||
if (bizRedisKey != null) {
|
||||
value = parseRedisLong(redisCache.getCacheMapValue(bizRedisKey, field));
|
||||
}
|
||||
return parseRedisLong(redisCache.getCacheMapValue(sourceKey, field));
|
||||
if (value == null && flightKey != null) {
|
||||
value = parseRedisLong(redisCache.getCacheMapValue(flightKey, field));
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
private static Long parseRedisLong(Object v) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user