配置下发修改
This commit is contained in:
parent
bdb29dca50
commit
84d715c130
@ -19,6 +19,8 @@ import org.springframework.web.multipart.MultipartFile;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.concurrent.ExecutionException;
|
||||||
|
import java.util.concurrent.TimeoutException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 物模型Controller
|
* 物模型Controller
|
||||||
@ -84,7 +86,7 @@ public class SysNodeController {
|
|||||||
|
|
||||||
/** 配置下发 */
|
/** 配置下发 */
|
||||||
@PostMapping("/configUpdate")
|
@PostMapping("/configUpdate")
|
||||||
public R<?> configUpdate(@RequestBody SysNodeDto sysNodeDto) {
|
public R<?> configUpdate(@RequestBody SysNodeDto sysNodeDto) throws ExecutionException, InterruptedException, TimeoutException {
|
||||||
nodeMessageService.sendTerminalConfig(sysNodeDto.getId());
|
nodeMessageService.sendTerminalConfig(sysNodeDto.getId());
|
||||||
return R.success();
|
return R.success();
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ import java.util.concurrent.TimeoutException;
|
|||||||
public interface NodeMessageService {
|
public interface NodeMessageService {
|
||||||
|
|
||||||
|
|
||||||
JsonNode sendTerminalConfig(Long nodeId);
|
JsonNode sendTerminalConfig(Long nodeId) throws ExecutionException, InterruptedException, TimeoutException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 向指定采集节点发送指令(无返回值)
|
* 向指定采集节点发送指令(无返回值)
|
||||||
|
@ -119,7 +119,7 @@ public class NodeMessageServiceImpl extends TextWebSocketHandler implements Node
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JsonNode sendTerminalConfig(Long nodeId) {
|
public JsonNode sendTerminalConfig(Long nodeId) throws ExecutionException, InterruptedException, TimeoutException {
|
||||||
ConfigUpdateVo configUpdateVo = new ConfigUpdateVo();
|
ConfigUpdateVo configUpdateVo = new ConfigUpdateVo();
|
||||||
List<LinkVo> links = new ArrayList<>();
|
List<LinkVo> links = new ArrayList<>();
|
||||||
try {
|
try {
|
||||||
@ -216,8 +216,7 @@ public class NodeMessageServiceImpl extends TextWebSocketHandler implements Node
|
|||||||
.time(time)
|
.time(time)
|
||||||
.data(jsonNode)
|
.data(jsonNode)
|
||||||
.build();
|
.build();
|
||||||
sendActionMessage(nodeId, configUpdate);
|
sendTerminalMessageWithResult(nodeId,configUpdate);
|
||||||
System.out.println(jsonNode);
|
|
||||||
return jsonNode;
|
return jsonNode;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user