//对数据做分组(分组条件:组织+对象)
List> list2 = new ArrayList<>();
Map map1 = new HashMap<>();
map1.put("organization", "北京");
map1.put("object", "故宫");
map1.put("score", "90");
list2.add(map1);
Map map2 = new HashMap<>();
map2.put("organization", "北京");
map2.put("object", "故宫");
map2.put("personQty", "8万");
list2.add(map2);
Map map3 = new HashMap<>();
map3.put("organization", "南京");
map3.put("object", "博物院");
map3.put("score", "80");
list2.add(map3);
Map map4 = new HashMap<>();
map4.put("organization", "南京");
map4.put("object", "博物院");
map4.put("personQty", "3万");
list2.add(map4);
List> groupList = list2.stream().collect(Collectors.groupingBy(d -> d.get("organization")
+ "||" + d.get("object"))).entrySet()
.stream().map(d -> {
Map map = new HashMap<>();
map.put("entrustList", d.getValue());
map.put("groupKey", d.getKey());
return map;
}).collect(Collectors.toList());