From 88f6cd8ce1af402c3ada020ee97a9433f2db5548 Mon Sep 17 00:00:00 2001 From: chenlinghy Date: Tue, 2 Feb 2021 16:42:58 +0800 Subject: [PATCH] =?UTF-8?q?OCT=20REM:=201.=E5=90=8C=E6=AD=A5=E7=BC=93?= =?UTF-8?q?=E5=AD=98=E5=92=8C=E8=AE=BE=E5=A4=87=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/DisposeAbilityRouterServiceImpl.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/com/dispose/service/impl/DisposeAbilityRouterServiceImpl.java b/src/main/java/com/dispose/service/impl/DisposeAbilityRouterServiceImpl.java index a3dcd041..2d2701b1 100644 --- a/src/main/java/com/dispose/service/impl/DisposeAbilityRouterServiceImpl.java +++ b/src/main/java/com/dispose/service/impl/DisposeAbilityRouterServiceImpl.java @@ -215,6 +215,13 @@ public class DisposeAbilityRouterServiceImpl implements DisposeAbilityRouterServ // 同步最新处置平台业务信息到设备 v.getDb().upgradeServiceGroup(serviceGroupMapper.selectAll()); + //如果数据库存在,缓存没有该信息,则添加进缓存 + for (DisposeDevice d: disposeDeviceManager.getAllNormalDisposeDevices()) { + if(getAllAbilityDevices().stream().noneMatch(k->k.getDev().getId().equals(d.getId()))){ + addDisposeAbilityDevice(d); + } + } + // 数据库中的设备信息和缓存中的设备信息同步 v.getDev().getDevCapacity().forEach(k -> dev.getDevCapacity().forEach(m -> { if (k.getId().equals(m.getId())) {