Bladeren bron

报告中学生分数为0的不统计

tags/正式版本
王宁 2 jaren geleden
bovenliggende
commit
3a8332ac48

+ 1
- 0
sexam/src/main/java/com/xhkjedu/sexam/controller/exam/EBaseController.java Bestand weergeven

@@ -267,6 +267,7 @@ public class EBaseController {
267 267
             eReportGenerateService.generateExamReport(eBase.getExamid(), eBase.getCreateid());
268 268
             return new ResultVo(0, "结束成功");
269 269
         } catch (Exception e) {
270
+            log.error("结束出错:"+e.getMessage());
270 271
             return new ResultVo(1, "结束失败");
271 272
         }
272 273
     }

+ 6
- 3
sexam/src/main/java/com/xhkjedu/sexam/service/report/EReportGenerateService.java Bestand weergeven

@@ -181,7 +181,8 @@ public class EReportGenerateService {
181 181
             }
182 182
         }
183 183
 
184
-        DoubleSummaryStatistics schoolStatistics = schoolStudents.stream().mapToDouble(s -> s.getScore()).summaryStatistics();
184
+        List<ERstudent> nozeroschoolStudents = schoolStudents.stream().filter(s -> s.getScore() > 0).collect(Collectors.toList());
185
+        DoubleSummaryStatistics schoolStatistics = nozeroschoolStudents.stream().mapToDouble(s -> s.getScore()).summaryStatistics();
185 186
         double schoolStatisticsMax = schoolStatistics.getMax();
186 187
         double schoolStatisticsAverage = N_Utils.formatDouble(schoolStatistics.getAverage(), 2);
187 188
         double schoolStatisticsMin = schoolStatistics.getMin();
@@ -294,7 +295,8 @@ public class EReportGenerateService {
294 295
         double jgscore = ExamUtil.mul(allscore, 0.6);//及格分
295 296
         double dfscore = ExamUtil.mul(allscore, 0.4);//低分
296 297
 
297
-        DoubleSummaryStatistics statistics = list.stream().mapToDouble(s -> s.getScore()).summaryStatistics();
298
+        List<ERstudent> nozerolist = list.stream().filter(s -> s.getScore()>0).collect(Collectors.toList());
299
+        DoubleSummaryStatistics statistics = nozerolist.stream().mapToDouble(s -> s.getScore()).summaryStatistics();
298 300
         double maxscore = statistics.getMax();
299 301
         double minscore = statistics.getMin();
300 302
         if (N_Utils.isListEmpty(list)) {
@@ -334,7 +336,8 @@ public class EReportGenerateService {
334 336
         for (Map.Entry<Integer, List<ERstudent>> entry : claCollect.entrySet()) {
335 337
             Integer classid = entry.getKey();
336 338
             List<ERstudent> rstudentList = entry.getValue();
337
-            DoubleSummaryStatistics claStatistics = rstudentList.stream().mapToDouble(s -> s.getScore()).summaryStatistics();
339
+            List<ERstudent> nozerorstudentList = rstudentList.stream().filter(s -> s.getScore()>0).collect(Collectors.toList());
340
+            DoubleSummaryStatistics claStatistics = nozerorstudentList.stream().mapToDouble(s -> s.getScore()).summaryStatistics();
338 341
             ERclass rc = new ERclass();
339 342
             rc.setQkbzc(qkbzc);
340 343
             rc.setExamid(examid);

Laden…
Annuleren
Opslaan