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

监测设备功能添加

parent 3d8735a8
......@@ -39,6 +39,17 @@ public class TGasAlarmController extends BaseController
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;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
......@@ -61,9 +62,22 @@ public class TGasData extends BaseEntity
/** $column.columnComment */
@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;
@Excel(name = "经度")
private BigDecimal longitude;
@Excel(name = "纬度")
private BigDecimal latitude;
private String contacts;
@Excel(name = "联系人")
private String contactsName;
private String contactsTel;
/**上报状态*/
private String reportStatus;
......@@ -205,6 +219,46 @@ public class TGasData extends BaseEntity
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
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
......
package com.zehong.system.service.impl;
import java.util.Date;
import java.util.List;
import com.alibaba.fastjson.JSONObject;
......@@ -121,8 +122,8 @@ public class TGasDataServiceImpl implements ITGasDataService
* @return 结果
*/
@Override
public int insertTGasData(TGasData tGasData)
{
public int insertTGasData(TGasData tGasData) {
tGasData.setCreatedAt(new Date());
return tGasDataMapper.insertTGasData(tGasData);
}
......
......@@ -17,10 +17,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="unit" column="unit" />
<result property="tag" column="tag" />
<result property="createdAt" column="created_at" />
<result property="longitude" column="longitude" />
<result property="latitude" column="latitude" />
<result property="contacts" column="contacts" />
</resultMap>
<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>
<select id="selectTGasDataList" parameterType="TGasData" resultMap="TGasDataResult">
......@@ -59,6 +81,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="unit != null">unit,</if>
<if test="tag != null">tag,</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 prefix="values (" suffix=")" suffixOverrides=",">
<if test="number != null">#{number},</if>
......@@ -72,6 +97,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="unit != null">#{unit},</if>
<if test="tag != null">#{tag},</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>
</insert>
......@@ -89,6 +117,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="unit != null">unit = #{unit},</if>
<if test="tag != null">tag = #{tag},</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>
where id = #{id}
</update>
......
......@@ -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) {
return request({
......
<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-row>
<el-col :span="14">
<el-form label-width="80px">
<el-row>
<el-col :span="12">
......@@ -65,6 +67,12 @@
<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>
......@@ -73,11 +81,20 @@
</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-dialog>
</template>
<script>
import { getData } from "@/api/gasdata/data";
import { EditorMap } from "@/utils/mapClass/map";
import { mapGetters } from "vuex";
export default {
name: "detail-info",
data(){
......@@ -95,10 +112,33 @@
getData(gasId).then(res =>{
if(res.code == 200){
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>
......
This diff is collapsed.
......@@ -46,6 +46,7 @@ import PipeInfo from "./components/PipeInfo";
import axios from "axios";
import gcoord from "gcoord";
import LineTips from "./components/LineTips";
import { getAlarmInfoList } from "@/api/gasdata/alarm";
export default {
name: "gao-map-index",
props: {
......@@ -92,7 +93,8 @@ export default {
},
pipeLines: [],
lineShow: false,
lineTipsShow: false
lineTipsShow: false,
alarmInfoData: []
};
},
methods: {
......@@ -188,7 +190,6 @@ export default {
},
getPipeByGeoJson() {
axios.get("../geo_json/huanggezhuang.json").then((res) => {
console.log("haha===========", res.data);
this.gaoMap.map.plugin(["AMap.GeoJSON"], () => {
const geojson = new AMap.GeoJSON({
geoJSON: res.data,
......@@ -316,6 +317,14 @@ export default {
}
});
},
//获取报警信息
getAlarmInfo(){
getAlarmInfoList({reason: "0"}).then(res =>{
if(res.code == 200){
this.alarmInfoData = res.data;
}
})
}
},
computed: {
...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