List<Map<String, Object>> 分组
//根据工号进行分组List<Map<String, Object>> dataList = ((PageResult<Map<String, Object>>) tuple.e2).getItems();Map<String, List<Map<String, Object>>> groupByEmpId= dataList.stream().collect(groupingBy(map -> map.get("emp_id").toString()));
List<Map<String, Object>>排序
//排序获取id最大的数据List<Map<String, Object>> result = new ArrayList<Map<String, Object>>();for(Map.Entry<String, List<Map<String, Object>>> entry : groupByEmpId.entrySet()){List<Map<String, Object>> mapValue = entry.getValue();Collections.sort(mapValue, new Comparator<Map<String, Object>>() {@Overridepublic int compare(Map<String, Object> o1, Map<String, Object> o2) {//此处o2.get("id")返回BigInteger类型转Integer需要先转String中转return Integer.valueOf(o2.get("id").toString()) - Integer.valueOf(o1.get("id").toString());}});result.add(CollectionUtils.isEmpty(mapValue.get(0)) ? null : mapValue.get(0)) ;}