From 43bc1fb50683f6b92612e1b04ab7f8612863544d Mon Sep 17 00:00:00 2001 From: gongjiale <942894820@qq.com> Date: Wed, 16 Oct 2024 22:06:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=A5=E8=AD=A6=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../oil/domain/monitor/ThDeviceReport.java | 392 +++++------------- .../service/impl/SysSendInfoServiceImpl.java | 2 + .../ruoyi/project/system/domain/SysUser.java | 10 + .../src/main/resources/application.yml | 4 +- .../mybatis/oil/OilMonitorMapper.xml | 33 +- .../mybatis/oil/ThDeviceReportMapper.xml | 30 +- .../mybatis/system/SysUserMapper.xml | 1 + ruoyi-ui/src/api/home.js | 15 + .../src/views/demostrate/alarm/sendMsg.vue | 4 +- .../src/views/deviceManage/bound/index.vue | 4 +- ruoyi-ui/src/views/history/bound/index.vue | 8 +- .../src/views/home/components/UserSelect.vue | 2 +- 12 files changed, 167 insertions(+), 338 deletions(-) diff --git a/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/domain/monitor/ThDeviceReport.java b/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/domain/monitor/ThDeviceReport.java index a9a6a93..e5b5b8a 100644 --- a/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/domain/monitor/ThDeviceReport.java +++ b/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/domain/monitor/ThDeviceReport.java @@ -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 + '\'' + + '}'; } } \ No newline at end of file diff --git a/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/service/impl/SysSendInfoServiceImpl.java b/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/service/impl/SysSendInfoServiceImpl.java index 5c6cf62..331fb0e 100644 --- a/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/service/impl/SysSendInfoServiceImpl.java +++ b/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/oil/service/impl/SysSendInfoServiceImpl.java @@ -31,6 +31,8 @@ public class SysSendInfoServiceImpl implements ISysSendInfoService { readList.forEach(reader -> { sysSendInfoMapper.sendMessage(sendMessageDTO,reader); }); + //todo 调用发送短信接口 + return 1; } diff --git a/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/system/domain/SysUser.java b/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/system/domain/SysUser.java index 96bd0d2..4843335 100644 --- a/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/system/domain/SysUser.java +++ b/RuoYi-Vue-Oracle/src/main/java/com/ruoyi/project/system/domain/SysUser.java @@ -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; diff --git a/RuoYi-Vue-Oracle/src/main/resources/application.yml b/RuoYi-Vue-Oracle/src/main/resources/application.yml index 850a9e5..b615bb2 100644 --- a/RuoYi-Vue-Oracle/src/main/resources/application.yml +++ b/RuoYi-Vue-Oracle/src/main/resources/application.yml @@ -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 diff --git a/RuoYi-Vue-Oracle/src/main/resources/mybatis/oil/OilMonitorMapper.xml b/RuoYi-Vue-Oracle/src/main/resources/mybatis/oil/OilMonitorMapper.xml index 4436baa..8603449 100644 --- a/RuoYi-Vue-Oracle/src/main/resources/mybatis/oil/OilMonitorMapper.xml +++ b/RuoYi-Vue-Oracle/src/main/resources/mybatis/oil/OilMonitorMapper.xml @@ -52,8 +52,7 @@ - - + @@ -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 and report_time <= #{endTime,jdbcType=TIMESTAMP} and th_device_report.sn= #{sn} and t.name like concat('%', #{name}, '%') - and t.dept_id=#{deptId} + and t.dept_id IN + (SELECT dept_id + FROM sys_dept START WITH dept_id = #{deptId} + CONNECT BY PRIOR dept_id = parent_id) ${params.dataScope} order by th_device_report.report_time desc diff --git a/RuoYi-Vue-Oracle/src/main/resources/mybatis/oil/ThDeviceReportMapper.xml b/RuoYi-Vue-Oracle/src/main/resources/mybatis/oil/ThDeviceReportMapper.xml index ec182ed..ff110e2 100644 --- a/RuoYi-Vue-Oracle/src/main/resources/mybatis/oil/ThDeviceReportMapper.xml +++ b/RuoYi-Vue-Oracle/src/main/resources/mybatis/oil/ThDeviceReportMapper.xml @@ -7,17 +7,9 @@ - - - - - - - - - - - + + + @@ -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 diff --git a/RuoYi-Vue-Oracle/src/main/resources/mybatis/system/SysUserMapper.xml b/RuoYi-Vue-Oracle/src/main/resources/mybatis/system/SysUserMapper.xml index 7d9750a..cadaf15 100644 --- a/RuoYi-Vue-Oracle/src/main/resources/mybatis/system/SysUserMapper.xml +++ b/RuoYi-Vue-Oracle/src/main/resources/mybatis/system/SysUserMapper.xml @@ -7,6 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + diff --git a/ruoyi-ui/src/api/home.js b/ruoyi-ui/src/api/home.js index 0fb6b84..f126b8f 100644 --- a/ruoyi-ui/src/api/home.js +++ b/ruoyi-ui/src/api/home.js @@ -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', + }) +} diff --git a/ruoyi-ui/src/views/demostrate/alarm/sendMsg.vue b/ruoyi-ui/src/views/demostrate/alarm/sendMsg.vue index 4791bba..7ae2b1f 100644 --- a/ruoyi-ui/src/views/demostrate/alarm/sendMsg.vue +++ b/ruoyi-ui/src/views/demostrate/alarm/sendMsg.vue @@ -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 diff --git a/ruoyi-ui/src/views/deviceManage/bound/index.vue b/ruoyi-ui/src/views/deviceManage/bound/index.vue index 06bf3df..67c2073 100644 --- a/ruoyi-ui/src/views/deviceManage/bound/index.vue +++ b/ruoyi-ui/src/views/deviceManage/bound/index.vue @@ -43,8 +43,8 @@ diff --git a/ruoyi-ui/src/views/history/bound/index.vue b/ruoyi-ui/src/views/history/bound/index.vue index 2606bd5..8ea544c 100644 --- a/ruoyi-ui/src/views/history/bound/index.vue +++ b/ruoyi-ui/src/views/history/bound/index.vue @@ -25,8 +25,8 @@ - - + + + - - + diff --git a/ruoyi-ui/src/views/home/components/UserSelect.vue b/ruoyi-ui/src/views/home/components/UserSelect.vue index 76902b7..2f0faf7 100644 --- a/ruoyi-ui/src/views/home/components/UserSelect.vue +++ b/ruoyi-ui/src/views/home/components/UserSelect.vue @@ -14,7 +14,7 @@ - +