From 54220ccaac1031251ce2f0d59833bcf966d1b370 Mon Sep 17 00:00:00 2001 From: lixiaolong <702156524@qq.com> Date: Fri, 14 Aug 2026 09:26:54 +0800 Subject: [PATCH] =?UTF-8?q?fix(flow):=20=E4=BF=AE=E5=A4=8D=E8=BE=B9?= =?UTF-8?q?=E7=BC=98=E6=93=8D=E4=BD=9C=E6=9C=8D=E5=8A=A1=E7=A9=BA=E6=8C=87?= =?UTF-8?q?=E9=92=88=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在executeEdgeOperateAction方法中添加edgeOperateServices为空检查 - 添加回退逻辑以支持Spring容器外的手动构造调用者 - 添加cmvr-iot-grpc-lib依赖以支持grpc功能 - 移除TaskNodeExecuteMessage中resolvedDeviceBindings的初始化赋值 --- cmvr-iot-test/pom.xml | 4 ++++ .../test/flow/runtime/message/TaskNodeExecuteMessage.java | 2 +- .../java/com/cmvr/test/service/FlowActionExecutorService.java | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/cmvr-iot-test/pom.xml b/cmvr-iot-test/pom.xml index 71cb3e6..1e3cb61 100644 --- a/cmvr-iot-test/pom.xml +++ b/cmvr-iot-test/pom.xml @@ -34,6 +34,10 @@ com.cmvr cmvr-iot-grpc-client + + com.cmvr + cmvr-iot-grpc-lib + diff --git a/cmvr-iot-test/src/main/java/com/cmvr/test/flow/runtime/message/TaskNodeExecuteMessage.java b/cmvr-iot-test/src/main/java/com/cmvr/test/flow/runtime/message/TaskNodeExecuteMessage.java index 974355b..0c5bd59 100644 --- a/cmvr-iot-test/src/main/java/com/cmvr/test/flow/runtime/message/TaskNodeExecuteMessage.java +++ b/cmvr-iot-test/src/main/java/com/cmvr/test/flow/runtime/message/TaskNodeExecuteMessage.java @@ -99,7 +99,7 @@ public class TaskNodeExecuteMessage { private List runtimeAssignments = new ArrayList<>(); /** 节点参数名到真实设备ID的解析结果。 */ - private JSONObject resolvedDeviceBindings = new JSONObject(); + private JSONObject resolvedDeviceBindings; /** * 节点入参 diff --git a/cmvr-iot-test/src/main/java/com/cmvr/test/service/FlowActionExecutorService.java b/cmvr-iot-test/src/main/java/com/cmvr/test/service/FlowActionExecutorService.java index 803f5b7..488edc4 100644 --- a/cmvr-iot-test/src/main/java/com/cmvr/test/service/FlowActionExecutorService.java +++ b/cmvr-iot-test/src/main/java/com/cmvr/test/service/FlowActionExecutorService.java @@ -87,6 +87,10 @@ public class FlowActionExecutorService { private String executeEdgeOperateAction(ActionEnum action, FlowActionRequestVO req) { TaskNodeExecuteMessage message = buildSingleNodeMessage(action, req.getPayload()); + if (edgeOperateServices == null) { + // Keep manually constructed legacy callers working outside the Spring container. + return executeEdgeAction(action, req); + } for (EdgeOperateService service : edgeOperateServices) { if (service.supports(action)) { return resultToString(service.execute(message));