he2802 преди 3 години
родител
ревизия
dc15494a6a
променени са 1 файла, в които са добавени 5 реда и са изтрити 2 реда
  1. 5 2
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/ExamServiceImpl.java

+ 5 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/ExamServiceImpl.java

@@ -237,8 +237,11 @@ public class ExamServiceImpl extends ServiceImpl<ExamMapper, Exam> implements IE
                 throw new CustomException("该卷已被绑定,不允许修改发布状态为未发布");
             }
         }
-        if(Validator.isNotEmpty(entity.getSimulateStatus())&&(entity.getDoType()!=2)&&(entity.getSimulateStatus()==1)){
-            throw new CustomException("非考试类型无法开启模拟随机做题");
+        if(Validator.isNotEmpty(entity.getSimulateStatus())&&(entity.getSimulateStatus()==1)){
+            if((Validator.isEmpty(entity.getDoType()))||(entity.getDoType()!=2)){
+                throw new CustomException("非考试类型无法开启模拟随机做题");
+            }
+
         }
         if(Validator.isNotEmpty(entity.getSimulateConfig())){
             Integer q1 = entity.getSimulateConfig().getSingleChoice().getQNum();