Commit 6f96112a authored by yaqizhang's avatar yaqizhang

Merge branch 'master' of ssh://111.61.77.35:15/gengdidi/gassafety-progress into master

parents f6685227 2157333f
......@@ -40,6 +40,8 @@ public class TDeviceInfoController extends BaseController
@Autowired
private ITDetectorInfoService itDetectorInfoService;
@Autowired
private ITDetectorUserService itDetectorUserService;
/**
* 查询设备信息列表
......@@ -217,6 +219,8 @@ public class TDeviceInfoController extends BaseController
{
Map<String,Object> map = itDetectorInfoService.selectDetectorNum(enterpriseId);
Map<String,Object> map1 =tDeviceInfoService.selectDeviceNum(enterpriseId);
Map<String,Object> map2 =itDetectorUserService.selectUserNum();
map.putAll(map2);
map.putAll(map1);
return AjaxResult.success(map);
}
......
......@@ -84,4 +84,10 @@ public interface TDetectorUserMapper
* @return 结果
*/
public int deleteTDetectorUserByIds(Long[] userIds);
/**
* 查询用户数量
* @return
*/
public Map<String,Object> selectUserNum();
}
......@@ -92,4 +92,10 @@ public interface ITDetectorUserService
* @return 结果
*/
public int deleteTDetectorUserById(Long userId);
/**
* 查询用户数量
* @return
*/
public Map<String,Object> selectUserNum();
}
......@@ -211,4 +211,12 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
{
return tDetectorUserMapper.deleteTDetectorUserById(userId);
}
/**
* 用户数量
* @return
*/
public Map<String,Object> selectUserNum(){
return tDetectorUserMapper.selectUserNum();
}
}
......@@ -260,8 +260,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<select id="selectDetectorNum" resultType="java.util.HashMap">
SELECT IFNULL(SUM(IF(detector_status=0,1,0)),0) AS changNum,IFNULL(SUM(detector_status=1),0) AS liNum,
IFNULL(SUM(IF(detector_status=2,1,0)),0) AS baoNum ,
(SELECT COUNT(user_id) FROM t_detector_user WHERE is_del = 0) AS userNum
IFNULL(SUM(IF(detector_status=2,1,0)),0) AS baoNum
FROM t_detector_info WHERE is_del = 0
</select>
......
......@@ -164,4 +164,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{userId}
</foreach>
</delete>
<select id="selectUserNum" resultType="java.util.HashMap">
SELECT SUM(IF(user_type=1,1,0)) AS juminNum,SUM(IF(user_type=2,1,0)) AS shangNum,
SUM(IF(user_type=3,1,0)) AS gongNum FROM t_detector_user WHERE is_del = 0
</select>
</mapper>
<!--
* @Author: your name
* @Date: 2022-01-26 20:07:52
* @LastEditTime: 2022-03-04 17:25:27
* @LastEditTime: 2022-03-07 18:09:02
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
......@@ -52,7 +52,7 @@
<div class="middle">{{ profile }}</div>
<div class="foot">
<div class="thead flex">
<div class="thead flex" v-if="list.length>0">
<div class="first">设备类型</div>
<div>设备数量</div>
<div>在线设备</div>
......@@ -90,7 +90,7 @@
</template>
</div>
<div class="btn">
<div class="btn" v-if="list.length>0">
<div @click="btnClick">感知设备</div>
</div>
</div>
......@@ -113,33 +113,33 @@ export default {
3: "探测器",
},
list: [
{
numberPressureGauges: "-",
onlineEquipment: "-",
offlineEquipment: "-",
historicalAlarm: "-",
alarmProcessed: "-",
inAlarm: "-",
dataType: 1,
},
{
numberPressureGauges: "-",
onlineEquipment: "-",
offlineEquipment: "-",
historicalAlarm: "-",
alarmProcessed: "-",
inAlarm: "-",
dataType: 2,
},
{
numberPressureGauges: "-",
onlineEquipment: "-",
offlineEquipment: "-",
historicalAlarm: "-",
alarmProcessed: "-",
inAlarm: "-",
dataType: 3,
},
// {
// numberPressureGauges: "-",
// onlineEquipment: "-",
// offlineEquipment: "-",
// historicalAlarm: "-",
// alarmProcessed: "-",
// inAlarm: "-",
// dataType: 1,
// },
// {
// numberPressureGauges: "-",
// onlineEquipment: "-",
// offlineEquipment: "-",
// historicalAlarm: "-",
// alarmProcessed: "-",
// inAlarm: "-",
// dataType: 2,
// },
// {
// numberPressureGauges: "-",
// onlineEquipment: "-",
// offlineEquipment: "-",
// historicalAlarm: "-",
// alarmProcessed: "-",
// inAlarm: "-",
// dataType: 3,
// },
],
};
},
......@@ -171,7 +171,7 @@ export default {
},
myHttp() {
getCzDevice({ deviceId: this.deviceData.siteStationId }).then((res) => {
this.list = res.data[0].subordinateEquipmentList;
this.list = res.data[0].subordinateEquipmentList.filter(item=>item.numberPressureGauges>0);
console.log("resresres",res)
});
},
......
<!--
* @Author: your name
* @Date: 2022-01-26 20:07:52
* @LastEditTime: 2022-03-04 17:27:21
* @LastEditTime: 2022-03-07 18:06:31
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
......@@ -52,7 +52,7 @@
<div class="middle">{{ profile }}</div>
<div class="foot">
<div class="thead flex">
<div class="thead flex" v-if="list.length > 0">
<div class="first">设备类型</div>
<div>设备数量</div>
<div>在线设备</div>
......@@ -65,7 +65,7 @@
<div
class="tbody flex"
v-for="deviceData in list"
:key="deviceData.inAlarm+Math.random()"
:key="deviceData.inAlarm + Math.random()"
>
<div v-unValue class="first zzz">
{{ typeList[deviceData.dataType] }}
......@@ -112,34 +112,33 @@ export default {
3: "探测器",
},
list: [
{
numberPressureGauges: "-",
onlineEquipment: "-",
offlineEquipment: "-",
historicalAlarm: "-",
alarmProcessed: "-",
inAlarm: "-",
dataType: 1,
},
{
numberPressureGauges: "-",
onlineEquipment: "-",
offlineEquipment: "-",
historicalAlarm: "-",
alarmProcessed: "-",
inAlarm: "-",
dataType: 2,
},
{
numberPressureGauges: "-",
onlineEquipment: "-",
offlineEquipment: "-",
historicalAlarm: "-",
alarmProcessed: "-",
inAlarm: "-",
dataType: 3,
},
// {
// numberPressureGauges: "-",
// onlineEquipment: "-",
// offlineEquipment: "-",
// historicalAlarm: "-",
// alarmProcessed: "-",
// inAlarm: "-",
// dataType: 1,
// },
// {
// numberPressureGauges: "-",
// onlineEquipment: "-",
// offlineEquipment: "-",
// historicalAlarm: "-",
// alarmProcessed: "-",
// inAlarm: "-",
// dataType: 2,
// },
// {
// numberPressureGauges: "-",
// onlineEquipment: "-",
// offlineEquipment: "-",
// historicalAlarm: "-",
// alarmProcessed: "-",
// inAlarm: "-",
// dataType: 3,
// },
],
};
},
......@@ -175,12 +174,18 @@ export default {
if (this.deviceData.iconType == 2) {
getTyxDevice({ deviceId: this.deviceData.deviceId }).then((res) => {
this.list = res.data[0].subordinateEquipmentList;
// 过滤设备数为0的
this.list = res.data[0].subordinateEquipmentList.filter(
(item) => item.numberPressureGauges > 0
);
console.log(this.list);
});
} else {
getFmDevice({ deviceId: this.deviceData.deviceId }).then((res) => {
this.list = res.data[0].subordinateEquipmentList;
// 过滤设备数为0的
this.list = res.data[0].subordinateEquipmentList.filter(
(item) => item.numberPressureGauges > 0
);
});
}
},
......
<!--
* @Author: your name
* @Date: 2022-01-26 20:07:52
* @LastEditTime: 2022-03-03 11:51:48
* @LastEditTime: 2022-03-07 14:02:43
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
......@@ -80,6 +80,7 @@
<script>
import { companyType, deviceType } from "@/utils/mapClass/config.js";
import { listDetectorInfo } from "@/api/detector/detectorInfo";
import { detectorUserList } from "@/api/detector/detectorUser";
export default {
......@@ -115,6 +116,7 @@ export default {
btnClick() {
// this.vueRoot.centerDataFunc(this.deviceData.pressureFlows);
this.vueRoot.getDetectorInfoList(
listDetectorInfo,
{ userId: this.deviceData.userId },
this.deviceData.nickName
);
......
<template>
<transition
>
<transition>
<div v-show="show" class="wrapper myCenter">
<div class="left">
<div class="title-wrapper">
......@@ -14,7 +13,6 @@
size="mini"
:data="tableData"
style="width: 100%"
class="el-bottom"
:key="Math.random()"
>
......@@ -73,12 +71,13 @@
<script>
// import Velocity from "velocity-animate";
// import { listDeviceAlarm } from "@/api/dataMonitoring/deviceAlarm";
import { listDetectorInfo } from "@/api/detector/detectorInfo";
export default {
props: {
detcetorList: {
type: Array,
default:()=>[],
default: () => [],
},
show: {
type: Boolean,
......@@ -109,7 +108,6 @@ export default {
// address: "上海市普陀区金沙江路",
// },
],
};
},
created() {
......@@ -134,6 +132,7 @@ export default {
},
handleCurrentChangvale(val) {
this.$parent.getDetectorInfoList(
listDetectorInfo,
{
userId: this.userId,
pageNum: val,
......
<!--
* @Author: your name
* @Date: 2022-01-11 13:44:17
* @LastEditTime: 2022-03-04 14:34:32
* @LastEditTime: 2022-03-07 15:40:59
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /test/hello-world/src/views/Home.vue
......@@ -450,13 +450,12 @@ export default {
this.map.allfilter(this.selarr, this.selarr1);
},
//用户的设备center
getDetectorInfoList(queryParams, title) {
getDetectorInfoList(httpFunc,queryParams, title) {
console.log(queryParams);
return listDetectorInfo(queryParams).then((res) => {
console.log("queryParams", res);
return httpFunc(queryParams).then((res) => {
// console.log("queryParams", res);
if (res.code == 200) {
this.detcetorList = res.rows;
this.centerUserId = queryParams.userId;
// 总数据
this.centerTotal = res.total;
......@@ -504,6 +503,7 @@ export default {
if (this.formatDate) {
clearInterval(this.formatDate); // 在Vue实例销毁前,清除时间定时器
}
// 报警
if (this.alarmTimer) {
clearInterval(this.alarmTimer);
}
......
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