|
@@ -32,7 +32,6 @@ import cn.com.qmth.examcloud.core.oe.admin.api.request.CheckExamIsStartedReq;
|
|
import cn.com.qmth.examcloud.core.oe.admin.api.response.CheckExamIsStartedResp;
|
|
import cn.com.qmth.examcloud.core.oe.admin.api.response.CheckExamIsStartedResp;
|
|
import cn.com.qmth.examcloud.task.api.DataSyncCloudService;
|
|
import cn.com.qmth.examcloud.task.api.DataSyncCloudService;
|
|
import cn.com.qmth.examcloud.task.api.request.SyncExamStudentReq;
|
|
import cn.com.qmth.examcloud.task.api.request.SyncExamStudentReq;
|
|
-import cn.com.qmth.examcloud.web.bootstrap.PropertyHolder;
|
|
|
|
import cn.com.qmth.examcloud.web.helpers.GlobalHelper;
|
|
import cn.com.qmth.examcloud.web.helpers.GlobalHelper;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -79,17 +78,6 @@ public class ExamStudentServiceImpl implements ExamStudentService {
|
|
@Autowired
|
|
@Autowired
|
|
ExamPaperTypeRelationRepo examPaperTypeRelationRepo;
|
|
ExamPaperTypeRelationRepo examPaperTypeRelationRepo;
|
|
|
|
|
|
- /**
|
|
|
|
- * 是否强制删除考生
|
|
|
|
- *
|
|
|
|
- * @return
|
|
|
|
- * @author WANGWEI
|
|
|
|
- */
|
|
|
|
- private boolean forceDeleteExamStudent() {
|
|
|
|
- boolean b = PropertyHolder.getBoolean("$deleteExamStudent.force", false);
|
|
|
|
- return b;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* 是否开考
|
|
* 是否开考
|
|
*
|
|
*
|
|
@@ -121,7 +109,7 @@ public class ExamStudentServiceImpl implements ExamStudentService {
|
|
|
|
|
|
for (ExamStudentEntity examStudent : examStudents) {
|
|
for (ExamStudentEntity examStudent : examStudents) {
|
|
// 网考判断
|
|
// 网考判断
|
|
- if ((!forceDeleteExamStudent()) && isStarted(examStudent.getExamId(), null, null)) {
|
|
|
|
|
|
+ if (isStarted(examStudent.getExamId(), null, null)) {
|
|
throw new StatusException("150112", examStudent.getName() + "已开始考试,不能删除");
|
|
throw new StatusException("150112", examStudent.getName() + "已开始考试,不能删除");
|
|
}
|
|
}
|
|
examStudentRepo.delete(examStudent);
|
|
examStudentRepo.delete(examStudent);
|
|
@@ -170,7 +158,7 @@ public class ExamStudentServiceImpl implements ExamStudentService {
|
|
public void deleteExamStudentsByExamId(Long examId) {
|
|
public void deleteExamStudentsByExamId(Long examId) {
|
|
ExamEntity exam = GlobalHelper.getEntity(examRepo, examId, ExamEntity.class);
|
|
ExamEntity exam = GlobalHelper.getEntity(examRepo, examId, ExamEntity.class);
|
|
// 已经开考
|
|
// 已经开考
|
|
- if ((!forceDeleteExamStudent()) && isStarted(exam.getId(), null, null)) {
|
|
|
|
|
|
+ if (isStarted(exam.getId(), null, null)) {
|
|
throw new StatusException("150113", "该考试已开始,不能删除");
|
|
throw new StatusException("150113", "该考试已开始,不能删除");
|
|
}
|
|
}
|
|
|
|
|