zxl
2025-04-17 da269c70838314527ca3e5c281be54e19fde1b2f
提取方法
1个文件已修改
22 ■■■■ 已修改文件
ycl-server/src/main/java/com/ycl/platform/service/impl/CheckScoreServiceImpl.java 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-server/src/main/java/com/ycl/platform/service/impl/CheckScoreServiceImpl.java
@@ -180,15 +180,18 @@
        }
        //分数保留一位小数
        checkScores.stream().forEach(item -> item.setScore(item.getScore().setScale(1, RoundingMode.HALF_UP)));
        Map<Long, List<CheckScore>> map = checkScores.stream().collect(Collectors.groupingBy(CheckScore::getDeptId));
        log.error("map :{}",map);
        for (Map.Entry<Long, List<CheckScore>> entry : map.entrySet()) {
            List<CheckScore> tempList = getCheckScores(entry);
            // 迭代结束后,将新元素添加到原始列表中
            entry.getValue().addAll(tempList);
        }
        return map;
    }
    private List<CheckScore> getCheckScores(Map.Entry<Long, List<CheckScore>> entry) {
            List<CheckScore> tempList = new ArrayList<>(); // 临时存储需要添加的元素
            Iterator<CheckScore> iterator = entry.getValue().iterator();
            while (iterator.hasNext()) {
                CheckScore listCheckScore = iterator.next();
        for (CheckScore listCheckScore : entry.getValue()) {
                if (listCheckScore.getExamineCategory() == 1 && entry.getValue().size() == 1) {
                    CheckScore face = new CheckScore();
                    face.setExamineCategory((short) 2);
@@ -200,12 +203,7 @@
                    tempList.add(car);
                }
            }
            // 迭代结束后,将新元素添加到原始列表中
            entry.getValue().addAll(tempList);
        }
        return map;
        return tempList;
    }
    private void getCheckScore(CheckScore checkScore) {