|
@@ -398,12 +398,14 @@ public class ExamStudentService {
|
|
|
targetExamStudents.clear();
|
|
|
}
|
|
|
|
|
|
- public void deleteExamStudent(Long id)throws Exception{
|
|
|
- ExamStudent examStudent = examStudentRepo.findOne(id);
|
|
|
- if(examStudent.getExam().getCanStuDel()){
|
|
|
- examStudentRepo.delete(id);
|
|
|
- }else{
|
|
|
- throw new RuntimeException("该考试已开始,不能删除");
|
|
|
+ public void deleteExamStudent(List<Long> ids)throws Exception{
|
|
|
+ List<ExamStudent> examStudents = examStudentRepo.findByIdIn(ids);
|
|
|
+ for(ExamStudent examStudent : examStudents){
|
|
|
+ if(examStudent.getExam().getCanStuDel()){
|
|
|
+ examStudentRepo.delete(examStudent);
|
|
|
+ }else{
|
|
|
+ throw new RuntimeException(examStudent.getName()+"已开始考试,不能删除");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|