change - 代码合并

main
wenjy 3 years ago
parent 1667dd2c5c
commit cf2d3b7c26

@ -6,12 +6,12 @@ spring:
druid:
# 主库数据源
master:
url: jdbc:mysql://121.36.58.109:3306/jrm-intelligent-iot?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: Haiwei123456
# url: jdbc:mysql://localhost:3306/jrm-intelligent-iot?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
# url: jdbc:mysql://121.36.58.109:3306/jrm-intelligent-iot?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
# username: root
# password: root
# password: Haiwei123456
url: jdbc:mysql://localhost:3306/jrm-intelligent-iot?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: root
# 从库数据源
slave:
# 从数据源开关/默认关闭

@ -44,7 +44,7 @@
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="record:recordAlarm:add">
<!-- <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="record:recordAlarm:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="record:recordAlarm:edit">
@ -52,7 +52,7 @@
</a>
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="record:recordAlarm:remove">
<i class="fa fa-remove"></i> 删除
</a>
</a>-->
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="record:recordAlarm:export">
<i class="fa fa-download"></i> 导出
</a>
@ -103,7 +103,7 @@
field: 'collectTime',
title: '采集时间'
},
{
/*{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
@ -112,7 +112,7 @@
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.sensorId + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
}]
}*/]
};
$.table.init(options);
});

@ -298,19 +298,6 @@
width: ['10%', '10%', '10%', '30%', '10%', '10%', '10%'],
})
const alertListData = [
['01', 'A1', '设备高温', '1#厂区', '无线检测 相对检测值为10°-20°其值为21°-25°', '越限', '10:00:00', '<span class="text-success">已处理</span>'],
['02', 'A1', '设备高温', '1#厂区', '无线检测 相对检测值为10°-20°其值为21°-25°', '越限', '10:00:00', '<span class="text-danger">未处理</span>'],
['03', 'A1', '设备高温', '1#厂区', '无线检测 相对检测值为10°-20°其值为21°-25°', '越限', '10:00:00', '<span class="text-success">已处理</span>'],
['04', 'A1', '设备高温', '1#厂区', '无线检测 相对检测值为10°-20°其值为21°-25°', '越限', '10:00:00', '<span class="text-danger">未处理</span>'],
['05', 'A1', '设备高温', '1#厂区', '无线检测 相对检测值为10°-20°其值为21°-25°', '越限', '10:00:00', '<span class="text-success">已处理</span>'],
['06', 'A1', '设备高温', '1#厂区', '无线检测 相对检测值为10°-20°其值为21°-25°', '越限', '10:00:00', '<span class="text-success">已处理</span>'],
];
alertList.loadData(alertListData, Object.keys(alertListColumns))
console.log(alertListData)
//获取告警信息
$(() => {
$.ajax({
@ -320,7 +307,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?'<span class="text-success">已处理</span>':'<span class="text-danger">未处理</span>'}`]), Object.keys(alertListColumns))
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?'<a class="text-success">已处理</a>':'<a onclick="alarmDispose('+value+')" class="text-danger">未处理</a>'}`]), Object.keys(alertListColumns))
},
error: () => {
@ -339,6 +326,10 @@
$(() => {
resize()
})
const alarmDispose = function (res) {
console.log("ces:"+res);
}
</script>
<script type="text/javascript">

@ -631,12 +631,12 @@
}
}
document.getElementById(result.sensorId + "sensorStatus").innerHTML = result['sensorStatus'] == null ? "-" : sensorStatus(result['sensorStatus']);
// document.getElementById(result.sensorId + "sensorStatus").innerHTML = result['sensorStatus'] == null ? "-" : sensorStatus(result['sensorStatus']);
document.getElementById(result.sensorId + "collectTime").innerHTML = result['collectTime'] == null ? "-" : collectTime(result['collectTime']);
}
//上报设备状态
const reportStatus = function (result) {
document.getElementById(result.sensorId + "sensorStatus").innerHTML = result['sensorStatus'] == null ? "-" : sensorStatus(result['sensorStatus']);
//document.getElementById(result.sensorId + "sensorStatus").innerHTML = result['sensorStatus'] == null ? "-" : sensorStatus(result['sensorStatus']);
}
</script>

@ -43,6 +43,12 @@ public class RecordAlarm extends BaseEntity
/** 处理标识 */
private Long disposeFlag;
/** 处理方式 */
private String disposeMode;
/** 告警原因 */
private String alarmReason;
public void setSensorId(String sensorId)
{
this.sensorId = sensorId;
@ -106,6 +112,22 @@ public class RecordAlarm extends BaseEntity
this.disposeFlag = disposeFlag;
}
public String getDisposeMode() {
return disposeMode;
}
public void setDisposeMode(String disposeMode) {
this.disposeMode = disposeMode;
}
public String getAlarmReason() {
return alarmReason;
}
public void setAlarmReason(String alarmReason) {
this.alarmReason = alarmReason;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -12,6 +12,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="maxValue" column="Max_Value" />
<result property="disposeFlag" column="Dispose_Flag" />
<result property="collectTime" column="Collect_Time" />
<result property="disposeMode" column="Dispose_Mode" />
<result property="alarmReason" column="Alarm_Reason" />
</resultMap>
<resultMap type="RecordAlarmDto" id="RecordAlarmDtoResult">
@ -28,10 +30,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="sensorName" column="Sensor_Name" />
<result property="sensorLocation" column="Sensor_Location" />
<result property="alarmInfo" column="Alarm_Info" />
<result property="disposeMode" column="Dispose_Mode" />
<result property="alarmReason" column="Alarm_Reason" />
</resultMap>
<sql id="selectRecordAlarmVo">
select Sensor_Id, AlarmType_Id, Min_Value, Alarm_Value, Max_Value,Dispose_Flag, Collect_Time from record_alarm
select Sensor_Id, AlarmType_Id, Min_Value, Alarm_Value, Max_Value,Dispose_Flag, Collect_Time,Dispose_Mode,Alarm_Reason from record_alarm
</sql>
<select id="selectRecordAlarmList" parameterType="RecordAlarm" resultMap="RecordAlarmResult">
@ -60,6 +64,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="alarmValue != null">Alarm_Value,</if>
<if test="maxValue != null">Max_Value,</if>
<if test="collectTime != null">Collect_Time,</if>
<if test="disposeMode != null">Dispose_Mode,</if>
<if test="alarmReason != null">Alarm_Reason,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="sensorId != null">#{sensorId},</if>
@ -68,6 +74,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="alarmValue != null">#{alarmValue},</if>
<if test="maxValue != null">#{maxValue},</if>
<if test="collectTime != null">#{collectTime},</if>
<if test="disposeMode != null">#{disposeMode},</if>
<if test="alarmReason != null">#{alarmReason},</if>
</trim>
</insert>
@ -79,6 +87,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="alarmValue != null">Alarm_Value = #{alarmValue},</if>
<if test="maxValue != null">Max_Value = #{maxValue},</if>
<if test="collectTime != null">Collect_Time = #{collectTime},</if>
<if test="disposeMode != null">Dispose_Mode = #{disposeMode},</if>
<if test="alarmReason != null">Alarm_Reason = #{alarmReason},</if>
</trim>
where Sensor_Id = #{sensorId}
</update>
@ -98,6 +108,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select t1.AlarmModule_Id,
t1.AlarmModule_Text,
t3.Sensor_Location,
t3.Sensor_Name,
t4.Min_Value,
t4.Max_Value,
t4.Alarm_Value,

Loading…
Cancel
Save