deason 1 年之前
父节点
当前提交
4e0d080a40

+ 13 - 0
examcloud-core-oe-admin-service/src/main/java/cn/com/qmth/examcloud/core/oe/admin/service/bean/statistic/ExamStudentScoreInfo.java

@@ -14,6 +14,11 @@ public class ExamStudentScoreInfo implements JsonSerializable {
 
     private Long examStudentId;
 
+    /**
+     * 是否完成考试
+     */
+    private Boolean finished;
+
     /**
      * 考生成绩
      */
@@ -56,6 +61,14 @@ public class ExamStudentScoreInfo implements JsonSerializable {
         this.examStudentId = examStudentId;
     }
 
+    public Boolean getFinished() {
+        return finished;
+    }
+
+    public void setFinished(Boolean finished) {
+        this.finished = finished;
+    }
+
     public Double getTotalScore() {
         return totalScore;
     }

+ 8 - 3
examcloud-core-oe-admin-service/src/main/java/cn/com/qmth/examcloud/core/oe/admin/service/impl/ExamStatisticServiceImpl.java

@@ -99,7 +99,8 @@ public class ExamStatisticServiceImpl implements ExamStatisticService {
                 }
 
                 StringBuffer sql = new StringBuffer();
-                sql.append(" select es.exam_id,es.course_id,es.org_id,es.exam_student_id,sc.total_score,d.paper_score");
+                sql.append(" select es.exam_id,es.course_id,es.org_id,es.exam_student_id,");
+                sql.append(" es.finished,sc.total_score,d.paper_score");
                 sql.append(" from ec_oe_exam_student es");
                 sql.append(" left join ec_oe_exam_student_final_score sc on sc.exam_student_id = es.exam_student_id");
                 sql.append(" left join ec_oe_exam_record_data d on d.id = sc.exam_record_data_id");
@@ -118,11 +119,15 @@ public class ExamStatisticServiceImpl implements ExamStatisticService {
                     for (ExamStudentScoreInfo v : e.getValue()) {
                         allCount++;
 
-                        if (v.getTotalScore() == null) {
-                            // 无成绩,则未完成考试
+                        if (v.getFinished() == null || !v.getFinished()) {
+                            // 未完成考试
                             continue;
                         }
 
+                        if (v.getTotalScore() == null) {
+                            v.setTotalScore(0d);
+                        }
+
                         finishCount++;
 
                         if (v.getTotalScore() >= (v.getPaperScore() * passScoreLine) / 100d) {