|
@@ -30,6 +30,7 @@ import cn.com.qmth.examcloud.common.dto.core.Student;
|
|
import cn.com.qmth.examcloud.common.dto.core.User;
|
|
import cn.com.qmth.examcloud.common.dto.core.User;
|
|
import cn.com.qmth.examcloud.common.dto.core.enums.UserType;
|
|
import cn.com.qmth.examcloud.common.dto.core.enums.UserType;
|
|
import cn.com.qmth.examcloud.common.dto.examwork.CommonExamStudent;
|
|
import cn.com.qmth.examcloud.common.dto.examwork.CommonExamStudent;
|
|
|
|
+import cn.com.qmth.examcloud.commons.base.exception.StatusException;
|
|
import cn.com.qmth.examcloud.commons.base.util.BeanCopierUtil;
|
|
import cn.com.qmth.examcloud.commons.base.util.BeanCopierUtil;
|
|
import cn.com.qmth.examcloud.commons.base.util.ErrorMsg;
|
|
import cn.com.qmth.examcloud.commons.base.util.ErrorMsg;
|
|
import cn.com.qmth.examcloud.commons.base.util.excel.ExcelError;
|
|
import cn.com.qmth.examcloud.commons.base.util.excel.ExcelError;
|
|
@@ -690,23 +691,35 @@ public class ExamStudentService {
|
|
targetExamStudents.clear();
|
|
targetExamStudents.clear();
|
|
}
|
|
}
|
|
|
|
|
|
- public void deleteExamStudent(List<Long> ids) throws Exception {
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 方法注释
|
|
|
|
+ *
|
|
|
|
+ * @author WANGWEI
|
|
|
|
+ * @param ids
|
|
|
|
+ */
|
|
|
|
+ public void deleteExamStudent(List<Long> ids) {
|
|
List<ExamStudent> examStudents = examStudentRepo.findByIdIn(ids);
|
|
List<ExamStudent> examStudents = examStudentRepo.findByIdIn(ids);
|
|
for (ExamStudent examStudent : examStudents) {
|
|
for (ExamStudent examStudent : examStudents) {
|
|
if (examStudent.getExam().getCanStuDel()) {
|
|
if (examStudent.getExam().getCanStuDel()) {
|
|
examStudentRepo.delete(examStudent);
|
|
examStudentRepo.delete(examStudent);
|
|
} else {
|
|
} else {
|
|
- throw new RuntimeException(examStudent.getName() + "已开始考试,不能删除");
|
|
|
|
|
|
+ throw new StatusException("E-150112", examStudent.getName() + "已开始考试,不能删除");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- public void deleteExamStudents(Long examId) throws Exception {
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 方法注释
|
|
|
|
+ *
|
|
|
|
+ * @author WANGWEI
|
|
|
|
+ * @param examId
|
|
|
|
+ */
|
|
|
|
+ public void deleteExamStudents(Long examId) {
|
|
Exam exam = examRepo.findOne(examId);
|
|
Exam exam = examRepo.findOne(examId);
|
|
if (exam.getCanStuDel()) {
|
|
if (exam.getCanStuDel()) {
|
|
examStudentRepo.deleteByExamId(examId);
|
|
examStudentRepo.deleteByExamId(examId);
|
|
} else {
|
|
} else {
|
|
- throw new RuntimeException("该考试已开始,不能删除");
|
|
|
|
|
|
+ throw new StatusException("E-150113", "该考试已开始,不能删除");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|