Browse Source

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

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

+ 1
- 0
sexam/src/main/java/com/xhkjedu/sexam/controller/exam/EBaseController.java View File

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

+ 6
- 3
sexam/src/main/java/com/xhkjedu/sexam/service/report/EReportGenerateService.java View File

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
         double schoolStatisticsMax = schoolStatistics.getMax();
186
         double schoolStatisticsMax = schoolStatistics.getMax();
186
         double schoolStatisticsAverage = N_Utils.formatDouble(schoolStatistics.getAverage(), 2);
187
         double schoolStatisticsAverage = N_Utils.formatDouble(schoolStatistics.getAverage(), 2);
187
         double schoolStatisticsMin = schoolStatistics.getMin();
188
         double schoolStatisticsMin = schoolStatistics.getMin();
294
         double jgscore = ExamUtil.mul(allscore, 0.6);//及格分
295
         double jgscore = ExamUtil.mul(allscore, 0.6);//及格分
295
         double dfscore = ExamUtil.mul(allscore, 0.4);//低分
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
         double maxscore = statistics.getMax();
300
         double maxscore = statistics.getMax();
299
         double minscore = statistics.getMin();
301
         double minscore = statistics.getMin();
300
         if (N_Utils.isListEmpty(list)) {
302
         if (N_Utils.isListEmpty(list)) {
334
         for (Map.Entry<Integer, List<ERstudent>> entry : claCollect.entrySet()) {
336
         for (Map.Entry<Integer, List<ERstudent>> entry : claCollect.entrySet()) {
335
             Integer classid = entry.getKey();
337
             Integer classid = entry.getKey();
336
             List<ERstudent> rstudentList = entry.getValue();
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
             ERclass rc = new ERclass();
341
             ERclass rc = new ERclass();
339
             rc.setQkbzc(qkbzc);
342
             rc.setQkbzc(qkbzc);
340
             rc.setExamid(examid);
343
             rc.setExamid(examid);

Loading…
Cancel
Save