Commit 5a6684ee authored by yaqizhang's avatar yaqizhang

Merge branch 'master' of http://111.61.77.35:9999/gengdidi/gassafety into master

parents b887097e 79231495
......@@ -78,6 +78,9 @@ public class CommonController
// String url = serverConfig.getUrl() + fileName;
String fileName = file.getOriginalFilename();
String fileServer = serverConfig.getUrl().contains("127") && serverConfig.getUrl().contains("8093") && !filePath.contains("/data")? serverConfig.getUrl() : serverConfig.getUrl().replace("127.0.0.1:8903","36.148.23.59:8901");
if(fileServer.contains("rqgw.zhkjgf.com")){
fileServer = serverConfig.getUrl().replace("rqgw.zhkjgf.com","36.148.23.59:8901");
}
String url = fileServer + FileUploadUtils.upload(filePath, file);
AjaxResult ajax = AjaxResult.success();
ajax.put("fileName", fileName);
......
......@@ -11,14 +11,7 @@ import com.zehong.system.domain.vo.TUserLocationVo;
import com.zehong.system.service.ISysUserService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.zehong.common.annotation.Log;
import com.zehong.common.core.controller.BaseController;
import com.zehong.common.core.domain.AjaxResult;
......@@ -123,7 +116,17 @@ public class TUserLocationController extends BaseController
{
return toAjax(tUserLocationService.insertTUserLocation(tUserLocation));
}
/**
* 小程序巡检员批量定位
* @param tUserLocationList
* @return
*/
@Log(title = "巡检员定位", businessType = BusinessType.INSERT)
@PostMapping(value = "/addlist")
public AjaxResult addlist(@RequestParam String tUserLocationList)
{
return toAjax(tUserLocationService.addTUserLocationList(tUserLocationList));
}
/**
* 修改巡检员定位
*/
......@@ -134,7 +137,6 @@ public class TUserLocationController extends BaseController
{
return toAjax(tUserLocationService.updateTUserLocation(tUserLocation));
}
/**
* 删除巡检员定位
*/
......
package com.zehong.system.domain;
import java.math.BigDecimal;
import java.util.Date;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.zehong.common.annotation.Excel;
import com.zehong.common.core.domain.BaseEntity;
import org.springframework.format.annotation.DateTimeFormat;
/**
* 巡检员定位对象 t_user_location
......@@ -36,7 +39,18 @@ public class TUserLocation extends BaseEntity
private String phonenumber;
private String nickName;
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
@Override
public Date getCreateTime() {
return createTime;
}
@Override
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public String getNickName() {
return nickName;
}
......
......@@ -43,6 +43,7 @@ public interface TUserLocationMapper
* @return 结果
*/
public int insertTUserLocation(TUserLocation tUserLocation);
public int insertTUserLocationList(List<TUserLocation> list);
/**
* 修改巡检员定位
......
......@@ -43,6 +43,7 @@ public interface ITUserLocationService
* @return 结果
*/
public int insertTUserLocation(TUserLocation tUserLocation);
public int addTUserLocationList(String tUserLocationList);
/**
* 修改巡检员定位
......
......@@ -127,7 +127,6 @@ public class TDeviceInfoServiceImpl implements ITDeviceInfoService
String[] strgps = str.split(",");
map.put("longitude",strgps[0].substring(3, strgps[0].length() - 1));
map.put("latitude",strgps[1].substring(1, strgps[1].length() - 2));
System.out.println("============================="+map.get("longitude")+","+map.get("latitude"));
//JSONObject jo = JSONObject.parseObject(str);
}
}
......
......@@ -76,11 +76,11 @@ public class TInspectionPlanServiceImpl implements ITInspectionPlanService
if(dataList.size() != 0) {
InspectionDataVo inspectionDataVo = new InspectionDataVo();
TDeviceInfo deviceInfo = null;
TPipe pipe = null;
for (TInspectionData temp : dataList) {
InspectionDataVo inspectionDataVo = new InspectionDataVo();
BeanUtils.copyProperties(temp, inspectionDataVo);
if (!"0".equals(temp.getDeviceType())) {
......
......@@ -3,6 +3,7 @@ package com.zehong.system.service.impl;
import java.util.List;
import java.util.Map;
import com.alibaba.fastjson.JSONObject;
import com.zehong.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -63,7 +64,11 @@ public class TUserLocationServiceImpl implements ITUserLocationService
tUserLocation.setCreateTime(DateUtils.getNowDate());
return tUserLocationMapper.insertTUserLocation(tUserLocation);
}
@Override
public int addTUserLocationList(String tUserLocationList){
List<TUserLocation> list =(List<TUserLocation> )JSONObject.parse(tUserLocationList);
return tUserLocationMapper.insertTUserLocationList(list);
}
/**
* 修改巡检员定位
*
......
......@@ -259,10 +259,17 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
public PageInfo<TWorkOrder> selectWaitingWorkOrder(String userId,Integer type,String searchStr,Integer waitingtype){
List<TWorkOrder> workOrderList = tWorkOrderMapper.selectWaitingWorkOrder(userId,type,searchStr,waitingtype);
for(TWorkOrder t :workOrderList){
if(t.getOrderType().equals('3')){
if(t.getOrderType().equals("3")){
String address = tDeviceAlarmMapper.selectAddressByOrderId(t.getOrderId());
t.setAddress(address);
}
if(t.getOrderType().equals("1")){
t.setLatitude(tInspectionDataMapper.selectFinishTInspectionData(t.getResourceId())+"");
TInspectionPlan plan = tInspectionPlanMapper.selectTInspectionPlanById(t.getResourceId());
if(plan!=null){
t.setLongitude((plan.getDeviceIds().split(",").length/2)+"");
}
}
}
PageInfo<TWorkOrder> pageInfo = new PageInfo<>(workOrderList);
return pageInfo;
......
......@@ -86,8 +86,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="selectRealtimeDataList" parameterType="DeviceReportDataForm" resultMap="TDeviceReportDataResultVo">
select
max(t.report_time) report_time,
SELECT
*
FROM
(
SELECT
t.report_time,
t.device_report_data_id,
t.device_num,
t.standard_condition_accumulation,
......@@ -105,34 +109,54 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
d.device_code,
d.device_type,
d.device_model,
CASE (SELECT COUNT(DISTINCT alarm.device_id) FROM t_device_alarm alarm WHERE alarm.device_id = d.device_id AND alarm.end_time IS NULL)
WHEN 0 THEN '正常'
ELSE '报警'
END as device_status
from t_device_report_data t
LEFT JOIN t_device_info d on t.device_num = d.iot_no
CASE (
SELECT
COUNT(DISTINCT alarm.device_id)
FROM
t_device_alarm alarm
WHERE
alarm.device_id = d.device_id
AND alarm.end_time IS NULL
)
WHEN 0 THEN
'正常'
ELSE
'报警'
END AS device_status
FROM
t_device_report_data t
LEFT JOIN t_device_info d ON t.device_num = d.iot_no
WHERE
(
d.device_type = '3'
OR d.device_type = '4'
)
ORDER BY t.create_time DESC
)data
<where>
<if test="deviceCode != null and deviceCode != ''"> and d.device_code like concat('%',#{deviceCode},'%')</if>
<if test="deviceType != null and deviceType != ''"> and d.device_type = #{deviceType}</if>
<if test="deviceType == null "> and (d.device_type = '3' or d.device_type = '4')</if>
<if test="startReportTime != null "> and t.report_time &gt;= #{startReportTime}</if>
<if test="endReportTime != null "> and t.report_time &lt;= #{endReportTime}</if>
<if test="communicationStatus != null and communicationStatus != ''"> and t.communication_status = #{communicationStatus}</if>
<if test="deviceStatus != null and deviceStatus != ''"> and t.device_status = #{deviceStatus}</if>
<if test="deviceCode != null and deviceCode != ''"> and data.device_code like concat('%',#{deviceCode},'%')</if>
<if test="deviceType != null and deviceType != ''"> and data.device_type = #{deviceType}</if>
<if test="deviceType == null "> and (data.device_type = '3' or data.device_type = '4')</if>
<if test="startReportTime != null "> and data.create_time &gt;= #{startReportTime}</if>
<if test="endReportTime != null "> and data.create_time &lt;= #{endReportTime}</if>
<if test="communicationStatus != null and communicationStatus != ''"> and data.communication_status = #{communicationStatus}</if>
<if test="deviceStatus != null and deviceStatus != ''"> and data.device_status = #{deviceStatus}</if>
</where>
group by d.device_id
GROUP BY data.device_id
</select>
<select id="selectTDeviceReportDataByDeviceNum" parameterType="String" resultMap="TDeviceReportDataResult">
select max(report_time) report_time, device_report_data_id, device_num, standard_condition_accumulation, working_condition_accumulation, residual_quantity, standard_condition_flow, working_condition_flow, temperature, pressure, communication_status, device_status, create_time, update_time
select report_time, device_report_data_id, device_num, standard_condition_accumulation, working_condition_accumulation, residual_quantity, standard_condition_flow, working_condition_flow, temperature, pressure, communication_status, device_status, create_time, update_time
from t_device_report_data
where device_num = #{deviceNum}
ORDER BY create_time DESC
LIMIT 1
</select>
<select id="getTDeviceReportDataList" parameterType="String" resultMap="TDeviceReportDataResult">
select report_time, device_report_data_id, device_num, standard_condition_accumulation, working_condition_accumulation, residual_quantity, standard_condition_flow, working_condition_flow, temperature, pressure, communication_status, device_status, create_time, update_time
from t_device_report_data
where device_num = #{deviceNum} and report_time &gt;= DATE_SUB(NOW(),INTERVAL 2 HOUR)
where device_num = #{deviceNum} and create_time &gt;= DATE_SUB(NOW(),INTERVAL 2 HOUR)
</select>
<select id="getAlarmDeviceReportDataList" parameterType="TDeviceReportData" resultMap="TDeviceReportDataResult">
......
......@@ -61,7 +61,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTime != null">#{createTime},</if>
</trim>
</insert>
<insert id="insertTUserLocationList">
INSERT INTO t_user_location (user_id,longitude,latitude,create_time)
VALUES
<foreach collection="list" index="index" separator="," item="item">
(#{item.userId},
#{item.longitude},
#{item.latitude},
#{item.createTime})
</foreach>
</insert>
<update id="updateTUserLocation" parameterType="TUserLocation">
update t_user_location
<trim prefix="SET" suffixOverrides=",">
......
......@@ -8,8 +8,10 @@
<!-- <el-menu-item :style="{'--theme': theme}" :index="item.path" :key="index" v-if="index < visibleNumber" -->
<el-menu-item
:index="item.path"
:key="index"
:key="index + `${item.meta.title}`"
v-if="index < visibleNumber"
:class="{ isActive: menuAcitve == item.meta.title }"
@click="menuClick($event, item)"
>
<!-- 导航栏左侧图标 -->
<!-- <svg-icon :icon-class="item.meta.icon" /> -->
......@@ -22,8 +24,10 @@
<!-- <div> -->
<el-submenu
class="onlyNavTio moreLise"
:class="{ noBg: moreMenu }"
index="more"
v-if="topMenus.length > visibleNumber"
ref="noBg"
>
<template slot="title">更多菜单</template>
<template v-for="(item, index) in topMenus">
......@@ -32,6 +36,7 @@
:index="item.path"
:key="index"
v-if="index >= visibleNumber"
@click="menuClick($event, item)"
><svg-icon :icon-class="item.meta.icon" />
{{ item.meta.title }}</el-menu-item
>
......@@ -55,12 +60,17 @@ export default {
// 当前激活菜单的 index
currentIndex: undefined,
myRouter: [],
// 因为更多菜单前面的最后一个总是出问题,所以调整一下
menuAcitve: null,
moreMenu: false,
};
},
computed: {
theme() {
return this.$store.state.settings.theme;
},
// 顶部显示菜单
topMenus() {
let topMenus = [];
......@@ -132,15 +142,54 @@ export default {
},
mounted() {
this.setVisibleNumber();
this.moreMenuChange();
},
methods: {
menuClick(e, item) {
this.menuAcitve = item.meta.title;
this.moreMenu = false;
},
// 为了解决菜单样式bug问题
moreMenuChange() {
// 展示更多的前一个路由
const lastMenuPath = this.topMenus[this.visibleNumber - 1]?.path;
// 当前跳转的路由
const routerMenuPath = this.$route.matched[0].path;
// 如果点击的正好是展示更多的前一个,展示更多就不能拥有高亮
if (lastMenuPath == routerMenuPath) {
this.moreMenu = true;
this.$refs.noBg.$el.addEventListener("mouseover", this.mouseOver);
this.$refs.noBg.$el.addEventListener("mouseout", this.mouseOut);
} else {
this.removeEvt();
}
// var reg = new RegExp("(\\s|^)" + 'is-active' + "(\\s|$)");
// console.log("this.topMenus",this.topMenus[this.visibleNumber-1].path)
// console.log("this.topMenus",this.$route.matched[0].path)
},
mouseOver() {
this.moreMenu = false;
},
mouseOut() {
this.moreMenu = true;
},
removeEvt() {
if (this.$refs.noBg) {
this.$refs.noBg.$el.removeEventListener("mouseover", this.mouseOver);
this.$refs.noBg.$el.removeEventListener("mouseout", this.mouseOut);
}
},
// 根据宽度计算设置显示栏数
setVisibleNumber() {
const width = document.body.getBoundingClientRect().width / 3;
this.visibleNumber = parseInt(width / 85);
this.visibleNumber = parseInt(width / 88);
},
// 菜单选择事件
handleSelect(key, keyPath) {
// 点菜单的时候清楚事件,为了解决菜单样式bug问题
this.removeEvt();
let path;
this.currentIndex = key;
if (this.ishttp(key)) {
......@@ -252,7 +301,8 @@ export default {
}
.navTopBar:focus,
.navTopBar.is-active {
.navTopBar.is-active,
.isActive {
outline: none;
background-image: url("../../assets/logo/item-background.png");
background-repeat: no-repeat;
......@@ -325,4 +375,7 @@ export default {
}
// height: 100px;
}
.noBg {
background: none !important ;
}
</style>
......@@ -56,7 +56,7 @@ class gaodeMap {
showLabel: true,
// labelzIndex: 110,
pitch: 8,
zoom: 9,
zoom: 12,
mapStyle,
// mapStyle: 'amap://styles/darkblue',
// mapStyle: 'amap://styles/3b679a15f448a4740ba2ff7524e1a4ae',
......@@ -341,7 +341,7 @@ class gaodeMap {
this.markers.splice(this.changePolineListNum, 0, marker);
this.changePolineListNum = null;
}
map.setZoom("11");
map.setZoom("12");
//map.setFitView();
function infoClose(e) {
......
......@@ -76,7 +76,7 @@ class gaodeMap {
showLabel: true,
// labelzIndex: 110,
pitch: 8,
zoom: 9,
zoom: 13,
//mapStyle: 'amap://styles/darkblue',
mapStyle
});
......@@ -427,7 +427,7 @@ class gaodeMap {
// 如果这个值为false说明不是workerpoint,就push进去
if (!marker.workerPoint) {
this.markers.push(marker);
map.setZoom("11");
map.setZoom("13");
}
//map.setFitView();
......
......@@ -14,7 +14,7 @@
<el-row style="width: 100%;height: 40px;">
<el-col :span="24">
<div style="">
<ul><li style="list-style: none;font-weight: 900;font-size: 20px;color: #053b6a;">报警信息管理详情</li></ul>
<ul><li style="list-style: none;font-weight: 900;font-size: 20px;color: #053b6a;">报警信息详情</li></ul>
</div>
</el-col>
</el-row>
......@@ -158,7 +158,7 @@
</el-col>
</el-row>
<template v-if="$route.query.deviceType!='管道'">
<template v-if="$route.query.deviceType!='管道' && form.deviceType != '管道'">
<el-row v-if="form.deviceType != '压力表'">
<el-col :span="12" style="padding: 10px;">
<div id="main1" style="height:300px;background-color: rgb(247 247 247);padding: 5px;">
......
......@@ -945,13 +945,20 @@ export default {
} else {
this.gaoMap.markerShow(8, false);
}
// 值班人员
if (this.leftBarNum.includes(9)) {
this.gaoMap.markerShow(9, true);
// this.panTo(item);
} else {
this.gaoMap.markerShow(9, false);
}
// 摄像头
if (this.leftBarNum.includes(10)) {
this.gaoMap.markerShow(10, true);
// this.panTo(item);
} else {
this.gaoMap.markerShow(10, false);
}
},
panTo(item, bool) {
this.gaoMap.myMap.setZoom(12);
......
......@@ -187,17 +187,17 @@
<div class="feedbackTime-div">
<div class="feedbackTime">
<el-image :src="activity.pictureUrl1" :preview-src-list="[activity.pictureUrl1]"
v-if="activity.pictureUrl1 != null && activity.pictureUrl1 != ''" style="width: 100%;">
v-if="activity.pictureUrl1 != null && activity.pictureUrl1 != ''" :z-index="9999" style="width: 100%;">
</el-image>
</div>
<div class="feedbackTime">
<el-image :src="activity.pictureUrl2" :preview-src-list="[activity.pictureUrl2]"
v-if="activity.pictureUrl2 != null && activity.pictureUrl2 != ''" style="width: 100%;">
v-if="activity.pictureUrl2 != null && activity.pictureUrl2 != ''" :z-index="9999" style="width: 100%;">
</el-image>
</div>
<div class="feedbackTime">
<el-image :src="activity.pictureUrl3" :preview-src-list="[activity.pictureUrl3]"
v-if="activity.pictureUrl3 != null && activity.pictureUrl3 != ''" style="width: 100%;">
v-if="activity.pictureUrl3 != null && activity.pictureUrl3 != ''" :z-index="9999" style="width: 100%;">
</el-image>
</div>
</div>
......
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