报警管理

This commit is contained in:
gongjiale 2024-10-16 22:06:17 +08:00
parent 117578f3c9
commit 43bc1fb506
12 changed files with 167 additions and 338 deletions

View File

@ -1,5 +1,6 @@
package com.ruoyi.project.oil.domain.monitor;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.framework.web.domain.BaseEntity;
import java.io.Serializable;
@ -10,143 +11,65 @@ import java.util.Date;
* @TableName th_device_report
*/
public class ThDeviceReport extends BaseEntity {
/**
* 主键
*/
private Long id;
/**
* 设备sn码
*/
private String sn;
/**
* 港区
*/
private String gangqu;
private String deptName;
private Long deptId;
/**
* 上报时间
*/
private Date reportTime;
/**
* ds 读数dw 单位 lc 量程zl 种类zt 状态dbz 低报值gbz 高报值
*/
private Object reportContent;
/**
* 设备电量
*/
private String power;
/**
* sos
*/
private String sos;
/**
* 气泵状态
*/
private String qb;
/**
* 温度
*/
private String wd;
/**
* 湿度
*/
private String sd;
/**
* 压力
*/
private String yl;
/**
* 纬度
*/
private String latitude;
/**
* 经度
*/
private String longitude;
/**
* 传感器数量
*/
private Integer cgq;
/**
* 设备原始报文
*/
private String source;
/**
* 读数
*/
private String ds;
/**
* 低报值
*/
private String dbz;
/**
* 高报值
*/
private String gbz;
private static final long serialVersionUID = 1L;
public String getPower() {
return power;
}
public void setPower(String power) {
this.power = power;
}
public Long getId() {
return id;
}
public String getDeptName() {
return deptName;
}
public void setDeptName(String deptName) {
this.deptName = deptName;
}
public Long getDeptId() {
return deptId;
}
public void setDeptId(Long deptId) {
this.deptId = deptId;
}
public String getGangqu() {
return gangqu;
}
public void setGangqu(String gangqu) {
this.gangqu = gangqu;
}
public void setId(Long id) {
this.id = id;
}
/**
* 上报时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date reportTime;
/**
* 设备编码
*/
private String sn;
/**
* 探测器标号
*/
private String flag;
/**
* 气体浓度 gas_value
*/
private String ds;
/**
* 检测精度 gas_dec
*/
private int jcjd;
/**
* 状态 gas_status
*/
private String zt;
/**
* 种类 gas_type
*/
private String zl;
/**
* 单位 gas_unit
*/
private String dw;
/**
* 一级报警值alarml
*/
private String dbz;
/**
* 二级报警值 alarmh
*/
private String gbz;
/**
* 量程 gas_range
*/
private String lc;
public String getSn() {
return sn;
}
@ -155,6 +78,42 @@ public class ThDeviceReport extends BaseEntity {
this.sn = sn;
}
public String getFlag() {
return flag;
}
public void setFlag(String flag) {
this.flag = flag;
}
public String getDs() {
return ds;
}
public void setDs(String ds) {
this.ds = ds;
}
public int getJcjd() {
return jcjd;
}
public void setJcjd(int jcjd) {
this.jcjd = jcjd;
}
public String getZt() {
return zt;
}
public void setZt(String zt) {
this.zt = zt;
}
public String getZl() {
return zl;
}
public Date getReportTime() {
return reportTime;
}
@ -163,92 +122,16 @@ public class ThDeviceReport extends BaseEntity {
this.reportTime = reportTime;
}
public Object getReportContent() {
return reportContent;
public void setZl(String zl) {
this.zl = zl;
}
public void setReportContent(Object reportContent) {
this.reportContent = reportContent;
public String getDw() {
return dw;
}
public String getSos() {
return sos;
}
public void setSos(String sos) {
this.sos = sos;
}
public String getQb() {
return qb;
}
public void setQb(String qb) {
this.qb = qb;
}
public String getWd() {
return wd;
}
public void setWd(String wd) {
this.wd = wd;
}
public String getSd() {
return sd;
}
public void setSd(String sd) {
this.sd = sd;
}
public String getYl() {
return yl;
}
public void setYl(String yl) {
this.yl = yl;
}
public String getLatitude() {
return latitude;
}
public void setLatitude(String latitude) {
this.latitude = latitude;
}
public String getLongitude() {
return longitude;
}
public void setLongitude(String longitude) {
this.longitude = longitude;
}
public Integer getCgq() {
return cgq;
}
public void setCgq(Integer cgq) {
this.cgq = cgq;
}
public String getSource() {
return source;
}
public void setSource(String source) {
this.source = source;
}
public String getDs() {
return ds;
}
public void setDs(String ds) {
this.ds = ds;
public void setDw(String dw) {
this.dw = dw;
}
public String getDbz() {
@ -267,86 +150,27 @@ public class ThDeviceReport extends BaseEntity {
this.gbz = gbz;
}
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
ThDeviceReport other = (ThDeviceReport) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getSn() == null ? other.getSn() == null : this.getSn().equals(other.getSn()))
&& (this.getReportTime() == null ? other.getReportTime() == null : this.getReportTime().equals(other.getReportTime()))
&& (this.getReportContent() == null ? other.getReportContent() == null : this.getReportContent().equals(other.getReportContent()))
&& (this.getPower() == null ? other.getPower() == null : this.getPower().equals(other.getPower()))
&& (this.getSos() == null ? other.getSos() == null : this.getSos().equals(other.getSos()))
&& (this.getQb() == null ? other.getQb() == null : this.getQb().equals(other.getQb()))
&& (this.getWd() == null ? other.getWd() == null : this.getWd().equals(other.getWd()))
&& (this.getSd() == null ? other.getSd() == null : this.getSd().equals(other.getSd()))
&& (this.getYl() == null ? other.getYl() == null : this.getYl().equals(other.getYl()))
&& (this.getLatitude() == null ? other.getLatitude() == null : this.getLatitude().equals(other.getLatitude()))
&& (this.getLongitude() == null ? other.getLongitude() == null : this.getLongitude().equals(other.getLongitude()))
&& (this.getCgq() == null ? other.getCgq() == null : this.getCgq().equals(other.getCgq()))
&& (this.getSource() == null ? other.getSource() == null : this.getSource().equals(other.getSource()))
&& (this.getDs() == null ? other.getDs() == null : this.getDs().equals(other.getDs()))
&& (this.getDbz() == null ? other.getDbz() == null : this.getDbz().equals(other.getDbz()))
&& (this.getGbz() == null ? other.getGbz() == null : this.getGbz().equals(other.getGbz()));
public String getLc() {
return lc;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getSn() == null) ? 0 : getSn().hashCode());
result = prime * result + ((getReportTime() == null) ? 0 : getReportTime().hashCode());
result = prime * result + ((getReportContent() == null) ? 0 : getReportContent().hashCode());
result = prime * result + ((getPower() == null) ? 0 : getPower().hashCode());
result = prime * result + ((getSos() == null) ? 0 : getSos().hashCode());
result = prime * result + ((getQb() == null) ? 0 : getQb().hashCode());
result = prime * result + ((getWd() == null) ? 0 : getWd().hashCode());
result = prime * result + ((getSd() == null) ? 0 : getSd().hashCode());
result = prime * result + ((getYl() == null) ? 0 : getYl().hashCode());
result = prime * result + ((getLatitude() == null) ? 0 : getLatitude().hashCode());
result = prime * result + ((getLongitude() == null) ? 0 : getLongitude().hashCode());
result = prime * result + ((getCgq() == null) ? 0 : getCgq().hashCode());
result = prime * result + ((getSource() == null) ? 0 : getSource().hashCode());
result = prime * result + ((getDs() == null) ? 0 : getDs().hashCode());
result = prime * result + ((getDbz() == null) ? 0 : getDbz().hashCode());
result = prime * result + ((getGbz() == null) ? 0 : getGbz().hashCode());
return result;
public void setLc(String lc) {
this.lc = lc;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", sn=").append(sn);
sb.append(", reportTime=").append(reportTime);
sb.append(", reportContent=").append(reportContent);
sb.append(", power=").append(power);
sb.append(", sos=").append(sos);
sb.append(", qb=").append(qb);
sb.append(", wd=").append(wd);
sb.append(", sd=").append(sd);
sb.append(", yl=").append(yl);
sb.append(", latitude=").append(latitude);
sb.append(", longitude=").append(longitude);
sb.append(", cgq=").append(cgq);
sb.append(", source=").append(source);
sb.append(", ds=").append(ds);
sb.append(", dbz=").append(dbz);
sb.append(", gbz=").append(gbz);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
return "SensorData{" +
"sn='" + sn + '\'' +
", flag='" + flag + '\'' +
", ds='" + ds + '\'' +
", jcjd=" + jcjd +
", zt='" + zt + '\'' +
", zl='" + zl + '\'' +
", dw=" + dw +
", dbz='" + dbz + '\'' +
", gbz='" + gbz + '\'' +
", lc='" + lc + '\'' +
'}';
}
}

View File

@ -31,6 +31,8 @@ public class SysSendInfoServiceImpl implements ISysSendInfoService {
readList.forEach(reader -> {
sysSendInfoMapper.sendMessage(sendMessageDTO,reader);
});
//todo 调用发送短信接口
return 1;
}

View File

@ -29,6 +29,8 @@ public class SysUser extends BaseEntity
@Excel(name = "部门编号", type = Type.IMPORT)
private Long deptId;
private String deptName;
/** 用户账号 */
@Excel(name = "登录名称")
private String userName;
@ -98,6 +100,14 @@ public class SysUser extends BaseEntity
}
public String getDeptName() {
return deptName;
}
public void setDeptName(String deptName) {
this.deptName = deptName;
}
public SysUser(Long userId)
{
this.userId = userId;

View File

@ -74,13 +74,13 @@ spring:
redis:
# 地址
host: 192.168.31.105
# host: 127.0.0.1
# host: 127.0.0.1
# 端口默认为6379
port: 6379
# 数据库索引
database: 0
# 密码
# password: 123456
# password: 123456
password: admin123!
# 连接超时时间
timeout: 10s

View File

@ -52,8 +52,7 @@
<result property="name" column="name"/>
<result property="reportTime" column="report_time"/>
<result property="reportContent" column="report_content"/>
<result property="yl" column="yl"/>
<result property="power" column="power"/>
<result property="zt" column="zt"/>
<result property="latitude" column="latitude"/>
<result property="longitude" column="longitude"/>
<result property="cgq" column="cgq"/>
@ -220,21 +219,15 @@ select t.id,t. name,t.unit_no,t.system_no,t.status,t.sn,t.file_url,t.note,t.crea
th_device_report.id AS reportId,
th_device_report.sn,
th_device_report.report_time,
th_device_report.power,
th_device_report.qb,
th_device_report.wd,
th_device_report.yl,
th_device_report.latitude,
th_device_report.longitude,
th_device_report.cgq,
th_device_report.ds AS ds,
th_device_report.dw AS dw,
th_device_report.zl AS zl,
th_device_report.zt AS zt,
th_device_report.dbz AS dbz,
th_device_report.gbz AS gbz,
t.NAME,
t.dept_id,
t.longitude,
t.latitude,
dept.dept_name,
d.id as dealId,
d.deal_way,
@ -315,21 +308,16 @@ select t.id,t. name,t.unit_no,t.system_no,t.status,t.sn,t.file_url,t.note,t.crea
SELECT
th_device_report.id AS reportId,
th_device_report.sn,
report_time,
power,
qb,
wd,
yl,
th_device_report.latitude,
th_device_report.longitude,
cgq,
th_device_report.report_time,
th_device_report.ds AS ds,
th_device_report.dw AS dw,
th_device_report.zl AS zl,
th_device_report.zt AS zt,
th_device_report.zt ,
th_device_report.dbz AS dbz,
th_device_report.gbz AS gbz,
th_device_report.lc,
t.NAME,
t. latitude,
t.longitude,
t.dept_id,
dept.dept_name
@ -344,7 +332,10 @@ select t.id,t. name,t.unit_no,t.system_no,t.status,t.sn,t.file_url,t.note,t.crea
<if test="endTime != null">and report_time &lt;= #{endTime,jdbcType=TIMESTAMP}</if>
<if test="sn != null">and th_device_report.sn= #{sn}</if>
<if test="name != null">and t.name like concat('%', #{name}, '%')</if>
<if test="deptId != null">and t.dept_id=#{deptId}</if>
<if test="deptId != null">and t.dept_id IN
(SELECT dept_id
FROM sys_dept START WITH dept_id = #{deptId}
CONNECT BY PRIOR dept_id = parent_id)</if>
${params.dataScope}
</where>
order by th_device_report.report_time desc

View File

@ -7,17 +7,9 @@
<id property="id" column="id" jdbcType="BIGINT"/>
<result property="sn" column="sn" jdbcType="VARCHAR"/>
<result property="reportTime" column="report_time" jdbcType="TIMESTAMP"/>
<result property="reportContent" column="report_content" jdbcType="OTHER"/>
<result property="power" column="power" jdbcType="VARCHAR"/>
<result property="sos" column="sos" jdbcType="VARCHAR"/>
<result property="qb" column="qb" jdbcType="VARCHAR"/>
<result property="wd" column="wd" jdbcType="VARCHAR"/>
<result property="sd" column="sd" jdbcType="VARCHAR"/>
<result property="yl" column="yl" jdbcType="VARCHAR"/>
<result property="latitude" column="latitude" jdbcType="VARCHAR"/>
<result property="longitude" column="longitude" jdbcType="VARCHAR"/>
<result property="cgq" column="cgq" jdbcType="INTEGER"/>
<result property="source" column="source" jdbcType="VARCHAR"/>
<result property="dw" column="dw" jdbcType="VARCHAR"/>
<result property="jcjd" column="JCJD" jdbcType="INTEGER"/>
<result property="ds" column="ds" jdbcType="VARCHAR"/>
<result property="dbz" column="dbz" jdbcType="VARCHAR"/>
<result property="gbz" column="gbz" jdbcType="VARCHAR"/>
@ -27,17 +19,11 @@
SELECT d.id,
d.sn,
d.report_time,
d.report_content,
d.power,
d.sos,
d.qb,
d.wd,
d.sd,
d.yl,
d.latitude,
d.longitude,
d.cgq,
d.source,
d.SBZT,
d.kcjd,
d.lc,
d.dw,
d.zt,
d.ds,
d.dbz,
d.gbz

View File

@ -7,6 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="SysUser" id="SysUserResult">
<id property="userId" column="user_id" />
<result property="deptId" column="dept_id" />
<result property="deptName" column="dept_name" />
<result property="userName" column="user_name" />
<result property="nickName" column="nick_name" />
<result property="email" column="email" />

View File

@ -57,4 +57,19 @@ export function queryMsgNum() {
method: 'get',
})
}
// 查询未读消息列表
export function listMsg(query) {
return request({
url: '/sendInfo/list',
method: 'get',
params: query
})
}
//将消息设置为已读
export function readMsg(id) {
return request({
url: '/sendInfo/readMsg/'+id,
method: 'get',
})
}

