报警处理功能更新

This commit is contained in:
zhangjunwen 2024-09-10 17:38:43 +08:00
parent f21653865c
commit 0441ee3ea7
3 changed files with 10 additions and 14 deletions

View File

@ -16,6 +16,7 @@ import java.time.LocalDateTime;
import java.time.ZoneId; import java.time.ZoneId;
import java.time.ZonedDateTime; import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -46,8 +47,13 @@ public class TrendAlarmDataTimeoutJob implements JobHandler {
String beginTime = DateUtils.localDateTimeToUTC(onedayBefore); String beginTime = DateUtils.localDateTimeToUTC(onedayBefore);
String endTime = DateUtils.localDateTimeToUTC(now); String endTime = DateUtils.localDateTimeToUTC(now);
//TODO 最好是从数据库中读取需要趋势报警的参数名参数值等 //TODO 最好是从数据库中读取需要趋势报警的参数名参数值等
Map<String, Object> diffDataMap = selectDiffDataByColumnNameandDate(null, "gateway_channel_temp_data", "x_bear_temp", beginTime, endTime); Map<String, Object> diffDataMap = new HashMap<>();
logger.info("查询设备数据差值:" + diffDataMap.get("x_bear_temp_diff")); Map<String, Object> diffDataMap1= selectDiffDataByColumnNameandDate(null, "gateway_channel_temp_data", "x_bear_temp", beginTime, endTime);
Map<String, Object> 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<AlarmRulesRespDTO> rules = alarmRulesApi.selectAlarmRulesListByCatch(equid); List<AlarmRulesRespDTO> rules = alarmRulesApi.selectAlarmRulesListByCatch(equid);
if(rules != null && rules.size() > 0){//预警规则过滤 if(rules != null && rules.size() > 0){//预警规则过滤
int alarmNum = alarmRulesApi.trendAlarmRulesFilter(diffDataMap, rules); int alarmNum = alarmRulesApi.trendAlarmRulesFilter(diffDataMap, rules);

View File

@ -146,7 +146,6 @@ public class AlarmRulesApiImpl implements AlarmRulesApi{
* 参数报警数据针对每条规则只有一条没有则新增有则更新时间 * 参数报警数据针对每条规则只有一条没有则新增有则更新时间
*/ */
private void refreshAlarmData(AlarmRulesRespDTO rule,BigDecimal value,String equipAlarmId ){ private void refreshAlarmData(AlarmRulesRespDTO rule,BigDecimal value,String equipAlarmId ){
AlarmDataDTO alarmData = alarmDataService.getAlarmDataByRulesId(rule.getAlarmId()); AlarmDataDTO alarmData = alarmDataService.getAlarmDataByRulesId(rule.getAlarmId());
if(alarmData == null){ if(alarmData == null){
alarmDataService.createAlarmData(new AlarmDataSaveReqVO(null,rule.getAlarmId(),rule.getEquipId(), alarmDataService.createAlarmData(new AlarmDataSaveReqVO(null,rule.getAlarmId(),rule.getEquipId(),

View File

@ -679,11 +679,6 @@ export default {
* 全部关闭报警 * 全部关闭报警
*/ */
handelClose() { handelClose() {
// var data = {
// equipAlarmId : this.$route.query.equipAlarmId;
// }
// AlarmDataApi.closeAllAlarmData(data);
this.$modal this.$modal
.confirm("是否确定关闭所有报警?") .confirm("是否确定关闭所有报警?")
.then(() => { .then(() => {
@ -691,12 +686,8 @@ export default {
AlarmDataApi.closeAllAlarmData(equipAlarmId); AlarmDataApi.closeAllAlarmData(equipAlarmId);
}) })
.then(() => { .then(() => {
// const obj = { path: "/alarm/equipalarm" };
// var updateData = { this.$store.dispatch("tagsView/delView", this.$router.currentRoute);
// equipAlarmId: this.$route.query.equipAlarmId,
// status: 1,
// };
// EquipAlarmDataApi.updateEquipAlarmData(updateData);
// //
this.$router.push("/alarm/equipalarm"); this.$router.push("/alarm/equipalarm");
}) })