|
@@ -790,7 +790,7 @@ public class EReportGenerateQuestionService {
|
790
|
790
|
// 单个知识点学生得分情况:一个知识对应一个或多个试题,
|
791
|
791
|
List<ERPointStuScoreVo> gradepointstulist = gradestulist.stream().filter(s -> s.getPointid().equals(pointid)).collect(Collectors.toList());
|
792
|
792
|
|
793
|
|
- List<ERPointStuScoreVo> pointstuscorelist = new ArrayList<>(); // 知识点下多个试题,处理成单个学生总分值情况
|
|
793
|
+ List<ERPointStuScoreVo> pointstuscorelistZero = new ArrayList<>(); // 知识点下多个试题,处理成单个学生总分值情况
|
794
|
794
|
Map<Integer, List<ERPointStuScoreVo>> pointstuscoremap = gradepointstulist.stream().collect(Collectors.groupingBy(ERPointStuScoreVo::getStudentid));
|
795
|
795
|
for (Map.Entry<Integer, List<ERPointStuScoreVo>> entry : pointstuscoremap.entrySet()) {
|
796
|
796
|
List<ERPointStuScoreVo> stuscorelist = entry.getValue();
|
|
@@ -798,59 +798,78 @@ public class EReportGenerateQuestionService {
|
798
|
798
|
stuscore = N_Utils.formatDouble(stuscore, 1);
|
799
|
799
|
ERPointStuScoreVo sscorevofirst = stuscorelist.get(0);
|
800
|
800
|
ERPointStuScoreVo sscorevo = new ERPointStuScoreVo();
|
|
801
|
+ sscorevo.setStupaperscore(sscorevofirst.getStupaperscore());
|
801
|
802
|
sscorevo.setStudentid(sscorevofirst.getStudentid());
|
802
|
803
|
sscorevo.setClassid(sscorevofirst.getClassid());
|
803
|
804
|
sscorevo.setStuscore(stuscore);
|
804
|
|
- pointstuscorelist.add(sscorevo);
|
|
805
|
+ pointstuscorelistZero.add(sscorevo);
|
|
806
|
+ }
|
|
807
|
+
|
|
808
|
+ List<ERPointStuScoreVo> pointstuscorelist = new ArrayList<>();
|
|
809
|
+ if(stuzero == 0){
|
|
810
|
+ //如果为0:0分学生不参与统计
|
|
811
|
+ pointstuscorelist = pointstuscorelistZero.stream().filter(s -> s.getStupaperscore() > 0).collect(Collectors.toList());
|
|
812
|
+ }else {
|
|
813
|
+ pointstuscorelist.addAll(pointstuscorelistZero);
|
|
814
|
+ }
|
|
815
|
+
|
|
816
|
+ Double gstuscore = 0D;
|
|
817
|
+ Double gavgscore = 0D;
|
|
818
|
+ Double gsrate = 0D;
|
|
819
|
+ if(pointstuscorelist.size() > 0){
|
|
820
|
+ gstuscore = pointstuscorelist.stream().mapToDouble(ERPointStuScoreVo::getStuscore).sum();
|
|
821
|
+ gstuscore = N_Utils.formatDouble(gstuscore, 1);
|
|
822
|
+ gavgscore = N_Utils.getDoubleDivideForAvg(gstuscore, pointstuscorelist.size());
|
|
823
|
+ gsrate = N_Utils.getDoubleDivideAndMulitiply(gstuscore, pointscore * pointstuscorelist.size());
|
805
|
824
|
}
|
806
|
825
|
|
807
|
|
- Double gstuscore = pointstuscorelist.stream().mapToDouble(ERPointStuScoreVo::getStuscore).sum();
|
808
|
|
- gstuscore = N_Utils.formatDouble(gstuscore, 1);
|
809
|
|
- Double gavgscore = N_Utils.getDoubleDivideForAvg(gstuscore, pointstuscorelist.size());
|
810
|
|
- Double gsrate = N_Utils.getDoubleDivideAndMulitiply(gstuscore, pointscore * pointstuscorelist.size());
|
811
|
826
|
|
812
|
827
|
for (Map classm : classes) {
|
813
|
828
|
Integer classid = Integer.parseInt(classm.get("classid").toString());
|
814
|
829
|
List<ERPointStuScoreVo> classpointstulist = pointstuscorelist.stream().filter(s -> s.getClassid().equals(classid)).collect(Collectors.toList());
|
815
|
|
- if (N_Utils.isListNotEmpty(classpointstulist)) {
|
816
|
|
- Double cstuscore = classpointstulist.stream().mapToDouble(ERPointStuScoreVo::getStuscore).sum();
|
|
830
|
+ List<ERPointStuScoreVo> classpointstulistZero = pointstuscorelistZero.stream().filter(s -> s.getClassid().equals(classid)).collect(Collectors.toList());
|
|
831
|
+
|
|
832
|
+ Double cstuscore = 0D;
|
|
833
|
+ Double cavgscore = 0D;
|
|
834
|
+ Double csrate = 0D;
|
|
835
|
+ if (N_Utils.isListNotEmpty(classpointstulist) && classpointstulist.size() > 0) {
|
|
836
|
+ cstuscore = classpointstulist.stream().mapToDouble(ERPointStuScoreVo::getStuscore).sum();
|
817
|
837
|
cstuscore = N_Utils.formatDouble(cstuscore, 1);
|
818
|
|
-// Double cscore = classpointstulist.stream().mapToDouble(ERPointStuScoreVo::getScore).sum();
|
819
|
|
- Double cavgscore = N_Utils.getDoubleDivideForAvg(cstuscore, classpointstulist.size());
|
820
|
|
- Double csrate = N_Utils.getDoubleDivideAndMulitiply(cstuscore, pointscore * classpointstulist.size());
|
821
|
|
-
|
822
|
|
- ERclassPoint eRclassPoint = new ERclassPoint();
|
823
|
|
- eRclassPoint.setExamid(examPaperClassVo.getExamid());
|
824
|
|
- eRclassPoint.setClassid(classid);
|
825
|
|
- eRclassPoint.setEpid(examPaperClassVo.getEpid());
|
826
|
|
- eRclassPoint.setSubjectid(examPaperClassVo.getSubjectid());
|
827
|
|
- eRclassPoint.setPointid(pointid);
|
828
|
|
- eRclassPoint.setPointname(pointname);
|
829
|
|
- eRclassPoint.setScore(pointscore);
|
830
|
|
- eRclassPoint.setSrate(pointrate);
|
831
|
|
- eRclassPoint.setGradescore(gstuscore);
|
832
|
|
- eRclassPoint.setGradeavgscore(gavgscore);
|
833
|
|
- eRclassPoint.setGradesrate(gsrate);
|
834
|
|
- eRclassPoint.setClassscore(cstuscore);
|
835
|
|
- eRclassPoint.setClassavgscore(cavgscore);
|
836
|
|
- eRclassPoint.setClasssrate(csrate);
|
837
|
|
- eRclassPoint.setQns(orderstr);
|
838
|
|
- cpointlist.add(eRclassPoint);
|
839
|
|
-
|
840
|
|
- // 遍历单个学生
|
841
|
|
- for (ERPointStuScoreVo stu : classpointstulist) {
|
842
|
|
- ERstudentPoint erstupoint = new ERstudentPoint();
|
843
|
|
- erstupoint.setExamid(examPaperClassVo.getExamid());
|
844
|
|
- erstupoint.setSubjectid(examPaperClassVo.getSubjectid());
|
845
|
|
- erstupoint.setEpid(examPaperClassVo.getEpid());
|
846
|
|
- erstupoint.setStudentid(stu.getStudentid());
|
847
|
|
- erstupoint.setClassid(classid);
|
848
|
|
- erstupoint.setPointid(pointid);
|
849
|
|
- erstupoint.setPointname(pointname);
|
850
|
|
- erstupoint.setStuscore(stu.getStuscore());
|
851
|
|
- erstupoint.setStusrate(N_Utils.getDoubleDivideAndMulitiply(stu.getStuscore(), pointscore));
|
852
|
|
- stupointlist.add(erstupoint);
|
853
|
|
- }
|
|
838
|
+ cavgscore = N_Utils.getDoubleDivideForAvg(cstuscore, classpointstulist.size());
|
|
839
|
+ csrate = N_Utils.getDoubleDivideAndMulitiply(cstuscore, pointscore * classpointstulist.size());
|
|
840
|
+ }
|
|
841
|
+
|
|
842
|
+ ERclassPoint eRclassPoint = new ERclassPoint();
|
|
843
|
+ eRclassPoint.setExamid(examPaperClassVo.getExamid());
|
|
844
|
+ eRclassPoint.setClassid(classid);
|
|
845
|
+ eRclassPoint.setEpid(examPaperClassVo.getEpid());
|
|
846
|
+ eRclassPoint.setSubjectid(examPaperClassVo.getSubjectid());
|
|
847
|
+ eRclassPoint.setPointid(pointid);
|
|
848
|
+ eRclassPoint.setPointname(pointname);
|
|
849
|
+ eRclassPoint.setScore(pointscore);
|
|
850
|
+ eRclassPoint.setSrate(pointrate);
|
|
851
|
+ eRclassPoint.setGradescore(gstuscore);
|
|
852
|
+ eRclassPoint.setGradeavgscore(gavgscore);
|
|
853
|
+ eRclassPoint.setGradesrate(gsrate);
|
|
854
|
+ eRclassPoint.setClassscore(cstuscore);
|
|
855
|
+ eRclassPoint.setClassavgscore(cavgscore);
|
|
856
|
+ eRclassPoint.setClasssrate(csrate);
|
|
857
|
+ eRclassPoint.setQns(orderstr);
|
|
858
|
+ cpointlist.add(eRclassPoint);
|
|
859
|
+
|
|
860
|
+ // 遍历单个学生
|
|
861
|
+ for (ERPointStuScoreVo stu : classpointstulistZero) {
|
|
862
|
+ ERstudentPoint erstupoint = new ERstudentPoint();
|
|
863
|
+ erstupoint.setExamid(examPaperClassVo.getExamid());
|
|
864
|
+ erstupoint.setSubjectid(examPaperClassVo.getSubjectid());
|
|
865
|
+ erstupoint.setEpid(examPaperClassVo.getEpid());
|
|
866
|
+ erstupoint.setStudentid(stu.getStudentid());
|
|
867
|
+ erstupoint.setClassid(classid);
|
|
868
|
+ erstupoint.setPointid(pointid);
|
|
869
|
+ erstupoint.setPointname(pointname);
|
|
870
|
+ erstupoint.setStuscore(stu.getStuscore());
|
|
871
|
+ erstupoint.setStusrate(N_Utils.getDoubleDivideAndMulitiply(stu.getStuscore(), pointscore));
|
|
872
|
+ stupointlist.add(erstupoint);
|
854
|
873
|
}
|
855
|
874
|
}
|
856
|
875
|
}
|
|
@@ -922,7 +941,6 @@ public class EReportGenerateQuestionService {
|
922
|
941
|
Map<Integer, List<EPaperStudentQuestion>> stuQuesMap = levelstuquelist.stream().collect(Collectors.groupingBy(EPaperStudentQuestion::getStudentid));
|
923
|
942
|
for (Map.Entry<Integer, List<EPaperStudentQuestion>> entry : stuQuesMap.entrySet()) {
|
924
|
943
|
List<EPaperStudentQuestion> stuqueslist = entry.getValue();
|
925
|
|
- log.error("key:" + entry.getKey());
|
926
|
944
|
EPaperStudentQuestion pfirst = stuqueslist.get(0);
|
927
|
945
|
EPaperStudentQuestion pstq = new EPaperStudentQuestion();
|
928
|
946
|
pstq.setStupaperscore(pfirst.getStupaperscore());
|