|
|
@ -2,6 +2,7 @@ package org.nl.modules.quartz.task; |
|
|
|
|
|
|
|
import cn.hutool.core.date.DateUtil; |
|
|
|
import cn.hutool.core.util.IdUtil; |
|
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.apache.commons.lang3.ObjectUtils; |
|
|
@ -40,26 +41,28 @@ public class AutoCreateInst { |
|
|
|
DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class); |
|
|
|
|
|
|
|
List<TaskDto> list = taskserver.queryAll("task_status = '0'"); |
|
|
|
Collections.sort(list, new Comparator<TaskDto>() { |
|
|
|
@Override |
|
|
|
public int compare(TaskDto t1, TaskDto t2) { |
|
|
|
String start_device_code1 = t1.getStart_device_code(); |
|
|
|
String start_device_code2 = t2.getStart_device_code(); |
|
|
|
Integer start_1 = Integer.parseInt(start_device_code1.split("_")[0]); |
|
|
|
Integer start_2 = Integer.parseInt(start_device_code2.split("_")[0]); |
|
|
|
if (start_1 > start_2){ |
|
|
|
|
|
|
|
if (ObjectUtil.isNotEmpty(list)) |
|
|
|
Collections.sort(list, new Comparator<TaskDto>() { |
|
|
|
@Override |
|
|
|
public int compare(TaskDto t1, TaskDto t2) { |
|
|
|
String start_device_code1 = t1.getStart_device_code(); |
|
|
|
String start_device_code2 = t2.getStart_device_code(); |
|
|
|
Integer start_1 = Integer.parseInt(start_device_code1.split("_")[0]); |
|
|
|
Integer start_2 = Integer.parseInt(start_device_code2.split("_")[0]); |
|
|
|
if (start_1 == start_2) { |
|
|
|
int end_i = Integer.parseInt(start_device_code1.split("_")[start_device_code1.split("_").length - 1]); |
|
|
|
int end_j = Integer.parseInt(start_device_code2.split("_")[start_device_code2.split("_").length - 1]); |
|
|
|
if (end_i > end_j) { |
|
|
|
return 1; |
|
|
|
} else if (end_i < end_j) { |
|
|
|
return -1; |
|
|
|
} |
|
|
|
return 0; |
|
|
|
} else { |
|
|
|
return 1; |
|
|
|
} |
|
|
|
} |
|
|
|
int end_i = Integer.parseInt(start_device_code1.split("_")[start_device_code1.split("_").length - 1]); |
|
|
|
int end_j = Integer.parseInt(start_device_code2.split("_")[start_device_code2.split("_").length - 1]); |
|
|
|
if (end_i > end_j) { |
|
|
|
return 1; |
|
|
|
} else if (end_i < end_j) { |
|
|
|
return -1; |
|
|
|
} |
|
|
|
return 0; |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
for (int i = 0; i < list.size(); i++) { |
|
|
|
TaskDto acsTask = list.get(i); |
|
|
|
String taskid = acsTask.getTask_id(); |
|
|
|