|
@@ -359,14 +359,8 @@ public class ExamStudentService {
|
|
|
" select t2.exam_times from ecs_exam t2 where t2.id = t1.exam_id "+
|
|
|
")");
|
|
|
sql.append(" and t1.exam_id="+examCriteria.getExamId());
|
|
|
- //排除掉设置了重考,但是还没考试的考生
|
|
|
- sql.append(" and t1.id not in ( "
|
|
|
- + " select t2.exam_student_id "
|
|
|
- + " from oe_exam_record t2 "
|
|
|
- + " where t2.batch_id = "+examCriteria.getExamId()
|
|
|
- + " and t2.is_reexamine = 1 "
|
|
|
- + " and t2.`status` = 'EXAM_INVALID' "
|
|
|
- +") ");
|
|
|
+ //没设置重考的或者设置了重考,重考已完成的
|
|
|
+ sql.append(" and (t1.is_reexamine is null OR (t1.is_reexamine = 1 and t1.reexamine_completed = 1)) ");
|
|
|
sql.append(getSqlSpecification(examCriteria));
|
|
|
sql.append(" limit "+(curPage-1)*pageSize+","+pageSize);
|
|
|
|
|
@@ -398,13 +392,8 @@ public class ExamStudentService {
|
|
|
" select t2.exam_times from ecs_exam t2 where t2.id = t1.exam_id "+
|
|
|
")");
|
|
|
sql.append(" and t1.exam_id="+examCriteria.getExamId());
|
|
|
- sql.append(" and t1.id not in ( "
|
|
|
- + " select t2.exam_student_id "
|
|
|
- + " from oe_exam_record t2 "
|
|
|
- + " where t2.batch_id = "+examCriteria.getExamId()
|
|
|
- + " and t2.is_reexamine = 1 "
|
|
|
- + " and t2.`status` = 'EXAM_INVALID' "
|
|
|
- +") ");
|
|
|
+ //没设置重考的或者设置了重考,重考已完成的
|
|
|
+ sql.append(" and (t1.is_reexamine is null OR (t1.is_reexamine = 1 and t1.reexamine_completed = 1)) ");
|
|
|
sql.append(getSqlSpecification(examCriteria));
|
|
|
return this.jdbcTemplate.queryForObject(sql.toString(), Integer.class);
|
|
|
}
|
|
@@ -731,6 +720,10 @@ public class ExamStudentService {
|
|
|
if(examTimes > examStudent.getNormalExamTimes()){
|
|
|
examStudent.setNormalExamTimes(examStudent.getNormalExamTimes()+1);
|
|
|
}
|
|
|
+ //考生开始重考时,将重考已完成设置为true
|
|
|
+ if(examStudent.getIsReexamine()!=null&&examStudent.getIsReexamine()){
|
|
|
+ examStudent.setReexamineCompleted(true);
|
|
|
+ }
|
|
|
examStudentRepo.save(examStudent);
|
|
|
}
|
|
|
|
|
@@ -747,6 +740,8 @@ public class ExamStudentService {
|
|
|
ExamStudent examStudent = examStudentRepo.findOne(commonExamStudent.getId());
|
|
|
if(examStudent!=null){
|
|
|
examStudent.setIsReexamine(true);
|
|
|
+ //设置了重考,但考生重考未完成,考生开始重考时,该字段改为true
|
|
|
+ examStudent.setReexamineCompleted(false);
|
|
|
examStudent.setReexamineType(commonExamStudent.getReexamineType());
|
|
|
examStudent.setReexamineDetail(commonExamStudent.getReexamineDetail());
|
|
|
examStudentRepo.save(examStudent);
|