parent
04cdb57e8f
commit
54d9f4eed7
|
@ -523,10 +523,13 @@ public class DeviceTaskManagerServiceImpl implements DeviceTaskManagerService {
|
||||||
// 启动新任务
|
// 启动新任务
|
||||||
switch (ai.getDev().getDeviceType()) {
|
switch (ai.getDev().getDeviceType()) {
|
||||||
case DPTECH_UMC:
|
case DPTECH_UMC:
|
||||||
case DPTECH_BYPASS_UMC:
|
|
||||||
dpTechDeviceTaskRun(ai, v, task);
|
dpTechDeviceTaskRun(ai, v, task);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case DPTECH_BYPASS_UMC:
|
||||||
|
restfulDeviceTaskRun(ai, v, task, DisposeDeviceType.DPTECH_BYPASS_UMC);
|
||||||
|
break;
|
||||||
|
|
||||||
case HAOHAN_PLATFORM:
|
case HAOHAN_PLATFORM:
|
||||||
restfulDeviceTaskRun(ai, v, task, DisposeDeviceType.HAOHAN_PLATFORM);
|
restfulDeviceTaskRun(ai, v, task, DisposeDeviceType.HAOHAN_PLATFORM);
|
||||||
break;
|
break;
|
||||||
|
@ -597,10 +600,13 @@ public class DeviceTaskManagerServiceImpl implements DeviceTaskManagerService {
|
||||||
|
|
||||||
switch (ai.getDev().getDeviceType()) {
|
switch (ai.getDev().getDeviceType()) {
|
||||||
case DPTECH_UMC:
|
case DPTECH_UMC:
|
||||||
case DPTECH_BYPASS_UMC:
|
|
||||||
dpTechDeviceTaskStop(ai, v, task);
|
dpTechDeviceTaskStop(ai, v, task);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case DPTECH_BYPASS_UMC:
|
||||||
|
restfulDeviceTaskStop(ai, v, task, DisposeDeviceType.DPTECH_BYPASS_UMC);
|
||||||
|
break;
|
||||||
|
|
||||||
case HAOHAN_PLATFORM:
|
case HAOHAN_PLATFORM:
|
||||||
restfulDeviceTaskStop(ai, v, task, DisposeDeviceType.HAOHAN_PLATFORM);
|
restfulDeviceTaskStop(ai, v, task, DisposeDeviceType.HAOHAN_PLATFORM);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -81,9 +81,9 @@ public class DisposeAbilityRouterServiceImpl implements DisposeAbilityRouterServ
|
||||||
@Override
|
@Override
|
||||||
public AbilityInfo getAbilityDevice(Long id) {
|
public AbilityInfo getAbilityDevice(Long id) {
|
||||||
DisposeDevice dev = disposeDeviceManager.getAllNormalDisposeDevices().parallelStream()
|
DisposeDevice dev = disposeDeviceManager.getAllNormalDisposeDevices().parallelStream()
|
||||||
.filter(v -> v.getId().equals(id))
|
.filter(v -> v.getId().equals(id))
|
||||||
.findAny()
|
.findAny()
|
||||||
.orElse(null);
|
.orElse(null);
|
||||||
|
|
||||||
if (dev != null) {
|
if (dev != null) {
|
||||||
return disposeAbilityMap.get(getAbilityDeviceHashKey(dev.getIpAddr(), dev.getIpPort()));
|
return disposeAbilityMap.get(getAbilityDeviceHashKey(dev.getIpAddr(), dev.getIpPort()));
|
||||||
|
@ -147,10 +147,10 @@ public class DisposeAbilityRouterServiceImpl implements DisposeAbilityRouterServ
|
||||||
|
|
||||||
// 缓存处置设备到Hash表中
|
// 缓存处置设备到Hash表中
|
||||||
disposeAbilityMap.put(addr, AbilityInfo.builder()
|
disposeAbilityMap.put(addr, AbilityInfo.builder()
|
||||||
.db(db)
|
.db(db)
|
||||||
.dev(dev)
|
.dev(dev)
|
||||||
.linkStatus(false)
|
.linkStatus(false)
|
||||||
.build());
|
.build());
|
||||||
|
|
||||||
return ErrorCode.ERR_OK;
|
return ErrorCode.ERR_OK;
|
||||||
}
|
}
|
||||||
|
@ -167,18 +167,18 @@ public class DisposeAbilityRouterServiceImpl implements DisposeAbilityRouterServ
|
||||||
public ErrorCode verifyDisposeCapacity(Long deviceId, String disposeIp, DisposeCapacityType capacityType) {
|
public ErrorCode verifyDisposeCapacity(Long deviceId, String disposeIp, DisposeCapacityType capacityType) {
|
||||||
|
|
||||||
if (getAllAbilityDevices().stream()
|
if (getAllAbilityDevices().stream()
|
||||||
.noneMatch(f -> deviceId == -1 || f.getDev().getId().equals(deviceId))) {
|
.noneMatch(f -> deviceId == -1 || f.getDev().getId().equals(deviceId))) {
|
||||||
return ErrorCode.ERR_NOSUCHDEVICE;
|
return ErrorCode.ERR_NOSUCHDEVICE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getAllAbilityDevices().stream()
|
if (getAllAbilityDevices().stream()
|
||||||
.noneMatch(c -> c.getDev().getDevCapacity().stream()
|
.noneMatch(c -> c.getDev().getDevCapacity().stream()
|
||||||
.anyMatch(m -> m.getCapacityType() == capacityType))) {
|
.anyMatch(m -> m.getCapacityType() == capacityType))) {
|
||||||
return ErrorCode.ERR_NOSUCHTYPE;
|
return ErrorCode.ERR_NOSUCHTYPE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getAllAbilityDevices().stream()
|
if (getAllAbilityDevices().stream()
|
||||||
.noneMatch(c -> c.getDb().isCarryProtectIp(disposeIp))) {
|
.noneMatch(c -> c.getDb().isCarryProtectIp(disposeIp))) {
|
||||||
return ErrorCode.ERR_IPNODEVICE;
|
return ErrorCode.ERR_IPNODEVICE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -192,7 +192,11 @@ public class DisposeAbilityRouterServiceImpl implements DisposeAbilityRouterServ
|
||||||
@Async("deviceTaskExecutor")
|
@Async("deviceTaskExecutor")
|
||||||
@Scheduled(fixedDelay = 1000)
|
@Scheduled(fixedDelay = 1000)
|
||||||
public void runPeriodTask() {
|
public void runPeriodTask() {
|
||||||
getAllAbilityDevices().forEach(v -> v.getDb().periodTaskRuntime());
|
getAllAbilityDevices().forEach(v -> {
|
||||||
|
v.getDb().periodTaskRuntime();
|
||||||
|
// 同步最新处置平台业务信息到设备
|
||||||
|
v.getDb().upgradeServiceGroup(serviceGroupMapper.selectAll());
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue