java8代码优化private CollectionListListObject getSheetDatassssfinal String activityId final ListMidLevelDemocracyEvaluationVO midLevelDemocracyEvaluations = getMidLevelDemocracyEvaluationsactivity
<p>private Collection<List<List<Object>>> getSheetDatassss(final String activityId) {
final List<MidLevelDemocracyEvaluationVO> midLevelDemocracyEvaluations = getMidLevelDemocracyEvaluations(activityId);
final Map<Integer, List<List<Object>>> collect = midLevelDemocracyEvaluations.stream()
.collect(Collectors.groupingBy(
MidLevelDemocracyEvaluationVO::getOrgSort,
Collectors.mapping(this::createDataObjects, Collectors.toList())));
return collect.entrySet().stream()
.sorted(Map.Entry.comparingByKey())
.map(Map.Entry::getValue)
.collect(Collectors.toList());
}</p>
<p>private List<List<Object>> createDataObjects(final MidLevelDemocracyEvaluationVO midLevelEvaluation) {
return midLevelEvaluation.getExaminerInfos().stream()
.map(examinerInfo -> Arrays.asList(
midLevelEvaluation.getAppraiseeOrgName(),
midLevelEvaluation.getAppraiseeName(),
midLevelEvaluation.getPositionSign(),
examinerInfo.getExaminerName(),
examinerInfo.getExaminerOrgName(),
examinerInfo.getWeight(),
examinerInfo.getWeightGroup()))
.collect(Collectors.toList());</p>
原文地址: http://www.cveoy.top/t/topic/isjQ 著作权归作者所有。请勿转载和采集!