Browse Source

Merge remote-tracking branch 'cloud-schoolapi/ywx'

tags/正式版本
王宁 2 years ago
parent
commit
cc59e66a04

+ 11
- 10
sexam/src/main/java/com/xhkjedu/sexam/service/report/EReportGenerateService.java View File

182
         }
182
         }
183
 
183
 
184
         DoubleSummaryStatistics schoolStatistics = schoolStudents.stream().mapToDouble(s -> s.getScore()).summaryStatistics();
184
         DoubleSummaryStatistics schoolStatistics = schoolStudents.stream().mapToDouble(s -> s.getScore()).summaryStatistics();
185
-        DoubleSummaryStatistics classStatistics = classStudents.stream().mapToDouble(s -> s.getScore()).summaryStatistics();
186
-        DoubleSummaryStatistics cSStatistics = classSubjectStudents.stream().mapToDouble(s -> s.getScore()).summaryStatistics();
187
         double schoolStatisticsMax = schoolStatistics.getMax();
185
         double schoolStatisticsMax = schoolStatistics.getMax();
188
         double schoolStatisticsAverage = N_Utils.formatDouble(schoolStatistics.getAverage(), 2);
186
         double schoolStatisticsAverage = N_Utils.formatDouble(schoolStatistics.getAverage(), 2);
189
         double schoolStatisticsMin = schoolStatistics.getMin();
187
         double schoolStatisticsMin = schoolStatistics.getMin();
238
 
236
 
239
         setRank(schoolStudents, schoolStuRank, 1);//学校学生分数排名
237
         setRank(schoolStudents, schoolStuRank, 1);//学校学生分数排名
240
 
238
 
239
+        Map<String, ERclass> rclassMap = classList.stream().collect(Collectors.toMap(c -> (c.getClassid() + "_" + c.getSubjectid()), c -> c));
241
         Map<String, Double> bzcMap = subjectList.stream().collect(Collectors.toMap(ERsubject::getSubjectid, ERsubject::getBzc));
240
         Map<String, Double> bzcMap = subjectList.stream().collect(Collectors.toMap(ERsubject::getSubjectid, ERsubject::getBzc));
242
         for (ERstudent cs : classStudents) {
241
         for (ERstudent cs : classStudents) {
243
             Integer studentid = cs.getStudentid();
242
             Integer studentid = cs.getStudentid();
244
             cs.setClassrank(classStuRank.get(cs.getClassid() + "_" + studentid));
243
             cs.setClassrank(classStuRank.get(cs.getClassid() + "_" + studentid));
245
-            cs.setClassmaxscore(classStatistics.getMax());
246
-            cs.setClassavgscore(N_Utils.formatDouble(classStatistics.getAverage(), 2));
244
+            ERclass rclass = rclassMap.get(cs.getClassid() + "_" + cs.getSubjectid());
245
+            cs.setClassmaxscore(rclass.getClassmaxscore());
246
+            cs.setClassavgscore(rclass.getClassavgscore());
247
             Integer schoolrank = schoolStuRank.get(studentid.toString());
247
             Integer schoolrank = schoolStuRank.get(studentid.toString());
248
             cs.setSchoolrank(schoolrank);
248
             cs.setSchoolrank(schoolrank);
249
-            cs.setSchoolmaxscore(schoolStatisticsMax);
250
-            cs.setSchoolavgscore(schoolStatisticsAverage);
249
+            cs.setSchoolmaxscore(rclass.getSchoolmaxscore());
250
+            cs.setSchoolavgscore(rclass.getSchoolavgscore());
251
             setStuGoal(stuRankGoals, cs, schoolrank);//设置学生目标
251
             setStuGoal(stuRankGoals, cs, schoolrank);//设置学生目标
252
             Double bzc = bzcMap.get(cs.getSubjectid());
252
             Double bzc = bzcMap.get(cs.getSubjectid());
253
             cs.setBzscore(ExamUtil.standardScore(cs.getScore(), cs.getSchoolavgscore(), bzc));//学生标准分
253
             cs.setBzscore(ExamUtil.standardScore(cs.getScore(), cs.getSchoolavgscore(), bzc));//学生标准分
260
             Integer classid = cs.getClassid();
260
             Integer classid = cs.getClassid();
261
             subjectid = cs.getSubjectid();
261
             subjectid = cs.getSubjectid();
262
             cs.setClassrank(classSubStuRank.get(classid + "_" + subjectid + "_" + studentid));
262
             cs.setClassrank(classSubStuRank.get(classid + "_" + subjectid + "_" + studentid));
263
-            cs.setClassmaxscore(cSStatistics.getMax());
264
-            cs.setClassavgscore(N_Utils.formatDouble(cSStatistics.getAverage(), 2));
263
+            ERclass rclass = rclassMap.get(classid + "_" + subjectid);
264
+            cs.setClassmaxscore(rclass.getClassmaxscore());
265
+            cs.setClassavgscore(rclass.getClassavgscore());
265
             Integer schoolrank = schoolSubStuRank.get(subjectid + "_" + studentid);
266
             Integer schoolrank = schoolSubStuRank.get(subjectid + "_" + studentid);
266
             cs.setSchoolrank(schoolrank);
267
             cs.setSchoolrank(schoolrank);
267
             cs.setZfSchoolRank(schoolStuRank.get(studentid.toString()));
268
             cs.setZfSchoolRank(schoolStuRank.get(studentid.toString()));
268
-            cs.setSchoolmaxscore(sSStatistics.getMax());
269
-            cs.setSchoolavgscore(N_Utils.formatDouble(sSStatistics.getAverage(), 2));
269
+            cs.setSchoolmaxscore(rclass.getSchoolmaxscore());
270
+            cs.setSchoolavgscore(rclass.getSchoolavgscore());
270
             setStuGoal(stuRankGoals, cs, schoolrank);//设置学生目标
271
             setStuGoal(stuRankGoals, cs, schoolrank);//设置学生目标
271
             Double bzc = bzcMap.get(subjectid);
272
             Double bzc = bzcMap.get(subjectid);
272
             cs.setBzscore(ExamUtil.standardScore(cs.getScore(), cs.getSchoolavgscore(), bzc));//学生标准分
273
             cs.setBzscore(ExamUtil.standardScore(cs.getScore(), cs.getSchoolavgscore(), bzc));//学生标准分

Loading…
Cancel
Save