Commit a86055cb authored by caotao's avatar caotao

修改电量表计问题

parent 0f22031c
...@@ -3,10 +3,7 @@ package com.yeejoin.amos.boot.module.jxiop.biz.constants; ...@@ -3,10 +3,7 @@ package com.yeejoin.amos.boot.module.jxiop.biz.constants;
import com.sun.javafx.logging.PulseLogger; import com.sun.javafx.logging.PulseLogger;
import org.checkerframework.checker.units.qual.C; import org.checkerframework.checker.units.qual.C;
import java.util.ArrayList; import java.util.*;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
public class CommonConstans { public class CommonConstans {
//光伏发电量系数 //光伏发电量系数
...@@ -115,6 +112,7 @@ public class CommonConstans { ...@@ -115,6 +112,7 @@ public class CommonConstans {
public static final String QueryStringIsAlarm = "isAlarm"; public static final String QueryStringIsAlarm = "isAlarm";
public static final String QueryStringIsAlarmKeyword = "isAlarm.keyword"; public static final String QueryStringIsAlarmKeyword = "isAlarm.keyword";
public static final String Twodecimalplaces = "%.2f"; public static final String Twodecimalplaces = "%.2f";
public static final String Threedecimalplaces = "%.3f";
public static final String Fourdecimalplaces = "%.4f"; public static final String Fourdecimalplaces = "%.4f";
public static final String QueryStringFrontMoudleNotKeyWord = "frontModule"; public static final String QueryStringFrontMoudleNotKeyWord = "frontModule";
//泰和的发电量数据 //泰和的发电量数据
...@@ -127,4 +125,35 @@ public class CommonConstans { ...@@ -127,4 +125,35 @@ public class CommonConstans {
public static final String taiheIrradiationPonit = "WTX-801_25_WTX-801_总辐射"; public static final String taiheIrradiationPonit = "WTX-801_25_WTX-801_总辐射";
public static final String xiazaoActivePowerPoint = "220kV夏雩线212线路测控装置PCS-9705TA有功功率一次值"; public static final String xiazaoActivePowerPoint = "220kV夏雩线212线路测控装置PCS-9705TA有功功率一次值";
public static final String xiazaoWindSpeedrPoint = "瞬时风速"; public static final String xiazaoWindSpeedrPoint = "瞬时风速";
public static final List<String> xiazaoElectricityMeter = new ArrayList<>(Arrays.asList("夏雩线212主表", "夏雩线212副表", "1号主变高压侧201", "1号主变低压侧301",
"35kV集电Ⅰ线311", "35kV集电Ⅱ线312", "35kV集电Ⅲ线313", "35kV集电Ⅳ线314", "35kV集电V线315", "35kV#1SVG316", "35kV#1SVG317", "35kV#1接地变307"));
public static final List<String> taiheElectricityMeter = new ArrayList<>(Arrays.asList("前光Ⅰ线", "前光Ⅱ线", "消弧线圈兼接地变", "#1SVG", "前万线"));
public static final HashMap<String, List<String>> xiazaoElectricityMeterPointSort = new HashMap<String, List<String>>() {
{
put("夏雩线212主表", Arrays.asList("威胜电量采集WFET2000S_v3.002夏雩线主表正向总有功P+", "威胜电量采集WFET2000S_v3.002夏雩线主表反向总有功P-", "威胜电量采集WFET2000S_v3.002夏雩线主表正向总无功Q+", "威胜电量采集WFET2000S_v3.002夏雩线主表反向总无功Q-"));
put("夏雩线212副表", Arrays.asList("威胜电量采集WFET2000S_v3.002夏雩线副表正向总有功P+", "威胜电量采集WFET2000S_v3.002夏雩线副表反向总有功P-", "威胜电量采集WFET2000S_v3.002夏雩线副表正向总无功Q+", "威胜电量采集WFET2000S_v3.002夏雩线副表反向总无功Q-"));
put("1号主变高压侧201", Arrays.asList("威胜电量采集WFET2000S_v3.002#1主变高压侧正向总有功P+", "威胜电量采集WFET2000S_v3.002#1主变高压侧反向总有功P-", "威胜电量采集WFET2000S_v3.002#1主变高压侧正向总无功Q+", "威胜电量采集WFET2000S_v3.002#1主变高压侧反向总无功Q-"));
put("1号主变低压侧301", Arrays.asList("威胜电量采集WFET2000S_v3.002#1主变低压侧正向总有功P+", "威胜电量采集WFET2000S_v3.002#1主变低压侧反向总有功P-", "威胜电量采集WFET2000S_v3.002#1主变低压侧正向总无功Q+", "威胜电量采集WFET2000S_v3.002#1主变低压侧反向总无功Q-"));
put("35kV集电Ⅰ线311", Arrays.asList("威胜电量采集WFET2000S_v3.002集电I线正向总有功P+", "威胜电量采集WFET2000S_v3.002集电I线反向总有功P-", "威胜电量采集WFET2000S_v3.002集电I线正向总无功Q+", "威胜电量采集WFET2000S_v3.002集电I线反向总无功Q-"));
put("35kV集电Ⅱ线312", Arrays.asList("威胜电量采集WFET2000S_v3.002集电II线正向总有功P+", "威胜电量采集WFET2000S_v3.002集电II线反向总有功P-", "威胜电量采集WFET2000S_v3.002集电II线正向总无功Q+", "威胜电量采集WFET2000S_v3.002集电II线反向总无功Q-"));
put("35kV集电Ⅲ线313", Arrays.asList("威胜电量采集WFET2000S_v3.002集电III线正向总有功P+", "威胜电量采集WFET2000S_v3.002集电III线反向总有功P-", "威胜电量采集WFET2000S_v3.002集电III线正向总无功Q+", "威胜电量采集WFET2000S_v3.002集电III线反向总无功Q-"));
put("35kV集电Ⅳ线314", Arrays.asList("威胜电量采集WFET2000S_v3.002集电IV线正向总有功P+", "威胜电量采集WFET2000S_v3.002集电IV线反向总有功P-", "威胜电量采集WFET2000S_v3.002集电IV线正向总无功Q+", "威胜电量采集WFET2000S_v3.002集电IV线反向总无功Q-"));
put("35kV集电V线315", Arrays.asList("威胜电量采集WFET2000S_v3.002集电V线正向总有功P+", "威胜电量采集WFET2000S_v3.002集电V线反向总有功P-", "威胜电量采集WFET2000S_v3.002集电V线正向总无功Q+", "威胜电量采集WFET2000S_v3.002集电V线反向总无功Q-"));
put("35kV#1SVG316", Arrays.asList("威胜电量采集WFET2000S_v3.002#1SVG正向总有功P+", "威胜电量采集WFET2000S_v3.002#1SVG反向总有功P-", "威胜电量采集WFET2000S_v3.002#1SVG正向总无功Q+", "威胜电量采集WFET2000S_v3.002#1SVG反向总无功Q-"));
put("35kV#1SVG317", Arrays.asList("威胜电量采集WFET2000S_v3.002#2SVG正向总有功P+", "威胜电量采集WFET2000S_v3.002#2SVG反向总有功P-", "威胜电量采集WFET2000S_v3.002#2SVG正向总无功Q+", "威胜电量采集WFET2000S_v3.002#2SVG反向总无功Q-"));
put("35kV#1接地变307", Arrays.asList("威胜电量采集WFET2000S_v3.002站用接地变正向总有功P+", "威胜电量采集WFET2000S_v3.002站用接地变反向总有功P-", "威胜电量采集WFET2000S_v3.002站用接地变正向总无功Q+", "威胜电量采集WFET2000S_v3.002站用接地变反向总无功Q-"));
}
};
public static final HashMap<String, List<String>> taiheElectricityMeterPointSort = new HashMap<String, List<String>>() {
{
put("前光Ⅰ线", Arrays.asList("314前光Ⅰ线保测_总正向有功电度", "314前光Ⅰ线保测_总反向有功电度", "314前光Ⅰ线保测_总感性无功电度", "314前光Ⅰ线保测_总容性无功电度"));
put("前光Ⅱ线", Arrays.asList("315前光Ⅱ线保测_总正向有功电度", "315前光Ⅱ线保测_总反向有功电度", "315前光Ⅱ线保测_总感性无功电度", "315前光Ⅱ线保测_总容性无功电度"));
put("消弧线圈兼接地变", Arrays.asList("311#1消弧线圈_总正向有功电度", "311#1消弧线圈_总反向有功电度", "311#1消弧线圈_总感性无功电度", "311#1消弧线圈_总容性无功电度"));
put("#1SVG", Arrays.asList("312#1SVG_总正向有功电度", "312#1SVG_总反向有功电度", "312#1SVG_总感性无功电度", "312#1SVG_总容性无功电度"));
put("前万线", Arrays.asList("313光差保护_总正向有功电度", "313光差保护_总反向有功电度", "313光差保护_总感性无功电度", "313光差保护_总容性无功电度"));
}
};
} }
...@@ -532,8 +532,8 @@ public class MonitorFanIdxController extends BaseController { ...@@ -532,8 +532,8 @@ public class MonitorFanIdxController extends BaseController {
@RequestParam(value = "stationId") String stationId, @RequestParam(value = "stationId") String stationId,
@RequestParam(value = "stationType", required = false) String stationType) { @RequestParam(value = "stationType", required = false) String stationType) {
StationBasic stationBasic = stationBasicMapper.selectById(stationId); StationBasic stationBasic = stationBasicMapper.selectById(stationId);
String gatewayId = stationBasic.getBoosterGatewayId(); // String gatewayId = stationBasic.getBoosterGatewayId();
ResultsData resultsData = monitorFanIndicatorImpl.getElectricQuantityList(current, size, gatewayId, stationType); ResultsData resultsData = monitorFanIndicatorImpl.getElectricQuantityList(current, size, stationBasic);
return ResponseHelper.buildResponse(resultsData); return ResponseHelper.buildResponse(resultsData);
} }
......
...@@ -120,55 +120,54 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -120,55 +120,54 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
public void UpdateMonitorFanIndicator(List<IndexDto> list) { public void UpdateMonitorFanIndicator(List<IndexDto> list) {
monitorFanIndicatorregionMapper.UpdateMonitorFanIndicator(list); monitorFanIndicatorregionMapper.UpdateMonitorFanIndicator(list);
} }
@Override @Override
public ResultsData getNationWideInfo(int current, int size, String gateway, String equipmentNumber) { public ResultsData getNationWideInfo(int current, int size, String gateway, String equipmentNumber) {
String table = gateway; String table = gateway;
Map<String, List<String>> queryCodntion = new HashMap<>(); Map<String, List<String>> queryCodntion = new HashMap<>();
queryCodntion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(gateway)); queryCodntion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(gateway));
queryCodntion.put(CommonConstans.QueryStringIsAlarmKeyword, Arrays.asList("1")); queryCodntion.put(CommonConstans.QueryStringIsAlarmKeyword, Arrays.asList("1"));
List<ESEquipments> alldata = commonServiceImpl.getListDataByCondtionsAndLike(queryCodntion, null, List<ESEquipments> alldata = commonServiceImpl.getListDataByCondtionsAndLike(queryCodntion, null,
ESEquipments.class, null); ESEquipments.class, null);
List<ESEquipments> waringData = alldata.stream() List<ESEquipments> waringData = alldata.stream()
.filter(esEquipments -> (!esEquipments.getValue().equals("0.0") .filter(esEquipments -> (!esEquipments.getValue().equals("0.0")
&& !esEquipments.getValue().equals(esEquipments.getValueLabel()) && !esEquipments.getValue().equals(esEquipments.getValueLabel())
|| (esEquipments.getValue().equals("true")))) || (esEquipments.getValue().equals("true"))))
.collect(Collectors.toList()); .collect(Collectors.toList());
if (StringUtils.isNotEmpty(equipmentNumber)) { if (StringUtils.isNotEmpty(equipmentNumber)) {
waringData = waringData.stream() waringData = waringData.stream()
.filter(esEquipments -> esEquipments.getEquipmentNumber().equals(equipmentNumber)) .filter(esEquipments -> esEquipments.getEquipmentNumber().equals(equipmentNumber))
.collect(Collectors.toList()); .collect(Collectors.toList());
} }
if (CollectionUtils.isNotEmpty(waringData)) { if (CollectionUtils.isNotEmpty(waringData)) {
Integer newSize = waringData.size() >= size ? size : waringData.size(); Integer newSize = waringData.size() >= size ? size : waringData.size();
waringData = waringData.stream().sorted(Comparator.comparing(ESEquipments::getCreatedTime).reversed()) waringData = waringData.stream().sorted(Comparator.comparing(ESEquipments::getCreatedTime).reversed())
.collect(Collectors.toList()).subList(((current - 1) * newSize), (current * newSize)); .collect(Collectors.toList()).subList(((current - 1) * newSize), (current * newSize));
waringData.forEach(i->{ waringData.forEach(i -> {
if("true".equals(i.getValue())) if ("true".equals(i.getValue())) {
{ i.setValue("合");
i.setValue("合"); i.setValueLabel(i.getEquipmentIndexName());
i.setValueLabel(i.getEquipmentIndexName()); }
} });
}); }
} // 对于查询到的告警信息进行按照时间顺序进行排序
// 对于查询到的告警信息进行按照时间顺序进行排序 DataGridMock DataGridMock = new DataGridMock(current, !waringData.isEmpty() ? waringData.size() : 0, false,
DataGridMock DataGridMock = new DataGridMock(current, !waringData.isEmpty() ? waringData.size() : 0, false, current, waringData);
current, waringData); ColModel colModelequipmentNumber = new ColModel("equipmentNumber", "equipmentNumber", "设备", "设备", "dataGrid",
ColModel colModelequipmentNumber = new ColModel("equipmentNumber", "equipmentNumber", "设备", "设备", "dataGrid", "equipmentNumber");
"equipmentNumber"); ColModel colModelvalueLabel = new ColModel("valueLabel", "valueLabel", "事件描述", "事件描述", "dataGrid",
ColModel colModelvalueLabel = new ColModel("valueLabel", "valueLabel", "事件描述", "事件描述", "dataGrid", "valueLabel");
"valueLabel"); ColModel colModelcreatedTime = new ColModel("createdTime", "createdTime", "发生时间", "发生时间", "dataGrid",
ColModel colModelcreatedTime = new ColModel("createdTime", "createdTime", "发生时间", "发生时间", "dataGrid", "createdTime");
"createdTime"); ColModel colModelvalue = new ColModel("value", "value", "告警值", "告警值", "dataGrid", "value");
ColModel colModelvalue = new ColModel("value", "value", "告警值", "告警值", "dataGrid", "value"); List<ColModel> listColModel = new ArrayList<>();
List<ColModel> listColModel = new ArrayList<>(); listColModel.add(colModelequipmentNumber);
listColModel.add(colModelequipmentNumber); listColModel.add(colModelvalueLabel);
listColModel.add(colModelvalueLabel); listColModel.add(colModelcreatedTime);
listColModel.add(colModelcreatedTime); listColModel.add(colModelvalue);
listColModel.add(colModelvalue); ResultsData resultsData = new ResultsData(DataGridMock, listColModel);
ResultsData resultsData = new ResultsData(DataGridMock, listColModel); return resultsData;
return resultsData; }
}
@Override @Override
public ResultsData getLsNationWideInfo(int current, int size, String stationBasicId, String equipmentNumber) { public ResultsData getLsNationWideInfo(int current, int size, String stationBasicId, String equipmentNumber) {
...@@ -521,9 +520,9 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -521,9 +520,9 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
activePowerInfo.put("minTime", time.get(values.lastIndexOf(min))); activePowerInfo.put("minTime", time.get(values.lastIndexOf(min)));
activePowerInfo.put("load", String.format(CommonConstans.Twodecimalplaces, Double.valueOf(values.get(values.size() - 1)) / installedCapacity)); activePowerInfo.put("load", String.format(CommonConstans.Twodecimalplaces, Double.valueOf(values.get(values.size() - 1)) / installedCapacity));
max = String.format(CommonConstans.Twodecimalplaces, valueList.stream().mapToDouble(Double::parseDouble).max().getAsDouble()); max = String.format(CommonConstans.Twodecimalplaces, valueList.stream().mapToDouble(Double::parseDouble).max().getAsDouble());
min = String.format(CommonConstans.Twodecimalplaces, valueList.stream().mapToDouble(Double::parseDouble).min().getAsDouble()); min = String.format(CommonConstans.Twodecimalplaces, valueList.stream().mapToDouble(Double::parseDouble).min().getAsDouble());
mean = String.format(CommonConstans.Twodecimalplaces, valueList.stream().mapToDouble(Double::parseDouble).average().getAsDouble()); mean = String.format(CommonConstans.Twodecimalplaces, valueList.stream().mapToDouble(Double::parseDouble).average().getAsDouble());
otherInfo.put("mean", mean); otherInfo.put("mean", mean);
otherInfo.put("max", max); otherInfo.put("max", max);
...@@ -544,11 +543,11 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -544,11 +543,11 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
map.put("axisData", time); map.put("axisData", time);
try { try {
log.info("---------------------推送全站图表信息开始------------------------------"); log.info("---------------------推送全站图表信息开始------------------------------");
emqKeeper.getMqttClient().publish(stationBasic.getSequenceNbr()+"_activePower_table", JSON.toJSON(map).toString().getBytes("UTF-8"),1,true); emqKeeper.getMqttClient().publish(stationBasic.getSequenceNbr() + "_activePower_table", JSON.toJSON(map).toString().getBytes("UTF-8"), 1, true);
emqKeeper.getMqttClient().publish(stationBasic.getSequenceNbr()+"_activePower_info", JSON.toJSON(activePowerInfo).toString().getBytes("UTF-8"),1,true); emqKeeper.getMqttClient().publish(stationBasic.getSequenceNbr() + "_activePower_info", JSON.toJSON(activePowerInfo).toString().getBytes("UTF-8"), 1, true);
emqKeeper.getMqttClient().publish(stationBasic.getSequenceNbr()+"_other_info", JSON.toJSON(otherInfo).toString().getBytes("UTF-8"),1,true); emqKeeper.getMqttClient().publish(stationBasic.getSequenceNbr() + "_other_info", JSON.toJSON(otherInfo).toString().getBytes("UTF-8"), 1, true);
log.info("---------------------推送全站图表信息结束------------------------------"); log.info("---------------------推送全站图表信息结束------------------------------");
}catch (Exception exception){ } catch (Exception exception) {
log.info("---------------------推送全站图表信息失败------------------------------"); log.info("---------------------推送全站图表信息失败------------------------------");
} }
...@@ -1061,7 +1060,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -1061,7 +1060,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
}); });
Map<String, String> powerSqlMap = powerSqlList.stream().collect(Collectors.toMap(ESEquipments::getEquipmentNumber, ESEquipments::getValue)); Map<String, String> powerSqlMap = powerSqlList.stream().collect(Collectors.toMap(ESEquipments::getEquipmentNumber, ESEquipments::getValue));
Map<String, String> windSpeedSqlMap = windSpeedSqlList.stream().collect(Collectors.toMap(ESEquipments::getEquipmentNumber, ESEquipments::getValue)); Map<String, String> windSpeedSqlMap = windSpeedSqlList.stream().collect(Collectors.toMap(ESEquipments::getEquipmentNumber, ESEquipments::getValue));
windSqlSortList = windSqlList.stream().sorted(Comparator.comparing(ESEquipments::getEquipmentNumber,Comparator.comparing(Integer::parseInt))).collect(Collectors.toList()); windSqlSortList = windSqlList.stream().sorted(Comparator.comparing(ESEquipments::getEquipmentNumber, Comparator.comparing(Integer::parseInt))).collect(Collectors.toList());
Map<String, String> electricitySqlMap = electricitySqlList.stream().collect(Collectors.toMap(ESEquipments::getEquipmentNumber, ESEquipments::getValue)); Map<String, String> electricitySqlMap = electricitySqlList.stream().collect(Collectors.toMap(ESEquipments::getEquipmentNumber, ESEquipments::getValue));
ArrayList<Map<String, String>> resultList = new ArrayList<>(); ArrayList<Map<String, String>> resultList = new ArrayList<>();
for (int i = 0; i < windSqlSortList.size(); i++) { for (int i = 0; i < windSqlSortList.size(); i++) {
...@@ -1087,19 +1086,18 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -1087,19 +1086,18 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
} }
public ResultsData getAlarmEventList(int current, int size, String stationId) { public ResultsData getAlarmEventList(int current, int size, String stationId) {
LambdaQueryWrapper<AlarmEvent> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<AlarmEvent> queryWrapper = new LambdaQueryWrapper<>();
if(stationId!=null) if (stationId != null) {
{
queryWrapper.eq(AlarmEvent::getStationId, stationId); queryWrapper.eq(AlarmEvent::getStationId, stationId);
} }
Calendar calendar = Calendar.getInstance(); Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.DAY_OF_MONTH, -7); calendar.add(Calendar.DAY_OF_MONTH, -7);
queryWrapper.gt(AlarmEvent::getCreatedTime, calendar.getTime()); queryWrapper.gt(AlarmEvent::getCreatedTime, calendar.getTime());
int count = alarmEventMapper.selectCount(queryWrapper); int count = alarmEventMapper.selectCount(queryWrapper);
List<AlarmEventDto> alarmEventList = alarmEventMapper.getAlarmEventList(null, stationId,(current-1)*size,size,calendar.getTime()); List<AlarmEventDto> alarmEventList = alarmEventMapper.getAlarmEventList(null, stationId, (current - 1) * size, size, calendar.getTime());
// List<AlarmEventDto> sorrtedAlarmEventList = alarmEventList.stream().sorted(Comparator.comparing(AlarmEventDto::getCreatedTime).reversed()).collect(Collectors.toList()); // List<AlarmEventDto> sorrtedAlarmEventList = alarmEventList.stream().sorted(Comparator.comparing(AlarmEventDto::getCreatedTime).reversed()).collect(Collectors.toList());
// ArrayList<Map<String, String>> resultList = new ArrayList<>(); // ArrayList<Map<String, String>> resultList = new ArrayList<>();
...@@ -1125,34 +1123,52 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -1125,34 +1123,52 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
} }
public ResultsData getElectricQuantityList(int current, int size, String gatewayId, String stationType) { public ResultsData getElectricQuantityList(int current, int size, StationBasic stationBasic) {
Map<String, List<String>> queryCondtion = new HashMap<>(); Map<String, List<String>> queryCondtion = new HashMap<>();
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(gatewayId)); queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(stationBasic.getBoosterGatewayId()));
// queryCondtion.put(CommonConstans.QueryStringFrontMoudle, Arrays.asList("电量表计")); // queryCondtion.put(CommonConstans.QueryStringFrontMoudle, Arrays.asList("电量表计"));
Map<String, String> likeMap = new HashMap<>(); Map<String, String> likeMap = new HashMap<>();
likeMap.put(CommonConstans.QueryStringFrontMoudleNotKeyWord, "电量表计"); likeMap.put(CommonConstans.QueryStringFrontMoudleNotKeyWord, "电量表计");
List<ESEquipments> esEquipmentsList = commonServiceImpl.getListDataByCondtionsAndLike(queryCondtion, null, ESEquipments.class, likeMap); List<ESEquipments> esEquipmentsList = commonServiceImpl.getListDataByCondtionsAndLike(queryCondtion, null, ESEquipments.class, likeMap);
List<ESEquipments> windSqlList = esEquipmentsList.stream().filter(esEquipments -> !esEquipments.getDisplayName().equals("") && !esEquipments.getDisplayName().equals("检修状态")).collect(Collectors.toList()); List<ESEquipments> windSqlList = esEquipmentsList.stream().filter(esEquipments -> !esEquipments.getDisplayName().equals("") && !esEquipments.getDisplayName().equals("检修状态")).collect(Collectors.toList());
Map<String, List<ESEquipments>> maps = windSqlList.stream().collect(Collectors.groupingBy(ESEquipments::getSystemType));
ArrayList<Map<String, String>> resultList = new ArrayList<>(); ArrayList<Map<String, String>> resultList = new ArrayList<>();
ArrayList<Map<String, String>> resultList1 = new ArrayList<>(); ArrayList<Map<String, String>> resultList1 = new ArrayList<>();
for (Map.Entry<String, List<ESEquipments>> stringListEntry : maps.entrySet()) { List<String> nameList = new ArrayList<>();
Map<String, String> handleData = new HashMap<>();
Map<String,List<String>> originalData = new HashMap<>();
if ("FDZ".equals(stationBasic.getStationType())) {
handleData = windSqlList.stream().collect(Collectors.toMap(ESEquipments::getEquipmentIndexName, esEquipments -> String.format(CommonConstans.Threedecimalplaces, esEquipments.getValueF())));
nameList = CommonConstans.xiazaoElectricityMeter;
originalData = CommonConstans.xiazaoElectricityMeterPointSort;
} else {
handleData=windSqlList.stream().collect(Collectors.toMap(ESEquipments::getEquipmentIndexName, esEquipments -> String.format(CommonConstans.Twodecimalplaces, esEquipments.getValueF()*0.01)));
nameList = CommonConstans.taiheElectricityMeter;
originalData= CommonConstans.taiheElectricityMeterPointSort;
}
for (int i = 0; i < nameList.size(); i++) {
HashMap<String, String> stringStringHashMap = new HashMap<>(); HashMap<String, String> stringStringHashMap = new HashMap<>();
stringStringHashMap.put("name", stringListEntry.getKey()); String name = nameList.get(i);
for (ESEquipments indicatorsDto : stringListEntry.getValue()) { stringStringHashMap.put("name",name);
stringStringHashMap.put(ElectricQuantity.getCode(indicatorsDto.getDisplayName()), String.format("%.3f", ObjectUtils.isEmpty(indicatorsDto.getValueF()) ? 0.0 : indicatorsDto.getValueF())); Double electricityIndicator = 1.0;
List<String> dataList = originalData.get(name);
stringStringHashMap.put("zxzyg",handleData.get(dataList.get(0)));
stringStringHashMap.put("fxzyg",handleData.get(dataList.get(1)));
stringStringHashMap.put("zxzwg",handleData.get(dataList.get(2)));
stringStringHashMap.put("fxzwg",handleData.get(dataList.get(3)));
if(name.equals("夏雩线212主表")){
stringStringHashMap.put("zxzyg",String.format(CommonConstans.Threedecimalplaces,Double.valueOf(handleData.get(dataList.get(0)))*0.001));
stringStringHashMap.put("fxzyg",String.format(CommonConstans.Threedecimalplaces,Double.valueOf(handleData.get(dataList.get(1)))*0.001));
stringStringHashMap.put("zxzwg",String.format(CommonConstans.Threedecimalplaces,Double.valueOf(handleData.get(dataList.get(2)))*0.001));
stringStringHashMap.put("fxzwg",String.format(CommonConstans.Threedecimalplaces,Double.valueOf(handleData.get(dataList.get(3)))*0.001));
} }
if (stringListEntry.getKey().contains("SVG")) { if(name.equals("夏雩线212副表")){
resultList1.add(stringStringHashMap); stringStringHashMap.put("zxzyg",String.format(CommonConstans.Threedecimalplaces,Double.valueOf(handleData.get(dataList.get(0)))*0.01));
} else { stringStringHashMap.put("fxzyg",String.format(CommonConstans.Threedecimalplaces,Double.valueOf(handleData.get(dataList.get(1)))*0.01));
resultList.add(stringStringHashMap); stringStringHashMap.put("zxzwg",String.format(CommonConstans.Threedecimalplaces,Double.valueOf(handleData.get(dataList.get(2)))*0.01));
stringStringHashMap.put("fxzwg",String.format(CommonConstans.Threedecimalplaces,Double.valueOf(handleData.get(dataList.get(3)))*0.01));
} }
resultList.add(stringStringHashMap);
} }
Collator instance = Collator.getInstance(Locale.CHINA);
Collections.sort(resultList, (e1, e2) -> {
return instance.compare(e1.get("name"), e2.get("name"));
});
resultList.addAll(resultList1); resultList.addAll(resultList1);
//构建平台数据 //构建平台数据
DataGridMock DataGridMock = new DataGridMock(current, resultList.size(), false, current, resultList); DataGridMock DataGridMock = new DataGridMock(current, resultList.size(), false, current, resultList);
...@@ -1161,13 +1177,6 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -1161,13 +1177,6 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
ColModel colModelEventDesc = new ColModel("fxzyg", "fxzyg", "反向总有功", "反向总有功", "dataGrid", "fxzyg"); ColModel colModelEventDesc = new ColModel("fxzyg", "fxzyg", "反向总有功", "反向总有功", "dataGrid", "fxzyg");
ColModel colModelAlarmGroupName = new ColModel("zxzwg", "zxzwg", "正向总无功", "正向总无功", "dataGrid", "zxzwg"); ColModel colModelAlarmGroupName = new ColModel("zxzwg", "zxzwg", "正向总无功", "正向总无功", "dataGrid", "zxzwg");
ColModel colModelEventTime = new ColModel("fxzwg", "fxzwg", "反向总无功", "反向总无功", "dataGrid", "fxzwg"); ColModel colModelEventTime = new ColModel("fxzwg", "fxzwg", "反向总无功", "反向总无功", "dataGrid", "fxzwg");
if (null != stationType) {
colModelEventMovement = new ColModel("name", "name", "测量点", "测量点", "dataGrid", "name");
colModelStationName = new ColModel("zgxwg", "zgxwg", "正向无功总", "正向无功总", "dataGrid", "zgxwg");
colModelEventDesc = new ColModel("zzxwg", "zzxwg", "正向有功总", "正向有功总", "dataGrid", "zzxwg");
colModelAlarmGroupName = new ColModel("zrxwg", "zrxwg", "反向无功总", "反向无功总", "dataGrid", "zrxwg");
colModelEventTime = new ColModel("zfxyg", "zfxyg", "反向有功总", "反向有功总", "dataGrid", "zfxyg");
}
List<ColModel> listColModel = Arrays.asList(colModelEventMovement, colModelStationName, colModelEventDesc, colModelAlarmGroupName, colModelEventTime); List<ColModel> listColModel = Arrays.asList(colModelEventMovement, colModelStationName, colModelEventDesc, colModelAlarmGroupName, colModelEventTime);
ResultsData resultsData = new ResultsData(DataGridMock, listColModel); ResultsData resultsData = new ResultsData(DataGridMock, listColModel);
return resultsData; return resultsData;
...@@ -1676,6 +1685,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -1676,6 +1685,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
} }
return s; return s;
} }
public String keepFourDecimalPlaces(String value) { public String keepFourDecimalPlaces(String value) {
String s = "0.0000"; String s = "0.0000";
if (!ObjectUtils.isEmpty(value)) { if (!ObjectUtils.isEmpty(value)) {
...@@ -1687,6 +1697,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -1687,6 +1697,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
} }
return s; return s;
} }
public HashMap<String, Object> SpeedIndicator(String gatewayId, String equipmentNumber, String equipmentIndexName) { public HashMap<String, Object> SpeedIndicator(String gatewayId, String equipmentNumber, String equipmentIndexName) {
HashMap<String, Object> resultMap = new HashMap<>(); HashMap<String, Object> resultMap = new HashMap<>();
Map<String, List<String>> queryCondtion = new HashMap<>(); Map<String, List<String>> queryCondtion = new HashMap<>();
...@@ -1813,10 +1824,10 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -1813,10 +1824,10 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
List<ESEquipments> indicatorsDtos = collects.get(s); List<ESEquipments> indicatorsDtos = collects.get(s);
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("name", s); map.put("name", s);
if(s.split("-")[1].equals("A")){ if (s.split("-")[1].equals("A")) {
map.put("sort", s.split("-")[0]+"1"); map.put("sort", s.split("-")[0] + "1");
}else { } else {
map.put("sort", s.split("-")[0]+"2"); map.put("sort", s.split("-")[0] + "2");
} }
map.put("type", "兆能");//此处暂时未提供数据 待定 暂写死值 map.put("type", "兆能");//此处暂时未提供数据 待定 暂写死值
map.put("status", "1");//此处暂时未提供数据 待定 暂写死值 map.put("status", "1");//此处暂时未提供数据 待定 暂写死值
...@@ -1927,7 +1938,6 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { ...@@ -1927,7 +1938,6 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
} }
} }
List<String> list = Arrays.asList(equipNum.split(",")); List<String> list = Arrays.asList(equipNum.split(","));
list.forEach(e -> { list.forEach(e -> {
if (Integer.parseInt(e) == intNum) { if (Integer.parseInt(e) == intNum) {
statusMaps.add(map); statusMaps.add(map);
......
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