From 022bc183ab7a49a95c180c741e7b28f5d7dcc615 Mon Sep 17 00:00:00 2001 From: sladro Date: Fri, 6 Feb 2026 08:17:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=BC=BA=E8=88=AA=E7=8F=AD=E6=8E=A8?= =?UTF-8?q?=E9=80=81=E6=95=B0=E6=8D=AE=E5=A4=84=E7=90=86=EF=BC=8C=E4=BC=98?= =?UTF-8?q?=E5=8C=96BizKey=E8=A7=A3=E6=9E=90=E9=80=BB=E8=BE=91=EF=BC=8C?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=AE=9E=E9=99=85=E6=8E=A8=E5=87=BA=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E5=AD=98=E5=82=A8=E8=87=B3Redis=EF=BC=8C=E4=BF=9D?= =?UTF-8?q?=E6=8C=81=E5=8E=9F=E6=9C=89=E8=B7=AF=E7=94=B1=E8=A7=A6=E5=8F=91?= =?UTF-8?q?=E8=A1=8C=E4=B8=BA=E3=80=82=E6=9B=B4=E6=96=B0=E6=96=87=E6=A1=A3?= =?UTF-8?q?=E4=BB=A5=E5=8F=8D=E6=98=A0=E7=B3=BB=E7=BB=9F=E8=83=BD=E5=8A=9B?= =?UTF-8?q?=E5=92=8C=E6=8E=A5=E5=8F=A3=E8=B0=83=E7=94=A8=E7=A4=BA=E4=BE=8B?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- accoutn.md | 42 ++++++++++++ .../AdxpFlightServiceWebSocketClient.java | 68 +++++++++++++++---- 命令.md | 45 +++++++++++- 3 files changed, 139 insertions(+), 16 deletions(-) create mode 100644 accoutn.md diff --git a/accoutn.md b/accoutn.md new file mode 100644 index 0000000..900bc84 --- /dev/null +++ b/accoutn.md @@ -0,0 +1,42 @@ +1.登录零信任平台 aTrust +(1)零信任账号tianjianyong, +(2)初始密码Qdairport@tao12 +(3)新密码 0703Dnkj@0703 +(4)新密码1107Dnkj@1107 +(5)1107Dnkj@1108 +2.运维审计系统账号密码 +(1)dxyk 账号 +(2)dnxxkj@1234 密码 +(3)Qdairport@tao12 +(4)Qdairport@tao13 +(5)Qdairport@tao14 +(6)`Zz301301 +3.正式平台--10.64.58.228 +(1)root --账号 +(2)Yptvmpasswd12#$ -- 密码 +(3)Yptvmpasswd12#$ +(4)Z31020**&d1231=+33 +4.测试平台-- 10.100.23.10 +(1)root +①Huawei@123 +5.红绿灯测试平台-- 10.98.23.111 windows系统 +(1)账密 +①administrator +②Huawei@123 +6.GIS--10.98.23.81 +(1)root +(2)Huawei@123 + + + + +min: 0, max: 8, avg: 0.11 (1768 samples) + + + +used_memory_human:7.94M +mem_fragmentation_ratio:1.36 +mem_clients_normal:5146661 + + +/home/project_20250804/qaup/adxp-adapter diff --git a/qaup-collision/src/main/java/com/qaup/collision/datacollector/websocket/AdxpFlightServiceWebSocketClient.java b/qaup-collision/src/main/java/com/qaup/collision/datacollector/websocket/AdxpFlightServiceWebSocketClient.java index a524fc7..5df808f 100644 --- a/qaup-collision/src/main/java/com/qaup/collision/datacollector/websocket/AdxpFlightServiceWebSocketClient.java +++ b/qaup-collision/src/main/java/com/qaup/collision/datacollector/websocket/AdxpFlightServiceWebSocketClient.java @@ -6,7 +6,6 @@ import com.qaup.collision.datacollector.config.FlightSdkProperties; import com.qaup.collision.datacollector.dto.FlightNotificationDTO; import com.qaup.collision.dataprocessing.service.DataProcessingService; import com.qaup.common.core.redis.RedisCache; -import jakarta.annotation.PostConstruct; import jakarta.annotation.PreDestroy; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; @@ -656,26 +655,65 @@ public class AdxpFlightServiceWebSocketClient implements WebSocketHandler { } private FlightNotificationDTO handleAXOT(org.w3c.dom.Element root) { - String flightNo = getTextContent(root, "BizKey"); - //分解BizKey - String[] arr = flightNo.split("-", 3); // 最多切 3 段 + // BizKey 常见格式:FLIGHTNO-进出港标识-时间(yyyyMMddHHmmss) 或其他分段 + String bizKey = getTextContent(root, "BizKey"); + String flightNumber = getTextContent(root, "FlightNumber"); + String actualPushback = getTextContent(root, "ActualPushback"); + + // 分解 BizKey(最少保证不会抛异常) + String[] arr = (bizKey == null ? new String[0] : bizKey.split("-", 3)); // 最多切 3 段 + String flightNoForKey = (arr.length >= 1 && arr[0] != null && !arr[0].isBlank()) + ? arr[0] + : (flightNumber != null && !flightNumber.isBlank() ? flightNumber : bizKey); + FlightNotificationDTO dto = new FlightNotificationDTO(); - dto.setFlightNo(flightNo); + // 保持兼容:如果FlightNumber存在优先用它;否则回退到BizKey + dto.setFlightNo(flightNumber != null && !flightNumber.isBlank() ? flightNumber : bizKey); dto.setType("OUT"); - // 存储到Redis - if (arr.length >= 3) { + + // 解析推出时间(ActualPushback),用于“推出事件时间”展示/调试 + if (actualPushback != null && !actualPushback.isBlank()) { try { - String key = "flight:" + arr[0]; // 使用航班号作为键 - redisCache.setCacheMapValue(key, "flightNumber", arr[0]); - redisCache.setCacheMapValue(key, "type", arr[1]); - redisCache.setCacheMapValue(key, "time", arr[2]); - log.info("成功将航班数据存储到Redis: flightNumber={}, type={}, time={}", arr[0], arr[1], arr[2]); + java.time.format.DateTimeFormatter formatter = java.time.format.DateTimeFormatter.ofPattern("yyyyMMddHHmmss"); + java.time.LocalDateTime pushbackTime = java.time.LocalDateTime.parse(actualPushback.trim(), formatter); + dto.setTime(pushbackTime.atZone(java.time.ZoneId.systemDefault()).toInstant().toEpochMilli()); } catch (Exception e) { - log.error("存储航班数据到Redis失败: {}", e.getMessage()); + log.warn("无法解析推出时间(ActualPushback): {}", actualPushback); } } - //假装模拟请求接口 - dataProcessingService.AXOT(arr[0]); + + // 存储到Redis:保留原有字段,同时补充 actualPushback 便于运行环境调试 + if (flightNoForKey != null && !flightNoForKey.isBlank()) { + try { + String key = "flight:" + flightNoForKey.trim(); // 使用航班号作为键 + redisCache.setCacheMapValue(key, "flightNumber", flightNoForKey.trim()); + if (arr.length >= 2) { + redisCache.setCacheMapValue(key, "type", arr[1]); + } + if (arr.length >= 3) { + redisCache.setCacheMapValue(key, "time", arr[2]); + } + if (actualPushback != null && !actualPushback.isBlank()) { + redisCache.setCacheMapValue(key, "actualPushback", actualPushback.trim()); + } + if (dto.getTime() != null) { + redisCache.setCacheMapValue(key, "pushbackTimeMs", String.valueOf(dto.getTime())); + } + log.info("成功将航班推出数据存储到Redis: flightNumber={}, bizKey={}, actualPushback={}", + flightNoForKey, bizKey, actualPushback); + } catch (Exception e) { + log.error("存储航班推出数据到Redis失败: {}", e.getMessage()); + } + } + + // 保持原有行为:触发路由查询 + if (arr.length >= 1 && arr[0] != null && !arr[0].isBlank()) { + dataProcessingService.AXOT(arr[0]); + } else if (flightNumber != null && !flightNumber.isBlank()) { + dataProcessingService.AXOT(flightNumber); + } else { + log.warn("AXOT事件缺少可用航班号,跳过路由触发: bizKey={}, flightNumber={}", bizKey, flightNumber); + } return dto; } diff --git a/命令.md b/命令.md index 9a7f1e9..3aeb400 100644 --- a/命令.md +++ b/命令.md @@ -6,4 +6,47 @@ mvn -pl qaup-admin -am package -DskipTests ``` #测试本地 java "-Dfile.encoding=GBK" -jar "qaup-admin\target\qaup-admin.jar" --spring.profiles.active=dev,druid -``` \ No newline at end of file +``` + +有:系统里已经有“航空器滑行路由”能力,并会推送给前端 + + • 路由来源:通过外部“机场滑行/路径规划”接口获取(DataCollectorDao#getArrivalRoute() / getDepartureRoute(),调用 + /runwayPathPlanningController/... 返回 taxiway 路由 GeoJSON)。 + • 触发方式:当前主要是收到航班进/出港通知(ARR/AXOT)后触发查询,不是靠“进入范围”/围栏触发。 + • AdxpFlightServiceWebSocketClient 解析到 ARR/AXOT 后会调用 DataProcessingService.ARR()/AXOT() 去拉路由并处理。 + • 推送前端:发布 AircraftRouteUpdateEvent,由 AircraftRouteUpdateEventListener 通过 WebSocket 广播,消息 type = + "aircraftRouteUpdate",带 routeCodes + routeGeometry(WKT) 等字段。 + • 落库:RoutePersistenceService 会把路由保存到 transport_routes,并写 object_route_assignment 关联航班号。 + +docker exec -it 3ba259ca788a sh -lc "curl -s http://localhost:8086/api/adxp/messages | head" +docker exec -it redis redis-cli HGET flight:CA1234 actualPushback +docker exec -it redis redis-cli HGET flight:CA1234 pushbackTimeMs + + +docker exec -it qaup-app sh -lc ' +echo "ADXP=$ADXP_HOST:$ADXP_PORT"; +curl -sv "http://$ADXP_HOST:$ADXP_PORT/actuator/health" 2>&1 | head -n 20; +echo "----"; +curl -sv "http://$ADXP_HOST:$ADXP_PORT/api/adxp/status" 2>&1 | head -n 40; +echo "----"; +curl -sv "http://$ADXP_HOST:$ADXP_PORT/api/adxp/messages" 2>&1 | head -n 60; +' + +docker logs qaup-app | grep -n "ADXP" | tail -n 200 + +docker logs qaup-app | grep -n "flight-notifications" | tail -n 200 + + +### 确定adapter没问题 +tail -n 20000 /home/project_20250804/qaup/adxp-adapter/logs/adapter-logs.log | grep -E "事件的类型是|ADXP_NAOMS_O_CDM_AXOT" | tail -n 200 + +docker logs qaup-app | grep -E "通过WebSocket接收到|AXOT|BizKey|ActualPushback" | tail -n 200 + +docker exec -it qaup-app sh -lc ' +while true; do + r=$(curl -s "http://$ADXP_HOST:$ADXP_PORT/api/adxp/messages"); + echo "$r" | grep -q "ADXP_NAOMS_O_CDM_AXOT" && echo "FOUND AXOT" && echo "$r" && break; + echo "$(date +%T) no-axot"; + sleep 1; +done +' \ No newline at end of file