Kaynağa Gözat

修改BUG:0001469: 【网考】考生正常的考试次数用完后,考生只要已进入考试,就可以对该考生设置重考,该考生交卷后就又会将该条考试记录由无效改为完成

chenken 7 yıl önce
ebeveyn
işleme
bc3ad44097

+ 4 - 4
exam-work-api/src/main/java/cn/com/qmth/examcloud/service/examwork/service/ExamStudentService.java

@@ -394,12 +394,11 @@ public class ExamStudentService {
 				   + "t1.student_code 	 	student_code,"
 				   + "t1.identity_number 	identity_number"
 				+ " from ecs_exam_student t1 "
-				+ " where t1.normal_exam_times >= ( "+
-				" 	select t2.exam_times from ecs_exam t2 where t2.id = t1.exam_id "+
-				")");
-    	sql.append(" and t1.exam_id="+examCriteria.getExamId());
+				+ " where t1.exam_id="+examCriteria.getExamId());
+    	sql.append(" and  t1.normal_exam_times >= ( select t2.exam_times from ecs_exam t2 where t2.id = t1.exam_id ) ");
     	//没设置重考的或者设置了重考,重考已完成的
     	sql.append(" and ((t1.is_reexamine is null OR t1.is_reexamine = 0) OR (t1.is_reexamine = 1 and t1.reexamine_completed = 1)) ");
+    	sql.append(" and NOT EXISTS ( select * from oe_exam_record t3 where t3.exam_student_id = t1.id and t3.status = 'EXAM_ING') ");
     	sql.append(getSqlSpecification(examCriteria));
     	sql.append(" limit "+(curPage-1)*pageSize+","+pageSize);
     	
@@ -433,6 +432,7 @@ public class ExamStudentService {
     	sql.append(" and t1.exam_id="+examCriteria.getExamId());
     	//没设置重考的或者设置了重考,重考已完成的
     	sql.append(" and ((t1.is_reexamine is null OR t1.is_reexamine = 0) OR (t1.is_reexamine = 1 and t1.reexamine_completed = 1)) ");
+    	sql.append(" and NOT EXISTS ( select * from oe_exam_record t3 where t3.exam_student_id = t1.id and t3.status = 'EXAM_ING') ");
     	sql.append(getSqlSpecification(examCriteria));
 		return this.jdbcTemplate.queryForObject(sql.toString(), Integer.class);
 	}