Commit 4f794384 authored by zhangjianqian's avatar zhangjianqian

Merge remote-tracking branch 'origin/master'

parents 9a96849e cb66c9f3
...@@ -6,10 +6,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -6,10 +6,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
...@@ -68,16 +65,30 @@ public class PipeInterfaceController { ...@@ -68,16 +65,30 @@ public class PipeInterfaceController {
DeviceList deviceList=new DeviceList(); DeviceList deviceList=new DeviceList();
//调压箱数据循环 //调压箱数据循环
for (int i=0;i<deviceData.size();i++){ for (int i=0;i<deviceData.size();i++){
//临时存下级数据id //临时存储压力表数据数组
List<PressureFlow> pressList=new ArrayList<>(); List<PressureFlow> pressureList=new ArrayList<>();
//临时存储流量计数据数组
List<PressureFlow> flowmeterList=new ArrayList<>();
//存储全部数据
List<PressureFlow> List=new ArrayList<>();
for (int s=0;s<pressureFlows1.size();s++){ for (int s=0;s<pressureFlows1.size();s++){
//判断调压箱id与下级数据调压箱id是否相等 //判断调压箱id与下级数据调压箱id是否相等
if (pressureFlows1.get(s).getDeviceId()==deviceData.get(i).getDeviceId()){ if (pressureFlows1.get(s).getDeviceId()==deviceData.get(i).getDeviceId()){
//下级数据添加进临时存储数据的数组中 //下级数据添加进临时存储数据的数组中
pressList.add(pressureFlows1.get(s)); List.add(pressureFlows1.get(s));
//判断是压力表还是流量计 1压力表 2流量计
if (pressureFlows1.get(s).getDeviceType()=="1"){
pressureList.add(pressureFlows1.get(s));
}else {
flowmeterList.add(pressureFlows1.get(s));
}
} }
} }
deviceData.get(i).setPressureFlows(pressList); //压力表设备数量添加
deviceData.get(i).setNumberPressureGauges(pressureList.size());
deviceData.get(i).setPressureFlows(List);
//流量计设备数量添加
deviceData.get(i).setNumberEquipment(flowmeterList.size());
deviceData.get(i).setIconType(2); deviceData.get(i).setIconType(2);
} }
deviceList.setData(deviceData); deviceList.setData(deviceData);
...@@ -93,11 +104,32 @@ public class PipeInterfaceController { ...@@ -93,11 +104,32 @@ public class PipeInterfaceController {
public TSiteStationInfoDataList selectTSiteStationInfoData(){ public TSiteStationInfoDataList selectTSiteStationInfoData(){
//场站信息查询方法 //场站信息查询方法
List<TSiteStationInfoData> tSiteStationInfoData = iPipeInterfaceService.selectTSiteStationInfoData(); List<TSiteStationInfoData> tSiteStationInfoData = iPipeInterfaceService.selectTSiteStationInfoData();
//查询场站下级设备数据
List<PressureFlow> pressureFlows = iPipeInterfaceService.selecttSiteStationInfoDataList("1");
TSiteStationInfoDataList tSiteStationInfoDataList=new TSiteStationInfoDataList(); TSiteStationInfoDataList tSiteStationInfoDataList=new TSiteStationInfoDataList();
for (int i=0;i<tSiteStationInfoData.size();i++){ for (int i=0;i<tSiteStationInfoData.size();i++){
//查询场站下级设备数据 //临时存储压力表数据数组
List<PressureFlow> pressureFlows = iPipeInterfaceService.selecttSiteStationInfoDataList(tSiteStationInfoData.get(i).getSiteStationId()); List<PressureFlow> pressureList=new ArrayList<>();
tSiteStationInfoData.get(i).setPressureFlows(pressureFlows); //临时存储流量计数据数组
List<PressureFlow> flowmeterList=new ArrayList<>();
//存储全部数据
List<PressureFlow> List=new ArrayList<>();
for (int s=0;s<pressureFlows.size();s++){
if (tSiteStationInfoData.get(i).getSiteStationId()==pressureFlows.get(s).getDeviceId()){
List.add(pressureFlows.get(s));
//判断是压力表还是流量计 1压力表 2流量计
if (pressureFlows.get(s).getDeviceType()=="1"){
pressureList.add(pressureFlows.get(s));
}else {
flowmeterList.add(pressureFlows.get(s));
}
}
}
//压力表设备数量添加
tSiteStationInfoData.get(i).setNumberPressureGauges(pressureList.size());
tSiteStationInfoData.get(i).setPressureFlows(List);
//流量计设备数量添加
tSiteStationInfoData.get(i).setNumberEquipment(flowmeterList.size());
tSiteStationInfoData.get(i).setIconType(4); tSiteStationInfoData.get(i).setIconType(4);
} }
tSiteStationInfoDataList.setData(tSiteStationInfoData); tSiteStationInfoDataList.setData(tSiteStationInfoData);
...@@ -164,16 +196,29 @@ public class PipeInterfaceController { ...@@ -164,16 +196,29 @@ public class PipeInterfaceController {
DeviceDataList deviceDataList=new DeviceDataList(); DeviceDataList deviceDataList=new DeviceDataList();
//调压箱数据循环 //调压箱数据循环
for (int i=0;i<pipeDates.size();i++){ for (int i=0;i<pipeDates.size();i++){
//临时存下级数据id //临时存储压力表数据数组
List<PressureFlow> pressList=new ArrayList<>(); List<PressureFlow> pressureList=new ArrayList<>();
//临时存储流量计数据数组
List<PressureFlow> flowmeterList=new ArrayList<>();
//存储全部数据
List<PressureFlow> List=new ArrayList<>();
for (int s=0;s<pressureFlows1.size();s++){ for (int s=0;s<pressureFlows1.size();s++){
//判断调压箱id与下级数据调压箱id是否相等 //判断调压箱id与下级数据调压箱id是否相等
if (pressureFlows1.get(s).getDeviceId()==pipeDates.get(i).getDeviceId()){ if (pressureFlows1.get(s).getDeviceId()==pipeDates.get(i).getDeviceId()){
//下级数据添加进临时存储数据的数组中 List.add(pressureFlows1.get(s));
pressList.add(pressureFlows1.get(s)); //判断是压力表还是流量计 1压力表 2流量计
if (pressureFlows1.get(s).getDeviceType()=="1"){
pressureList.add(pressureFlows1.get(s));
}else {
flowmeterList.add(pressureFlows1.get(s));
}
} }
} }
pipeDates.get(i).setPressureFlows(pressList); //压力表设备数量添加
pipeDates.get(i).setNumberPressureGauges(pressureList.size());
pipeDates.get(i).setPressureFlows(List);
//流量计设备数量添加
pipeDates.get(i).setNumberEquipment(flowmeterList.size());
pipeDates.get(i).setIconType(3); pipeDates.get(i).setIconType(3);
} }
deviceDataList.setData(pipeDates); deviceDataList.setData(pipeDates);
......
...@@ -91,7 +91,7 @@ public class TDetectorReportController extends BaseController ...@@ -91,7 +91,7 @@ public class TDetectorReportController extends BaseController
TDetectorUser tDetectorUser = new TDetectorUser(); TDetectorUser tDetectorUser = new TDetectorUser();
tDetectorUser.setNickName(username); tDetectorUser.setNickName(username);
tDetectorUser.setIsDel("0"); tDetectorUser.setIsDel("0");
List<TDetectorUserVO> tDetectorUserList = tDetectorUserService.detectorUserList(tDetectorUser); List<TDetectorUser> tDetectorUserList = tDetectorUserService.selectTDetectorUser(tDetectorUser);
if(tDetectorUserList.size() == 0){ if(tDetectorUserList.size() == 0){
return AjaxResult.error(1,"查询不到用户名username=" + username); return AjaxResult.error(1,"查询不到用户名username=" + username);
} }
...@@ -167,7 +167,7 @@ public class TDetectorReportController extends BaseController ...@@ -167,7 +167,7 @@ public class TDetectorReportController extends BaseController
TDetectorUser tDetectorUser = new TDetectorUser(); TDetectorUser tDetectorUser = new TDetectorUser();
tDetectorUser.setNickName(username); tDetectorUser.setNickName(username);
tDetectorUser.setIsDel("0"); tDetectorUser.setIsDel("0");
List<TDetectorUserVO> tDetectorUserList = tDetectorUserService.detectorUserList(tDetectorUser); List<TDetectorUser> tDetectorUserList = tDetectorUserService.selectTDetectorUser(tDetectorUser);
if(tDetectorUserList.size() == 0){ if(tDetectorUserList.size() == 0){
return AjaxResult.error(1,"查询不到用户名username=" + username); return AjaxResult.error(1,"查询不到用户名username=" + username);
} }
...@@ -224,7 +224,7 @@ public class TDetectorReportController extends BaseController ...@@ -224,7 +224,7 @@ public class TDetectorReportController extends BaseController
TDetectorUser tDetectorUser = new TDetectorUser(); TDetectorUser tDetectorUser = new TDetectorUser();
tDetectorUser.setNickName(username); tDetectorUser.setNickName(username);
tDetectorUser.setIsDel("0"); tDetectorUser.setIsDel("0");
List<TDetectorUserVO> tDetectorUserList = tDetectorUserService.detectorUserList(tDetectorUser); List<TDetectorUser> tDetectorUserList = tDetectorUserService.selectTDetectorUser(tDetectorUser);
if(tDetectorUserList.size() == 0){ if(tDetectorUserList.size() == 0){
continue; continue;
} }
...@@ -265,7 +265,7 @@ public class TDetectorReportController extends BaseController ...@@ -265,7 +265,7 @@ public class TDetectorReportController extends BaseController
TDetectorUser tDetectorUser1 = new TDetectorUser(); TDetectorUser tDetectorUser1 = new TDetectorUser();
tDetectorUser1.setNickName(sourceUsername); tDetectorUser1.setNickName(sourceUsername);
tDetectorUser1.setIsDel("0"); tDetectorUser1.setIsDel("0");
List<TDetectorUserVO> tDetectorUserList1 = tDetectorUserService.detectorUserList(tDetectorUser1); List<TDetectorUser> tDetectorUserList1 = tDetectorUserService.selectTDetectorUser(tDetectorUser1);
if(tDetectorUserList1.size() == 0){ if(tDetectorUserList1.size() == 0){
return AjaxResult.error(4,"查询不到原用户名sourceUsername=" + sourceUsername); return AjaxResult.error(4,"查询不到原用户名sourceUsername=" + sourceUsername);
} }
...@@ -273,7 +273,7 @@ public class TDetectorReportController extends BaseController ...@@ -273,7 +273,7 @@ public class TDetectorReportController extends BaseController
TDetectorUser tDetectorUser2 = new TDetectorUser(); TDetectorUser tDetectorUser2 = new TDetectorUser();
tDetectorUser2.setNickName(targetUsername); tDetectorUser2.setNickName(targetUsername);
tDetectorUser2.setIsDel("0"); tDetectorUser2.setIsDel("0");
List<TDetectorUserVO> tDetectorUserList2 = tDetectorUserService.detectorUserList(tDetectorUser2); List<TDetectorUser> tDetectorUserList2 = tDetectorUserService.selectTDetectorUser(tDetectorUser2);
if(tDetectorUserList2.size() == 0){ if(tDetectorUserList2.size() == 0){
return AjaxResult.error(5,"查询不到目标用户名targetUsername=" + targetUsername); return AjaxResult.error(5,"查询不到目标用户名targetUsername=" + targetUsername);
} }
......
...@@ -47,12 +47,20 @@ public class TDetectorUserController extends BaseController ...@@ -47,12 +47,20 @@ public class TDetectorUserController extends BaseController
/** /**
* 获取探测器用户列表 * 获取探测器用户列表
* @param tDetectorUser
* @return * @return
*/ */
@GetMapping("/detectorUserList") @GetMapping("/detectorUserList")
public AjaxResult detectorUserList(TDetectorUser tDetectorUser){ public AjaxResult detectorUserList(){
return AjaxResult.success(tDetectorUserService.detectorUserList(tDetectorUser)); return AjaxResult.success(tDetectorUserService.detectorUserList());
}
/**
* 获取探测器用户列表
* @return
*/
@GetMapping("/getDetectorUserAlarmList")
public AjaxResult getDetectorUserAlarmList(){
return AjaxResult.success(tDetectorUserService.getDetectorUserAlarmList());
} }
/** /**
......
...@@ -30,6 +30,139 @@ public class DeviceData { ...@@ -30,6 +30,139 @@ public class DeviceData {
private int iconType; private int iconType;
//压力表设备数量
private int numberPressureGauges;
//压力表在线设备
private int onlineEquipment;
//压力表离线设备
private int offlineEquipment;
//压力表历史报警
private int historicalAlarm;
//压力表已处理报警
private int alarmProcessed;
//压力表报警中
private int inAlarm;
//流量计设备数量
private int numberEquipment;
//流量计在线设备
private int numberOnlineEquipment;
//流量计离线设备
private int numberOfflineEquipment;
//流量计历史报警
private int numberHistoricalAlarm;
//流量计已处理报警
private int numberAlarmProcessed;
//流量计报警中
private int numberInAlarm;
public int getNumberPressureGauges() {
return numberPressureGauges;
}
public void setNumberPressureGauges(int numberPressureGauges) {
this.numberPressureGauges = numberPressureGauges;
}
public int getNumberOnlineEquipment() {
return numberOnlineEquipment;
}
public void setNumberOnlineEquipment(int numberOnlineEquipment) {
this.numberOnlineEquipment = numberOnlineEquipment;
}
public int getNumberOfflineEquipment() {
return numberOfflineEquipment;
}
public void setNumberOfflineEquipment(int numberOfflineEquipment) {
this.numberOfflineEquipment = numberOfflineEquipment;
}
public int getNumberHistoricalAlarm() {
return numberHistoricalAlarm;
}
public void setNumberHistoricalAlarm(int numberHistoricalAlarm) {
this.numberHistoricalAlarm = numberHistoricalAlarm;
}
public int getNumberAlarmProcessed() {
return numberAlarmProcessed;
}
public void setNumberAlarmProcessed(int numberAlarmProcessed) {
this.numberAlarmProcessed = numberAlarmProcessed;
}
public int getNumberInAlarm() {
return numberInAlarm;
}
public void setNumberInAlarm(int numberInAlarm) {
this.numberInAlarm = numberInAlarm;
}
public int getOnlineEquipment() {
return onlineEquipment;
}
public void setOnlineEquipment(int onlineEquipment) {
this.onlineEquipment = onlineEquipment;
}
public int getOfflineEquipment() {
return offlineEquipment;
}
public void setOfflineEquipment(int offlineEquipment) {
this.offlineEquipment = offlineEquipment;
}
public int getHistoricalAlarm() {
return historicalAlarm;
}
public void setHistoricalAlarm(int historicalAlarm) {
this.historicalAlarm = historicalAlarm;
}
public int getAlarmProcessed() {
return alarmProcessed;
}
public void setAlarmProcessed(int alarmProcessed) {
this.alarmProcessed = alarmProcessed;
}
public int getInAlarm() {
return inAlarm;
}
public void setInAlarm(int inAlarm) {
this.inAlarm = inAlarm;
}
public int getNumberEquipment() {
return numberEquipment;
}
public void setNumberEquipment(int numberEquipment) {
this.numberEquipment = numberEquipment;
}
public int getIconType() { public int getIconType() {
return iconType; return iconType;
} }
...@@ -126,6 +259,7 @@ public class DeviceData { ...@@ -126,6 +259,7 @@ public class DeviceData {
this.pressureFlows = pressureFlows; this.pressureFlows = pressureFlows;
} }
@Override @Override
public String toString() { public String toString() {
return "DeviceData{" + return "DeviceData{" +
...@@ -141,6 +275,18 @@ public class DeviceData { ...@@ -141,6 +275,18 @@ public class DeviceData {
", pressureFlows=" + pressureFlows + ", pressureFlows=" + pressureFlows +
", beyondEnterpriseName='" + beyondEnterpriseName + '\'' + ", beyondEnterpriseName='" + beyondEnterpriseName + '\'' +
", iconType=" + iconType + ", iconType=" + iconType +
", numberPressureGauges=" + numberPressureGauges +
", onlineEquipment=" + onlineEquipment +
", offlineEquipment=" + offlineEquipment +
", historicalAlarm=" + historicalAlarm +
", alarmProcessed=" + alarmProcessed +
", inAlarm=" + inAlarm +
", numberEquipment=" + numberEquipment +
", numberOnlineEquipment=" + numberOnlineEquipment +
", numberOfflineEquipment=" + numberOfflineEquipment +
", numberHistoricalAlarm=" + numberHistoricalAlarm +
", numberAlarmProcessed=" + numberAlarmProcessed +
", numberInAlarm=" + numberInAlarm +
'}'; '}';
} }
} }
package com.zehong.system.domain; package com.zehong.system.domain;
import java.util.List; import java.util.List;
public class TSiteStationInfoData { public class TSiteStationInfoData {
...@@ -23,13 +22,148 @@ public class TSiteStationInfoData { ...@@ -23,13 +22,148 @@ public class TSiteStationInfoData {
private String buildCompany; private String buildCompany;
private String powerCompany; private String powerCompany;
//流量计数组
private List<PressureFlow> pressureFlows; private List<PressureFlow> pressureFlows;
private int iconType; private int iconType;
private String companyType; private String companyType;
//压力表设备数量
private int numberPressureGauges;
//压力表在线设备
private int onlineEquipment;
//压力表离线设备
private int offlineEquipment;
//压力表历史报警
private int historicalAlarm;
//压力表已处理报警
private int alarmProcessed;
//压力表报警中
private int inAlarm;
//流量计设备数量
private int numberEquipment;
//流量计在线设备
private int numberOnlineEquipment;
//流量计离线设备
private int numberOfflineEquipment;
//流量计历史报警
private int numberHistoricalAlarm;
//流量计已处理报警
private int numberAlarmProcessed;
//流量计报警中
private int numberInAlarm;
public int getNumberOnlineEquipment() {
return numberOnlineEquipment;
}
public void setNumberOnlineEquipment(int numberOnlineEquipment) {
this.numberOnlineEquipment = numberOnlineEquipment;
}
public int getNumberOfflineEquipment() {
return numberOfflineEquipment;
}
public void setNumberOfflineEquipment(int numberOfflineEquipment) {
this.numberOfflineEquipment = numberOfflineEquipment;
}
public int getNumberHistoricalAlarm() {
return numberHistoricalAlarm;
}
public void setNumberHistoricalAlarm(int numberHistoricalAlarm) {
this.numberHistoricalAlarm = numberHistoricalAlarm;
}
public int getNumberAlarmProcessed() {
return numberAlarmProcessed;
}
public void setNumberAlarmProcessed(int numberAlarmProcessed) {
this.numberAlarmProcessed = numberAlarmProcessed;
}
public int getNumberInAlarm() {
return numberInAlarm;
}
public void setNumberInAlarm(int numberInAlarm) {
this.numberInAlarm = numberInAlarm;
}
public int getNumberPressureGauges() {
return numberPressureGauges;
}
public void setNumberPressureGauges(int numberPressureGauges) {
this.numberPressureGauges = numberPressureGauges;
}
public int getNumberEquipment() {
return numberEquipment;
}
public void setNumberEquipment(int numberEquipment) {
this.numberEquipment = numberEquipment;
}
public int getOnlineEquipment() {
return onlineEquipment;
}
public void setOnlineEquipment(int onlineEquipment) {
this.onlineEquipment = onlineEquipment;
}
public int getOfflineEquipment() {
return offlineEquipment;
}
public void setOfflineEquipment(int offlineEquipment) {
this.offlineEquipment = offlineEquipment;
}
public int getHistoricalAlarm() {
return historicalAlarm;
}
public void setHistoricalAlarm(int historicalAlarm) {
this.historicalAlarm = historicalAlarm;
}
public int getAlarmProcessed() {
return alarmProcessed;
}
public void setAlarmProcessed(int alarmProcessed) {
this.alarmProcessed = alarmProcessed;
}
public int getInAlarm() {
return inAlarm;
}
public void setInAlarm(int inAlarm) {
this.inAlarm = inAlarm;
}
public String getCompanyType() { public String getCompanyType() {
return companyType; return companyType;
} }
...@@ -150,6 +284,18 @@ public class TSiteStationInfoData { ...@@ -150,6 +284,18 @@ public class TSiteStationInfoData {
", pressureFlows=" + pressureFlows + ", pressureFlows=" + pressureFlows +
", iconType=" + iconType + ", iconType=" + iconType +
", companyType='" + companyType + '\'' + ", companyType='" + companyType + '\'' +
", numberPressureGauges=" + numberPressureGauges +
", onlineEquipment=" + onlineEquipment +
", offlineEquipment=" + offlineEquipment +
", historicalAlarm=" + historicalAlarm +
", alarmProcessed=" + alarmProcessed +
", inAlarm=" + inAlarm +
", numberEquipment=" + numberEquipment +
", numberOnlineEquipment=" + numberOnlineEquipment +
", numberOfflineEquipment=" + numberOfflineEquipment +
", numberHistoricalAlarm=" + numberHistoricalAlarm +
", numberAlarmProcessed=" + numberAlarmProcessed +
", numberInAlarm=" + numberInAlarm +
'}'; '}';
} }
} }
...@@ -22,8 +22,8 @@ public class TDetectorUserVO ...@@ -22,8 +22,8 @@ public class TDetectorUserVO
/** 图标类型 */ /** 图标类型 */
private String iconType; private String iconType;
/** 用户账号 */ /** 用户状态(1正常,2报警) */
private String username; private String userStatus;
/** 用户名称 */ /** 用户名称 */
private String nickName; private String nickName;
...@@ -71,10 +71,4 @@ public class TDetectorUserVO ...@@ -71,10 +71,4 @@ public class TDetectorUserVO
/** 邮箱 */ /** 邮箱 */
private String email; private String email;
/** 是否删除(0正常,1删除) */
private String isDel;
/** 备注 */
private String remarks;
} }
package com.zehong.system.mapper; package com.zehong.system.mapper;
import java.util.List; import java.util.List;
import com.zehong.system.domain.TDetectorInfo;
import com.zehong.system.domain.TDetectorUser; import com.zehong.system.domain.TDetectorUser;
import com.zehong.system.domain.vo.TDetectorUserVO;
/** /**
* 燃气用户Mapper接口 * 燃气用户Mapper接口
...@@ -19,6 +22,29 @@ public interface TDetectorUserMapper ...@@ -19,6 +22,29 @@ public interface TDetectorUserMapper
*/ */
public TDetectorUser selectTDetectorUserById(Long userId); public TDetectorUser selectTDetectorUserById(Long userId);
/**
* 查询燃气用户统计信息
*
* @return 燃气用户
*/
public List<TDetectorUserVO> countTDetectorUser(TDetectorInfo tDetectorInfo);
/**
* 查询探测器报警用户
*
* @param tDetectorUser 探测器用户
* @return 探测器用户
*/
public TDetectorUserVO countTDetectorUserAlarm(TDetectorUser tDetectorUser);
/**
* 泽宏云推送查询燃气用户
*
* @param tDetectorUser 燃气用户
* @return 燃气用户
*/
public List<TDetectorUser> selectTDetectorUser(TDetectorUser tDetectorUser);
/** /**
* 查询燃气用户列表 * 查询燃气用户列表
* *
......
...@@ -16,10 +16,32 @@ public interface ITDetectorUserService ...@@ -16,10 +16,32 @@ public interface ITDetectorUserService
/** /**
* 查询探测器用户列表 * 查询探测器用户列表
* *
* @param tDetectorUser 探测器用户
* @return 探测器用户集合 * @return 探测器用户集合
*/ */
public List<TDetectorUserVO> detectorUserList(TDetectorUser tDetectorUser); public List<TDetectorUserVO> detectorUserList();
/**
* 查询探测器报警用户(前台调用)
*
* @return 探测器用户
*/
public List<TDetectorUserVO> getDetectorUserAlarmList();
/**
* 查询探测器报警用户(后台推送)
*
* @param tDetectorUser 探测器用户
* @return 探测器用户
*/
public TDetectorUserVO detectorUserAlarmList(TDetectorUser tDetectorUser);
/**
* 泽宏云推送查询燃气用户
*
* @param tDetectorUser 燃气用户
* @return 燃气用户
*/
public List<TDetectorUser> selectTDetectorUser(TDetectorUser tDetectorUser);
/** /**
* 查询燃气用户 * 查询燃气用户
......
...@@ -56,8 +56,10 @@ public class TDetectorInfoServiceImpl implements ITDetectorInfoService ...@@ -56,8 +56,10 @@ public class TDetectorInfoServiceImpl implements ITDetectorInfoService
for(TDetectorInfo detector : list){ for(TDetectorInfo detector : list){
if("0".equals(detector.getDetectorStatus())){ if("0".equals(detector.getDetectorStatus())){
detector.setDetectorStatus("正常"); detector.setDetectorStatus("正常");
} else { } else if("1".equals(detector.getDetectorStatus())) {
detector.setDetectorStatus("离线"); detector.setDetectorStatus("离线");
} else {
detector.setDetectorStatus("报警");
} }
} }
...@@ -77,8 +79,10 @@ public class TDetectorInfoServiceImpl implements ITDetectorInfoService ...@@ -77,8 +79,10 @@ public class TDetectorInfoServiceImpl implements ITDetectorInfoService
for(TDetectorInfo detector : list){ for(TDetectorInfo detector : list){
if("0".equals(detector.getDetectorStatus())){ if("0".equals(detector.getDetectorStatus())){
detector.setDetectorStatus("正常"); detector.setDetectorStatus("正常");
} else { } else if("1".equals(detector.getDetectorStatus())) {
detector.setDetectorStatus("离线"); detector.setDetectorStatus("离线");
} else {
detector.setDetectorStatus("报警");
} }
} }
return new PageInfo(list); return new PageInfo(list);
......
...@@ -36,63 +36,110 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService ...@@ -36,63 +36,110 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
/** /**
* 查询探测器用户列表 * 查询探测器用户列表
* *
* @param tDetectorUser 探测器用户
* @return 探测器用户 * @return 探测器用户
*/ */
@Override @Override
public List<TDetectorUserVO> detectorUserList(TDetectorUser tDetectorUser) public List<TDetectorUserVO> detectorUserList()
{ {
List<TDetectorUserVO> list = new ArrayList<>(); List<TDetectorUserVO> list = new ArrayList<>();
List<TDetectorUser> tDetectorUserList = tDetectorUserMapper.selectTDetectorUserList(tDetectorUser); List<TDetectorUserVO> tDetectorUserList = tDetectorUserMapper.countTDetectorUser(new TDetectorInfo());
TDetectorInfo detector = new TDetectorInfo(); List<Object> initList = new ArrayList<>();
for(TDetectorUser user : tDetectorUserList){ for(TDetectorUserVO user : tDetectorUserList){
TDetectorUserVO userVO = new TDetectorUserVO(); TDetectorUserVO userVO = new TDetectorUserVO();
BeanUtils.copyProperties(user, userVO); BeanUtils.copyProperties(user, userVO);
detector.setUserId(user.getUserId()); TDetectorUserVO temp = new TDetectorUserVO();
detector.setIsDel("0"); if(user.getUserId().equals(temp.getUserId())){
List<TDetectorInfo> tDetectorInfoList = tDetectorInfoMapper.selectTDetectorInfoList(detector); initList.add(user);
userVO.setDetectorCountList(initList);
int onLineNum = 0; userVO.setIconType("6");
int offLineNum = 0; userVO.setUserStatus("1");
int cancelAlarmNum = 0; } else {
int historyAlarmNum = 0; BeanUtils.copyProperties(user, temp);
List<Object> newList = new ArrayList<>();
if(tDetectorInfoList.size() > 0){ newList.add(temp);
for(TDetectorInfo info : tDetectorInfoList){ userVO.setDetectorCountList(newList);
if(!StringUtils.isEmpty(info.getDetectorStatus()) && info.getDetectorStatus().equals("0")){ userVO.setIconType("6");
++onLineNum; userVO.setUserStatus("1");
}else{ list.add(userVO);
++offLineNum;
}
}
List<TDetectorReportData> dataList = tDetectorReportDataMapper.countDetectorByUserId(detector);
historyAlarmNum = dataList.size();
for(TDetectorReportData data : dataList){
if(!StringUtils.isEmpty(data.getIsCancelAlarm()) && data.getIsCancelAlarm().equals("1")){
++cancelAlarmNum;
}
}
} }
}
return list;
}
/**
* 查询探测器报警用户(前台调用)
*
* @return 探测器用户
*/
@Override
public List<TDetectorUserVO> getDetectorUserAlarmList()
{
List<TDetectorUserVO> list = new ArrayList<>();
TDetectorInfo tDetectorInfo = new TDetectorInfo();
tDetectorInfo.setDetectorStatus("2");
// 查询报警的数据
List<TDetectorUserVO> tDetectorUserList = tDetectorUserMapper.countTDetectorUser(tDetectorInfo);
userVO.setDetectorCount(tDetectorInfoList.size()); List<Object> initList = new ArrayList<>();
userVO.setOnLineNum(onLineNum); for(TDetectorUserVO user : tDetectorUserList){
userVO.setOffLineNum(offLineNum); TDetectorUserVO userVO = new TDetectorUserVO();
userVO.setHistoryAlarmNum(historyAlarmNum); BeanUtils.copyProperties(user, userVO);
userVO.setCancelAlarmNum(cancelAlarmNum);
userVO.setProcessingAlarmNum(Math.abs(historyAlarmNum - cancelAlarmNum));
userVO.setIconType("6");
userVO.setDetectorType("气体探测器");
list.add(userVO); TDetectorUserVO temp = new TDetectorUserVO();
if(user.getUserId().equals(temp.getUserId())){
initList.add(user);
userVO.setDetectorCountList(initList);
userVO.setIconType("6");
userVO.setUserStatus("2");
} else {
BeanUtils.copyProperties(user, temp);
List<Object> newList = new ArrayList<>();
newList.add(temp);
userVO.setDetectorCountList(newList);
userVO.setIconType("6");
userVO.setUserStatus("2");
list.add(userVO);
}
} }
return list; return list;
} }
/**
* 查询探测器报警用户(后台推送)
*
* @param tDetectorUser 探测器用户
* @return 探测器用户
*/
@Override
public TDetectorUserVO detectorUserAlarmList(TDetectorUser tDetectorUser)
{
List<Object> list = new ArrayList<>();
TDetectorUserVO user = tDetectorUserMapper.countTDetectorUserAlarm(tDetectorUser);
TDetectorUserVO userVO = new TDetectorUserVO();
BeanUtils.copyProperties(user, userVO);
list.add(user);
userVO.setDetectorCountList(list);
return userVO;
}
/**
* 泽宏云推送查询燃气用户
*
* @param tDetectorUser 燃气用户
* @return 燃气用户
*/
@Override
public List<TDetectorUser> selectTDetectorUser(TDetectorUser tDetectorUser)
{
return tDetectorUserMapper.selectTDetectorUser(tDetectorUser);
}
/** /**
* 查询燃气用户 * 查询燃气用户
* *
......
...@@ -115,8 +115,8 @@ ...@@ -115,8 +115,8 @@
<!--查询场站下级数据--> <!--查询场站下级数据-->
<select id="selecttSiteStationInfoDataList" parameterType="DeviceData" resultMap="PressureFlowResult"> <select id="selecttSiteStationInfoDataList" parameterType="DeviceData" resultMap="PressureFlowResult">
select device_model,device_type,create_time from t_relation_device_detail_info select device_model,device_type,create_time,relation_device_id from t_relation_device_detail_info
where relation_device_id=#{deviceId} and relation_device_type='2' where relation_device_type='2'
</select> </select>
<!--监控信息查询--> <!--监控信息查询-->
......
...@@ -52,6 +52,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -52,6 +52,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="isDel != null and isDel != ''"> and is_del = #{isDel}</if> <if test="isDel != null and isDel != ''"> and is_del = #{isDel}</if>
<if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if> <if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
</where> </where>
order by detector_status desc, alarm_time desc
</select> </select>
<select id="selectTDetectorInfoById" parameterType="Long" resultMap="TDetectorInfoResult"> <select id="selectTDetectorInfoById" parameterType="Long" resultMap="TDetectorInfoResult">
......
...@@ -69,7 +69,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -69,7 +69,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
t_detector_report_data rd t_detector_report_data rd
LEFT JOIN t_detector_info di ON rd.detector_code = di.detector_code LEFT JOIN t_detector_info di ON rd.detector_code = di.detector_code
LEFT JOIN t_detector_user u ON u.user_id = di.user_id LEFT JOIN t_detector_user u ON u.user_id = di.user_id
WHERE u.is_del = '0' WHERE u.is_del = '0' and di.is_del = '0'
ORDER BY rd.create_time DESC LIMIT 50 ORDER BY rd.create_time DESC LIMIT 50
</select> </select>
......
...@@ -32,11 +32,121 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -32,11 +32,121 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
group by user_id desc group by user_id desc
</select> </select>
<select id="selectTDetectorUser" parameterType="TDetectorUser" resultMap="TDetectorUserResult">
<include refid="selectTDetectorUserVo"/>
<where>
<if test="isDel != null and isDel != ''"> and is_del = #{isDel}</if>
<if test="username != null and username != ''"> and username = #{username}</if>
<if test="nickName != null and nickName != ''"> and nick_name = #{nickName}</if>
</where>
group by user_id desc
</select>
<select id="selectTDetectorUserById" parameterType="Long" resultMap="TDetectorUserResult"> <select id="selectTDetectorUserById" parameterType="Long" resultMap="TDetectorUserResult">
<include refid="selectTDetectorUserVo"/> <include refid="selectTDetectorUserVo"/>
where user_id = #{userId} where user_id = #{userId}
</select> </select>
<select id="countTDetectorUser" resultType="TDetectorUserVO" parameterType="TDetectorInfo">
select t1.*,
IFNULL(t2.historyAlarmNum,0) AS historyAlarmNum,
IFNULL(t2.processingAlarmNum,0) AS processingAlarmNum,
IFNULL(t2.cancelAlarmNum,0) AS cancelAlarmNum
from(
select a.user_id AS userId,
a.detector_id AS detectorId,
a.detector_status AS detectorStatus,
a.nick_name AS nickName,
a.user_type AS userType,
a.address AS address,
a.longitude AS longitude,
a.latitude AS latitude,
a.linkman AS linkman,
a.phone AS phone,
a.email AS email,
CASE a.detector_type
WHEN '1' THEN '家用报警器'
WHEN '2' THEN '工业报警器' END AS detectorType,
COUNT(a.detector_id) AS detectorCount,
SUM(CASE a.detector_status WHEN '0' THEN 1 ELSE 0 END) AS onLineNum,
SUM(CASE a.detector_status WHEN '1' THEN 1 ELSE 0 END) AS offLineNum
from(select a1.detector_id,
a1.detector_type,
a1.detector_status,
a2.* from t_detector_info a1
right join t_detector_user a2 on a1.user_id = a2.user_id
<where> a1.is_del = '0' and a2.is_del = '0'
<if test="detectorStatus != null and detectorStatus != ''"> and a1.detector_status = #{detectorStatus}</if>
</where>) a
group by a.user_id,a.detector_type
) t1 left join (
select b.user_id AS userId,
COUNT(b.id) AS historyAlarmNum,
SUM(CASE b.is_cancel_alarm WHEN '0' THEN 1 ELSE 0 END) AS processingAlarmNum,
COUNT(b.id) - SUM(CASE b.is_cancel_alarm WHEN '0' THEN 1 ELSE 0 END) AS cancelAlarmNum
from(select b1.id,b1.is_cancel_alarm,b2.*
from t_detector_report_data b1
left join t_detector_info b2 on b1.detector_code = b2.detector_code
right join t_detector_user b3 on b2.user_id = b3.user_id
<where> b2.is_del = '0' and b3.is_del = '0'
<if test="detectorStatus != null and detectorStatus != ''"> and b2.detector_status = #{detectorStatus}</if>
</where>) b
group by b.user_id,b.detector_type
) t2 on t2.userId = t1.userId
</select>
<select id="countTDetectorUserAlarm" resultType="TDetectorUserVO" parameterType="TDetectorUser">
select t1.*,
IFNULL(t2.historyAlarmNum,0) AS historyAlarmNum,
IFNULL(t2.processingAlarmNum,0) AS processingAlarmNum,
IFNULL(t2.cancelAlarmNum,0) AS cancelAlarmNum
from(
select a.user_id AS userId,
a.detector_id AS detectorId,
a.detector_status AS detectorStatus,
a.nick_name AS nickName,
a.user_type AS userType,
a.address AS address,
a.longitude AS longitude,
a.latitude AS latitude,
a.linkman AS linkman,
a.phone AS phone,
a.email AS email,
CASE a.detector_type
WHEN '1' THEN '家用报警器'
WHEN '2' THEN '工业报警器' END AS detectorType,
COUNT(a.detector_id) AS detectorCount,
SUM(CASE a.detector_status WHEN '0' THEN 1 ELSE 0 END) AS onLineNum,
SUM(CASE a.detector_status WHEN '1' THEN 1 ELSE 0 END) AS offLineNum
from(select a1.detector_id,
a1.detector_type,
a1.detector_status,
a2.* from t_detector_info a1
right join t_detector_user a2 on a1.user_id = a2.user_id
where a1.is_del = '0' and a2.is_del = '0' and a2.user_id = #{userId}) a
group by a.detector_type
) t1 left join (
select b.user_id AS userId,
COUNT(b.id) AS historyAlarmNum,
SUM(CASE b.is_cancel_alarm WHEN '0' THEN 1 ELSE 0 END) AS processingAlarmNum,
COUNT(b.id) - SUM(CASE b.is_cancel_alarm WHEN '0' THEN 1 ELSE 0 END) AS cancelAlarmNum
from(select b1.id,b1.is_cancel_alarm,b2.*
from t_detector_report_data b1
left join t_detector_info b2 on b1.detector_code = b2.detector_code
right join t_detector_user b3 on b2.user_id = b3.user_id
where b2.is_del = '0' and b3.is_del = '0' and b3.user_id = #{userId}) b
group by b.detector_type
) t2 on t2.userId = t1.userId
</select>
<insert id="insertTDetectorUser" parameterType="TDetectorUser" useGeneratedKeys="true" keyProperty="userId"> <insert id="insertTDetectorUser" parameterType="TDetectorUser" useGeneratedKeys="true" keyProperty="userId">
insert into t_detector_user insert into t_detector_user
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
......
/* /*
* @Author: your name * @Author: your name
* @Date: 2022-02-23 15:28:07 * @Date: 2022-02-23 15:28:07
* @LastEditTime: 2022-02-25 18:43:58 * @LastEditTime: 2022-03-01 09:05:43
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /newDev/gassafety-progress/gassafetyprogress-web/src/api/bigWindow/getdevice.js * @FilePath: /newDev/gassafety-progress/gassafetyprogress-web/src/api/bigWindow/getdevice.js
...@@ -67,4 +67,12 @@ export function getCompany(query) { ...@@ -67,4 +67,12 @@ export function getCompany(query) {
method: 'get', method: 'get',
params: query params: query
}) })
}
// 报警
export function userAlarm(query) {
return request({
url: '/supervise/user/getDetectorUserAlarmList',
method: 'get',
params: query
})
} }
\ No newline at end of file
...@@ -18,6 +18,15 @@ export function detectorUserList(query) { ...@@ -18,6 +18,15 @@ export function detectorUserList(query) {
}) })
} }
// 探测器用户列表
export function getDetectorUserAlarmList(query) {
return request({
url: '/supervise/user/getDetectorUserAlarmList',
method: 'get',
params: query
})
}
// 查询探测器用户详细 // 查询探测器用户详细
export function getDetectorUser(userId) { export function getDetectorUser(userId) {
return request({ return request({
......
<svg id="组_2446" data-name="组 2446" xmlns="http://www.w3.org/2000/svg" width="18" height="25" viewBox="0 0 23 33.9">
<path id="路径_170" data-name="路径 170" d="M-1583.57,295.955a3.719,3.719,0,0,0-3.714,3.713,3.719,3.719,0,0,0,3.714,3.713,3.719,3.719,0,0,0,3.713-3.713,3.719,3.719,0,0,0-3.713-3.713Zm2.287,4.15a.608.608,0,0,1-.437.184h-1.862a.618.618,0,0,1-.621-.621V297.2a.618.618,0,0,1,.621-.621.608.608,0,0,1,.437.184.608.608,0,0,1,.184.437v1.862h1.242a.618.618,0,0,1,.621.621.6.6,0,0,1-.184.425Zm-8.966-5.047a4.143,4.143,0,0,0,4.161,0,4.166,4.166,0,0,0,2.081-3.61,4.161,4.161,0,0,0-4.162-4.161,4.16,4.16,0,0,0-4.161,4.161A4.179,4.179,0,0,0-1590.249,295.058Zm1.724,4.61a4.872,4.872,0,0,1,.391-1.931,5.639,5.639,0,0,1,.54-.966,4.67,4.67,0,0,1-.575.035,5.145,5.145,0,0,1-2.081-.425,5.006,5.006,0,0,1-.943-.517,1.2,1.2,0,0,0-1.345-.011,7.8,7.8,0,0,0-3.414,6.265v.069a.6.6,0,0,0,.6.575h7.92a5.215,5.215,0,0,1-.7-1.161,5.035,5.035,0,0,1-.391-1.931Z" transform="translate(1599.528 -284.903)" fill="#7bf8f4" opacity="0.996">
<animate attributeName="fill" attributeType="XML"
from="#7bf8f4" to="#ff0000"
begin="0s" dur="1s"
fill="remove" repeatCount="indefinite"/>
</path>
<g id="路径_190" data-name="路径 190" fill="none">
<path d="M11.5,0A11.5,11.5,0,0,1,23,11.5c0,6.351-11.6,18.226-11.5,18.3S0,17.851,0,11.5A11.5,11.5,0,0,1,11.5,0Z" stroke="none"/>
<path d="M 11.5 1.000003814697266 C 5.71027946472168 1.000003814697266 1 5.710294723510742 1 11.50003433227539 C 1 15.44052124023438 6.295677185058594 22.62869262695312 11.47670078277588 28.30246353149414 C 12.68496322631836 26.95182609558105 15.33070659637451 23.97891044616699 17.65538024902344 20.72865295410156 C 19.63738059997559 17.95753479003906 22 14.10700416564941 22 11.50003433227539 C 22 5.710294723510742 17.28972053527832 1.000003814697266 11.5 1.000003814697266 M 11.5 3.814697265625e-06 C 17.85128021240234 3.814697265625e-06 23 5.148744583129883 23 11.50003433227539 C 23 17.82767677307129 11.48916530609131 29.63790130615234 11.49940204620361 29.80170249938965 C 11.36462783813477 29.63816833496094 0 17.78736114501953 0 11.50003433227539 C 0 5.148744583129883 5.14872932434082 3.814697265625e-06 11.5 3.814697265625e-06 Z M 11.49940204620361 29.80170249938965 C 11.50076866149902 29.80335998535156 11.50098419189453 29.80382347106934 11.5 29.80304336547852 C 11.49963855743408 29.80275726318359 11.49944019317627 29.80231475830078 11.49940204620361 29.80170249938965 Z" stroke="none" fill="#7bf8f4">
<animate attributeName="fill" attributeType="XML"
from="#7bf8f4" to="#ff0000"
begin="0s" dur="1s"
fill="remove" repeatCount="indefinite"/>
</path>
</g>
<path id="多边形_37" data-name="多边形 37" d="M4.471,0,8.941,5.961H0Z" transform="translate(16.094 29.803) rotate(180)" fill="#7bf8f4">
<animate attributeName="fill" attributeType="XML"
from="#7bf8f4" to="#ff0000"
begin="0s" dur="1s"
fill="remove" repeatCount="indefinite"/>
</path>
</svg>
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
<div v-else>-</div> <div v-else>-</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="reportTime" label="警时间" width=""> <el-table-column prop="reportTime" label="警时间" width="">
<template slot-scope="scope"> <template slot-scope="scope">
<div v-unValue>{{ scope.row.reportTime }}</div> <div v-unValue>{{ scope.row.reportTime }}</div>
</template> </template>
......
<!-- <!--
* @Author: your name * @Author: your name
* @Date: 2022-01-26 20:07:52 * @Date: 2022-01-26 20:07:52
* @LastEditTime: 2022-02-28 15:52:58 * @LastEditTime: 2022-02-28 18:05:19
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
...@@ -62,8 +62,8 @@ ...@@ -62,8 +62,8 @@
<div class="last">报警中</div> <div class="last">报警中</div>
</div> </div>
<div class="tbody flex" v-if="Array.isArray(deviceData.pressureFlows)"> <div class="tbody flex" v-if="Array.isArray(deviceData.pressureFlows)">
<div class="first zzz">{{ "压力表与流量计" }}</div> <div class="first zzz">{{ "压力表" }}</div>
<div v-unValue class="">{{ deviceData.numberEquipment }}</div> <div v-unValue class="">{{ deviceData.numberPressureGauges }}</div>
<div v-unValue class=""> <div v-unValue class="">
{{ deviceData.onlineEquipment }} {{ deviceData.onlineEquipment }}
</div> </div>
...@@ -80,6 +80,25 @@ ...@@ -80,6 +80,25 @@
{{ deviceData.inAlarm }} {{ deviceData.inAlarm }}
</div> </div>
</div> </div>
<div class="tbody flex" v-if="Array.isArray(deviceData.pressureFlows)">
<div class="first zzz">{{ "流量计" }}</div>
<div v-unValue class="">{{ deviceData.numberEquipment }}</div>
<div v-unValue class="">
{{ deviceData.numberOnlineEquipment }}
</div>
<div v-unValue class="">
{{ deviceData.numberOfflineEquipment }}
</div>
<div v-unValue class="">
{{ deviceData.numberHistoricalAlarm }}
</div>
<div v-unValue class="">
{{ deviceData.numberAlarmProcessed }}
</div>
<div v-unValue class="last">
{{ deviceData.numberInAlarm }}
</div>
</div>
</div> </div>
<div class="btn"> <div class="btn">
......
<!-- <!--
* @Author: your name * @Author: your name
* @Date: 2022-01-26 20:07:52 * @Date: 2022-01-26 20:07:52
* @LastEditTime: 2022-02-28 13:30:46 * @LastEditTime: 2022-03-01 09:17:01
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
...@@ -35,41 +35,46 @@ ...@@ -35,41 +35,46 @@
</div> </div>
</div> </div>
<div class="foot"> <template v-if="deviceData.detectorCountList">
<div class="thead flex"> <div class="foot">
<div class="first">设备类型</div> <div class="thead flex">
<div>设备数量</div> <div class="first">设备类型</div>
<div>在线设备</div> <div>设备数量</div>
<div>离线设备</div> <div>在线设备</div>
<div>历史报警</div> <div>离线设备</div>
<div>已处理报警</div> <div>历史报警</div>
<div class="last">报警中</div> <div>已处理报警</div>
</div> <div class="last">报警中</div>
<div class="tbody flex">
<div v-unValue class="first zzz">{{ deviceData.detectorType }}</div>
<div class="">{{ deviceData.detectorCount }}</div>
<div v-unValue class="">
{{ deviceData.onLineNum }}
</div>
<div v-unValue class="">
{{ deviceData.offLineNum }}
</div>
<div v-unValue class="">
{{ deviceData.historyAlarmNum }}
</div> </div>
<div v-unValue class=""> <div
{{ deviceData.cancelAlarmNum }} v-for="data in deviceData.detectorCountList"
</div> :key="data.userId"
<div v-unValue class="last zzz"> class="tbody flex"
{{ deviceData.processingAlarmNum }} >
<div v-unValue class="first zzz">{{ data.detectorType }}</div>
<div class="">{{ data.detectorCount }}</div>
<div v-unValue class="">
{{ data.onLineNum }}
</div>
<div v-unValue class="">
{{ data.offLineNum }}
</div>
<div v-unValue class="">
{{ data.historyAlarmNum }}
</div>
<div v-unValue class="">
{{ data.cancelAlarmNum }}
</div>
<div v-unValue class="last zzz">
{{ data.processingAlarmNum }}
</div>
</div> </div>
</div> </div>
</div> </template>
<div class="btn"> <div class="btn">
<div @click="btnClick">感知设备</div> <div @click="btnClick">感知设备</div>
</div> </div>
</div> </div>
</template> </template>
...@@ -106,7 +111,10 @@ export default { ...@@ -106,7 +111,10 @@ export default {
}, },
btnClick() { btnClick() {
// this.vueRoot.centerDataFunc(this.deviceData.pressureFlows); // this.vueRoot.centerDataFunc(this.deviceData.pressureFlows);
this.vueRoot.getDetectorInfoList({ userId: this.deviceData.userId },this.deviceData.nickName); this.vueRoot.getDetectorInfoList(
{ userId: this.deviceData.userId },
this.deviceData.nickName
);
}, },
}, },
}; };
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="detectorName" label="设备名称" width="100"> <el-table-column prop="detectorName" label="设备名称" width="120">
<template slot-scope="scope"> <template slot-scope="scope">
<div :title="scope.row.detectorName" class="ddd" v-unValue> <div :title="scope.row.detectorName" class="ddd" v-unValue>
{{ scope.row.detectorName }} {{ scope.row.detectorName }}
...@@ -39,12 +39,15 @@ ...@@ -39,12 +39,15 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="linkman" label="联系人" width="100"> <el-table-column prop="linkman" label="联系人" width="100">
<template slot-scope="scope">
<div v-unValue>{{ scope.row.linkman }}</div>
</template>
</el-table-column> </el-table-column>
<el-table-column prop="phone" label="联系电话" width=""> <el-table-column prop="phone" label="联系电话" width="">
</el-table-column> </el-table-column>
<el-table-column prop="detectorStatus" label="设备状态" width="100"> <el-table-column prop="detectorStatus" label="设备状态" width="100">
</el-table-column> </el-table-column>
<el-table-column prop="alarmTime" label="报警时间" width="200"> <el-table-column prop="alarmTime" label="预警时间" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<div v-unValue>{{ scope.row.alarmTime }}</div> <div v-unValue>{{ scope.row.alarmTime }}</div>
</template> </template>
......
/* /*
* @Author: your name * @Author: your name
* @Date: 2022-01-26 10:47:44 * @Date: 2022-01-26 10:47:44
* @LastEditTime: 2022-02-28 15:53:46 * @LastEditTime: 2022-02-28 20:33:47
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /test/hello-world/src/utils/config.js * @FilePath: /test/hello-world/src/utils/config.js
...@@ -27,6 +27,13 @@ export const svgUrl = { ...@@ -27,6 +27,13 @@ export const svgUrl = {
5: require("@/assets/image/jiankong1.svg"), 5: require("@/assets/image/jiankong1.svg"),
6: require("@/assets/image/user1.svg"), 6: require("@/assets/image/user1.svg"),
}; };
export const svgAlarm = {
2: require("@/assets/image/tiaoyaxiang1.svg"),
3: require("@/assets/image/famen1.svg"),
4: require("@/assets/image/changzhan1.svg"),
5: require("@/assets/image/jiankong1.svg"),
6: require("@/assets/mapImages/userAlarm.svg"),
};
export const deviceType = { export const deviceType = {
1:"管道", 1:"管道",
2:"调压箱", 2:"调压箱",
......
/* /*
* @Author: your name * @Author: your name
* @Date: 2022-01-11 13:45:12 * @Date: 2022-01-11 13:45:12
* @LastEditTime: 2022-02-28 10:25:45 * @LastEditTime: 2022-03-01 10:19:55
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /test/hello-world/src/utils/mapClass.js * @FilePath: /test/hello-world/src/utils/mapClass.js
*/ */
import { pipeColor, svgUrl } from "@/utils/mapClass/config.js"; import { pipeColor, svgUrl, svgAlarm } from "@/utils/mapClass/config.js";
// 编辑类 // 编辑类
// 在地图上新增的设备可以直接编辑, // 在地图上新增的设备可以直接编辑,
...@@ -34,6 +34,8 @@ export class EditorMap { ...@@ -34,6 +34,8 @@ export class EditorMap {
allDevice = {}; allDevice = {};
// 存放所有的管道 // 存放所有的管道
pipeArr = {}; pipeArr = {};
// 报警设备的对象
alarmObj = {};
// 当前的infowindow的组件 // 当前的infowindow的组件
infowindowComponent = null; infowindowComponent = null;
// infowindow本身 // infowindow本身
...@@ -249,6 +251,7 @@ export class EditorMap { ...@@ -249,6 +251,7 @@ export class EditorMap {
addDevice(deviceData, compontent) { addDevice(deviceData, compontent) {
const { longitude: lng, latitude: lat, iconType } = deviceData; const { longitude: lng, latitude: lat, iconType } = deviceData;
const icon = svgUrl[iconType]; const icon = svgUrl[iconType];
console.log("icon", icon);
let device = this.createMarker({ let device = this.createMarker({
map: this.map, map: this.map,
anchor: "bottom-center", anchor: "bottom-center",
...@@ -266,7 +269,6 @@ export class EditorMap { ...@@ -266,7 +269,6 @@ export class EditorMap {
this.allDevice[iconType] = []; this.allDevice[iconType] = [];
} }
this.allDevice[iconType].push(device); this.allDevice[iconType].push(device);
// 设备的事件函数 // 设备的事件函数
this.deviceEvent(device, compontent); this.deviceEvent(device, compontent);
} }
...@@ -282,18 +284,19 @@ export class EditorMap { ...@@ -282,18 +284,19 @@ export class EditorMap {
// 3是删除操作 // 3是删除操作
} }
}); });
device.on("mouseover",(e)=>{ device.on("mouseover", (e) => {
const target = e.target; const target = e.target;
const data = target.getExtData(); const data = target.getExtData();
console.log(data) console.log(data);
const name = data.nickName||data.deviceName||data.videoName||data.stationName const name =
target.setLabel({content:name,direction:"top"}) data.nickName || data.deviceName || data.videoName || data.stationName;
}) target.setLabel({ content: name, direction: "top" });
device.on("mouseout",(e)=>{ });
device.on("mouseout", (e) => {
const target = e.target; const target = e.target;
const data = target.getExtData(); const data = target.getExtData();
target.setLabel({content:""}) target.setLabel({ content: "" });
}) });
} }
/** 点击marker出现infowindow /** 点击marker出现infowindow
* @description: * @description:
...@@ -477,8 +480,8 @@ export class EditorMap { ...@@ -477,8 +480,8 @@ export class EditorMap {
// 燃气没有公司,所以没有device.companyType不收到公司的控制 // 燃气没有公司,所以没有device.companyType不收到公司的控制
const companyHas = companyArr.indexOf(data.companyType + "") >= 0; const companyHas = companyArr.indexOf(data.companyType + "") >= 0;
// 设备存在 // 设备存在
const deviceHas = typeArr.indexOf(+data.iconType ) >= 0; const deviceHas = typeArr.indexOf(+data.iconType) >= 0;
console.log(deviceHas) console.log(deviceHas);
// 必须设备存在数组里,才会显示设备 !data.companyType代表用户不受公司制约 // 必须设备存在数组里,才会显示设备 !data.companyType代表用户不受公司制约
if (deviceHas && (companyHas || !data.companyType)) { if (deviceHas && (companyHas || !data.companyType)) {
device.show(); device.show();
...@@ -488,7 +491,93 @@ export class EditorMap { ...@@ -488,7 +491,93 @@ export class EditorMap {
}); });
} }
} }
// 普通调用方法
// 设备报警
deviceAlarm(obj) {
// 设备的类型
const { iconType, userId } = obj;
// 找到这个设备所属的空间
const device = this.allDevice[iconType].filter(
(item) => item.getExtData().userId == userId
)[0];
// 更改的icon
const icon = svgAlarm[iconType];
device.setIcon(icon);
// 将旧的值缓存一下
device.oldData = device.getExtData();
device.setExtData(obj);
// 如果infowindow是打开的,就改变里面的数据
if (this.infowindowComponent) {
this.infowindowComponentChange(obj);
}
if (!this.alarmObj[iconType]) {
this.alarmObj[iconType] = [];
} else {
const ind = this.alarmObj[iconType].indexOf(userId);
if (ind < 0) {
this.alarmObj[iconType].push(userId);
}
}
}
//如果传过来的报警设备中,有不在deviceAlarm中,就是恢复的设备恢复
relieveAlarm(alarmObj) {
// 把报警数组改变结构
const httpArr = alarmObj.map((item) => item.userId);
// 循环现有报警设备
for (let iconType in this.alarmObj) {
const arr = this.alarmObj[iconType];
// 循环现有报警设备
for (let i = 0; i < arr.length; i++) {
// 看看现有报警设备中有没有不在 报警数组中的值,有就恢复
const userId = arr[i];
// 看看接口传来的数据中还有没有这些UserId,如果没有了,就是修好了
const index = httpArr.indexOf(userId);
// 如果已经不在报警数组中,就要去大数组中找他,利用userId
if (index < 0) {
// 过滤出来这个要恢复的设备
const device = this.allDevice[iconType].filter(
(item) => item.getExtData().userId == userId
)[0];
// 恢复
const icon = svgUrl[iconType];
device.setIcon(icon);
// 赋值
const deviceData = device.oldData;
device.setExtData(deviceData);
device.oldData = null;
// 如果infowindow是打开的
if (this.infowindowComponent) {
this.infowindowComponentChange(deviceData);
}
// 在arr中删掉
arr.splice(i, 1);
// 由于删掉了当前,所以要--恢复位置
i--;
}
}
}
}
// ws协议方法
wsAlarm(obj) {
const { iconType, userId, userStatus } = obj;
const decice = this.allDevice[iconType].filter(
(item) => item.getExtData().userId == userId
)[0];
let icon = null;
// 2报警,1恢复
if (userStatus == 2) {
icon = svgAlarm[iconType];
device.oldData = device.getExtData();
device.setExtData(obj);
} else if (userStatus == 1) {
icon = svgUrl[iconType];
const oldData = device.oldData;
device.setExtData(oldData);
device.oldData = null;
}
decice.setIcon(icon);
}
// 卫星图切换 // 卫星图切换
satellite = null; satellite = null;
changeMap(bool) { changeMap(bool) {
......
<!-- <!--
* @Author: your name * @Author: your name
* @Date: 2022-01-11 13:44:17 * @Date: 2022-01-11 13:44:17
* @LastEditTime: 2022-02-28 15:54:27 * @LastEditTime: 2022-03-01 09:51:34
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /test/hello-world/src/views/Home.vue * @FilePath: /test/hello-world/src/views/Home.vue
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
<!-- 头部 --> <!-- 头部 -->
<div class="banner-test"> <div class="banner-test">
<!-- <dv-decoration-5 style="width:100%;height:100%;" /> --> <!-- <dv-decoration-5 style="width:100%;height:100%;" /> -->
<img src="@/assets/mapinages/topbanner.png" alt="" /> <img src="@/assets/mapinages/tb.png" alt="" />
</div> </div>
<!-- 左边 --> <!-- 左边 -->
...@@ -152,6 +152,7 @@ import { ...@@ -152,6 +152,7 @@ import {
getCz, getCz,
getVideo, getVideo,
getUser, getUser,
userAlarm,
} from "@/api/bigWindow/getDevice"; } from "@/api/bigWindow/getDevice";
import Line from "@/components/bigWindow/Line.vue"; import Line from "@/components/bigWindow/Line.vue";
import VideoView from "@/components/bigWindow/VideoView.vue"; import VideoView from "@/components/bigWindow/VideoView.vue";
...@@ -244,6 +245,9 @@ export default { ...@@ -244,6 +245,9 @@ export default {
centerTotal: null, centerTotal: null,
centerShow: false, centerShow: false,
centerTitle: "", centerTitle: "",
// 报警轮询timer
alarmTimer: null,
}; };
}, },
...@@ -305,12 +309,16 @@ export default { ...@@ -305,12 +309,16 @@ export default {
this.goMap(getFm, this.addDevice, DeviceA); this.goMap(getFm, this.addDevice, DeviceA);
this.goMap(getCz, this.addDevice, DeviceA); this.goMap(getCz, this.addDevice, DeviceA);
this.goMap(getVideo, this.addDevice, VideoView); this.goMap(getVideo, this.addDevice, VideoView);
this.goMap(detectorUserList, this.addDevice, User); // 用户要等一下 因为有报警数据
// getVideo().then((res) => { this.goMap(detectorUserList, this.addDevice, User).then((res) => {
// console.log("getVideo", res); // 先查一下,然后开启定时器
// }); this.userAlarm();
this.alarmTimer = setInterval(() => {
this.userAlarm();
// console.log("查询报警");
}, 6000);
});
} }
this.currentTime(); this.currentTime();
this.$refs.mychild.choice(0); this.$refs.mychild.choice(0);
this.$refs.mychild2.choice(this.selarr); this.$refs.mychild2.choice(this.selarr);
...@@ -336,7 +344,7 @@ export default { ...@@ -336,7 +344,7 @@ export default {
} }
}, },
goMap(httpFunc, addFunc, component) { goMap(httpFunc, addFunc, component) {
httpFunc().then((res) => { return httpFunc().then((res) => {
// 给用户加icontype // 给用户加icontype
if (res.data && !res.data[0].iconType) { if (res.data && !res.data[0].iconType) {
...@@ -344,26 +352,35 @@ export default { ...@@ -344,26 +352,35 @@ export default {
item.iconType = 6; item.iconType = 6;
}); });
} }
// if (res.data && !res.data[0].iconType) {
// res.data.forEach((item) => {
// item.iconType = 6;
// });
// }
// 根据数据格式不同,赋值不同,如果是个数组,就用res,如果不是就用res.data // 根据数据格式不同,赋值不同,如果是个数组,就用res,如果不是就用res.data
let config = {}; let config = {};
if (Array.isArray(res)) { if (Array.isArray(res)) {
config = { data: res }; config = { data: res };
// 给视频设备的conpanyType变成null // 给视频设备的conpanyType变成null
if(res[0].iconType==5){ if (res[0].iconType == 5) {
res.forEach(item=>{ res.forEach((item) => {
item.companyType = null; item.companyType = null;
}) });
} }
} else { } else {
config = { data: res.data }; config = { data: res.data };
} }
addFunc(config, component); addFunc(config, component);
return config.iconType;
});
},
userAlarm() {
userAlarm().then((res) => {
console.log("报警", res.data);
if (res.data.length > 0) {
// 报警
res.data.forEach((item) => {
this.map.deviceAlarm(item);
});
// 看看谁告消警
}
this.map.relieveAlarm(res.data);
}); });
}, },
...@@ -476,6 +493,9 @@ export default { ...@@ -476,6 +493,9 @@ export default {
if (this.formatDate) { if (this.formatDate) {
clearInterval(this.formatDate); // 在Vue实例销毁前,清除时间定时器 clearInterval(this.formatDate); // 在Vue实例销毁前,清除时间定时器
} }
if (this.alarmTimer) {
clearInterval(this.alarmTimer);
}
}, },
}; };
</script> </script>
......
...@@ -34,7 +34,7 @@ module.exports = { ...@@ -34,7 +34,7 @@ module.exports = {
proxy: { proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy // detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: { [process.env.VUE_APP_BASE_API]: {
// target: `http://localhost:8903/gassafety`, // target: `http://192.168.2.14:8903/gassafety`,
target: `http://222.223.203.154:8092/gassafety`, target: `http://222.223.203.154:8092/gassafety`,
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {
......
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