Commit 7201cd54 authored by wujiang's avatar wujiang

提交代码

parent ecf04911
...@@ -1125,19 +1125,31 @@ public class LargeScreenImpl { ...@@ -1125,19 +1125,31 @@ public class LargeScreenImpl {
values.add(String.format(CommonConstans.Twodecimalplaces, vl)); values.add(String.format(CommonConstans.Twodecimalplaces, vl));
} }
String max = String.format(CommonConstans.Twodecimalplaces, if(!values.isEmpty())
values.stream().mapToDouble(Double::parseDouble).max().getAsDouble()); {
String min = String.format(CommonConstans.Twodecimalplaces, String max = String.format(CommonConstans.Twodecimalplaces,
values.stream().mapToDouble(Double::parseDouble).min().getAsDouble()); values.stream().mapToDouble(Double::parseDouble).max().getAsDouble());
String mean = String.format(CommonConstans.Twodecimalplaces, String min = String.format(CommonConstans.Twodecimalplaces,
values.stream().mapToDouble(Double::parseDouble).average().getAsDouble()); values.stream().mapToDouble(Double::parseDouble).min().getAsDouble());
activePowerInfo.put("mean", mean); String mean = String.format(CommonConstans.Twodecimalplaces,
activePowerInfo.put("max", max); values.stream().mapToDouble(Double::parseDouble).average().getAsDouble());
activePowerInfo.put("min", min); activePowerInfo.put("mean", mean);
activePowerInfo.put("maxTime", time.get(values.lastIndexOf(max))); activePowerInfo.put("max", max);
activePowerInfo.put("minTime", time.get(values.lastIndexOf(min))); activePowerInfo.put("min", min);
activePowerInfo.put("load", String.format(CommonConstans.Twodecimalplaces, activePowerInfo.put("maxTime", time.get(values.lastIndexOf(max)));
Double.valueOf(values.get(values.size() - 1)) / installedCapacity.get())); activePowerInfo.put("minTime", time.get(values.lastIndexOf(min)));
activePowerInfo.put("load", String.format(CommonConstans.Twodecimalplaces,
Double.valueOf(values.get(values.size() - 1)) / installedCapacity.get()));
}else
{
activePowerInfo.put("mean", null);
activePowerInfo.put("max", null);
activePowerInfo.put("min", null);
activePowerInfo.put("maxTime", null);
activePowerInfo.put("minTime", null);
activePowerInfo.put("load",null);
}
List<Map<String, Object>> seriesData = new ArrayList<>(); List<Map<String, Object>> seriesData = new ArrayList<>();
Map<String, Object> map3 = new HashMap<>(); Map<String, Object> map3 = new HashMap<>();
......
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