|
@@ -890,6 +890,380 @@ public class EReportGenerateService {
|
890
|
890
|
eRclassRankMapper.insertList(rclassRankList);
|
891
|
891
|
}
|
892
|
892
|
|
|
893
|
+ //单科等级分布
|
|
894
|
+ public void setSubjectRank(Integer examid, String subjectid, Integer createid, List<ERrank> rranks, Integer ranktype) {
|
|
895
|
+ Double pscore = eReportGenerateMapper.getScoreByExamAndSubjectId(examid, subjectid);//获取试卷分数
|
|
896
|
+ List<ERstudent> students = ePaperStudentMapper.listByExamAndSubjectId(examid, subjectid);//考试试卷学生
|
|
897
|
+ List<Integer> userids = students.stream().map(ERstudent::getStudentid).distinct().collect(Collectors.toList());
|
|
898
|
+ List<UserVo> users = userMapper.listNameByUserIds(userids);
|
|
899
|
+ Map<Integer, String> userMap = users.stream().collect(Collectors.toMap(UserVo::getUserid, UserVo::getUsername));
|
|
900
|
+ List<ERstudent> cstudents = new ArrayList<>();//班级学生
|
|
901
|
+ Map<String, List<ERstudent>> cscollect = students.stream().collect(
|
|
902
|
+ Collectors.groupingBy(s -> s.getClassid() + "_" + s.getStudentid()));
|
|
903
|
+ setStuScore(cscollect, cstudents);
|
|
904
|
+ //总分统计
|
|
905
|
+ Map<Integer, List<ERstudent>> zfcollect = cstudents.stream().collect(
|
|
906
|
+ Collectors.groupingBy(s -> s.getClassid()));
|
|
907
|
+ List<ERstudent> sstudents = new ArrayList<>();//科目学生
|
|
908
|
+ Map<String, List<ERstudent>> sscollect = students.stream().collect(
|
|
909
|
+ Collectors.groupingBy(s -> s.getSubjectid() + "_" + s.getStudentid()));
|
|
910
|
+ setStuScore(sscollect, sstudents);
|
|
911
|
+ //全部班级统计
|
|
912
|
+ Map<String, List<ERstudent>> qbbjcollect = sstudents.stream().collect(
|
|
913
|
+ Collectors.groupingBy(s -> s.getSubjectid()));
|
|
914
|
+
|
|
915
|
+ List<ERrank> rrankList = new ArrayList<>();//考试报告等级
|
|
916
|
+ List<ERclassRank> rclassRankList = new ArrayList<>();//考试报告班级统计
|
|
917
|
+ ERrank eRrank = rranks.get(0);
|
|
918
|
+ if (ranktype == 1) {//等级(A[85%~100%],B[70%~85%),C[60%~70%),D[40%~60%),E[0%~40%))
|
|
919
|
+ for (ERrank rank : rranks) {
|
|
920
|
+ Double maxrate = rank.getMaxscore();
|
|
921
|
+ Double minrate = rank.getMinscore();
|
|
922
|
+ String rankname = rank.getRankname();
|
|
923
|
+ if ("zf".equals(subjectid)) {
|
|
924
|
+ //总分统计
|
|
925
|
+ double zfmaxscore = ExamUtil.mul(maxrate, pscore);
|
|
926
|
+ double zfminscore = ExamUtil.mul(minrate, pscore);
|
|
927
|
+ ERrank rr = new ERrank();
|
|
928
|
+ rr.setRanktype(ranktype);
|
|
929
|
+ rr.setRankname(rankname);
|
|
930
|
+ rr.setMaxscore(zfmaxscore);
|
|
931
|
+ rr.setMinscore(zfminscore);
|
|
932
|
+ rr.setSubjectid("zf");
|
|
933
|
+ String zfrankrange = "[" + zfminscore + "," + zfmaxscore;
|
|
934
|
+ if (rr.getRankname().equals("A")) {
|
|
935
|
+ zfrankrange = zfrankrange + "]";
|
|
936
|
+ } else {
|
|
937
|
+ zfrankrange = zfrankrange + ")";
|
|
938
|
+ }
|
|
939
|
+ for (Map.Entry<Integer, List<ERstudent>> entry : zfcollect.entrySet()) {
|
|
940
|
+ Integer classid = entry.getKey();
|
|
941
|
+ List<ERstudent> list = entry.getValue();
|
|
942
|
+ setDjTj(examid, userMap, rclassRankList, rr, zfrankrange, subjectid, classid, list);
|
|
943
|
+ }
|
|
944
|
+ IntSummaryStatistics zfstatistics = cstudents.stream().mapToInt(s -> s.getSchoolrank()).summaryStatistics();
|
|
945
|
+ rr.setLinescore(zfstatistics.getMax());
|
|
946
|
+ rr.setFloatscore(zfstatistics.getMin());
|
|
947
|
+ rrankList.add(rr);
|
|
948
|
+ } else {
|
|
949
|
+ //分科统计
|
|
950
|
+ ERrank rrank = new ERrank();
|
|
951
|
+ rrank.setRanktype(ranktype);
|
|
952
|
+ rrank.setRankname(rankname);
|
|
953
|
+ rrank.setSubjectid(subjectid);
|
|
954
|
+ double maxscore = ExamUtil.mul(maxrate, pscore);
|
|
955
|
+ double minscore = ExamUtil.mul(minrate, pscore);
|
|
956
|
+ rrank.setMaxscore(maxscore);
|
|
957
|
+ rrank.setMinscore(minscore);
|
|
958
|
+ String rankrange = "[" + minscore + "," + maxscore;
|
|
959
|
+ if (rankname.equals("A")) {
|
|
960
|
+ rankrange = rankrange + "]";
|
|
961
|
+ } else {
|
|
962
|
+ rankrange = rankrange + ")";
|
|
963
|
+ }
|
|
964
|
+
|
|
965
|
+ //全部班级统计
|
|
966
|
+ Integer classid = 0;
|
|
967
|
+ List<ERstudent> list = qbbjcollect.get(subjectid);
|
|
968
|
+ setDjTj(examid, userMap, rclassRankList, rrank, rankrange, subjectid, classid, list);
|
|
969
|
+ IntSummaryStatistics statistics = list.stream().mapToInt(s -> s.getSchoolrank()).summaryStatistics();
|
|
970
|
+ rrank.setLinescore(statistics.getMax());
|
|
971
|
+ rrank.setFloatscore(statistics.getMin());
|
|
972
|
+ rrankList.add(rrank);
|
|
973
|
+
|
|
974
|
+ //班级科目统计
|
|
975
|
+ Map<Integer, List<ERstudent>> ccollect = students.stream().filter(s -> s.getSubjectid().equals(subjectid))
|
|
976
|
+ .collect(Collectors.groupingBy(s -> s.getClassid()));
|
|
977
|
+ for (Map.Entry<Integer, List<ERstudent>> entry : ccollect.entrySet()) {
|
|
978
|
+ classid = entry.getKey();
|
|
979
|
+ list = entry.getValue();
|
|
980
|
+ setDjTj(examid, userMap, rclassRankList, rrank, rankrange, subjectid, classid, list);
|
|
981
|
+ }
|
|
982
|
+ }
|
|
983
|
+ }
|
|
984
|
+ } else if (ranktype == 2) {//分数段(10分/段)
|
|
985
|
+ Integer linescore = eRrank.getLinescore();
|
|
986
|
+ if ("zf".equals(subjectid)) {
|
|
987
|
+ //总分统计
|
|
988
|
+ Integer gnum = ExamUtil.divUp(pscore, linescore);
|
|
989
|
+ for (Integer i = 1; i <= gnum; i++) {
|
|
990
|
+ ERrank rrank = new ERrank();
|
|
991
|
+ rrank.setRanktype(ranktype);
|
|
992
|
+ double maxscore = ExamUtil.mul(i, linescore);
|
|
993
|
+ double minscore = ExamUtil.mul(i - 1, linescore);
|
|
994
|
+ if (maxscore > pscore) {
|
|
995
|
+ maxscore = pscore;
|
|
996
|
+ }
|
|
997
|
+ rrank.setMaxscore(maxscore);
|
|
998
|
+ rrank.setMinscore(minscore);
|
|
999
|
+ String rankrange = "[" + minscore + "," + maxscore;
|
|
1000
|
+ if (i == gnum) {
|
|
1001
|
+ rankrange = rankrange + "]";
|
|
1002
|
+ } else {
|
|
1003
|
+ rankrange = rankrange + ")";
|
|
1004
|
+ }
|
|
1005
|
+ rrank.setRankname(rankrange);
|
|
1006
|
+ rrank.setSubjectid("zf");
|
|
1007
|
+ rrankList.add(rrank);
|
|
1008
|
+
|
|
1009
|
+ for (Map.Entry<Integer, List<ERstudent>> entry : zfcollect.entrySet()) {
|
|
1010
|
+ Integer classid = entry.getKey();
|
|
1011
|
+ List<ERstudent> list = entry.getValue();
|
|
1012
|
+ setFdTj(examid, userMap, rclassRankList, gnum, i, rrank, rankrange, classid, list);
|
|
1013
|
+ }
|
|
1014
|
+ }
|
|
1015
|
+ } else {
|
|
1016
|
+ //分科统计
|
|
1017
|
+ Integer cnum = ExamUtil.divUp(pscore, linescore);
|
|
1018
|
+ for (Integer i = 1; i <= cnum; i++) {
|
|
1019
|
+ ERrank rrank = new ERrank();
|
|
1020
|
+ rrank.setSubjectid(subjectid);
|
|
1021
|
+ rrank.setRanktype(ranktype);
|
|
1022
|
+ rrank.setSubjectid(subjectid);
|
|
1023
|
+ double maxscore = ExamUtil.mul(i, linescore);
|
|
1024
|
+ double minscore = ExamUtil.mul(i - 1, linescore);
|
|
1025
|
+ if (maxscore > pscore) {
|
|
1026
|
+ maxscore = pscore;
|
|
1027
|
+ }
|
|
1028
|
+ rrank.setMaxscore(maxscore);
|
|
1029
|
+ rrank.setMinscore(minscore);
|
|
1030
|
+ String rankrange = "[" + minscore + "," + maxscore;
|
|
1031
|
+ if (i == cnum) {
|
|
1032
|
+ rankrange = rankrange + "]";
|
|
1033
|
+ } else {
|
|
1034
|
+ rankrange = rankrange + ")";
|
|
1035
|
+ }
|
|
1036
|
+ rrank.setRankname(rankrange);
|
|
1037
|
+ rrankList.add(rrank);
|
|
1038
|
+
|
|
1039
|
+ //全部班级统计
|
|
1040
|
+ Integer classid = 0;
|
|
1041
|
+ List<ERstudent> list = qbbjcollect.get(subjectid);
|
|
1042
|
+ setFdTj(examid, userMap, rclassRankList, cnum, i, rrank, rankrange, classid, list);
|
|
1043
|
+
|
|
1044
|
+ //班级科目统计
|
|
1045
|
+ Map<Integer, List<ERstudent>> ccollect = students.stream().filter(s -> s.getSubjectid().equals(subjectid))
|
|
1046
|
+ .collect(Collectors.groupingBy(s -> s.getClassid()));
|
|
1047
|
+ for (Map.Entry<Integer, List<ERstudent>> entry : ccollect.entrySet()) {
|
|
1048
|
+ classid = entry.getKey();
|
|
1049
|
+ list = entry.getValue();
|
|
1050
|
+ setFdTj(examid, userMap, rclassRankList, cnum, i, rrank, rankrange, classid, list);
|
|
1051
|
+ }
|
|
1052
|
+ }
|
|
1053
|
+ }
|
|
1054
|
+ } else {
|
|
1055
|
+ Integer lscore = eRrank.getLinescore();
|
|
1056
|
+ if (ranktype == 3) {//临界分(临界分:总分*80%,浮动分:5分)
|
|
1057
|
+ Integer linescore = lscore;
|
|
1058
|
+ Integer floatscore = eRrank.getFloatscore();
|
|
1059
|
+ ERrank rr = new ERrank();
|
|
1060
|
+ rr.setRanktype(ranktype);
|
|
1061
|
+ if ("zf".equals(subjectid)) {
|
|
1062
|
+ //总分统计
|
|
1063
|
+ if (N_Utils.isEmptyInteger(linescore)) linescore = (int) (ExamUtil.mul(pscore, 0.8));
|
|
1064
|
+ double zfmaxscore = ExamUtil.add(linescore, floatscore);
|
|
1065
|
+ double zfminscore = ExamUtil.sub(linescore, floatscore);
|
|
1066
|
+ if (zfmaxscore > pscore) zfmaxscore = pscore;
|
|
1067
|
+ if (zfminscore < 0) zfminscore = 0;
|
|
1068
|
+ rr.setMaxscore(zfmaxscore);
|
|
1069
|
+ rr.setMinscore(zfminscore);
|
|
1070
|
+ rr.setLinescore(linescore);
|
|
1071
|
+ rr.setFloatscore(floatscore);
|
|
1072
|
+ String zfrankrange = "[" + zfminscore + "," + zfmaxscore + "]";
|
|
1073
|
+ rr.setRankname(zfrankrange);
|
|
1074
|
+ rr.setSubjectid("zf");
|
|
1075
|
+ rrankList.add(rr);
|
|
1076
|
+
|
|
1077
|
+ for (Map.Entry<Integer, List<ERstudent>> entry : zfcollect.entrySet()) {
|
|
1078
|
+ Integer classid = entry.getKey();
|
|
1079
|
+ List<ERstudent> list = entry.getValue();
|
|
1080
|
+ setLjfTj(examid, userMap, rclassRankList, rr, zfrankrange, classid, subjectid, list);
|
|
1081
|
+ }
|
|
1082
|
+ } else {
|
|
1083
|
+ //分科统计
|
|
1084
|
+ ERrank rrank = new ERrank();
|
|
1085
|
+ rrank.setRanktype(ranktype);
|
|
1086
|
+ rrank.setSubjectid(subjectid);
|
|
1087
|
+ linescore = lscore;
|
|
1088
|
+ if (N_Utils.isEmptyInteger(linescore)) linescore = (int) (ExamUtil.mul(pscore, 0.8));
|
|
1089
|
+ double maxscore = ExamUtil.add(linescore, floatscore);
|
|
1090
|
+ double minscore = ExamUtil.sub(linescore, floatscore);
|
|
1091
|
+ if (maxscore > pscore) maxscore = pscore;
|
|
1092
|
+ if (minscore < 0) minscore = 0;
|
|
1093
|
+ rrank.setMaxscore(maxscore);
|
|
1094
|
+ rrank.setMinscore(minscore);
|
|
1095
|
+ rrank.setLinescore(linescore);
|
|
1096
|
+ rrank.setFloatscore(floatscore);
|
|
1097
|
+ String rankrange = "[" + minscore + "," + maxscore + "]";
|
|
1098
|
+ rrank.setRankname(rankrange);
|
|
1099
|
+ rrankList.add(rrank);
|
|
1100
|
+
|
|
1101
|
+ //全部班级统计
|
|
1102
|
+ Integer classid = 0;
|
|
1103
|
+ List<ERstudent> list = qbbjcollect.get(subjectid);
|
|
1104
|
+ setLjfTj(examid, userMap, rclassRankList, rrank, rankrange, classid, subjectid, list);
|
|
1105
|
+
|
|
1106
|
+ //班级科目统计
|
|
1107
|
+ Map<Integer, List<ERstudent>> ccollect = students.stream().filter(s -> s.getSubjectid().equals(subjectid))
|
|
1108
|
+ .collect(Collectors.groupingBy(s -> s.getClassid()));
|
|
1109
|
+ for (Map.Entry<Integer, List<ERstudent>> entry : ccollect.entrySet()) {
|
|
1110
|
+ classid = entry.getKey();
|
|
1111
|
+ list = entry.getValue();
|
|
1112
|
+ setLjfTj(examid, userMap, rclassRankList, rrank, rankrange, classid, subjectid, list);
|
|
1113
|
+ }
|
|
1114
|
+ }
|
|
1115
|
+
|
|
1116
|
+ } else if (ranktype == 4) {//临界名次(临界名次10,浮动名次5)
|
|
1117
|
+ Integer linescore = lscore;
|
|
1118
|
+ Integer floatscore = eRrank.getFloatscore();
|
|
1119
|
+ ERrank rr = new ERrank();
|
|
1120
|
+ rr.setRanktype(ranktype);
|
|
1121
|
+ if ("zf".equals(subjectid)) {
|
|
1122
|
+ //总分统计
|
|
1123
|
+ double zfmaxscore = ExamUtil.sub(linescore, floatscore);//最高名次
|
|
1124
|
+ double zfminscore = ExamUtil.add(linescore, floatscore);//最低名次
|
|
1125
|
+ if (zfmaxscore < 1) zfmaxscore = 1;//最高名次为1
|
|
1126
|
+ int zfstunum = (int) students.stream().map(s -> s.getStudentid()).distinct().count();//学生数量
|
|
1127
|
+ if (zfminscore > zfstunum) zfminscore = zfstunum;//最低名次=学生数量
|
|
1128
|
+ rr.setMaxscore(zfmaxscore);
|
|
1129
|
+ rr.setMinscore(zfminscore);
|
|
1130
|
+ rr.setLinescore(linescore);
|
|
1131
|
+ rr.setFloatscore(floatscore);
|
|
1132
|
+ String zfrankrange = "[" + zfminscore + "," + zfmaxscore + "]";
|
|
1133
|
+ rr.setRankname(zfrankrange);
|
|
1134
|
+ rr.setSubjectid("zf");
|
|
1135
|
+ rrankList.add(rr);
|
|
1136
|
+
|
|
1137
|
+ for (Map.Entry<Integer, List<ERstudent>> entry : zfcollect.entrySet()) {
|
|
1138
|
+ Integer classid = entry.getKey();
|
|
1139
|
+ List<ERstudent> list = entry.getValue();
|
|
1140
|
+ setLjmcTj(examid, userMap, rclassRankList, rr, zfrankrange, classid, subjectid, list);
|
|
1141
|
+ }
|
|
1142
|
+ } else {
|
|
1143
|
+ //分科统计
|
|
1144
|
+ double maxscore = ExamUtil.sub(linescore, floatscore);//最高名次
|
|
1145
|
+ double minscore = ExamUtil.add(linescore, floatscore);//最低名次
|
|
1146
|
+ if (maxscore < 1) maxscore = 1;//最高名次为1
|
|
1147
|
+ Integer stunum = students.size();//学生数量
|
|
1148
|
+ if (minscore > stunum) minscore = stunum;//最低名次=学生数量
|
|
1149
|
+ ERrank rrank = new ERrank();
|
|
1150
|
+ rrank.setRanktype(ranktype);
|
|
1151
|
+ rrank.setSubjectid(subjectid);
|
|
1152
|
+ rrank.setMaxscore(maxscore);
|
|
1153
|
+ rrank.setMinscore(minscore);
|
|
1154
|
+ rrank.setLinescore(linescore);
|
|
1155
|
+ rrank.setFloatscore(floatscore);
|
|
1156
|
+ String rankrange = "[" + minscore + "," + maxscore + "]";
|
|
1157
|
+ rrank.setRankname(rankrange);
|
|
1158
|
+ rrankList.add(rrank);
|
|
1159
|
+
|
|
1160
|
+ //全部班级统计
|
|
1161
|
+ Integer classid = 0;
|
|
1162
|
+ List<ERstudent> list = qbbjcollect.get(subjectid);
|
|
1163
|
+ setLjmcTj(examid, userMap, rclassRankList, rrank, rankrange, classid, subjectid, list);
|
|
1164
|
+
|
|
1165
|
+ //班级科目统计
|
|
1166
|
+ Map<Integer, List<ERstudent>> ccollect = students.stream().filter(s -> s.getSubjectid().equals(subjectid))
|
|
1167
|
+ .collect(Collectors.groupingBy(s -> s.getClassid()));
|
|
1168
|
+ for (Map.Entry<Integer, List<ERstudent>> entry : ccollect.entrySet()) {
|
|
1169
|
+ classid = entry.getKey();
|
|
1170
|
+ list = entry.getValue();
|
|
1171
|
+ setLjmcTj(examid, userMap, rclassRankList, rrank, rankrange, classid, subjectid, list);
|
|
1172
|
+ }
|
|
1173
|
+ }
|
|
1174
|
+
|
|
1175
|
+ } else if (ranktype == 5) {//优秀年级前(10名)
|
|
1176
|
+ Integer linescore = lscore;
|
|
1177
|
+ ERrank rr = new ERrank();
|
|
1178
|
+ rr.setRanktype(ranktype);
|
|
1179
|
+ rr.setLinescore(linescore);
|
|
1180
|
+ String rankrange = "年级前" + linescore + "名";
|
|
1181
|
+ rr.setRankname(rankrange);
|
|
1182
|
+ if ("zf".equals(subjectid)) {
|
|
1183
|
+ //总分统计
|
|
1184
|
+ rr.setSubjectid("zf");
|
|
1185
|
+ rrankList.add(rr);
|
|
1186
|
+ for (Map.Entry<Integer, List<ERstudent>> entry : zfcollect.entrySet()) {
|
|
1187
|
+ Integer classid = entry.getKey();
|
|
1188
|
+ List<ERstudent> list = entry.getValue();
|
|
1189
|
+ setNjqTj(examid, userMap, rclassRankList, rr, rankrange, classid, subjectid, list);
|
|
1190
|
+ }
|
|
1191
|
+ } else {
|
|
1192
|
+ //分科统计
|
|
1193
|
+ ERrank rrank = new ERrank();
|
|
1194
|
+ rrank.setRanktype(ranktype);
|
|
1195
|
+ rrank.setRankname(rankrange);
|
|
1196
|
+ rrank.setLinescore(linescore);
|
|
1197
|
+ rrank.setSubjectid(subjectid);
|
|
1198
|
+ rrankList.add(rrank);
|
|
1199
|
+ //全部班级统计
|
|
1200
|
+ Integer classid = 0;
|
|
1201
|
+ List<ERstudent> list = qbbjcollect.get(subjectid);
|
|
1202
|
+ setNjqTj(examid, userMap, rclassRankList, rrank, rankrange, classid, subjectid, list);
|
|
1203
|
+
|
|
1204
|
+ //班级科目统计
|
|
1205
|
+ Map<Integer, List<ERstudent>> ccollect = students.stream().filter(s -> s.getSubjectid().equals(subjectid))
|
|
1206
|
+ .collect(Collectors.groupingBy(s -> s.getClassid()));
|
|
1207
|
+ for (Map.Entry<Integer, List<ERstudent>> entry : ccollect.entrySet()) {
|
|
1208
|
+ classid = entry.getKey();
|
|
1209
|
+ list = entry.getValue();
|
|
1210
|
+ setNjqTj(examid, userMap, rclassRankList, rrank, rankrange, classid, subjectid, list);
|
|
1211
|
+ }
|
|
1212
|
+ }
|
|
1213
|
+ } else if (ranktype == 6) {//学困年级后(10名)
|
|
1214
|
+ Integer linescore = lscore;
|
|
1215
|
+ ERrank rr = new ERrank();
|
|
1216
|
+ rr.setRanktype(ranktype);
|
|
1217
|
+ rr.setLinescore(linescore);
|
|
1218
|
+ String rankrange = "年级后" + linescore + "名";
|
|
1219
|
+ rr.setRankname(rankrange);
|
|
1220
|
+ if ("zf".equals(subjectid)) {
|
|
1221
|
+ //总分统计
|
|
1222
|
+ rr.setSubjectid("zf");
|
|
1223
|
+ rrankList.add(rr);
|
|
1224
|
+ for (Map.Entry<Integer, List<ERstudent>> entry : zfcollect.entrySet()) {
|
|
1225
|
+ Integer classid = entry.getKey();
|
|
1226
|
+ List<ERstudent> list = entry.getValue();
|
|
1227
|
+ setNjqTj(examid, userMap, rclassRankList, rr, rankrange, classid, subjectid, list);
|
|
1228
|
+ }
|
|
1229
|
+ } else {
|
|
1230
|
+ //分科统计
|
|
1231
|
+ ERrank rrank = new ERrank();
|
|
1232
|
+ rrank.setRanktype(ranktype);
|
|
1233
|
+ rrank.setRankname(rankrange);
|
|
1234
|
+ rrank.setLinescore(linescore);
|
|
1235
|
+ rrank.setSubjectid(subjectid);
|
|
1236
|
+ rrankList.add(rrank);
|
|
1237
|
+ //全部班级统计
|
|
1238
|
+ Integer classid = 0;
|
|
1239
|
+ List<ERstudent> list = qbbjcollect.get(subjectid);
|
|
1240
|
+ rrank.setMaxscore(getMaxScore(list, linescore));
|
|
1241
|
+ setNjhTj(examid, userMap, rclassRankList, rrank, rankrange, classid, subjectid, list);
|
|
1242
|
+
|
|
1243
|
+ //班级科目统计
|
|
1244
|
+ Map<Integer, List<ERstudent>> ccollect = students.stream().filter(s -> s.getSubjectid().equals(subjectid))
|
|
1245
|
+ .collect(Collectors.groupingBy(s -> s.getClassid()));
|
|
1246
|
+ for (Map.Entry<Integer, List<ERstudent>> entry : ccollect.entrySet()) {
|
|
1247
|
+ classid = entry.getKey();
|
|
1248
|
+ list = entry.getValue();
|
|
1249
|
+ rrank.setMaxscore(getMaxScore(list, linescore));
|
|
1250
|
+ setNjhTj(examid, userMap, rclassRankList, rrank, rankrange, classid, subjectid, list);
|
|
1251
|
+ }
|
|
1252
|
+ rrank.setMaxscore(null);
|
|
1253
|
+ }
|
|
1254
|
+ }
|
|
1255
|
+ }
|
|
1256
|
+
|
|
1257
|
+ int timestamp = N_Utils.getSecondTimestamp();
|
|
1258
|
+ rrankList.forEach(r -> {
|
|
1259
|
+ r.setExamid(examid);
|
|
1260
|
+ r.setCreateid(createid);
|
|
1261
|
+ r.setCreatetime(timestamp);
|
|
1262
|
+ });
|
|
1263
|
+ eRrankMapper.insertList(rrankList);
|
|
1264
|
+ eRclassRankMapper.insertList(rclassRankList);
|
|
1265
|
+ }
|
|
1266
|
+
|
893
|
1267
|
//获取最高分
|
894
|
1268
|
private Double getMaxScore(List<ERstudent> cstudents, Integer linescore) {
|
895
|
1269
|
List<Double> cScore = cstudents.stream().map(s -> s.getScore()).distinct().sorted().collect(Collectors.toList());
|