Commit cb66c9f3 authored by wuqinghua's avatar wuqinghua

2022-3-1 吴卿华

parent 118fbd49
......@@ -6,10 +6,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
......@@ -68,16 +65,30 @@ public class PipeInterfaceController {
DeviceList deviceList=new DeviceList();
//调压箱数据循环
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++){
//判断调压箱id与下级数据调压箱id是否相等
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);
}
deviceList.setData(deviceData);
......@@ -93,11 +104,32 @@ public class PipeInterfaceController {
public TSiteStationInfoDataList selectTSiteStationInfoData(){
//场站信息查询方法
List<TSiteStationInfoData> tSiteStationInfoData = iPipeInterfaceService.selectTSiteStationInfoData();
//查询场站下级设备数据
List<PressureFlow> pressureFlows = iPipeInterfaceService.selecttSiteStationInfoDataList("1");
TSiteStationInfoDataList tSiteStationInfoDataList=new TSiteStationInfoDataList();
for (int i=0;i<tSiteStationInfoData.size();i++){
//查询场站下级设备数据
List<PressureFlow> pressureFlows = iPipeInterfaceService.selecttSiteStationInfoDataList(tSiteStationInfoData.get(i).getSiteStationId());
tSiteStationInfoData.get(i).setPressureFlows(pressureFlows);
//临时存储压力表数据数组
List<PressureFlow> pressureList=new ArrayList<>();
//临时存储流量计数据数组
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);
}
tSiteStationInfoDataList.setData(tSiteStationInfoData);
......@@ -164,16 +196,29 @@ public class PipeInterfaceController {
DeviceDataList deviceDataList=new DeviceDataList();
//调压箱数据循环
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++){
//判断调压箱id与下级数据调压箱id是否相等
if (pressureFlows1.get(s).getDeviceId()==pipeDates.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));
}
}
}
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);
}
deviceDataList.setData(pipeDates);
......
......@@ -30,6 +30,139 @@ public class DeviceData {
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() {
return iconType;
}
......@@ -126,6 +259,7 @@ public class DeviceData {
this.pressureFlows = pressureFlows;
}
@Override
public String toString() {
return "DeviceData{" +
......@@ -141,6 +275,18 @@ public class DeviceData {
", pressureFlows=" + pressureFlows +
", beyondEnterpriseName='" + beyondEnterpriseName + '\'' +
", 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;
import java.util.List;
public class TSiteStationInfoData {
......@@ -23,13 +22,148 @@ public class TSiteStationInfoData {
private String buildCompany;
private String powerCompany;
//流量计数组
private List<PressureFlow> pressureFlows;
private int iconType;
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() {
return companyType;
}
......@@ -150,6 +284,18 @@ public class TSiteStationInfoData {
", pressureFlows=" + pressureFlows +
", iconType=" + iconType +
", 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 +
'}';
}
}
......@@ -115,8 +115,8 @@
<!--查询场站下级数据-->
<select id="selecttSiteStationInfoDataList" parameterType="DeviceData" resultMap="PressureFlowResult">
select device_model,device_type,create_time from t_relation_device_detail_info
where relation_device_id=#{deviceId} and relation_device_type='2'
select device_model,device_type,create_time,relation_device_id from t_relation_device_detail_info
where relation_device_type='2'
</select>
<!--监控信息查询-->
......
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