Commit 307fa9cd authored by wanghao's avatar wanghao

1 测试分支,单独测试 不需要 机械臂 获取iot数据

parent 927e9662
...@@ -165,25 +165,33 @@ public class NettyUdpServerHandler extends SimpleChannelInboundHandler<DatagramP ...@@ -165,25 +165,33 @@ public class NettyUdpServerHandler extends SimpleChannelInboundHandler<DatagramP
public void onlyCompleted() { public void onlyCompleted() {
Long commandId = null; Long commandId = null;
// 优先从currentCommandId获取 // 如果currentCommandId为空,从数据库查询正在执行的任务
if (currentCommandId != null) { List<RobotArmCommand> robotArmCommands = robotArmCommandService.selectTopRunningRobotArmCommands();
commandId = currentCommandId; if (robotArmCommands != null && !robotArmCommands.isEmpty()) {
} else { commandId = robotArmCommands.get(0).getRobotArmCommandId();
// 如果currentCommandId为空,从数据库查询正在执行的任务 // 如果找到了指令ID,更新currentCommandId
List<RobotArmCommand> robotArmCommands = robotArmCommandService.selectTopRunningRobotArmCommands(); currentCommandId = commandId;
if (robotArmCommands != null && !robotArmCommands.isEmpty()) { }
commandId = robotArmCommands.get(0).getRobotArmCommandId(); if(currentCommandId != null){
// 如果找到了指令ID,更新currentCommandId robotArmCommandService.completeCommand(currentCommandId);
currentCommandId = commandId;
}
} }
if (commandId != null) { // 优先从currentCommandId获取
robotArmCommandService.completeCommand(commandId); // if (currentCommandId != null) {
// commandId = currentCommandId;
// 使用状态机完成指令 // } else {
// // 如果currentCommandId为空,从数据库查询正在执行的任务
// List<RobotArmCommand> robotArmCommands = robotArmCommandService.selectTopRunningRobotArmCommands();
// if (robotArmCommands != null && !robotArmCommands.isEmpty()) {
// commandId = robotArmCommands.get(0).getRobotArmCommandId();
// // 如果找到了指令ID,更新currentCommandId
// currentCommandId = commandId;
// }
// }
//
// if (commandId != null) {
// completeCommandWithStateMachine(commandId); // completeCommandWithStateMachine(commandId);
} // }
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment