rev:优化异常分切行架任务排序
This commit is contained in:
@@ -403,41 +403,39 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
TaskDto task = null;
|
||||
for (int i = 0; i < getDeviceCodeList.size(); i++) {
|
||||
String startDeviceCode = getDeviceCodeList.get(i);
|
||||
List<TaskDto> taskDtos = taskserver.queryTaskByDeviceCodeAndStatus(startDeviceCode);
|
||||
List<TaskDto> taskDtos = taskserver.queryTaskByDeviceCodeAndStatus2(startDeviceCode);
|
||||
if (ObjectUtil.isNotEmpty(taskDtos)) {
|
||||
//按照优先级排序 优先级相等按照创建时间排序
|
||||
taskDtos = this.sortTask(taskDtos);
|
||||
TaskDto taskDto = taskDtos.get(0);
|
||||
truss_type = taskDto.getTruss_type();
|
||||
//查询任务是行架任务
|
||||
if (!StrUtil.equals(taskDto.getTask_type(), "6")) {
|
||||
taskDto = null;
|
||||
continue;
|
||||
//按照创建时间排序
|
||||
List<TaskDto> taskDtoStream = taskDtos.stream().sorted(Comparator.comparing(TaskDto::getCreate_time)).collect(Collectors.toList());
|
||||
if (ObjectUtil.isNotEmpty(taskDtoStream)) {
|
||||
TaskDto taskDto = taskDtoStream.get(0);
|
||||
this.executeReadyInst(taskDto);
|
||||
}
|
||||
flag = this.executeReadyInst(taskDto);
|
||||
} else {
|
||||
List<TaskDto> taskDtoList = taskserver.queryTaskByDeviceCode(startDeviceCode);
|
||||
List<TaskDto> taskDtoList = taskserver.findByTrappedManipulatorReady();
|
||||
if (ObjectUtil.isNotEmpty(taskDtoList)) {
|
||||
//按照优先级排序 优先级相等按照创建时间排序
|
||||
taskDtoList = this.sortTask(taskDtoList);
|
||||
for (int j = 0; j < taskDtoList.size(); j++) {
|
||||
task = taskDtoList.get(j);
|
||||
|
||||
// 6 行架任务
|
||||
if (ObjectUtil.isNotEmpty(task) && !StrUtil.equals(task.getTask_type(), "6")) {
|
||||
task = null;
|
||||
continue;
|
||||
List<TaskDto> taskDtosReady = new ArrayList<>();
|
||||
for (TaskDto taskDto1 : taskDtoList) {
|
||||
if (getDeviceCodeList.contains(taskDto1.getStart_device_code())) {
|
||||
taskDtosReady.add(taskDto1);
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(task)) break;
|
||||
}
|
||||
//按照优先级排序 优先级相等按照创建时间排序
|
||||
taskDtosReady = this.sortTask(taskDtosReady);
|
||||
task = taskDtosReady.get(0);
|
||||
}
|
||||
if (!ObjectUtil.isEmpty(task)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!ObjectUtil.isEmpty(task)) {
|
||||
flag = this.executeReadyTask(task);
|
||||
this.executeReadyTask(task);
|
||||
} else {
|
||||
notCreateInstMessage = "universal_notCreateInstMessage";
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
//执行已有就绪指令
|
||||
|
||||
Reference in New Issue
Block a user