|
@@ -116,11 +116,11 @@ public class IDataAnalysisWebServiceImpl implements IDataAnalysisWebService {
|
|
|
String url = iotDataAnalysisUrl + "/alarm/alarmList";
|
|
|
String response = HttpUtils.postJson(url, paramObject.toString());
|
|
|
JSONObject responseObject = JSONObject.parseObject(response);
|
|
|
+ Map<String, Integer> pjId_alarmCountMap = new HashMap<>();
|
|
|
+ Map<String, Double> pjId_alarmDurationMap = new HashMap<>();
|
|
|
if (DataConstants.SUCCESS.equals(responseObject.getString("respMsg"))) {
|
|
|
List<Map> content = (List<Map>) responseObject.get("content");
|
|
|
if (CollectionUtils.isNotEmpty(content)) {
|
|
|
- Map<String, Integer> pjId_alarmCountMap = new HashMap<>();
|
|
|
- Map<String, Double> pjId_alarmDurationMap = new HashMap<>();
|
|
|
for (Map map : content) {
|
|
|
String pjId = (String) map.get("projectId");
|
|
|
Long alarmBeginTime = (Long) map.get("alarmStartTime");
|
|
@@ -145,17 +145,15 @@ public class IDataAnalysisWebServiceImpl implements IDataAnalysisWebService {
|
|
|
alarmDuration = alarmDuration + duration;
|
|
|
pjId_alarmDurationMap.put(pjId, alarmDuration);
|
|
|
}
|
|
|
- if (pjId_alarmCountMap.size() != 0) {
|
|
|
- for (Map.Entry<String, Integer> entry : pjId_alarmCountMap.entrySet()) {
|
|
|
- AlarmInfoVo alarmInfoVo = new AlarmInfoVo();
|
|
|
- alarmInfoVo.setProjectId(entry.getKey());
|
|
|
- alarmInfoVo.setAlarmCount(entry.getValue());
|
|
|
- alarmInfoVo.setTotalDuration(pjId_alarmDurationMap.get(entry.getKey()));
|
|
|
- resultList.add(alarmInfoVo);
|
|
|
- }
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
+ for (String projectId : projectIdList) {
|
|
|
+ AlarmInfoVo alarmInfoVo = new AlarmInfoVo();
|
|
|
+ alarmInfoVo.setProjectId(projectId);
|
|
|
+ alarmInfoVo.setAlarmCount(pjId_alarmCountMap.get(projectId) == null ? 0 : pjId_alarmCountMap.get(projectId));
|
|
|
+ alarmInfoVo.setTotalDuration(pjId_alarmDurationMap.get(projectId) == null ? 0.0 : pjId_alarmDurationMap.get(projectId));
|
|
|
+ resultList.add(alarmInfoVo);
|
|
|
+ }
|
|
|
} catch (Exception e) {
|
|
|
log.error("获取数据质量报警数据异常:", e);
|
|
|
}
|