wangwei 6 年之前
父節點
當前提交
edcd4b738e

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

@@ -60,11 +60,11 @@ import cn.com.qmth.examcloud.core.examwork.dao.ExamOrgSettingsRepo;
 import cn.com.qmth.examcloud.core.examwork.dao.ExamPropertyRepo;
 import cn.com.qmth.examcloud.core.examwork.dao.ExamRepo;
 import cn.com.qmth.examcloud.core.examwork.dao.ExamStudentRepo;
-import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamCourseGroupSettingsEntity;
 import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamCourseGroupRelationEntity;
+import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamCourseGroupSettingsEntity;
 import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamEntity;
-import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamOrgSettingsEntity;
 import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamOrgPropertyEntity;
+import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamOrgSettingsEntity;
 import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamPropertyEntity;
 import cn.com.qmth.examcloud.core.examwork.dao.enums.ExamType;
 import cn.com.qmth.examcloud.core.examwork.service.bean.ExamInfo;
@@ -463,7 +463,8 @@ public class ExamController extends ControllerSupport {
 
 		Pageable pageable = new PageRequest(curPage - 1, pageSize, Sort.Direction.DESC,
 				"updateTime");
-		List<ExamCourseGroupSettingsEntity> groupList = courseGroupRepo.findAllByExamId(examId, pageable);
+		List<ExamCourseGroupSettingsEntity> groupList = courseGroupRepo.findAllByExamId(examId,
+				pageable);
 
 		List<ExamCourseGroupDomain> ret = Lists.newArrayList();
 
@@ -504,8 +505,8 @@ public class ExamController extends ControllerSupport {
 	 */
 	@ApiOperation(value = "通过课程ID查询课程组集合", notes = "")
 	@GetMapping("getCourseGroupListByExamIdAndCourseId/{examId}/{courseId}")
-	public List<ExamCourseGroupDomain> getCourseGroupListByExamIdAndCourseId(@PathVariable Long examId,
-			@PathVariable Long courseId) {
+	public List<ExamCourseGroupDomain> getCourseGroupListByExamIdAndCourseId(
+			@PathVariable Long examId, @PathVariable Long courseId) {
 
 		List<ExamCourseGroupRelationEntity> relationList = courseGroupRelationRepo
 				.findAllByCourseIdAndExamId(courseId, examId);
@@ -679,8 +680,8 @@ public class ExamController extends ControllerSupport {
 	}
 
 	@ApiOperation(value = "查询考生考试机构配置", notes = "")
-	@PostMapping("studentExamOrg/{examId}")
-	public ExamOrgSettingsEntity getStudentExamOrg(@PathVariable Long examId) {
+	@PostMapping("examOrgSettings/{examId}")
+	public ExamDomain getExamOrgSettings(@PathVariable Long examId) {
 		User accessUser = getAccessUser();
 		ExamEntity examEntity = examRepo.findOne(examId);
 		if (null == examEntity) {
@@ -691,7 +692,25 @@ public class ExamController extends ControllerSupport {
 		ExamOrgSettingsEntity examOrgEntity = examOrgSettingsRepo.findByExamIdAndOrgId(examId,
 				accessUser.getOrgId());
 
-		return examOrgEntity;
+		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) {
+			domain.setBeginTime(examOrgEntity.getBeginTime());
+			domain.setEndTime(examOrgEntity.getEndTime());
+		}
+
+		return domain;
 	}
 
 	/**