Commit cd006ba7 authored by wujiang's avatar wujiang

修改获取离散率

parent 302fede2
......@@ -1680,6 +1680,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
url = pictureUrl + urls[0];
} else {
url = pictureUrl + urls[1];
;
}
photoUrls.put(datass.getDisplayName().split("_")[0] + "jddwz", url);
}
......@@ -1725,14 +1726,14 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
}
public HashMap<String, Object> getyw(String gatewayId) {
HashMap<String, Object> resultMap = new HashMap<>();
Map<String, List<String>> queryCondtion = new HashMap<>();
queryCondtion.put(CommonConstans.QueryStringGateWayId, Arrays.asList(gatewayId));
queryCondtion.put(CommonConstans.QueryStringSystemTypeKeyword, Arrays.asList("模拟量"));
Map<String,String> likeMap = new HashMap<>();
likeMap.put(CommonConstans.QueryStringFrontMoudle,"1主变");
List<ESEquipments> esEquipmentsList = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class,likeMap);
queryCondtion.put(CommonConstans.QueryStringFrontMoudle, Arrays.asList("1主变"));
queryCondtion.put(CommonConstans.QueryStringSystemType, Arrays.asList("模拟量"));
List<ESEquipments> esEquipmentsList = commonServiceImpl.getListDataByCondtions(queryCondtion, null, ESEquipments.class);
// TODO: 2023/7/14 数据未整理 ---> 油面温1 油面温2 绕组温度
resultMap.put("value1", "0.0");
resultMap.put("value2", "0.0");
......@@ -1740,13 +1741,13 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
resultMap.put("value4", "0.0");
esEquipmentsList.forEach(item -> {
if ("档位".equals(item.getDisplayName())) {
resultMap.put("value4", String.format("%.0f",item.getValueF()));
resultMap.put("value4", item.getValue());
} else if ("油面温1".equals(item.getDisplayName())) {
resultMap.put("value1", String.format("%.1f",item.getValueF()));
resultMap.put("value1", item.getValue());
} else if ("油面温2".equals(item.getDisplayName())) {
resultMap.put("value2", String.format("%.1f",item.getValueF()));
resultMap.put("value2", item.getValue());
} else if ("绕组温度".equals(item.getDisplayName())) {
resultMap.put("value3", String.format("%.1f",item.getValueF()));
resultMap.put("value3", item.getValue());
}
});
return resultMap;
......@@ -1954,58 +1955,67 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
public ResultsData collectingBox(String gatewayId, int current, int size) {
ArrayList<Map<String, Object>> resultList = new ArrayList<>();
Map<String, List<String>> queryConditon = new HashMap<>();
queryConditon.put(CommonConstans.QueryStringGateWayId, Arrays.asList(gatewayId));
Map<String, String> likeMap = new HashMap<>();
likeMap.put(CommonConstans.QueryStringEquipmentIndexNameNotKeyword, "路电流");
List<ESEquipments> list = commonServiceImpl.getListDataByCondtionsAndLike(queryConditon, null, ESEquipments.class, likeMap);
Map<String, List<String>> queryConditon1 = new HashMap<>();
queryConditon1.put(CommonConstans.QueryStringGateWayId, Arrays.asList(gatewayId));
Map<String, String> likeMap1 = new HashMap<>();
likeMap1.put(CommonConstans.QueryStringEquipmentIndexNameNotKeyword, "平均电流");
List<ESEquipments> list1 = commonServiceImpl.getListDataByCondtionsAndLike(queryConditon, null, ESEquipments.class, likeMap1);
if (!ValidationUtil.isEmpty(list)) {
Map<String, List<ESEquipments>> collect = list.stream().collect(Collectors.groupingBy(ESEquipments::getEquipmentNumber));
for (String s : collect.keySet()) {
List<ESEquipments> indicatorsDtos = collect.get(s);
HashMap<String, Object> resultMap = new HashMap<>();
Double avageValue = 0.0;
avageValue = indicatorsDtos.stream().filter(e -> !ObjectUtils.isEmpty(e.getValueF())).mapToDouble(l -> Double.parseDouble(l.getValueF().toString())).average().getAsDouble();
avageValue = Double.valueOf(String.format(CommonConstans.Twodecimalplaces, avageValue));
resultMap.put("avg", avageValue);
String[] name = s.split("-");
resultMap.put("zz", "#" + name[0] + "子阵");
resultMap.put("nbq", "逆变器" + name[1]);
resultMap.put("hlx", "#" + name[2] + "汇流箱");
double lsv = 0.00;
if (!ValidationUtil.isEmpty(list1)) {
List<ESEquipments> dtos = list1.stream().filter(e -> e.getEquipmentNumber().equals(s)).collect(Collectors.toList());
if (!ValidationUtil.isEmpty(dtos)) {
for (ESEquipments esEquipments : indicatorsDtos) {
lsv = lsv + Math.pow(esEquipments.getValueF() - avageValue, 2);
}
}
lsv = lsv / indicatorsDtos.size();
lsv = Math.sqrt(lsv);
}
resultMap.put("lsv", String.format(CommonConstans.Twodecimalplaces, lsv));
resultList.add(resultMap);
}
}
ArrayList<Map<String, Object>> resultList = getLSV(gatewayId);
//构建平台数据
DataGridMock DataGridMock = new DataGridMock(current, resultList.size(), false, current, resultList);
ColModel colModelEventMovement = new ColModel("zz", "zz", "子阵", "子阵", "dataGrid", "zz");
ColModel colModelStationName = new ColModel("nbq", "nbq", "逆变器", "逆变器", "dataGrid", "nvq");
ColModel colModelEventDesc = new ColModel("hlx", "hlx", "汇流箱", "汇流箱", "dataGrid", "hlx");
ColModel colModelAlarmGroupName = new ColModel("avg", "avg", "支路电流平均值", "支路电流平均值", "dataGrid", "avg");
ColModel colModelEventTime = new ColModel("lsl", "lsv", "支路电流离散率", "支路电流离散率", "dataGrid", "lsv");
ColModel colModelEventTime = new ColModel("lsv", "lsv", "支路电流离散率", "支路电流离散率", "dataGrid", "lsv");
List<ColModel> listColModel = Arrays.asList(colModelEventMovement, colModelStationName, colModelEventDesc, colModelAlarmGroupName, colModelEventTime);
ResultsData resultsData = new ResultsData(DataGridMock, listColModel);
return resultsData;
}
public ArrayList<Map<String, Object>> getLSV(String gatewayId)
{
ArrayList<Map<String, Object>> resultList = new ArrayList<>();
Map<String, List<String>> queryConditon = new HashMap<>();
queryConditon.put(CommonConstans.QueryStringGateWayId, Arrays.asList(gatewayId));
Map<String, String> likeMap = new HashMap<>();
likeMap.put(CommonConstans.QueryStringEquipmentIndexNameNotKeyword, "路电流");
List<ESEquipments> list = commonServiceImpl.getListDataByCondtionsAndLike(queryConditon, null, ESEquipments.class, likeMap);
Map<String, List<String>> queryConditon1 = new HashMap<>();
queryConditon1.put(CommonConstans.QueryStringGateWayId, Arrays.asList(gatewayId));
Map<String, String> likeMap1 = new HashMap<>();
likeMap1.put(CommonConstans.QueryStringEquipmentIndexNameNotKeyword, "平均电流");
List<ESEquipments> list1 = commonServiceImpl.getListDataByCondtionsAndLike(queryConditon, null, ESEquipments.class, likeMap1);
if (!ValidationUtil.isEmpty(list)) {
Map<String, List<ESEquipments>> collect = list.stream().collect(Collectors.groupingBy(ESEquipments::getEquipmentNumber));
for (String s : collect.keySet()) {
List<ESEquipments> indicatorsDtos = collect.get(s);
HashMap<String, Object> resultMap = new HashMap<>();
Double avageValue = 0.0;
avageValue = indicatorsDtos.stream().filter(e -> !ObjectUtils.isEmpty(e.getValueF())).mapToDouble(l -> Double.parseDouble(l.getValueF().toString())).average().getAsDouble();
avageValue = Double.valueOf(String.format(CommonConstans.Twodecimalplaces, avageValue));
resultMap.put("avg", avageValue);
String[] name = s.split("-");
resultMap.put("zz", "#" + name[0] + "子阵");
resultMap.put("nbq", "逆变器" + name[1]);
resultMap.put("hlx", "#" + name[2] + "汇流箱");
double lsv = 0.00;
if (!ValidationUtil.isEmpty(list1)) {
List<ESEquipments> dtos = list1.stream().filter(e -> e.getEquipmentNumber().equals(s)).collect(Collectors.toList());
if (!ValidationUtil.isEmpty(dtos)) {
for (ESEquipments esEquipments : indicatorsDtos) {
lsv = lsv + Math.pow(esEquipments.getValueF() - avageValue, 2);
}
}
lsv = lsv / indicatorsDtos.size();
lsv = Math.sqrt(lsv);
}
resultMap.put("lsv", String.format(CommonConstans.Twodecimalplaces, lsv));
resultList.add(resultMap);
}
}
return resultList;
}
public List<Map<String, Object>> solarPowerOperation(String gatewayId) {
......
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