|
@ -62,11 +62,10 @@ public class CheckServiceImpl implements CheckService { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public boolean updateCoordAndStatus(int taskId, String currentCoord, int status, boolean updateStartTime, boolean updateEndTime, Integer order) throws IOException { |
|
|
public boolean updateCoordAndStatus(int taskId, String currentCoord, int status, boolean updateStartTime, boolean updateEndTime, Integer order) throws IOException { |
|
|
UpdateWrapper<Task> taskUpdateWrapper = new UpdateWrapper<>(); |
|
|
|
|
|
taskUpdateWrapper.eq("id",taskId); |
|
|
|
|
|
Task task = new Task(); |
|
|
|
|
|
task.setEndTime(null); |
|
|
|
|
|
task.setStartTime(null); |
|
|
|
|
|
|
|
|
// 根据taskId查询出来Task对象,更新时回填回去 |
|
|
|
|
|
QueryWrapper<Task> taskQueryWrapper = new QueryWrapper<>(); |
|
|
|
|
|
taskQueryWrapper.eq("id",taskId); |
|
|
|
|
|
Task task = taskService.getOne(taskQueryWrapper); |
|
|
if (currentCoord != null){ |
|
|
if (currentCoord != null){ |
|
|
task.setCurrentCoord(currentCoord); |
|
|
task.setCurrentCoord(currentCoord); |
|
|
} |
|
|
} |
|
@ -81,7 +80,7 @@ public class CheckServiceImpl implements CheckService { |
|
|
if (order != null){ |
|
|
if (order != null){ |
|
|
task.setCheckOrder(order); |
|
|
task.setCheckOrder(order); |
|
|
} |
|
|
} |
|
|
boolean update = taskService.update(task, taskUpdateWrapper); |
|
|
|
|
|
|
|
|
boolean update = taskService.updateById(task); |
|
|
this.sendMessageToPage(); |
|
|
this.sendMessageToPage(); |
|
|
return update; |
|
|
return update; |
|
|
} |
|
|
} |
|
@ -208,8 +207,19 @@ public class CheckServiceImpl implements CheckService { |
|
|
QueryWrapper<Path> pathQueryWrapper = new QueryWrapper<>(); |
|
|
QueryWrapper<Path> pathQueryWrapper = new QueryWrapper<>(); |
|
|
pathQueryWrapper.eq("task_id", taskId); |
|
|
pathQueryWrapper.eq("task_id", taskId); |
|
|
List<Path> pathList = pathService.list(pathQueryWrapper); |
|
|
List<Path> pathList = pathService.list(pathQueryWrapper); |
|
|
|
|
|
if (startIndex == null) { |
|
|
|
|
|
// startIndex 取复杂路径第一项 |
|
|
|
|
|
// 直接取order_number 为1 的 |
|
|
|
|
|
for(int i=0; i < pathList.size(); i++) { |
|
|
|
|
|
Path item = pathList.get(i); |
|
|
|
|
|
if (item.getOrderNumber() == 1) { |
|
|
|
|
|
startIndex = item.getCoord(); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
pathQueryWrapper.eq("coord", startIndex); |
|
|
pathQueryWrapper.eq("coord", startIndex); |
|
|
Path currentPath = pathService.getOne(pathQueryWrapper); |
|
|
Path currentPath = pathService.getOne(pathQueryWrapper); |
|
|
|
|
|
if (currentPath != null){ |
|
|
int orderNumber = currentPath.getOrderNumber(); |
|
|
int orderNumber = currentPath.getOrderNumber(); |
|
|
int size = pathList.size(); |
|
|
int size = pathList.size(); |
|
|
// 逻辑理顺后 将该处转换为while循环形成路径 |
|
|
// 逻辑理顺后 将该处转换为while循环形成路径 |
|
@ -226,6 +236,7 @@ public class CheckServiceImpl implements CheckService { |
|
|
// 将该coord转换为机械臂的x y坐标移动 |
|
|
// 将该coord转换为机械臂的x y坐标移动 |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
CheckResult checkResult = new CheckResult(); |
|
|
CheckResult checkResult = new CheckResult(); |
|
|
checkResult.setCurrentTestCoord(nextCoord); |
|
|
checkResult.setCurrentTestCoord(nextCoord); |
|
|
return checkResult; |
|
|
return checkResult; |
|
|