下面是实现代码:
// 需拆分的集合
List<ZLDXXEntity> list = JSONObject.parseArray(jsonStr, ZLDXXEntity.class);
// 保存拆分数据的集合
List<List<ZLDXXEntity>> sumList = new ArrayList<>();
// 进行拆分处理
list.stream().collect(Collectors.groupingBy(ZLDXXEntity::getZLDH, Collectors.toList()))
.forEach((accountId, shopProductVoList) -> sumList.add(shopProductVoList));
System.out.println(JSONObject.toJSONString(sumList));