<p>private Collection&lt;List&lt;List<Object>&gt;&gt; getSheetDatas(final String activityId) {\n    final List<MidLevelDemocracyEvaluationVO> midLevelDemocracyEvaluations = getMidLevelDemocracyEvaluations(activityId);\n    final Map&lt;Integer, List&lt;List<Object>&gt;&gt; collect = CollectionUtils.emptyIfNull(midLevelDemocracyEvaluations)\n        .stream()\n        .collect(Collectors.groupingBy(\n            MidLevelDemocracyEvaluationVO::getOrgSort,\n            LinkedHashMap::new,\n            Collectors.mapping(this::createDataObjects, Collectors.toList())));\n    return collect.values();\n}</p>
Java 代码优化:使用 Stream API 简化数据处理

原文地址: https://www.cveoy.top/t/topic/p9Sa 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录