parent
cd21a62a0b
commit
a06e348088
|
@ -127,7 +127,7 @@ public class TaskServiceImpl implements TaskService {
|
|||
// 查询当前是否有相同能力节点,相同用户,相同处置IP的且正在执行的处置任务,如果存在则忽略该次任务(依照产品需求)
|
||||
List<TaskInfoDetail> taskList = taskCacheManager.getAllRunningTask()
|
||||
.stream()
|
||||
.filter(v -> ((taskId == null || taskId == -1L) || Objects.equals(v.getDeviceId(), task.getDeviceId()) || (v.getDeviceId() == -1L))
|
||||
.filter(v -> ((taskId == null || taskId == -1L) || Objects.equals(v.getDeviceId(), task.getDeviceId()))
|
||||
&& Objects.equals(v.getAccountId(), task.getAccountId())
|
||||
&& taskIsRunning(v)
|
||||
&& Objects.equals(v.getType(), task.getType())
|
||||
|
@ -346,7 +346,7 @@ public class TaskServiceImpl implements TaskService {
|
|||
.getAllRunningTask()
|
||||
.stream()
|
||||
.filter(v -> v.getCurrentStatus() == DisposeTaskStatus.TASK_RUNNING.getCode()
|
||||
&& v.getDeviceId().equals(devId))
|
||||
&& (v.getDeviceId().equals(devId)) || v.getDeviceId() == -1L)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
if (taskList.size() > 0) {
|
||||
|
@ -365,15 +365,27 @@ public class TaskServiceImpl implements TaskService {
|
|||
*/
|
||||
@Override
|
||||
public List<TaskInfoDetail> getNodeAllTask(Long devId) {
|
||||
List<TaskInfoDetail> taskList = disposeTaskMapper.getAllTaskByNodeDevId(devId);
|
||||
List<TaskInfoDetail> taskList = new ArrayList<>();
|
||||
|
||||
//-1广播,所有设备都下发清洗任务
|
||||
List<TaskInfoDetail> curId = disposeTaskMapper.getAllTaskByNodeDevId(devId);
|
||||
List<TaskInfoDetail> allId = disposeTaskMapper.getAllTaskByNodeDevId(-1L);
|
||||
|
||||
if(allId != null && allId.size() > 0) {
|
||||
taskList.addAll(allId);
|
||||
}
|
||||
|
||||
if(curId != null && curId.size() > 0) {
|
||||
taskList.addAll(curId);
|
||||
}
|
||||
|
||||
if (taskList.size() > 0) {
|
||||
log.info("The device has tasks: devId:{}, tasksNumber:{}", devId, taskList.size());
|
||||
return taskList;
|
||||
} else {
|
||||
log.info("The device has nothing tasks: devId:{}", devId);
|
||||
}
|
||||
|
||||
log.info("The device has nothing tasks: devId:{}", devId);
|
||||
return new ArrayList<>();
|
||||
return taskList;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue