From 0441ee3ea75b82da6b7c797f9500edd495c9f331 Mon Sep 17 00:00:00 2001 From: zhangjunwen Date: Tue, 10 Sep 2024 17:38:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=A5=E8=AD=A6=E5=A4=84=E7=90=86=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module/data/job/TrendAlarmDataTimeoutJob.java | 10 ++++++++-- .../module/system/api/alarm/AlarmRulesApiImpl.java | 1 - imt-ui/src/views/system/alarm/alarmdata/index.vue | 13 ++----------- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/imt-server/imt-module-data/imt-module-data-biz/src/main/java/com/inspur/module/data/job/TrendAlarmDataTimeoutJob.java b/imt-server/imt-module-data/imt-module-data-biz/src/main/java/com/inspur/module/data/job/TrendAlarmDataTimeoutJob.java index 9a5eef4..52bc822 100644 --- a/imt-server/imt-module-data/imt-module-data-biz/src/main/java/com/inspur/module/data/job/TrendAlarmDataTimeoutJob.java +++ b/imt-server/imt-module-data/imt-module-data-biz/src/main/java/com/inspur/module/data/job/TrendAlarmDataTimeoutJob.java @@ -16,6 +16,7 @@ import java.time.LocalDateTime; import java.time.ZoneId; import java.time.ZonedDateTime; import java.time.format.DateTimeFormatter; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -46,8 +47,13 @@ public class TrendAlarmDataTimeoutJob implements JobHandler { String beginTime = DateUtils.localDateTimeToUTC(onedayBefore); String endTime = DateUtils.localDateTimeToUTC(now); //TODO 最好是从数据库中读取(需要趋势报警的参数名,参数值等) - Map diffDataMap = selectDiffDataByColumnNameandDate(null, "gateway_channel_temp_data", "x_bear_temp", beginTime, endTime); - logger.info("查询设备数据差值:" + diffDataMap.get("x_bear_temp_diff")); + Map diffDataMap = new HashMap<>(); + Map diffDataMap1= selectDiffDataByColumnNameandDate(null, "gateway_channel_temp_data", "x_bear_temp", beginTime, endTime); + Map diffDataMap2 = selectDiffDataByColumnNameandDate(null, "gateway_channel_vibr_data", "x_entropy", beginTime, endTime); + diffDataMap.putAll(diffDataMap1); + diffDataMap.putAll(diffDataMap2); +// logger.info("查询设备数据差值:" + diffDataMap.get("x_bear_temp_diff")); +// logger.info("查询设备数据差值:" + diffDataMap.get("x_entropy_diff")); List rules = alarmRulesApi.selectAlarmRulesListByCatch(equid); if(rules != null && rules.size() > 0){//预警规则过滤 int alarmNum = alarmRulesApi.trendAlarmRulesFilter(diffDataMap, rules); diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/api/alarm/AlarmRulesApiImpl.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/api/alarm/AlarmRulesApiImpl.java index 701bae0..21475e5 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/api/alarm/AlarmRulesApiImpl.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/api/alarm/AlarmRulesApiImpl.java @@ -146,7 +146,6 @@ public class AlarmRulesApiImpl implements AlarmRulesApi{ * (参数报警数据针对每条规则只有一条,没有则新增,有则更新时间) */ private void refreshAlarmData(AlarmRulesRespDTO rule,BigDecimal value,String equipAlarmId ){ - AlarmDataDTO alarmData = alarmDataService.getAlarmDataByRulesId(rule.getAlarmId()); if(alarmData == null){ alarmDataService.createAlarmData(new AlarmDataSaveReqVO(null,rule.getAlarmId(),rule.getEquipId(), diff --git a/imt-ui/src/views/system/alarm/alarmdata/index.vue b/imt-ui/src/views/system/alarm/alarmdata/index.vue index ec420cb..a207464 100644 --- a/imt-ui/src/views/system/alarm/alarmdata/index.vue +++ b/imt-ui/src/views/system/alarm/alarmdata/index.vue @@ -679,11 +679,6 @@ export default { * 全部关闭报警 */ handelClose() { - // var data = { - // equipAlarmId : this.$route.query.equipAlarmId; - // } - // AlarmDataApi.closeAllAlarmData(data); - this.$modal .confirm("是否确定关闭所有报警?") .then(() => { @@ -691,12 +686,8 @@ export default { AlarmDataApi.closeAllAlarmData(equipAlarmId); }) .then(() => { - //关闭设备报警 - // var updateData = { - // equipAlarmId: this.$route.query.equipAlarmId, - // status: 1, - // }; - // EquipAlarmDataApi.updateEquipAlarmData(updateData); + const obj = { path: "/alarm/equipalarm" }; + this.$store.dispatch("tagsView/delView", this.$router.currentRoute); //跳转到前一个页面 this.$router.push("/alarm/equipalarm"); })