Browse Source

fix:集中告警去掉假数据

pull/56/head
肖晋飞 3 weeks ago
parent
commit
bbfd106f75
  1. 11
      yudao-module-alert/yudao-module-alert-biz/src/main/java/cn/iocoder/yudao/module/alert/service/warn/WarnServiceImpl.java

11
yudao-module-alert/yudao-module-alert-biz/src/main/java/cn/iocoder/yudao/module/alert/service/warn/WarnServiceImpl.java

@ -274,11 +274,10 @@ public class WarnServiceImpl implements WarnService {
// exaHistoryReqVO.setEndTime("2023-10-28 23:00:00");
// exaHistoryReqVO.setInterval(60L);
List<List<Double>> inputData = exaUtils.getHistory(EXA_IP, exaHistoryReqVO);
exaHistoryReqVO.setItemName(outpoint);
List<List<Double>> outputData = exaUtils.getHistory(EXA_IP, exaHistoryReqVO);
// 4. 数据校验
if (inputData.isEmpty() || outputData.isEmpty()) {
throw exception(EXA_HISTORY_IS_EMPTY,"历史数据为空,point: " + point + ", outputPoint: " + outpoint);
}
if (inputData != null || outputData != null) {
//直接深拷贝outputData
//上限值列表
@ -337,7 +336,11 @@ public class WarnServiceImpl implements WarnService {
result.setValueList(Arrays.asList(inputData, upList, lowList, errorList));
result.setTagList(Arrays.asList("实时值", "上限值", "下限值", "告警值"));
return result;
}
else{
log.error("getAlarmTrend error, point: {}", point);
throw exception(ALARM_TREND_FAILED, "获取告警趋势失败: 数据为空");
}
} catch (Exception e) {
log.error("getAlarmTrend error", e);
throw exception(ALARM_TREND_FAILED, "获取告警趋势失败: " + e.getMessage());

Loading…
Cancel
Save