fix(flow): 修复边缘操作服务空指针异常

- 在executeEdgeOperateAction方法中添加edgeOperateServices为空检查
- 添加回退逻辑以支持Spring容器外的手动构造调用者
- 添加cmvr-iot-grpc-lib依赖以支持grpc功能
- 移除TaskNodeExecuteMessage中resolvedDeviceBindings的初始化赋值
This commit is contained in:
lixiaolong 2026-08-14 09:26:54 +08:00
parent 1eb1a88870
commit 54220ccaac
3 changed files with 9 additions and 1 deletions

View File

@ -34,6 +34,10 @@
<groupId>com.cmvr</groupId>
<artifactId>cmvr-iot-grpc-client</artifactId>
</dependency>
<dependency>
<groupId>com.cmvr</groupId>
<artifactId>cmvr-iot-grpc-lib</artifactId>
</dependency>
<!-- 设备服务,供工作流报警监听组件使用 -->
<dependency>

View File

@ -99,7 +99,7 @@ public class TaskNodeExecuteMessage {
private List<ResourceRuntimeAssignmentVO> runtimeAssignments = new ArrayList<>();
/** 节点参数名到真实设备ID的解析结果。 */
private JSONObject resolvedDeviceBindings = new JSONObject();
private JSONObject resolvedDeviceBindings;
/**
* 节点入参

View File

@ -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));