WANG 5 lat temu
rodzic
commit
15f521f86d

+ 17 - 18
examcloud-core-examwork-api-provider/src/main/java/cn/com/qmth/examcloud/core/examwork/api/controller/ExamController.java

@@ -96,6 +96,7 @@ import cn.com.qmth.examcloud.core.oe.admin.api.response.CheckExamIsStartedResp;
 import cn.com.qmth.examcloud.support.cache.CacheHelper;
 import cn.com.qmth.examcloud.support.cache.bean.ExamOrgPropertyCacheBean;
 import cn.com.qmth.examcloud.support.cache.bean.ExamOrgSettingsCacheBean;
+import cn.com.qmth.examcloud.support.cache.bean.ExamSettingsCacheBean;
 import cn.com.qmth.examcloud.support.cache.bean.StudentCacheBean;
 import cn.com.qmth.examcloud.task.api.DataSyncCloudService;
 import cn.com.qmth.examcloud.task.api.request.SyncExamReq;
@@ -458,26 +459,24 @@ public class ExamController extends ControllerSupport {
 	@ApiOperation(value = "按ID查询考试批次", notes = "ID查询")
 	@GetMapping("{examId}")
 	public ExamDomain getExamById(@PathVariable Long examId) {
-		ExamEntity one = GlobalHelper.getEntity(examRepo, examId, ExamEntity.class);
-		if (null == one) {
-			throw new StatusException("001250", "examId is wrong");
-		}
-		validateRootOrgIsolation(one.getRootOrgId());
+
+		ExamSettingsCacheBean cache = examSettingsCache.get(examId);
+		validateRootOrgIsolation(cache.getRootOrgId());
 
 		ExamDomain domain = new ExamDomain();
-		domain.setBeginTime(one.getBeginTime());
-		domain.setDuration(one.getDuration());
-		domain.setEnable(one.getEnable());
-		domain.setEndTime(one.getEndTime());
-		domain.setExamTimes(one.getExamTimes());
-		domain.setExamType(one.getExamType());
-		domain.setId(one.getId());
-		domain.setName(one.getName());
-		domain.setCode(one.getCode());
-		domain.setRemark(one.getRemark());
-		domain.setRootOrgId(one.getRootOrgId());
-		domain.setStarted(isStarted(one.getId()));
-		domain.setExamLimit(one.getExamLimit());
+		domain.setBeginTime(cache.getBeginTime());
+		domain.setDuration(cache.getDuration());
+		domain.setEnable(cache.getEnable());
+		domain.setEndTime(cache.getEndTime());
+		domain.setExamTimes(cache.getExamTimes());
+		domain.setExamType(ExamType.valueOf(cache.getExamType()));
+		domain.setId(cache.getId());
+		domain.setName(cache.getName());
+		domain.setCode(cache.getCode());
+		domain.setRemark(cache.getRemark());
+		domain.setRootOrgId(cache.getRootOrgId());
+		domain.setStarted(isStarted(cache.getId()));
+		domain.setExamLimit(cache.getExamLimit());
 		return domain;
 	}
 

+ 0 - 1
examcloud-core-examwork-starter/src/main/resources/security.properties

@@ -1,6 +1,5 @@
 [s][${$rmp.ctr.examwork}/exam][queryByNameLike][GET]=true
 [s][${$rmp.ctr.examwork}/exam][{examId}][GET]=true
-[s][${$rmp.ctr.examwork}/exam][examOrgProperty/{examId}/{key}][GET]=true
 [s][${$rmp.ctr.examwork}/exam][ipLimit/{examId}][GET]=true
 [s][${$rmp.ctr.examwork}/exam][examOrgPropertyFromCache4StudentSession/{examId}/{keys}][GET]=true
 [s][${$rmp.ctr.examwork}/exam][examOrgSettingsFromCacheByStudentSession/{examId}][GET]=true