|
@@ -24,6 +24,9 @@ public class ExamService {
|
|
|
@Autowired
|
|
|
ExamRepo examRepo;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ ExamStudentService examStudentService;
|
|
|
+
|
|
|
/**
|
|
|
* 获取所有考试批次(分页)
|
|
|
* @param examCriteria
|
|
@@ -73,10 +76,11 @@ public class ExamService {
|
|
|
* @param ids
|
|
|
* @return
|
|
|
*/
|
|
|
- public void deleteExam(List<Long> ids){
|
|
|
+ public void deleteExam(List<Long> ids)throws Exception{
|
|
|
List<Exam> exams = examRepo.findByIdIn(ids);
|
|
|
for(Exam exam:exams){
|
|
|
if(exam.getCanStuDel()){
|
|
|
+ examStudentService.deleteExamStudents(exam.getId());
|
|
|
examRepo.delete(exam);
|
|
|
}else{
|
|
|
throw new RuntimeException(exam.getName()+"批次已经开始,不能删除");
|