From 89b7ce697d92cca53a0d966e5658c5897bba3302 Mon Sep 17 00:00:00 2001 From: lixiaolong <702156524@qq.com> Date: Wed, 18 Mar 2026 13:33:54 +0800 Subject: [PATCH] =?UTF-8?q?refactor(edge):=20=E4=BC=98=E5=8C=96=E8=BE=B9?= =?UTF-8?q?=E7=BC=98=E7=9B=B8=E6=9C=BA=E5=92=8C=E8=A7=A6=E6=8E=A7=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E6=9C=8D=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将边缘相机服务从 getRGBDImages 方法切换为 getRGBImage 方法 - 简化 TiTouchOperateService 中的路径搜索逻辑 - 移除硬编码的当前位置值,改为从输入参数获取 - 集成 exTiVehicleFunctionService 服务进行功能查找 - 简化路径匹配和下一步计算逻辑 - 统一输出结构,直接使用服务返回的 JSON 对象数据 --- .../edge/EdgeCameraOperateService.java | 2 +- .../edge/ti/TiTouchOperateService.java | 47 +++---------------- 2 files changed, 8 insertions(+), 41 deletions(-) diff --git a/cmvr-iot-test/src/main/java/com/cmvr/test/flow/runtime/operator/edge/EdgeCameraOperateService.java b/cmvr-iot-test/src/main/java/com/cmvr/test/flow/runtime/operator/edge/EdgeCameraOperateService.java index b6b2e94..af7a715 100644 --- a/cmvr-iot-test/src/main/java/com/cmvr/test/flow/runtime/operator/edge/EdgeCameraOperateService.java +++ b/cmvr-iot-test/src/main/java/com/cmvr/test/flow/runtime/operator/edge/EdgeCameraOperateService.java @@ -88,7 +88,7 @@ public class EdgeCameraOperateService implements EdgeOperateService { // imageUrl = "http://192.168.1.100:9000/cmvr-iot/FILE/20250822/1755849654731.jpg"; // } // String imageUrl = "http://192.168.1.100:9000/cmvr-iot/IMAGE/20250901/1756718594725.jpg"; - String imageUrl = edgeCameraService.getRGBDImages(edgeCommonVO); + String imageUrl = edgeCameraService.getRGBImage(edgeCommonVO); JSONArray imageUrls = new JSONArray(); if (ObjUtil.isNotEmpty(upstreamOutput)) { diff --git a/cmvr-iot-test/src/main/java/com/cmvr/test/flow/runtime/operator/edge/ti/TiTouchOperateService.java b/cmvr-iot-test/src/main/java/com/cmvr/test/flow/runtime/operator/edge/ti/TiTouchOperateService.java index a97d7c3..b7ab3c2 100644 --- a/cmvr-iot-test/src/main/java/com/cmvr/test/flow/runtime/operator/edge/ti/TiTouchOperateService.java +++ b/cmvr-iot-test/src/main/java/com/cmvr/test/flow/runtime/operator/edge/ti/TiTouchOperateService.java @@ -67,48 +67,15 @@ public class TiTouchOperateService implements EdgeOperateService { switch (action) { case TI_PATH_SEARCH: { // 当前界面 -// String currentLocation = inputParams.getString("currentLocation"); - String currentLocation = "主页"; + String currentLocation = inputParams.getString("currentLocation"); + Long vehicleConfigId = inputParams.getLong("vehicleConfigId"); + String clickFunction = inputParams.getString("funcId"); // 查询功能 - JSONObject funcObj = getFuncObj(message.getIterations(),inputParams); - - String funcKey = funcObj.getString("funcKey"); - String iconUrl = funcObj.getString("iconUrl"); - - - // ========== 根据当前界面匹配路径 ========== - List matchedPath = null; - - for (List path : ALL_PATHS) { - if (path.contains(funcKey)) { - matchedPath = path; - break; - } - } - - if (matchedPath == null) { - throw new GlobalException("未匹配到可用路径"); - } - - // ========== 计算下一步 ========== - int index = matchedPath.indexOf(currentLocation); - - String nextLocation; - boolean isEnd; - - if (index == -1 || index == matchedPath.size() - 1) { - nextLocation = currentLocation; - isEnd = true; - } else { - nextLocation = matchedPath.get(index + 1); - isEnd = (index + 1 == matchedPath.size() - 1); - } - + JSONObject funcObj = exTiVehicleFunctionService.findNextClickToFunction(vehicleConfigId, currentLocation, clickFunction); // 输出 - output.put("nextLocation", nextLocation); - output.put("isEnd", isEnd); - output.put("iconUrl", iconUrl); - + output.put("nextLocation", funcObj.get("nextLocation")); + output.put("isEnd", funcObj.get("isEnd")); + output.put("iconUrl", funcObj.get("iconUrl")); break; } case TI_TOUCH_COORDINATES: {