Przeglądaj źródła

remove forceDeleteExamStudent

deason 3 lat temu
rodzic
commit
87c7557996

+ 2 - 14
examcloud-core-examwork-service/src/main/java/cn/com/qmth/examcloud/core/examwork/service/impl/ExamStudentServiceImpl.java

@@ -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.task.api.DataSyncCloudService;
 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 org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -79,17 +78,6 @@ public class ExamStudentServiceImpl implements ExamStudentService {
     @Autowired
     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) {
             // 网考判断
-            if ((!forceDeleteExamStudent()) && isStarted(examStudent.getExamId(), null, null)) {
+            if (isStarted(examStudent.getExamId(), null, null)) {
                 throw new StatusException("150112", examStudent.getName() + "已开始考试,不能删除");
             }
             examStudentRepo.delete(examStudent);
@@ -170,7 +158,7 @@ public class ExamStudentServiceImpl implements ExamStudentService {
     public void deleteExamStudentsByExamId(Long examId) {
         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", "该考试已开始,不能删除");
         }