final List evaluationExaminers = midLevelDemocracyEvaluations.stream() .skip(1) // Skip the first element .peek(currentMiddleEvaluation -> { if (StringUtils.isBlank(currentMiddleEvaluation.getAppraiseeName())) { setMidLevelEvaluationInfo(standardMiddleEvaluation, currentMiddleEvaluation, templateCode); throw new NoSuchElementException(); // Break the loop } evaluationExaminers.add(createEvaluationExaminer(activityId, loginUserPojo, currentMiddleEvaluation, appraiseeEmpCodeMap, examinerEmpMap)); leaderIncorruptibleEvaluationConvertMapper.copyMidLevelEvalaution(currentMiddleEvaluation, standardMiddleEvaluation); }) .collect(Collectors.toList()); return evaluationExaminers;

Java代码优化:使用Stream简化中层民主测评数据处理

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

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