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