|
|
@@ -245,8 +245,12 @@ public class IotBoardServiceImpl implements IotBoardService {
|
|
|
hashMap.put("historyAlarm", value.size());
|
|
|
hashMap.put("currentAlarm", (int) currentAlarm);
|
|
|
hashMap.put("unDealAlarm", (int) unDealAlarm);
|
|
|
+
|
|
|
+ List<AppAlarmDataPageVo> pageVos = getAlarmDataList(value, listEntry.getKey().toString(), cacheList, needAlarm);
|
|
|
+ hashMap.put("currentAlarmData", pageVos);
|
|
|
+
|
|
|
+ needAlarm = pageVos.stream().anyMatch(d -> ObjectUtil.equal(d.getNeedAlarm(), 1)) ? 1 : 0;
|
|
|
hashMap.put("needAlarm", needAlarm);
|
|
|
- hashMap.put("currentAlarmData", getAlarmDataList(value, listEntry.getKey().toString(), cacheList,needAlarm));
|
|
|
|
|
|
resultList.add(hashMap);
|
|
|
}
|
|
|
@@ -556,11 +560,15 @@ public class IotBoardServiceImpl implements IotBoardService {
|
|
|
if (!optional.isPresent()){
|
|
|
Map<String, Object> hashMap = new HashMap<>();
|
|
|
hashMap.put("key", value.get(0).getSourceTypeDes());
|
|
|
- hashMap.put("historyAlarm", value.size());
|
|
|
- hashMap.put("unDealAlarm", (int) unDealAlarm);
|
|
|
hashMap.put("currentAlarm", (int) currentAlarm);
|
|
|
+ hashMap.put("unDealAlarm", (int) unDealAlarm);
|
|
|
+ hashMap.put("historyAlarm", value.size());
|
|
|
+
|
|
|
+ List<AppAlarmDataPageVo> pageVos = getAlarmDataList(value, listEntry.getKey().toString(), cacheList, needAlarm);
|
|
|
+ hashMap.put("currentAlarmData", pageVos);
|
|
|
+
|
|
|
+ needAlarm = pageVos.stream().anyMatch(d -> ObjectUtil.equal(d.getNeedAlarm(), 1)) ? 1 : 0;
|
|
|
hashMap.put("needAlarm", needAlarm);
|
|
|
- hashMap.put("currentAlarmData", getAlarmDataList(value, listEntry.getKey().toString(), cacheList,needAlarm));
|
|
|
|
|
|
resultList.add(hashMap);
|
|
|
}else {
|
|
|
@@ -574,7 +582,7 @@ public class IotBoardServiceImpl implements IotBoardService {
|
|
|
dataList.addAll(getAlarmDataList(value, listEntry.getKey().toString(), cacheList, needAlarm));
|
|
|
objectMap.put("currentAlarmData", dataList);
|
|
|
|
|
|
- needAlarm = ((int) objectMap.get("needAlarm") == 1 && needAlarm == 1) ? 1 : 0;
|
|
|
+ needAlarm = dataList.stream().anyMatch(d -> ObjectUtil.equal(d.getNeedAlarm(), 1)) ? 1 : 0;
|
|
|
objectMap.put("needAlarm", needAlarm);
|
|
|
|
|
|
resultList.set(index,objectMap);
|