REM:
1. 还原创建处置设备处置任务
This commit is contained in:
HuangXin 2020-10-09 17:37:39 +08:00
parent 79e2bcb585
commit 2f86465e12
1 changed files with 15 additions and 18 deletions

View File

@ -432,18 +432,15 @@ public class DeviceTaskManagerServiceImpl implements DeviceTaskManagerService {
// 设置任务状态, 开始创建任务 // 设置任务状态, 开始创建任务
disposeTaskManager.changeDisposeTaskStatus(v.getId(), DisposeTaskStatus.TASK_STARTING); disposeTaskManager.changeDisposeTaskStatus(v.getId(), DisposeTaskStatus.TASK_STARTING);
// 检查改任务是否能够被处置
ErrorCode ret = disposeAbilityRouterService.verifyDisposeCapacity(v.getDeviceId(),
v.getDisposeObject(),
v.getDisposeCapacity());
if (ret != ErrorCode.ERR_OK) {
log.warn("{}: Not found support dispose device for [{}]", ret, v);
continue;
}
// 为当前所有可用处置设备创建对应的处置任务 // 为当前所有可用处置设备创建对应的处置任务
disposeAbilityRouterService.getAllAbilityDevices().forEach(d -> { disposeAbilityRouterService.getAllAbilityDevices().stream()
// 判断是否是当前设备的处置任务
.filter(f -> v.getDeviceId() == -1 || f.getDev().getId().equals(v.getDeviceId()))
// 当前设备是否支持该处置能力
.filter(c -> c.getDev().getDevCapacity().stream().anyMatch(m -> m.getCapacityType() == v
.getDisposeCapacity()))
.filter(c -> c.getDb().isCarryProtectIp(v.getDisposeObject()))
.forEach(d -> {
log.info("Add dispose task for device: {}", d.getDev()); log.info("Add dispose task for device: {}", d.getDev());
if (!deviceTaskManager.addDisposeDeviceTaskInfo(v.getId(), d.getDev().getId(), if (!deviceTaskManager.addDisposeDeviceTaskInfo(v.getId(), d.getDev().getId(),