change - 告警信息栏的内容有问题

main
wenjy 3 years ago
parent fa6ea1a55a
commit 8f6d10b84c

@ -174,7 +174,7 @@ public class WisdomScenarioContorller extends BaseController {
@GetMapping("/getAlarmByUid")
@ResponseBody
public String getAlarmByUid(String alarmuid) {
RecordAlarm recordAlarm = recordAlarmService.selectRecordAlarmBySensorId(alarmuid);
RecordAlarmDto recordAlarm = recordAlarmService.selectRecordAlarmBySensorId(alarmuid);
return JSONArray.toJSONString(recordAlarm);
}

@ -302,7 +302,7 @@
});
//获取监控单元模块
const alertListColumns = ['告警编号', '告警单元', '告警位置', '告警信息', '类型', '告警时间', '处理情况']
const alertListColumns = ['告警编号', '告警类型', '告警单元', '告警信息', '告警位置', '告警时间', '处理情况']
const alertList = new AutoScrollTable(document.getElementById("alert-list"), alertListColumns, {
width: ['10%', '10%', '10%', '30%', '10%', '10%', '10%'],
})
@ -316,7 +316,7 @@
success: (res) => {
console.log("告警信息:" + res);
alertList.loadData(res.map(value => [value.alarmModuleId.substring(0, 2) + "...", value.alarmModuleText, value.sensorLocation, `${"无线检测 相对检测值为:" + value.minValue + "-" + value.maxValue + ",其值为:" + value.alarmValue}`, "超限", value.collectTime, `${value.disposeFlag == 1 ? '<button class="text-success" id="' + value.alarmuid + '" onclick="disposeInfo(this.id)">已处理</button>' : '<button id="' + value.alarmuid + '" onclick="alarmDispose(this.id)" class="text-danger">未处理</button>'}`]), Object.keys(alertListColumns))
alertList.loadData(res.map(value => [value.alarmModuleId.substring(0, 4) + "...", value.alarmModuleText, value.monitorUnitName, `${"无线检测 相对检测值为:" + value.minValue + "-" + value.maxValue + ",其值为:" + value.alarmValue}`, value.sensorLocation, value.collectTime, `${value.disposeFlag == 1 ? '<button class="text-success" id="' + value.alarmuid + '" onclick="disposeInfo(this.id)">已处理</button>' : '<button id="' + value.alarmuid + '" onclick="alarmDispose(this.id)" class="text-danger">未处理</button>'}`]), Object.keys(alertListColumns))
},
error: () => {
@ -347,6 +347,15 @@
<p style="margin-top: 13px;">
<label>告警编号:${result.alarmuid}</label>
</p>
<p style="margin-top: 13px;">
<label>告警单元:${result.monitorUnitName}</label>
</p>
<p style="margin-top: 13px;">
<label>告警类型:${result.alarmModuleText}</label>
</p>
<p style="margin-top: 13px;">
<label>告警位置:${result.sensorLocation}</label>
</p>
<p style="margin-top: 13px;">
<label>告警信息:${"无线检测相对检测值为:" + result.minValue + "-" + result.maxValue + ",实际值为:" + result.alarmValue}</label>
</p>
@ -377,6 +386,15 @@
<p style="margin-top: 13px;">
<label>告警编号:${res.alarmuid}</label>
</p>
<p style="margin-top: 13px;">
<label>告警单元:${res.monitorUnitName}</label>
</p>
<p style="margin-top: 13px;">
<label>告警类型:${res.alarmModuleText}</label>
</p>
<p style="margin-top: 13px;">
<label>告警位置:${res.sensorLocation}</label>
</p>
<p style="margin-top: 13px;">
<label>告警信息:${"无线检测相对检测值为:" + res.minValue + "-" + res.maxValue + ",实际值为:" + res.alarmValue}</label>
</p>

@ -24,4 +24,6 @@ public class RecordAlarmDto extends RecordAlarm {
private String alarmInfo;
private String monitorUnitName;
}

@ -18,7 +18,7 @@ public interface RecordAlarmMapper
* @param sensorId
* @return
*/
public RecordAlarm selectRecordAlarmBySensorId(String sensorId);
public RecordAlarmDto selectRecordAlarmBySensorId(String sensorId);
/**
*

@ -18,7 +18,7 @@ public interface IRecordAlarmService
* @param sensorId
* @return
*/
public RecordAlarm selectRecordAlarmBySensorId(String sensorId);
public RecordAlarmDto selectRecordAlarmBySensorId(String sensorId);
/**
*

@ -29,7 +29,7 @@ public class RecordAlarmServiceImpl implements IRecordAlarmService
* @return
*/
@Override
public RecordAlarm selectRecordAlarmBySensorId(String sensorId)
public RecordAlarmDto selectRecordAlarmBySensorId(String sensorId)
{
return recordAlarmMapper.selectRecordAlarmBySensorId(sensorId);
}

@ -34,6 +34,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="alarmInfo" column="Alarm_Info" />
<result property="disposeMode" column="Dispose_Mode" />
<result property="alarmReason" column="Alarm_Reason" />
<result property="monitorUnitName" column="MonitorUnit_Name" />
</resultMap>
<sql id="selectRecordAlarmVo">
@ -53,9 +54,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
</select>
<select id="selectRecordAlarmBySensorId" parameterType="String" resultMap="RecordAlarmResult">
<include refid="selectRecordAlarmVo"/>
where Alarm_Uid = #{alarmuid}
<select id="selectRecordAlarmBySensorId" parameterType="String" resultMap="RecordAlarmDtoResult">
select t1.AlarmModule_Id,
t1.AlarmModule_Text,
t2.MonitorUnit_Name,
t3.Sensor_Location,
t3.Sensor_Name,
t4.Min_Value,
t4.Max_Value,
t4.Alarm_Uid,
t4.Alarm_Value,
t4.Collect_Time,
t4.Dispose_Flag,
t4.Dispose_Mode,
t4.Alarm_Reason
from base_alarm_module t1
left join base_monitorunit_info t2 on t2.MonitorUnit_Type = t1.MonitorUnit_Id
left join base_sensor_info t3 on t2.MonitorUnit_Id = t3.MonitorUnit_Id
left join record_alarm t4 on t3.Sensor_Id = t4.Sensor_Id and t1.AlarmType_Id = t4.AlarmType_Id
where t4.Alarm_Uid = #{alarmuid}
</select>
<insert id="insertRecordAlarm" parameterType="RecordAlarm">
@ -106,6 +123,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectAlarmInfoList" parameterType="String" resultMap="RecordAlarmDtoResult">
select t1.AlarmModule_Id,
t1.AlarmModule_Text,
t2.MonitorUnit_Name,
t3.Sensor_Location,
t3.Sensor_Name,
t4.Min_Value,

Loading…
Cancel
Save