1、根据id组合两个LIst<Map>
List<Map> list1 = new ArrayList<>();
List<Map> list2 = new ArrayList<>();
List<Map> collection = new ArrayList<>();
collection = list1.stream().map(map -> list2 .stream()
.filter(m -> Objects.equals(m.get("id"), map.get("id")))
.findFirst().map(m -> { map.putAll(m);return map;}).orElse(null))
.filter(Objects::nonNull).collect(Collectors.toList());
2、集合设置序号
list.stream().forEach(map -> map.put("index",list.indexOf(map) + 1+""));