diff --git a/tzipc-server/tzipc-system/src/main/java/com/inspur/ipc/domain/IpcAlarmRecord.java b/tzipc-server/tzipc-system/src/main/java/com/inspur/ipc/domain/IpcAlarmRecord.java
index 1e7ceba..1a34f9f 100644
--- a/tzipc-server/tzipc-system/src/main/java/com/inspur/ipc/domain/IpcAlarmRecord.java
+++ b/tzipc-server/tzipc-system/src/main/java/com/inspur/ipc/domain/IpcAlarmRecord.java
@@ -37,10 +37,6 @@ public class IpcAlarmRecord extends BaseEntity {
@Excel(name = "传感器id")
private String sensorId;
- /**
- * 参数key值
- */
- private String nameKey;
/** 报警内容 */
@Excel(name = "报警内容")
@@ -77,8 +73,15 @@ public class IpcAlarmRecord extends BaseEntity {
private IpcAlarmRules alarmRules;
- public IpcAlarmRecord(String fastSimpleUUID, String equipId, String equipName, String alarmNameKey, String alarmName, String valueOf, String alarmInfoUnit, String alarmLevel, String referenceName, String description, String id) {
- super();
+
+ public IpcAlarmRecord( String alarmRulesId, String equipId, String sensorId, String content, BigDecimal alarmValue, String alarmLevel, Long deptId) {
+ this.alarmRulesId = alarmRulesId;
+ this.equipId = equipId;
+ this.sensorId = sensorId;
+ this.content = content;
+ this.alarmValue = alarmValue;
+ this.alarmLevel = alarmLevel;
+ this.deptId = deptId;
}
public IpcAlarmRecord() {
@@ -125,13 +128,6 @@ public class IpcAlarmRecord extends BaseEntity {
this.content = content;
}
- public String getNameKey() {
- return nameKey;
- }
-
- public void setNameKey(String nameKey) {
- this.nameKey = nameKey;
- }
public String getContent()
{
@@ -224,7 +220,6 @@ public class IpcAlarmRecord extends BaseEntity {
.append("alarmRulesId", getAlarmRulesId())
.append("equipId", getEquipId())
.append("sensorId", getSensorId())
- .append("nameKey", getNameKey())
.append("content", getContent())
.append("alarmValue", getAlarmValue())
.append("alarmTime", getAlarmTime())
diff --git a/tzipc-server/tzipc-system/src/main/java/com/inspur/ipc/utils/IpcUtil.java b/tzipc-server/tzipc-system/src/main/java/com/inspur/ipc/utils/IpcUtil.java
index 68c4f66..f151e7e 100644
--- a/tzipc-server/tzipc-system/src/main/java/com/inspur/ipc/utils/IpcUtil.java
+++ b/tzipc-server/tzipc-system/src/main/java/com/inspur/ipc/utils/IpcUtil.java
@@ -72,7 +72,7 @@ public class IpcUtil {
if (judgeAlarm(map.get(rulesConfig.getAlarmNameKey()), rulesConfig.getAlertUpperBound(), rulesConfig.getAlertLowerBound(), rulesConfig.getReferenceCon())) {
// 报警数据
isAlarm = "1";
- IpcAlarmRecord ipcAlarmRecord = new IpcAlarmRecord(IdUtils.fastSimpleUUID(), rulesConfig.getEquipId(), rulesConfig.getEquipName(), rulesConfig.getAlarmNameKey(), rulesConfig.getAlarmName(), String.valueOf(map.get(rulesConfig.getAlarmNameKey())), rulesConfig.getAlarmInfoUnit(), rulesConfig.getAlarmLevel(), rulesConfig.getReferenceName(), rulesConfig.getDescription(), rulesConfig.getId());
+ IpcAlarmRecord ipcAlarmRecord = new IpcAlarmRecord(rulesConfig.getId(), rulesConfig.getEquipId(), rulesConfig.getSensorId(), rulesConfig.getDescription(), new BigDecimal(String.valueOf(map.get(rulesConfig.getAlarmNameKey()) == null ? 0 : map.get(rulesConfig.getAlarmNameKey()))), rulesConfig.getAlarmLevel(), rulesConfig.getDeptId());
returnList.add(ipcAlarmRecord);
}
}
diff --git a/tzipc-server/tzipc-system/src/main/resources/mapper/ipc/IpcAlarmRecordMapper.xml b/tzipc-server/tzipc-system/src/main/resources/mapper/ipc/IpcAlarmRecordMapper.xml
index 4fa3c6b..0938f8c 100644
--- a/tzipc-server/tzipc-system/src/main/resources/mapper/ipc/IpcAlarmRecordMapper.xml
+++ b/tzipc-server/tzipc-system/src/main/resources/mapper/ipc/IpcAlarmRecordMapper.xml
@@ -10,7 +10,6 @@
-
@@ -26,7 +25,6 @@
alarm_rules_id,
equip_id,
sensor_id,
- name_key,
content,
alarm_value,
alarm_time,
@@ -62,7 +60,6 @@
alarm_rules_id,
equip_id,
sensor_id,
- name_key,
content,
alarm_value,
alarm_time,
@@ -76,7 +73,6 @@
#{alarmRulesId},
#{equipId},
#{sensorId},
- #{nameKey},
#{content},
#{alarmValue},
#{alarmTime},
@@ -90,18 +86,15 @@
insert delayed into
- ipc_alarm_record(alarm_rules_id,equip_id,sensor_id,name_key,content,alarm_value,alarm_time,status,operator,alarm_level,dept_id)
+ ipc_alarm_record(alarm_rules_id,equip_id,sensor_id,content,alarm_value,alarm_time,alarm_level,dept_id)
values
(#{item.alarmRulesId},
#{item.equipId},
#{item.sensorId},
- #{item.nameKey},
#{item.content},
#{item.alarmValue},
- #{item.alarmTime},
- #{item.status},
- #{item.operator},
+ NOW(),
#{item.alarmLevel},
#{item.deptId})