View File

@ -104,8 +104,8 @@ export default {
},
//
chooseUser(val) {
if (val && val.length > 1) {
this.$message.error("请选择一名处理人员!")
if (val && val.length <1) {
this.$message.error("请至少选择一名处理人员!")
this.isShowUser = false
} else {
this.userList = val

View File

@ -43,8 +43,8 @@
<el-table-column prop="status" label="设备状态" align="center">
<!-- 使用 scoped slot 来自定义显示 -->
<template slot-scope="scope">
<span v-if="scope.row.status === 1">运行</span>
<span v-else-if="scope.row.status === 0">停运</span>
<span v-if="scope.row.status == '1'">运行</span>
<span v-else-if="scope.row.status == '0'">停运</span>
</template>
</el-table-column>
<el-table-column label="上传时间" align="center" prop="createTime" />

View File

@ -25,8 +25,8 @@
<el-table-column prop="sn" label="设备编号" header-align="center" align="center" />
<el-table-column prop="reportTime" label="上报时间" header-align="center" align="center" />
<!-- <el-table-column prop="wd" label="设备温度" header-align="center" align="center"/>-->
<el-table-column prop="power" label="设备电量" header-align="center" align="center" />
<el-table-column prop="zl" label="传感器类型" header-align="center" align="center" />
<!-- <el-table-column prop="zl" label="传感器类型" header-align="center" align="center" /> -->
<el-table-column prop="lc" label="量程" header-align="center" align="center" />
<el-table-column prop="ds" label="传感器读数" header-align="center" align="center">
<template slot-scope="scope">
@ -38,6 +38,7 @@
</span>
</template>
</el-table-column>
<el-table-column prop="zt" label="报警状态" header-align="center" align="center">
<template slot-scope="scope">
<span v-if="scope.row.zt == '一级报警'" style="color: #c00808;">
@ -51,8 +52,7 @@
</span>
</template>
</el-table-column>
<el-table-column prop="dbz" label="低报值" header-align="center" align="center" />
<el-table-column prop="gbz" label="高报值" header-align="center" align="center" />
</el-table>

View File

@ -14,7 +14,7 @@
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="用户名称" align="center" prop="userName" />
<el-table-column label="用户昵称" align="center" prop="nickName" />
<el-table-column label="企业" align="center" prop="factoryName" />
<el-table-column label="企业" align="center" prop="deptName" />
<el-table-column label="用户手机号" align="center" prop="phonenumber" />
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="userParams.pageNum" :limit.sync="userParams.pageSize"