diff --git a/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/mysql/Impl/device/DeviceAbnormaStatisticsServiceImpl.java b/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/mysql/Impl/device/DeviceAbnormaStatisticsServiceImpl.java index 9d5048e96..d974aace1 100644 --- a/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/mysql/Impl/device/DeviceAbnormaStatisticsServiceImpl.java +++ b/pqs-prepare/prepare-boot/src/main/java/com/njcn/prepare/harmonic/service/mysql/Impl/device/DeviceAbnormaStatisticsServiceImpl.java @@ -168,7 +168,7 @@ public class DeviceAbnormaStatisticsServiceImpl implements DeviceAbnormalStatist List comMsgs = new ArrayList<>(); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); Map> comMap = communicates.stream().collect(Collectors.groupingBy(Communicate::getDevId)); - if (CollectionUtil.isNotEmpty(communicates)) { + if (CollectionUtil.isNotEmpty(comMap)) { for (Map.Entry> entry : comMap.entrySet()) { String key = entry.getKey(); List value = entry.getValue(); @@ -223,6 +223,9 @@ public class DeviceAbnormaStatisticsServiceImpl implements DeviceAbnormalStatist QueryResult result1 = influxDbUtils.query(sql1); InfluxDBResultMapper influxDBResultMapper1 = new InfluxDBResultMapper(); List earlyData = influxDBResultMapper1.toPOJO(result1, Communicate.class); + if (earlyData.size()==0){ + continue; + } Communicate early = earlyData.get(0); Communicate communicate = new Communicate(); if (early.getType() == 0) {