Commit 7d01300f by liuyang

2024-10-19 生产驾驶舱接口调整

parent d68b7dfa
...@@ -314,20 +314,22 @@ public class ServiceHPBI003 extends ServiceBase { ...@@ -314,20 +314,22 @@ public class ServiceHPBI003 extends ServiceBase {
} }
List<Map> result = new ArrayList<>(); List<Map> result = new ArrayList<>();
List<Map> listMap = DaoBase.getInstance().query("HPBI003.queryDayWts", params, 0,100); List<Map> listMap = DaoBase.getInstance().query("HPBI003.queryDayWts", params, 0,100);
Map<Object , Map<Object,List<Map>>> mapList = listMap.stream().collect(Collectors.groupingBy(map -> map.get("date"),Collectors.groupingBy(map -> map.get("series")))); List listMap2 = listMap.stream().map(map -> map.get("date")).sorted().distinct().collect(Collectors.toList());
for (Object key: mapList.keySet()) { Map<Object, List<Map>> listMap1 = listMap.stream().collect(Collectors.groupingBy(m -> m.get("series")));
for (Object key: listMap1.keySet()) {
Map<Object, Object> map = new HashMap<>(); Map<Object, Object> map = new HashMap<>();
List<Map> list1 = new ArrayList<>(); map.put("name", key);
Map<Object, List<Map>> listMap1 = mapList.get(key); map.put("type", "line");
for (Object key1: listMap1.keySet()) { map.put("stack", "Total");
Map<Object, Object> map2 = new HashMap<>(); List list1 = new ArrayList<>();
map2.put(key1, listMap1.get(key1).stream().map(m -> m.get("wt")).collect(Collectors.toList())); for (Map map1: listMap1.get(key)) {
list1.add(map2); list1.add(map1.get("wt"));
} }
map.put(key, list1); map.put("data", list1);
result.add(map); result.add(map);
} }
inInfo.set("date", mapList.keySet()); inInfo.set("date", listMap2);
inInfo.set("name", listMap1.keySet());
inInfo.set("result", result); inInfo.set("result", result);
return inInfo; return inInfo;
} }
......
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