问题单修复

This commit is contained in:
zhuxinyu
2023-05-09 11:04:15 +08:00
parent 056c19195a
commit ba0de03a93

View File

@@ -168,7 +168,7 @@ public class DeviceAbnormaStatisticsServiceImpl implements DeviceAbnormalStatist
List<TopMsgPO> comMsgs = new ArrayList<>();
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
Map<String, List<Communicate>> comMap = communicates.stream().collect(Collectors.groupingBy(Communicate::getDevId));
if (CollectionUtil.isNotEmpty(communicates)) {
if (CollectionUtil.isNotEmpty(comMap)) {
for (Map.Entry<String, List<Communicate>> entry : comMap.entrySet()) {
String key = entry.getKey();
List<Communicate> value = entry.getValue();
@@ -223,6 +223,9 @@ public class DeviceAbnormaStatisticsServiceImpl implements DeviceAbnormalStatist
QueryResult result1 = influxDbUtils.query(sql1);
InfluxDBResultMapper influxDBResultMapper1 = new InfluxDBResultMapper();
List<Communicate> earlyData = influxDBResultMapper1.toPOJO(result1, Communicate.class);
if (earlyData.size()==0){
continue;
}
Communicate early = earlyData.get(0);
Communicate communicate = new Communicate();
if (early.getType() == 0) {