Commit d2019e2d authored by 耿迪迪's avatar 耿迪迪

监测设备功能添加

parent 3d8735a8
...@@ -39,6 +39,17 @@ public class TGasAlarmController extends BaseController ...@@ -39,6 +39,17 @@ public class TGasAlarmController extends BaseController
return getDataTable(list); return getDataTable(list);
} }
/**
* 获取报警信息
* @param tGasAlarm
* @return
*/
@GetMapping("/getAlarmInfoList")
public AjaxResult getAlarmInfoList(TGasAlarm tGasAlarm) {
List<TGasAlarm> list = tGasAlarmService.selectTGasAlarmList(tGasAlarm);
return AjaxResult.success(list);
}
/** /**
* 导出报警器报警记录列表 * 导出报警器报警记录列表
*/ */
......
package com.zehong.system.domain; package com.zehong.system.domain;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
...@@ -61,9 +62,22 @@ public class TGasData extends BaseEntity ...@@ -61,9 +62,22 @@ public class TGasData extends BaseEntity
/** $column.columnComment */ /** $column.columnComment */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "位号", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date createdAt; private Date createdAt;
@Excel(name = "经度")
private BigDecimal longitude;
@Excel(name = "纬度")
private BigDecimal latitude;
private String contacts;
@Excel(name = "联系人")
private String contactsName;
private String contactsTel;
/**上报状态*/ /**上报状态*/
private String reportStatus; private String reportStatus;
...@@ -205,6 +219,46 @@ public class TGasData extends BaseEntity ...@@ -205,6 +219,46 @@ public class TGasData extends BaseEntity
this.type = type; this.type = type;
} }
public BigDecimal getLongitude() {
return longitude;
}
public void setLongitude(BigDecimal longitude) {
this.longitude = longitude;
}
public BigDecimal getLatitude() {
return latitude;
}
public void setLatitude(BigDecimal latitude) {
this.latitude = latitude;
}
public String getContacts() {
return contacts;
}
public void setContacts(String contacts) {
this.contacts = contacts;
}
public String getContactsName() {
return contactsName;
}
public void setContactsName(String contactsName) {
this.contactsName = contactsName;
}
public String getContactsTel() {
return contactsTel;
}
public void setContactsTel(String contactsTel) {
this.contactsTel = contactsTel;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
......
package com.zehong.system.service.impl; package com.zehong.system.service.impl;
import java.util.Date;
import java.util.List; import java.util.List;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
...@@ -121,8 +122,8 @@ public class TGasDataServiceImpl implements ITGasDataService ...@@ -121,8 +122,8 @@ public class TGasDataServiceImpl implements ITGasDataService
* @return 结果 * @return 结果
*/ */
@Override @Override
public int insertTGasData(TGasData tGasData) public int insertTGasData(TGasData tGasData) {
{ tGasData.setCreatedAt(new Date());
return tGasDataMapper.insertTGasData(tGasData); return tGasDataMapper.insertTGasData(tGasData);
} }
......
...@@ -17,10 +17,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -17,10 +17,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="unit" column="unit" /> <result property="unit" column="unit" />
<result property="tag" column="tag" /> <result property="tag" column="tag" />
<result property="createdAt" column="created_at" /> <result property="createdAt" column="created_at" />
<result property="longitude" column="longitude" />
<result property="latitude" column="latitude" />
<result property="contacts" column="contacts" />
</resultMap> </resultMap>
<sql id="selectTGasDataVo"> <sql id="selectTGasDataVo">
select id, number,type, position, high_alarm, high_high_alarm, low_alarm, low_low_alarm, `range`, unit, tag, created_at from t_gas_data SELECT
id,
number,
type,
position,
high_alarm,
high_high_alarm,
low_alarm,
low_low_alarm,
`range`,
unit,
tag,
created_at,
longitude,
latitude,
contacts,
(select GROUP_CONCAT(nick_name) from sys_user where find_in_set(user_id,contacts)) as contactsName,
(select GROUP_CONCAT(NULLIF(phonenumber, '')) from sys_user where find_in_set(user_id,contacts)) as contactsTel
FROM
t_gas_data
</sql> </sql>
<select id="selectTGasDataList" parameterType="TGasData" resultMap="TGasDataResult"> <select id="selectTGasDataList" parameterType="TGasData" resultMap="TGasDataResult">
...@@ -59,6 +81,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -59,6 +81,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="unit != null">unit,</if> <if test="unit != null">unit,</if>
<if test="tag != null">tag,</if> <if test="tag != null">tag,</if>
<if test="createdAt != null">created_at,</if> <if test="createdAt != null">created_at,</if>
<if test="longitude != null">longitude,</if>
<if test="latitude != null">latitude,</if>
<if test="contacts != null">contacts,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="number != null">#{number},</if> <if test="number != null">#{number},</if>
...@@ -72,6 +97,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -72,6 +97,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="unit != null">#{unit},</if> <if test="unit != null">#{unit},</if>
<if test="tag != null">#{tag},</if> <if test="tag != null">#{tag},</if>
<if test="createdAt != null">#{createdAt},</if> <if test="createdAt != null">#{createdAt},</if>
<if test="longitude != null">#{longitude},</if>
<if test="latitude != null">#{latitude},</if>
<if test="contacts != null">#{contacts},</if>
</trim> </trim>
</insert> </insert>
...@@ -89,6 +117,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -89,6 +117,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="unit != null">unit = #{unit},</if> <if test="unit != null">unit = #{unit},</if>
<if test="tag != null">tag = #{tag},</if> <if test="tag != null">tag = #{tag},</if>
<if test="createdAt != null">created_at = #{createdAt},</if> <if test="createdAt != null">created_at = #{createdAt},</if>
<if test="longitude != null">longitude = #{longitude},</if>
<if test="latitude != null">latitude = #{latitude},</if>
<if test="contacts != null">contacts = #{contacts},</if>
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>
......
...@@ -9,6 +9,15 @@ export function listAlarm(query) { ...@@ -9,6 +9,15 @@ export function listAlarm(query) {
}) })
} }
//获取所有报警信息
export function getAlarmInfoList(query) {
return request({
url: '/gas/alarm/getAlarmInfoList',
method: 'get',
params: query
})
}
// 查询报警器报警记录详细 // 查询报警器报警记录详细
export function getAlarm(id) { export function getAlarm(id) {
return request({ return request({
......
<template> <template>
<el-dialog title="设备详情" :visible.sync="detailOpen" width="800px" append-to-body destroy-on-close :close-on-click-modal="false"> <el-dialog title="设备详情" :visible.sync="detailOpen" width="1000px" append-to-body destroy-on-close :close-on-click-modal="false">
<el-form label-width="80px"> <el-row>
<el-row> <el-col :span="14">
<el-col :span="12"> <el-form label-width="80px">
<el-form-item label="设备编号"> <el-row>
<span>{{ detailInfo.number }}</span> <el-col :span="12">
</el-form-item> <el-form-item label="设备编号">
</el-col> <span>{{ detailInfo.number }}</span>
</el-form-item>
</el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="所属厂家"> <el-form-item label="所属厂家">
<span v-if="detailInfo.type">{{ $parent.typeFormat(detailInfo) }}</span> <span v-if="detailInfo.type">{{ $parent.typeFormat(detailInfo) }}</span>
<span v-else>-</span> <span v-else>-</span>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="位号"> <el-form-item label="位号">
<span>{{ detailInfo.tag }}</span> <span>{{ detailInfo.tag }}</span>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="安装位置"> <el-form-item label="安装位置">
<span>{{ detailInfo.position }}</span> <span>{{ detailInfo.position }}</span>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="高报"> <el-form-item label="高报">
<span v-if="detailInfo.highAlarm">{{ detailInfo.highAlarm }}</span> <span v-if="detailInfo.highAlarm">{{ detailInfo.highAlarm }}</span>
<span v-else>-</span> <span v-else>-</span>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="高高报"> <el-form-item label="高高报">
<span v-if="detailInfo.highHighAlarm">{{ detailInfo.highHighAlarm }}</span> <span v-if="detailInfo.highHighAlarm">{{ detailInfo.highHighAlarm }}</span>
<span v-else>-</span> <span v-else>-</span>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12">
<el-form-item label="低报">
<span v-if="detailInfo.lowAlarm">{{ detailInfo.lowAlarm }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="低低报">
<span v-if="detailInfo.lowLowAlarm">{{ detailInfo.lowLowAlarm }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="量程">
<span v-if="detailInfo.range">{{ detailInfo.range }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="单位">
<span v-if="detailInfo.unit">{{ detailInfo.unit }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="联系人">
<span v-if="detailInfo.contactsName">{{ detailInfo.contactsName }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="创建时间">
<span v-if="detailInfo.createdAt">{{ detailInfo.createdAt }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-col>
<el-col :span="10">
<div id="monitor_dev_map" style="width: 100%;height: 400px;border: 1px solid"></div>
</el-col>
</el-row>
<el-col :span="12">
<el-form-item label="低报">
<span v-if="detailInfo.lowAlarm">{{ detailInfo.lowAlarm }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="低低报">
<span v-if="detailInfo.lowLowAlarm">{{ detailInfo.lowLowAlarm }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="量程">
<span v-if="detailInfo.range">{{ detailInfo.range }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="单位">
<span v-if="detailInfo.unit">{{ detailInfo.unit }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="创建时间">
<span v-if="detailInfo.createdAt">{{ detailInfo.createdAt }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import { getData } from "@/api/gasdata/data"; import { getData } from "@/api/gasdata/data";
import { EditorMap } from "@/utils/mapClass/map";
import { mapGetters } from "vuex";
export default { export default {
name: "detail-info", name: "detail-info",
data(){ data(){
...@@ -95,10 +112,33 @@ ...@@ -95,10 +112,33 @@
getData(gasId).then(res =>{ getData(gasId).then(res =>{
if(res.code == 200){ if(res.code == 200){
this.detailInfo = res.data; this.detailInfo = res.data;
this.initMap();
} }
}) })
},
initMap(){
this.$nextTick(() => {
const path = eval(this.systemSetting.map_center);
let map = new EditorMap(
"monitor_dev_map",
{
center: path,
//mapStyle: "amap://styles/f71d3a3d73e14f5b2bf5508bf1411758",
zoom: 14.5,
},
this
);
if(this.detailInfo.longitude){
map.control = 1;
map.addDevice(this.detailInfo);
map.map.setCenter([this.detailInfo.longitude,this.detailInfo.latitude])
}
});
} }
} },
computed: {
...mapGetters(["systemSetting"]),
},
} }
</script> </script>
......
This diff is collapsed.
...@@ -46,6 +46,7 @@ import PipeInfo from "./components/PipeInfo"; ...@@ -46,6 +46,7 @@ import PipeInfo from "./components/PipeInfo";
import axios from "axios"; import axios from "axios";
import gcoord from "gcoord"; import gcoord from "gcoord";
import LineTips from "./components/LineTips"; import LineTips from "./components/LineTips";
import { getAlarmInfoList } from "@/api/gasdata/alarm";
export default { export default {
name: "gao-map-index", name: "gao-map-index",
props: { props: {
...@@ -92,7 +93,8 @@ export default { ...@@ -92,7 +93,8 @@ export default {
}, },
pipeLines: [], pipeLines: [],
lineShow: false, lineShow: false,
lineTipsShow: false lineTipsShow: false,
alarmInfoData: []
}; };
}, },
methods: { methods: {
...@@ -188,7 +190,6 @@ export default { ...@@ -188,7 +190,6 @@ export default {
}, },
getPipeByGeoJson() { getPipeByGeoJson() {
axios.get("../geo_json/huanggezhuang.json").then((res) => { axios.get("../geo_json/huanggezhuang.json").then((res) => {
console.log("haha===========", res.data);
this.gaoMap.map.plugin(["AMap.GeoJSON"], () => { this.gaoMap.map.plugin(["AMap.GeoJSON"], () => {
const geojson = new AMap.GeoJSON({ const geojson = new AMap.GeoJSON({
geoJSON: res.data, geoJSON: res.data,
...@@ -316,6 +317,14 @@ export default { ...@@ -316,6 +317,14 @@ export default {
} }
}); });
}, },
//获取报警信息
getAlarmInfo(){
getAlarmInfoList({reason: "0"}).then(res =>{
if(res.code == 200){
this.alarmInfoData = res.data;
}
})
}
}, },
computed: { computed: {
...mapGetters(["systemSetting"]), ...mapGetters(["systemSetting"]),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment