wangwei vor 6 Jahren
Ursprung
Commit
3b30980db6

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

@@ -60,6 +60,7 @@ import cn.com.qmth.examcloud.core.examwork.dao.ExamCourseGroupSettingsRepo;
 import cn.com.qmth.examcloud.core.examwork.dao.ExamCourseRelationRepo;
 import cn.com.qmth.examcloud.core.examwork.dao.ExamOrgPropertyRepo;
 import cn.com.qmth.examcloud.core.examwork.dao.ExamOrgSettingsRepo;
+import cn.com.qmth.examcloud.core.examwork.dao.ExamPaperTypeRelationRepo;
 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;
@@ -69,6 +70,7 @@ import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamCourseRelationEntity;
 import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamEntity;
 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.ExamPaperTypeRelationEntity;
 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;
@@ -128,6 +130,26 @@ public class ExamController extends ControllerSupport {
 	@Autowired
 	ExamCourseRelationRepo examCourseRelationRepo;
 
+	@Autowired
+	ExamPaperTypeRelationRepo examPaperTypeRelationRepo;
+
+	@ApiOperation(value = "查询考试课程的试卷类型集合")
+	@GetMapping("queryExamCoursePaperTypeList")
+	public List<ExamPaperTypeRelationEntity> queryExamCoursePaperTypeList(
+			@RequestParam(required = true) Long examId,
+			@RequestParam(required = true) Long courseId) {
+		ExamEntity one = examRepo.findOne(examId);
+		if (null == one) {
+			throw new StatusException("E-001250", "examId is wrong");
+		}
+		validateRootOrgIsolation(one.getRootOrgId());
+
+		List<ExamPaperTypeRelationEntity> list = examPaperTypeRelationRepo
+				.findByExamIdAndCourseId(examId, courseId);
+
+		return list;
+	}
+
 	@ApiOperation(value = "查询考试的课程集合")
 	@GetMapping("queryExamCourseList")
 	public List<ExamCourseRelationEntity> getExamCourseList(

+ 4 - 0
examcloud-core-examwork-dao/src/main/java/cn/com/qmth/examcloud/core/examwork/dao/ExamPaperTypeRelationRepo.java

@@ -1,5 +1,7 @@
 package cn.com.qmth.examcloud.core.examwork.dao;
 
+import java.util.List;
+
 import org.springframework.data.jpa.repository.JpaRepository;
 import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
 import org.springframework.data.repository.query.QueryByExampleExecutor;
@@ -13,4 +15,6 @@ public interface ExamPaperTypeRelationRepo
 			QueryByExampleExecutor<ExamPaperTypeRelationEntity>,
 			JpaSpecificationExecutor<ExamPaperTypeRelationEntity> {
 
+	List<ExamPaperTypeRelationEntity> findByExamIdAndCourseId(Long examId, Long courseId);
+
 }