Commit 307fa9cd authored by wanghao's avatar wanghao

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

parent 927e9662
......@@ -165,25 +165,33 @@ public class NettyUdpServerHandler extends SimpleChannelInboundHandler<DatagramP
public void onlyCompleted() {
Long commandId = null;
// 优先从currentCommandId获取
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;
}
// 如果currentCommandId为空,从数据库查询正在执行的任务
List<RobotArmCommand> robotArmCommands = robotArmCommandService.selectTopRunningRobotArmCommands();
if (robotArmCommands != null && !robotArmCommands.isEmpty()) {
commandId = robotArmCommands.get(0).getRobotArmCommandId();
// 如果找到了指令ID,更新currentCommandId
currentCommandId = commandId;
}
if(currentCommandId != null){
robotArmCommandService.completeCommand(currentCommandId);
}
if (commandId != null) {
robotArmCommandService.completeCommand(commandId);
// 使用状态机完成指令
// 优先从currentCommandId获取
// 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);
}
// }
}
/**
......
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