Commit 307fa9cd authored by wanghao's avatar wanghao

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

parent 927e9662
...@@ -165,10 +165,6 @@ public class NettyUdpServerHandler extends SimpleChannelInboundHandler<DatagramP ...@@ -165,10 +165,6 @@ public class NettyUdpServerHandler extends SimpleChannelInboundHandler<DatagramP
public void onlyCompleted() { public void onlyCompleted() {
Long commandId = null; Long commandId = null;
// 优先从currentCommandId获取
if (currentCommandId != null) {
commandId = currentCommandId;
} else {
// 如果currentCommandId为空,从数据库查询正在执行的任务 // 如果currentCommandId为空,从数据库查询正在执行的任务
List<RobotArmCommand> robotArmCommands = robotArmCommandService.selectTopRunningRobotArmCommands(); List<RobotArmCommand> robotArmCommands = robotArmCommandService.selectTopRunningRobotArmCommands();
if (robotArmCommands != null && !robotArmCommands.isEmpty()) { if (robotArmCommands != null && !robotArmCommands.isEmpty()) {
...@@ -176,14 +172,26 @@ public class NettyUdpServerHandler extends SimpleChannelInboundHandler<DatagramP ...@@ -176,14 +172,26 @@ public class NettyUdpServerHandler extends SimpleChannelInboundHandler<DatagramP
// 如果找到了指令ID,更新currentCommandId // 如果找到了指令ID,更新currentCommandId
currentCommandId = commandId; currentCommandId = commandId;
} }
if(currentCommandId != null){
robotArmCommandService.completeCommand(currentCommandId);
} }
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