|
@@ -663,8 +663,7 @@ public class ExamController extends ControllerSupport {
|
|
|
|
|
|
@ApiOperation(value = "查询考生的考试批次配置")
|
|
|
@GetMapping("examOrgSettingsFromCacheByStudentSession/{examId}")
|
|
|
- public ExamOrgSettingsCacheBean getExamOrgSettingsFromCacheByStudentSession(
|
|
|
- @PathVariable Long examId) {
|
|
|
+ public ExamDomain getExamOrgSettingsFromCacheByStudentSession(@PathVariable Long examId) {
|
|
|
|
|
|
User accessUser = getAccessUser();
|
|
|
if (!accessUser.getUserType().equals(UserType.STUDENT)) {
|
|
@@ -676,8 +675,22 @@ public class ExamController extends ControllerSupport {
|
|
|
StudentCacheBean student = CacheHelper.getStudent(studentId);
|
|
|
Long orgId = student.getOrgId();
|
|
|
|
|
|
- ExamOrgSettingsCacheBean orgExamConfig = CacheHelper.getExamOrgSettings(examId, orgId);
|
|
|
- return orgExamConfig;
|
|
|
+ ExamOrgSettingsCacheBean examCache = CacheHelper.getExamOrgSettings(examId, orgId);
|
|
|
+
|
|
|
+ ExamDomain domain = new ExamDomain();
|
|
|
+ domain.setBeginTime(examCache.getBeginTime());
|
|
|
+ domain.setDuration(examCache.getDuration());
|
|
|
+ domain.setEnable(examCache.getEnable());
|
|
|
+ domain.setEndTime(examCache.getEndTime());
|
|
|
+ domain.setExamTimes(examCache.getExamTimes());
|
|
|
+ domain.setExamType(ExamType.valueOf(examCache.getExamType()));
|
|
|
+ domain.setId(examCache.getId());
|
|
|
+ domain.setName(examCache.getName());
|
|
|
+ domain.setRemark(examCache.getRemark());
|
|
|
+ domain.setRootOrgId(examCache.getRootOrgId());
|
|
|
+ domain.setStarted(examCache.getBeginTime().before(new Date()));
|
|
|
+
|
|
|
+ return domain;
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "查询考生的考试批次属性集")
|
|
@@ -761,29 +774,6 @@ public class ExamController extends ControllerSupport {
|
|
|
return properties;
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 方法注释
|
|
|
- *
|
|
|
- * @author WANGWEI
|
|
|
- * @param examId
|
|
|
- * @return
|
|
|
- */
|
|
|
- @ApiOperation(value = "查询考生考试批次单个属性")
|
|
|
- @GetMapping("examOrgProperty/{examId}/{key}")
|
|
|
- public String getExamOrgProperty(@PathVariable Long examId, @PathVariable String key) {
|
|
|
- User accessUser = getAccessUser();
|
|
|
- ExamEntity examEntity = GlobalHelper.getEntity(examRepo, examId, ExamEntity.class);
|
|
|
- if (null == examEntity) {
|
|
|
- throw new StatusException("001250", "examId is wrong");
|
|
|
- }
|
|
|
- validateRootOrgIsolation(examEntity.getRootOrgId());
|
|
|
-
|
|
|
- StudentBean student = getStudent(accessUser.getUserId());
|
|
|
- Long orgId = student.getOrgId();
|
|
|
-
|
|
|
- return examService.getOrgProperty(examId, orgId, key);
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* 方法注释
|
|
|
*
|
|
@@ -972,50 +962,6 @@ public class ExamController extends ControllerSupport {
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "查询考生考试机构配置", notes = "")
|
|
|
- @PostMapping("examOrgSettings/{examId}")
|
|
|
- public ExamDomain getExamOrgSettings(@PathVariable Long examId) {
|
|
|
- User accessUser = getAccessUser();
|
|
|
- ExamEntity examEntity = GlobalHelper.getEntity(examRepo, examId, ExamEntity.class);
|
|
|
- if (null == examEntity) {
|
|
|
- throw new StatusException("001250", "examId is wrong");
|
|
|
- }
|
|
|
- validateRootOrgIsolation(examEntity.getRootOrgId());
|
|
|
-
|
|
|
- StudentBean student = getStudent(accessUser.getUserId());
|
|
|
- Long orgId = student.getOrgId();
|
|
|
-
|
|
|
- ExamSpecialSettingsEntity examOrgEntity = examSpecialSettingsRepo
|
|
|
- .findByExamIdAndOrgIdAndCourseIdIsNull(examId, orgId);
|
|
|
-
|
|
|
- ExamDomain domain = new ExamDomain();
|
|
|
- domain.setBeginTime(examEntity.getBeginTime());
|
|
|
- domain.setDuration(examEntity.getDuration());
|
|
|
- domain.setEnable(examEntity.getEnable());
|
|
|
- domain.setEndTime(examEntity.getEndTime());
|
|
|
- domain.setExamTimes(examEntity.getExamTimes());
|
|
|
- domain.setExamType(examEntity.getExamType());
|
|
|
- domain.setId(examEntity.getId());
|
|
|
- domain.setName(examEntity.getName());
|
|
|
- domain.setRemark(examEntity.getRemark());
|
|
|
- domain.setRootOrgId(examEntity.getRootOrgId());
|
|
|
- domain.setStarted(examEntity.getBeginTime().before(new Date()));
|
|
|
-
|
|
|
- if (null != examOrgEntity) {
|
|
|
- if (null != examOrgEntity.getBeginTime()) {
|
|
|
- domain.setBeginTime(examOrgEntity.getBeginTime());
|
|
|
- }
|
|
|
- if (null != examOrgEntity.getEndTime()) {
|
|
|
- domain.setEndTime(examOrgEntity.getEndTime());
|
|
|
- }
|
|
|
- if (null != examOrgEntity.getExamLimit()) {
|
|
|
- domain.setExamLimit(examOrgEntity.getExamLimit());
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- return domain;
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* 方法注释
|
|
|
*
|