|
@ -86,8 +86,8 @@ public class CheckServiceImpl implements CheckService { |
|
|
if (order == 0) { |
|
|
if (order == 0) { |
|
|
if (startIndex == null || "".equals(startIndex)) { |
|
|
if (startIndex == null || "".equals(startIndex)) { |
|
|
// 指定初始化index为1-6 |
|
|
// 指定初始化index为1-6 |
|
|
this.updateCoordAndStatus(taskId, "1-6", 1); |
|
|
|
|
|
String nextCoord = "1-6"; |
|
|
String nextCoord = "1-6"; |
|
|
|
|
|
this.updateCoordAndStatus(taskId, nextCoord, 1); |
|
|
// 开始检测 |
|
|
// 开始检测 |
|
|
this.sendMessageToClient(nextCoord, taskId); |
|
|
this.sendMessageToClient(nextCoord, taskId); |
|
|
// 如果中间终止 则退出返回 与messagehandler 处理逻辑相同 外部控制while的终止 |
|
|
// 如果中间终止 则退出返回 与messagehandler 处理逻辑相同 外部控制while的终止 |
|
@ -155,9 +155,71 @@ public class CheckServiceImpl implements CheckService { |
|
|
}else if (order == 1) { |
|
|
}else if (order == 1) { |
|
|
if (startIndex == null || "".equals(startIndex)) { |
|
|
if (startIndex == null || "".equals(startIndex)) { |
|
|
// 指定初始化index为6-1 |
|
|
// 指定初始化index为6-1 |
|
|
this.updateCoordAndStatus(taskId, "6-1", 1); |
|
|
|
|
|
|
|
|
String nextCoord = "6-1"; |
|
|
|
|
|
this.updateCoordAndStatus(taskId, nextCoord, 1); |
|
|
|
|
|
// 开始检测 |
|
|
|
|
|
this.sendMessageToClient(nextCoord, taskId); |
|
|
|
|
|
// 如果中间终止 则退出返回 与messagehandler 处理逻辑相同 外部控制while的终止 |
|
|
|
|
|
// 下一次进入后则进入其他流程 |
|
|
|
|
|
while (!"finish".equals(nextCoord)) { |
|
|
|
|
|
// 需要一个中断的接口, 中途暂停本次流程 |
|
|
|
|
|
// 用messagehandler处理检测完毕的消息 从而启动以下流程 |
|
|
|
|
|
boolean breakFirst = false; |
|
|
|
|
|
while (true) { |
|
|
|
|
|
if (this.breakOff) { |
|
|
|
|
|
breakFirst = true; |
|
|
|
|
|
this.updateCoordAndStatus(taskId, nextCoord, 2); |
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
|
|
|
if (this.isMessageReceived()) { |
|
|
|
|
|
messageReceived = false; |
|
|
|
|
|
break; // 跳出循环 |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
if (breakFirst) { |
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
|
|
|
// 检测完毕后获取下一个坐标 |
|
|
|
|
|
nextCoord = this.getNextCoord(nextCoord, 1); |
|
|
|
|
|
this.updateCoordAndStatus(taskId, nextCoord, 1); |
|
|
|
|
|
this.sendMessageToClient(nextCoord, taskId); |
|
|
|
|
|
if ("finish".equals(nextCoord)) { |
|
|
|
|
|
this.updateCoordAndStatus(taskId, nextCoord, 3); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
}else { |
|
|
}else { |
|
|
|
|
|
|
|
|
|
|
|
// 被中断过,需要从中断的currentCoord坐标继续 |
|
|
|
|
|
// 首先需要读取数据库,获得当前taskId的信息 |
|
|
|
|
|
Task task = taskService.getById(taskId); |
|
|
|
|
|
String nextCoord = task.getCurrentCoord(); |
|
|
|
|
|
this.sendMessageToClient(nextCoord, taskId); |
|
|
|
|
|
// 得到的currentCoord已经检测过,直接进入下一流程 |
|
|
|
|
|
while (!"finish".equals(nextCoord)) { |
|
|
|
|
|
// 需要一个中断的接口, 中途暂停本次流程 |
|
|
|
|
|
// 用messagehandler处理检测完毕的消息 从而启动以下流程 |
|
|
|
|
|
boolean breakFirst = false; |
|
|
|
|
|
while (true) { |
|
|
|
|
|
if (this.breakOff) { |
|
|
|
|
|
breakFirst = true; |
|
|
|
|
|
this.updateCoordAndStatus(taskId, nextCoord, 2); |
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
|
|
|
if (this.isMessageReceived()) { |
|
|
|
|
|
messageReceived = false; |
|
|
|
|
|
break; // 跳出循环 |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
if (breakFirst){ |
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
|
|
|
// 检测完毕后获取下一个坐标 |
|
|
|
|
|
nextCoord = this.getNextCoord(nextCoord, 1); |
|
|
|
|
|
this.updateCoordAndStatus(taskId, nextCoord, 1); |
|
|
|
|
|
this.sendMessageToClient(nextCoord, taskId); |
|
|
|
|
|
if ("finish".equals(nextCoord)) { |
|
|
|
|
|
this.updateCoordAndStatus(taskId, nextCoord, 3); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
return null; |
|
|
return null; |
|
|