|
@@ -22,8 +22,8 @@ import cn.com.qmth.examcloud.commons.helpers.DynamicEnum;
|
|
|
import cn.com.qmth.examcloud.commons.helpers.DynamicEnumManager;
|
|
|
import cn.com.qmth.examcloud.commons.helpers.poi.ExcelReader;
|
|
|
import cn.com.qmth.examcloud.commons.util.DateUtil;
|
|
|
-import cn.com.qmth.examcloud.commons.util.PathUtil;
|
|
|
import cn.com.qmth.examcloud.commons.util.DateUtil.DatePatterns;
|
|
|
+import cn.com.qmth.examcloud.commons.util.PathUtil;
|
|
|
import cn.com.qmth.examcloud.core.basic.api.OrgCloudService;
|
|
|
import cn.com.qmth.examcloud.core.basic.api.bean.OrgBean;
|
|
|
import cn.com.qmth.examcloud.core.basic.api.request.GetOrgReq;
|
|
@@ -43,7 +43,7 @@ import cn.com.qmth.examcloud.core.examwork.service.bean.ExamInfo;
|
|
|
import cn.com.qmth.examcloud.core.examwork.service.bean.ExamSpecialSettingsInfo;
|
|
|
import cn.com.qmth.examcloud.task.api.DataSyncCloudService;
|
|
|
import cn.com.qmth.examcloud.task.api.request.SyncExamReq;
|
|
|
-import cn.com.qmth.examcloud.web.enums.DataExecutionStatus;
|
|
|
+import cn.com.qmth.examcloud.web.enums.CURD;
|
|
|
|
|
|
/**
|
|
|
* 类注释
|
|
@@ -103,7 +103,7 @@ public class ExamServiceImpl implements ExamService {
|
|
|
* qmth.examcloud.core.examwork.service.bean.ExamInfo)
|
|
|
*/
|
|
|
@Override
|
|
|
- public ExamEntity saveExam(ExamInfo examInfo, DataExecutionStatus es) {
|
|
|
+ public ExamEntity saveExam(ExamInfo examInfo, CURD es) {
|
|
|
|
|
|
if (null == examInfo.getExamType()) {
|
|
|
throw new StatusException("E-001005", "考试类型为空");
|
|
@@ -127,9 +127,9 @@ public class ExamServiceImpl implements ExamService {
|
|
|
|
|
|
ExamEntity exam = null;
|
|
|
|
|
|
- DataExecutionStatus realStatus = null;
|
|
|
+ CURD realStatus = null;
|
|
|
// 更新
|
|
|
- if (es.equals(DataExecutionStatus.UPDATE)) {
|
|
|
+ if (es.equals(CURD.UPDATE)) {
|
|
|
if (null != examInfo.getId()) {
|
|
|
exam = examRepo.findOne(examInfo.getId());
|
|
|
if (null == exam) {
|
|
@@ -151,10 +151,10 @@ public class ExamServiceImpl implements ExamService {
|
|
|
throw new StatusException("E-002005", "考试名称已存在");
|
|
|
}
|
|
|
|
|
|
- realStatus = DataExecutionStatus.UPDATE;
|
|
|
+ realStatus = CURD.UPDATE;
|
|
|
}
|
|
|
// 创建
|
|
|
- else if (es.equals(DataExecutionStatus.CREATION)) {
|
|
|
+ else if (es.equals(CURD.CREATION)) {
|
|
|
if (null != examInfo.getId()) {
|
|
|
throw new StatusException("E-002004", "id is needless");
|
|
|
}
|
|
@@ -165,10 +165,10 @@ public class ExamServiceImpl implements ExamService {
|
|
|
}
|
|
|
exam = new ExamEntity();
|
|
|
exam.setEnable(true);
|
|
|
- realStatus = DataExecutionStatus.CREATION;
|
|
|
+ realStatus = CURD.CREATION;
|
|
|
}
|
|
|
// (根据考试名称)新增或创建
|
|
|
- else if (es.equals(DataExecutionStatus.CREATION_OR_UPDATE)) {
|
|
|
+ else if (es.equals(CURD.CREATION_OR_UPDATE)) {
|
|
|
if (null != examInfo.getId()) {
|
|
|
throw new StatusException("E-002006", "id is needless");
|
|
|
}
|
|
@@ -176,7 +176,7 @@ public class ExamServiceImpl implements ExamService {
|
|
|
if (null == exam) {
|
|
|
exam = new ExamEntity();
|
|
|
exam.setEnable(true);
|
|
|
- realStatus = DataExecutionStatus.CREATION;
|
|
|
+ realStatus = CURD.CREATION;
|
|
|
} else {
|
|
|
if (!exam.getRootOrgId().equals(examInfo.getRootOrgId())) {
|
|
|
throw new StatusException("E-002003", "rootOrgId is wrong");
|
|
@@ -184,11 +184,11 @@ public class ExamServiceImpl implements ExamService {
|
|
|
if (!exam.getExamType().equals(examInfo.getExamType())) {
|
|
|
throw new StatusException("E-002100", "examType is wrong");
|
|
|
}
|
|
|
- realStatus = DataExecutionStatus.UPDATE;
|
|
|
+ realStatus = CURD.UPDATE;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (realStatus.equals(DataExecutionStatus.CREATION)) {
|
|
|
+ if (realStatus.equals(CURD.CREATION)) {
|
|
|
if (null == examInfo.getBeginTime()) {
|
|
|
throw new StatusException("E-002006", "beginTime is null");
|
|
|
}
|