|
@@ -995,19 +995,24 @@ public class PaperReportService {
|
995
|
995
|
List<PaperPointStuScoreVo> gradepointstulist = gradestulist.stream().filter(s -> s.getPointid().equals(pointid)).collect(Collectors.toList());
|
996
|
996
|
|
997
|
997
|
List<PaperPointStuScoreVo> pointstuscorelist = new ArrayList<>(); // 知识点下多个试题,处理成单个学生总分值情况
|
998
|
|
- Map<Integer, List<PaperPointStuScoreVo>> pointstuscoremap = gradepointstulist.stream().collect(Collectors.groupingBy(PaperPointStuScoreVo::getStudentid));
|
999
|
|
- for (Map.Entry<Integer, List<PaperPointStuScoreVo>> entry : pointstuscoremap.entrySet()) {
|
1000
|
|
- List<PaperPointStuScoreVo> stuscorelist = entry.getValue();
|
1001
|
|
- Double stuscore = stuscorelist.stream().mapToDouble(PaperPointStuScoreVo::getStuscore).sum();
|
1002
|
|
- stuscore = N_Utils.formatDouble(stuscore, 1);
|
1003
|
|
-
|
1004
|
|
- PaperPointStuScoreVo sscorevofirst = stuscorelist.get(0);
|
1005
|
|
- PaperPointStuScoreVo sscorevo = new PaperPointStuScoreVo();
|
1006
|
|
- sscorevo.setStudentid(sscorevofirst.getStudentid());
|
1007
|
|
- sscorevo.setClassid(sscorevofirst.getClassid());
|
1008
|
|
- sscorevo.setStuscore(stuscore);
|
1009
|
|
- sscorevo.setSchoolid(sscorevofirst.getSchoolid());
|
1010
|
|
- pointstuscorelist.add(sscorevo);
|
|
998
|
+ //先按照班级进行分组,防止一个学生在多个班级收到多份作业
|
|
999
|
+ Map<Integer,List<PaperPointStuScoreVo>> pointclassscoremap = gradepointstulist.stream().collect(Collectors.groupingBy(PaperPointStuScoreVo::getClassid));
|
|
1000
|
+ for(Map.Entry<Integer, List<PaperPointStuScoreVo>> classEntry : pointclassscoremap.entrySet()){
|
|
1001
|
+ List<PaperPointStuScoreVo> pointstuscoreList = classEntry.getValue();
|
|
1002
|
+ Map<Integer, List<PaperPointStuScoreVo>> pointstuscoremap = pointstuscoreList.stream().collect(Collectors.groupingBy(PaperPointStuScoreVo::getStudentid));
|
|
1003
|
+ for (Map.Entry<Integer, List<PaperPointStuScoreVo>> entry : pointstuscoremap.entrySet()) {
|
|
1004
|
+ List<PaperPointStuScoreVo> stuscorelist = entry.getValue();
|
|
1005
|
+ Double stuscore = stuscorelist.stream().mapToDouble(PaperPointStuScoreVo::getStuscore).sum();
|
|
1006
|
+ stuscore = N_Utils.formatDouble(stuscore, 1);
|
|
1007
|
+
|
|
1008
|
+ PaperPointStuScoreVo sscorevofirst = stuscorelist.get(0);
|
|
1009
|
+ PaperPointStuScoreVo sscorevo = new PaperPointStuScoreVo();
|
|
1010
|
+ sscorevo.setStudentid(sscorevofirst.getStudentid());
|
|
1011
|
+ sscorevo.setClassid(sscorevofirst.getClassid());
|
|
1012
|
+ sscorevo.setStuscore(stuscore);
|
|
1013
|
+ sscorevo.setSchoolid(sscorevofirst.getSchoolid());
|
|
1014
|
+ pointstuscorelist.add(sscorevo);
|
|
1015
|
+ }
|
1011
|
1016
|
}
|
1012
|
1017
|
|
1013
|
1018
|
Map<Integer, List<PaperPointStuScoreVo>> schoolStuMap = pointstuscorelist.stream().collect(Collectors.groupingBy(PaperPointStuScoreVo::getSchoolid));
|