报警管理代码提交

This commit is contained in:
gongjiale 2024-09-05 12:01:00 +08:00
parent 511d8dd2c6
commit 6d7c2e9ce8
5 changed files with 83 additions and 303 deletions

View File

@ -28,6 +28,10 @@ public class ThAlarm extends BaseEntity {
*/ */
private String sn; private String sn;
private Long deptId;
private String deptName;
/** /**
*是否处理 *是否处理
@ -50,9 +54,7 @@ public class ThAlarm extends BaseEntity {
*/ */
private String power; private String power;
private String factoryName;
private Long factoryId;
/** /**
* 温度 * 温度
*/ */
@ -133,21 +135,7 @@ public class ThAlarm extends BaseEntity {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date dealTime; private Date dealTime;
public String getFactoryName() {
return factoryName;
}
public void setFactoryName(String factoryName) {
this.factoryName = factoryName;
}
public Long getFactoryId() {
return factoryId;
}
public void setFactoryId(Long factoryId) {
this.factoryId = factoryId;
}
public Long getReportId() { public Long getReportId() {
return reportId; return reportId;
@ -161,6 +149,22 @@ public class ThAlarm extends BaseEntity {
return isDeal; return isDeal;
} }
public Long getDeptId() {
return deptId;
}
public void setDeptId(Long deptId) {
this.deptId = deptId;
}
public String getDeptName() {
return deptName;
}
public void setDeptName(String deptName) {
this.deptName = deptName;
}
public void setIsDeal(String isDeal) { public void setIsDeal(String isDeal) {
this.isDeal = isDeal; this.isDeal = isDeal;
} }

View File

@ -65,8 +65,8 @@
<result property="isDeal" column="is_deal"/> <result property="isDeal" column="is_deal"/>
<result property="dealTime" column="deal_time"/> <result property="dealTime" column="deal_time"/>
<result property="reason" column="reason"/> <result property="reason" column="reason"/>
<result property="factoryName" column="factory_name"/> <result property="deptId" column="dept_id"/>
<result property="factoryId" column="factory_id"/> <result property="deptName" column="dept_name"/>
</resultMap> </resultMap>
<resultMap type="com.ruoyi.project.oil.domain.monitor.ThAlarmEchart" id="ThAlarmEchartResult"> <resultMap type="com.ruoyi.project.oil.domain.monitor.ThAlarmEchart" id="ThAlarmEchartResult">
<result property="level1" column="level1"/> <result property="level1" column="level1"/>
@ -86,7 +86,7 @@ select t.id,t. name,t.sn,t.file_url,t.note,t.create_by,t.create_time,t.address,t
<if test="id != null and id != ''">and t.id=#{id}</if> <if test="id != null and id != ''">and t.id=#{id}</if>
<if test="monitorName != null and monitorName != ''">and t.name like concat('%', #{monitorName},'%') </if> <if test="monitorName != null and monitorName != ''">and t.name like concat('%', #{monitorName},'%') </if>
<if test="monitorNo != null and monitorNo != ''">and t.sn= #{monitorNo} </if> <if test="monitorNo != null and monitorNo != ''">and t.sn= #{monitorNo} </if>
<if test="deptId != null and deptId != ''">and t.dep_id= #{fadeptIdctoryId} </if> <if test="deptId != null and deptId != ''">and t.dept_id= #{deptId} </if>
</where> </where>
</select> </select>
@ -216,36 +216,35 @@ select t.id,t. name,t.sn,t.file_url,t.note,t.create_by,t.create_time,t.address,t
th_device_report.latitude, th_device_report.latitude,
th_device_report.longitude, th_device_report.longitude,
cgq, cgq,
report_content, th_device_report.ds AS ds,
report_content ->> '$[0].ds' AS ds, th_device_report.dw AS dw,
report_content ->> '$[0].dw' AS dw, th_device_report.zl AS zl,
report_content ->> '$[0].lc' AS lc, th_device_report.zt AS zt,
report_content ->> '$[0].zl' AS zl, th_device_report.dbz AS dbz,
report_content ->> '$[0].zt' AS zt, th_device_report.gbz AS gbz,
report_content ->> '$[0].dbz' AS dbz,
report_content ->> '$[0].gbz' AS gbz,
t.NAME, t.NAME,
t.dept_id,
dept.dept_name,
d.id as dealId, d.id as dealId,
d.deal_way, d.deal_way,
d.is_deal, d.is_deal,
d.deal_time, d.deal_time,
d.reason, d.reason,
d.deal_user, d.deal_user
t.factory_id,
f.factory_name
FROM FROM
th_device_report th_device_report
LEFT JOIN th_device t ON th_device_report.sn = t.sn LEFT JOIN th_device t ON th_device_report.sn = t.sn
LEFT JOIN sys_factory f on t.factory_id=f.factory_id LEFT JOIN sys_dept dept on t.dept_id=dept.dept_id
LEFT JOIN th_device_deal d ON th_device_report.id = d.report_id LEFT JOIN th_device_deal d ON th_device_report.id = d.report_id
<where> <where>
(report_content ->> '$[0].zt' ='一级报警' ||report_content ->> '$[0].zt' ='二级报警' ) ( th_device_report.zt='一级报警' or th_device_report.zt='二级报警')
<if test="startTime != null">and report_time > #{startTime,jdbcType=TIMESTAMP}</if> <if test="startTime != null">and report_time > #{startTime,jdbcType=TIMESTAMP}</if>
<if test="endTime != null">and report_time &lt; #{endTime,jdbcType=TIMESTAMP}</if> <if test="endTime != null">and report_time &lt; #{endTime,jdbcType=TIMESTAMP}</if>
<if test="endTime != null">and th_device_report.sn= #{sn}</if> <if test="endTime != null">and th_device_report.sn= #{sn}</if>
<if test="endTime != null">and t.name like concat('%', #{name}, '%')</if> <if test="endTime != null">and t.name like concat('%', #{name}, '%')</if>
<if test="dealUser != null">and d.dealUser like concat('%', #{dealUser}, '%')</if> <if test="dealUser != null">and d.dealUser like concat('%', #{dealUser}, '%')</if>
<if test="factoryId != null">and t.factory_id=#{factoryId}</if> <if test="deptId != null">and t.dept_id=#{deptId}</if>
<choose> <choose>
<when test="isDeal=='1'.toString()"> <when test="isDeal=='1'.toString()">
and d.is_deal='1' and d.is_deal='1'
@ -332,34 +331,28 @@ select t.id,t. name,t.sn,t.file_url,t.note,t.create_by,t.create_time,t.address,t
th_device_report.latitude, th_device_report.latitude,
th_device_report.longitude, th_device_report.longitude,
cgq, cgq,
report_content, th_device_report.ds AS ds,
report_content ->> '$[0].ds' AS ds, th_device_report.dw AS dw,
report_content ->> '$[0].dw' AS dw, th_device_report.zl AS zl,
report_content ->> '$[0].lc' AS lc, th_device_report.zt AS zt,
report_content ->> '$[0].zl' AS zl, th_device_report.dbz AS dbz,
report_content ->> '$[0].zt' AS zt, th_device_report.gbz AS gbz,
report_content ->> '$[0].dbz' AS dbz,
report_content ->> '$[0].gbz' AS gbz,
t.NAME, t.NAME,
d.id as dealId, t.dept_id,
d.deal_way, dept.dept_name
d.is_deal,
d.deal_time,
d.deal_user,
t.factory_id,
f.factory_name
FROM FROM
th_device_report th_device_report
LEFT JOIN th_device t ON th_device_report.sn = t.sn LEFT JOIN th_device t ON th_device_report.sn = t.sn
LEFT JOIN sys_factory f on t.factory_id=f.factory_id LEFT JOIN sys_dept dept on t.dept_id=dept.dept_id
LEFT JOIN th_device_deal d ON th_device_report.id = d.report_id
<where> <where>
<if test="startTime != null">and report_time >= #{startTime,jdbcType=TIMESTAMP}</if> <if test="startTime != null">and report_time >= #{startTime,jdbcType=TIMESTAMP}</if>
<if test="endTime != null">and report_time &lt;= #{endTime,jdbcType=TIMESTAMP}</if> <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="sn != null">and th_device_report.sn= #{sn}</if>
<if test="name != null">and t.name like concat('%', #{name}, '%')</if> <if test="name != null">and t.name like concat('%', #{name}, '%')</if>
<if test="factoryId != null">and t.factory_id=#{factoryId}</if> <if test="deptId != null">and t.dept_id=#{deptId}</if>
${params.dataScope} ${params.dataScope}
</where> </where>
order by th_device_report.report_time desc order by th_device_report.report_time desc

View File

@ -37,7 +37,7 @@ import DictTag from '@/components/DictTag'
import VueMeta from 'vue-meta' import VueMeta from 'vue-meta'
// 字典数据组件 // 字典数据组件
import DictData from '@/components/DictData' import DictData from '@/components/DictData'
import BaiduMap from 'vue-baidu-map'
// 全局方法挂载 // 全局方法挂载
Vue.prototype.getDicts = getDicts Vue.prototype.getDicts = getDicts
Vue.prototype.getConfigKey = getConfigKey Vue.prototype.getConfigKey = getConfigKey
@ -57,7 +57,10 @@ Vue.component('Editor', Editor)
Vue.component('FileUpload', FileUpload) Vue.component('FileUpload', FileUpload)
Vue.component('ImageUpload', ImageUpload) Vue.component('ImageUpload', ImageUpload)
Vue.component('ImagePreview', ImagePreview) Vue.component('ImagePreview', ImagePreview)
Vue.use(BaiduMap, {
// ak密钥
ak: 'cGGHoaL28hAugwgCpH4AGrqBVh3FAzbf',
})
Vue.use(directive) Vue.use(directive)
Vue.use(plugins) Vue.use(plugins)
Vue.use(VueMeta) Vue.use(VueMeta)

View File

@ -1,11 +1,8 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :inline="true" :model="queryParams" ref="form"> <el-form :inline="true" :model="queryParams" ref="form">
<el-form-item label="选择企业" prop="factoryId"> <el-form-item label="选择部门" prop="deptId">
<el-select v-model="queryParams.factoryId" clearable filterable placeholder="请选择"> <dept-tree @deptChange="handleDeptChange" style="width: 150px;" />
<el-option v-for="item in factorys" :key="item.value" :label="item.factoryName" :value="item.factoryId">
</el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="设备名称" prop="equipmentName"> <el-form-item label="设备名称" prop="equipmentName">
<el-input v-model="queryParams.name"></el-input> <el-input v-model="queryParams.name"></el-input>
@ -108,14 +105,13 @@
import { listAlarm } from "@/api/demostrate/monitor"; import { listAlarm } from "@/api/demostrate/monitor";
import sendMsg from "@/views/demostrate/alarm/sendMsg"; import sendMsg from "@/views/demostrate/alarm/sendMsg";
import dealAlarm from "@/views/demostrate/alarm/dealAlarm"; import dealAlarm from "@/views/demostrate/alarm/dealAlarm";
import { getAllFactory } from "@/api/home"; import DeptTree from "@/components/DeptTree/index.vue";
export default { export default {
name: "alarm", name: "alarm",
components: { sendMsg,dealAlarm }, components: { sendMsg,dealAlarm,DeptTree },
dicts: [], dicts: [],
data() { data() {
return { return {
factorys:[],
loading: false, loading: false,
deviceInfo: {}, deviceInfo: {},
isOpenMsg: false, isOpenMsg: false,
@ -145,6 +141,7 @@
startTime: null, startTime: null,
endTime: null, endTime: null,
factoryId:null, factoryId:null,
deptId: null,
}, },
userName: '', userName: '',
@ -152,19 +149,28 @@
}, },
created() { created() {
this.userName = store.getters.user.userName this.userName = store.getters.user.userName
this.queryParams.factoryId = store.getters.user.factoryId
}, },
mounted() { mounted() {
this.getFactory() this.init();
}, },
methods: { methods: {
/**获取企业下拉框 */ async init() {
getFactory() { this.emitChange();
getAllFactory({}).then(response => { this.getList()
this.factorys = response.data; },
this.getList() /**获取企业下拉框 */
}) handleDeptChange(value) {
}, this.queryParams.deptId = value.deptId;
this.emitChange();
},
emitChange() {
this.$nextTick(() => {
this.$emit("queryChange", {
deptId: this.queryParams.deptId,
});
});
},
getList() { getList() {
if (this.dateList && this.dateList.length > 0) { if (this.dateList && this.dateList.length > 0) {
this.queryParams.startTime = this.dateList[0] this.queryParams.startTime = this.dateList[0]
@ -174,237 +180,12 @@
this.queryParams.endTime = null this.queryParams.endTime = null
} }
this.loading = true; this.loading = true;
// listAlarm(this.queryParams).then(response => { listAlarm(this.queryParams).then(response => {
// this.dataList = response.rows; this.dataList = response.rows;
// this.total = response.total; this.total = response.total;
// this.loading = false; this.loading = false;
// }); });
this.total = 343;
this.loading = false;
this.dataList=[ {
"sn": "ZABB6210850989ZA",
"isDeal": null,
"name": null,
"reportTime": "2024-05-26 23:49:12",
"power": "59",
"factoryName": '**有限公司',
"wd": "0",
"yl": "101.3",
"latitude": "3604.89440",
"longitude": "12022.12783",
"lng": null,
"lat": null,
"cgq": 1,
"ds": 0.0,
"dw": "PPM",
"lc": 500,
"zl": "VOC",
"zt": "二级报警",
"dbz": 20, "gbz": 50,
},{
"sn": "ZABB6210850989ZA",
"isDeal": null,
"name": null,
"reportTime": "2024-05-25 23:49:12",
"power": "59",
"factoryName": '**有限公司',
"wd": "0",
"yl": "101.3",
"latitude": "3604.89440",
"longitude": "12022.12783",
"lng": null,
"lat": null,
"cgq": 1,
"ds": 0.0,
"dw": "PPM",
"lc": 500,
"zl": "VOC",
"zt": "二级报警",
"dbz": 20, "gbz": 50,
isDeal:'1',
reason:'阀门泄漏',
dealUser:'张三',
dealWay:'拧紧螺栓',
dealTime:'2024-05-26 09:49:12',
},
{
"sn": "ZABB6210850989ZA",
"isDeal": null,
"name": null,
"reportTime": "2024-05-24 23:49:12",
"power": "59",
"factoryName": '**有限公司',
"wd": "0",
"yl": "101.3",
"latitude": "3604.89440",
"longitude": "12022.12783",
"lng": null,
"lat": null,
"cgq": 1,
"ds": 0.0,
"dw": "PPM",
"lc": 500,
"zl": "VOC",
"zt": "二级报警",
"dbz": 20, "gbz": 50,
},{
"sn": "ZABB621085098QW",
"isDeal": null,
"name": null,
"reportTime": "2024-05-25 23:49:12",
"power": "59",
"factoryName": '**有限公司',
"wd": "0",
"yl": "101.3",
"latitude": "3604.89440",
"longitude": "12022.12783",
"lng": null,
"lat": null,
"cgq": 1,
"ds": 121.23,
"dw": "PPM",
"lc": 500,
"zl": "VOC",
"zt": "一级报警",
"dbz": 50, "gbz": 120,
isDeal:'1',
reason:'阀门泄漏',
dealUser:'李四',
dealWay:'拧紧螺栓',
dealTime:'2024-05-26 09:49:12',
},{
"sn": "ZABB621085098QWS",
"isDeal": null,
"name": null,
"reportTime": "2024-05-24 23:49:12",
"power": "59",
"factoryName": '**有限公司',
"wd": "0",
"yl": "101.3",
"latitude": "3604.89440",
"longitude": "12022.12783",
"lng": null,
"lat": null,
"cgq": 1,
"ds": 0.0,
"dw": "PPM",
"lc": 500,
"zl": "VOC",
"zt": "二级报警",
"dbz": 20, "gbz": 50,
},{
"sn": "ZABB6210850989ZA",
"isDeal": null,
"name": null,
"reportTime": "2024-05-23 23:49:12",
"power": "59",
"factoryName": '**有限公司',
"wd": "0",
"yl": "101.3",
"latitude": "3604.89440",
"longitude": "12022.12783",
"lng": null,
"lat": null,
"cgq": 1,
"ds": 0.0,
"dw": "PPM",
"lc": 500,
"zl": "VOC",
"zt": "二级报警",
"dbz": 20, "gbz": 50,
},{
"sn": "ZABB6210850989ZA",
"isDeal": null,
"name": null,
"reportTime": "2024-05-22 23:49:12",
"power": "59",
"factoryName": '**有限公司',
"wd": "0",
"yl": "101.3",
"latitude": "3604.89440",
"longitude": "12022.12783",
"lng": null,
"lat": null,
"cgq": 1,
"ds": 0.0,
"dw": "PPM",
"lc": 500,
"zl": "VOC",
"zt": "二级报警",
"dbz": 20, "gbz": 50,
},{
"sn": "ZABB6210850989ZA",
"isDeal": null,
"name": null,
"reportTime": "2024-05-21 23:49:12",
"power": "59",
"factoryName": '**有限公司',
"wd": "0",
"yl": "101.3",
"latitude": "3604.89440",
"longitude": "12022.12783",
"lng": null,
"lat": null,
"cgq": 1,
"ds": 9.0,
"dw": "PPM",
"lc": 500,
"zl": "VOC",
"zt": "二级报警",
"dbz": 20, "gbz": 50,
},{
"sn": "ZABB6210850989ZA",
"isDeal": null,
"name": null,
"reportTime": "2024-05-20 23:49:12",
"power": "59",
"factoryName": '**有限公司',
"wd": "0",
"yl": "101.3",
"latitude": "3604.89440",
"longitude": "12022.12783",
"lng": null,
"lat": null,
"cgq": 1,
"ds": 0.0,
"dw": "PPM",
"lc": 500,
"zl": "VOC",
"zt": "二级报警",
"dbz": 20, "gbz": 50,
},{
"sn": "ZABB6210850989ZA",
"isDeal": null,
"name": null,
"reportTime": "2024-05-20 23:49:12",
"power": "59",
"factoryName": '**有限公司',
"wd": "0",
"yl": "101.3",
"latitude": "3604.89440",
"longitude": "12022.12783",
"lng": null,
"lat": null,
"cgq": 1,
"ds": 40.0,
"dw": "PPM",
"lc": 500,
"zl": "VOC",
"zt": "二级报警",
"dbz": 12, "gbz": 58,
},
]
}, },
// //
handleUpdate(row) { handleUpdate(row) {

View File

@ -28,13 +28,12 @@
</template> </template>
<script> <script>
import { BmlHeatmap } from 'vue-baidu-map'//
import bus from '@/utils/bus.js' import bus from '@/utils/bus.js'
import iconMarker from '@/assets/images/marker1.png' // import import iconMarker from '@/assets/images/marker1.png' // import
import { getMonitorMap } from "@/api/demostrate/monitor"; import { getMonitorMap } from "@/api/demostrate/monitor";
export default { export default {
components: { components: {
BmlHeatmap
}, },
data() { data() {
return { return {