|
@ -129,7 +129,7 @@ public class CheckServiceImpl implements CheckService { |
|
|
break; |
|
|
break; |
|
|
} |
|
|
} |
|
|
// 检测完毕后获取下一个坐标 |
|
|
// 检测完毕后获取下一个坐标 |
|
|
nextCoord = this.getNextCoord(nextCoord, order); |
|
|
|
|
|
|
|
|
nextCoord = this.getNextCoord(nextCoord, order, taskId + ""); |
|
|
this.updateCoordAndStatus(taskId, nextCoord, 1, false, false, order); |
|
|
this.updateCoordAndStatus(taskId, nextCoord, 1, false, false, order); |
|
|
this.sendMessageToDevice(nextCoord, taskId); |
|
|
this.sendMessageToDevice(nextCoord, taskId); |
|
|
if ("finish".equals(nextCoord)) { |
|
|
if ("finish".equals(nextCoord)) { |
|
@ -165,7 +165,7 @@ public class CheckServiceImpl implements CheckService { |
|
|
break; |
|
|
break; |
|
|
} |
|
|
} |
|
|
// 检测完毕后获取下一个坐标 |
|
|
// 检测完毕后获取下一个坐标 |
|
|
nextCoord = this.getNextCoord(nextCoord, order); |
|
|
|
|
|
|
|
|
nextCoord = this.getNextCoord(nextCoord, order, taskId + ""); |
|
|
this.updateCoordAndStatus(taskId, nextCoord, 1, false, false, order); |
|
|
this.updateCoordAndStatus(taskId, nextCoord, 1, false, false, order); |
|
|
this.sendMessageToDevice(nextCoord, taskId); |
|
|
this.sendMessageToDevice(nextCoord, taskId); |
|
|
if ("finish".equals(nextCoord)) { |
|
|
if ("finish".equals(nextCoord)) { |
|
@ -252,7 +252,7 @@ public class CheckServiceImpl implements CheckService { |
|
|
* 传入当前检查的坐标点 |
|
|
* 传入当前检查的坐标点 |
|
|
* @return 获取下一个坐标点 |
|
|
* @return 获取下一个坐标点 |
|
|
*/ |
|
|
*/ |
|
|
public String getNextCoord(String current, int order) { |
|
|
|
|
|
|
|
|
public String getNextCoord(String current, int order, String taskId) { |
|
|
if (current == null ) { |
|
|
if (current == null ) { |
|
|
return null; |
|
|
return null; |
|
|
} |
|
|
} |
|
@ -447,6 +447,61 @@ public class CheckServiceImpl implements CheckService { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
if (order == 2) { |
|
|
|
|
|
// 复杂路径 |
|
|
|
|
|
String complexPath = this.getComplexPath(current, taskId, 1); |
|
|
|
|
|
return complexPath; |
|
|
|
|
|
} |
|
|
|
|
|
return ""; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public String getComplexPath(String current, String taskId, int order) { |
|
|
|
|
|
QueryWrapper<Path> pathQueryWrapper = new QueryWrapper<>(); |
|
|
|
|
|
pathQueryWrapper.eq("task_id",taskId).eq("coord", current); |
|
|
|
|
|
Path one = pathService.getOne(pathQueryWrapper); |
|
|
|
|
|
if (one == null){ |
|
|
|
|
|
if (order == 1) { |
|
|
|
|
|
QueryWrapper<Path> queryWrapper = new QueryWrapper<>(); |
|
|
|
|
|
queryWrapper.eq("task_id",taskId); |
|
|
|
|
|
List<Path> list = pathService.list(queryWrapper); |
|
|
|
|
|
Path path = list.get(list.size() - 1); |
|
|
|
|
|
return path.getCoord(); |
|
|
|
|
|
} |
|
|
|
|
|
if (order == 2) { |
|
|
|
|
|
QueryWrapper<Path> queryWrapper = new QueryWrapper<>(); |
|
|
|
|
|
queryWrapper.eq("task_id",taskId); |
|
|
|
|
|
List<Path> list = pathService.list(queryWrapper); |
|
|
|
|
|
Path path = list.get(0); |
|
|
|
|
|
return path.getCoord(); |
|
|
|
|
|
} |
|
|
|
|
|
}else { |
|
|
|
|
|
int orderNumber = one.getOrderNumber(); |
|
|
|
|
|
// 下一个上一个,如果下一个那就直接orderNumber + 1 上一个 -1 如果是最后一个则返回"" |
|
|
|
|
|
if (order == 1) { |
|
|
|
|
|
int nextNumber = orderNumber + 1; |
|
|
|
|
|
QueryWrapper<Path> queryWrapper = new QueryWrapper<>(); |
|
|
|
|
|
queryWrapper.eq("task_id",taskId).eq("order_number", nextNumber); |
|
|
|
|
|
Path one1 = pathService.getOne(queryWrapper); |
|
|
|
|
|
if (one1 == null) { |
|
|
|
|
|
// 最后了 |
|
|
|
|
|
return ""; |
|
|
|
|
|
}else { |
|
|
|
|
|
return one1.getCoord(); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
if (order == 2) { |
|
|
|
|
|
int nextNumber = orderNumber - 1; |
|
|
|
|
|
QueryWrapper<Path> queryWrapper = new QueryWrapper<>(); |
|
|
|
|
|
queryWrapper.eq("task_id",taskId).eq("order_number", nextNumber); |
|
|
|
|
|
Path one1 = pathService.getOne(queryWrapper); |
|
|
|
|
|
if (one1 == null) { |
|
|
|
|
|
// 最后了 |
|
|
|
|
|
return ""; |
|
|
|
|
|
}else { |
|
|
|
|
|
return one1.getCoord(); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
return ""; |
|
|
return ""; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -454,7 +509,7 @@ public class CheckServiceImpl implements CheckService { |
|
|
* 传入当前检查的坐标点 |
|
|
* 传入当前检查的坐标点 |
|
|
* @return 获取上一个坐标点 |
|
|
* @return 获取上一个坐标点 |
|
|
*/ |
|
|
*/ |
|
|
public String getPreCoord(String current, int order){ |
|
|
|
|
|
|
|
|
public String getPreCoord(String current, int order, String taskId){ |
|
|
if (current == null ) { |
|
|
if (current == null ) { |
|
|
return null; |
|
|
return null; |
|
|
} |
|
|
} |
|
@ -647,6 +702,11 @@ public class CheckServiceImpl implements CheckService { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
if (order == 2) { |
|
|
|
|
|
// 复杂路径 |
|
|
|
|
|
String complexPath = this.getComplexPath(current, taskId, 2); |
|
|
|
|
|
return complexPath; |
|
|
|
|
|
} |
|
|
return null; |
|
|
return null; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |