|
@@ -57,6 +57,7 @@ import cn.com.qmth.examcloud.core.examwork.api.controller.bean.ExamOrgSettingsDo
|
|
import cn.com.qmth.examcloud.core.examwork.base.enums.ExamProperty;
|
|
import cn.com.qmth.examcloud.core.examwork.base.enums.ExamProperty;
|
|
import cn.com.qmth.examcloud.core.examwork.dao.ExamCourseGroupRelationRepo;
|
|
import cn.com.qmth.examcloud.core.examwork.dao.ExamCourseGroupRelationRepo;
|
|
import cn.com.qmth.examcloud.core.examwork.dao.ExamCourseGroupSettingsRepo;
|
|
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.ExamOrgPropertyRepo;
|
|
import cn.com.qmth.examcloud.core.examwork.dao.ExamOrgSettingsRepo;
|
|
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.ExamPropertyRepo;
|
|
@@ -64,6 +65,7 @@ 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.ExamStudentRepo;
|
|
import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamCourseGroupRelationEntity;
|
|
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.ExamCourseGroupSettingsEntity;
|
|
|
|
+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.ExamEntity;
|
|
import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamOrgPropertyEntity;
|
|
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.ExamOrgSettingsEntity;
|
|
@@ -123,6 +125,53 @@ public class ExamController extends ControllerSupport {
|
|
@Autowired
|
|
@Autowired
|
|
StudentCloudService studentCloudService;
|
|
StudentCloudService studentCloudService;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ ExamCourseRelationRepo examCourseRelationRepo;
|
|
|
|
+
|
|
|
|
+ @ApiOperation(value = "查询考试的课程集合")
|
|
|
|
+ @GetMapping("queryExamCourseList")
|
|
|
|
+ public List<ExamCourseRelationEntity> getExamCourseList(
|
|
|
|
+ @RequestParam(required = true) Long examId, @RequestParam(required = false) String name,
|
|
|
|
+ @RequestParam(required = false) String level) {
|
|
|
|
+
|
|
|
|
+ ExamEntity one = examRepo.findOne(examId);
|
|
|
|
+ if (null == one) {
|
|
|
|
+ throw new StatusException("E-001250", "examId is wrong");
|
|
|
|
+ }
|
|
|
|
+ validateRootOrgIsolation(one.getRootOrgId());
|
|
|
|
+
|
|
|
|
+ Specification<ExamCourseRelationEntity> specification = (root, query, cb) -> {
|
|
|
|
+ List<Predicate> predicates = new ArrayList<>();
|
|
|
|
+
|
|
|
|
+ Predicate pr1 = cb.like(root.get("name"), toSqlSearchPattern(name));
|
|
|
|
+ Predicate pr2 = cb.like(root.get("code"), toSqlSearchPattern(name));
|
|
|
|
+
|
|
|
|
+ predicates.add(cb.or(pr1, pr2));
|
|
|
|
+
|
|
|
|
+ if (StringUtils.isNotBlank(level)) {
|
|
|
|
+ predicates.add(cb.equal(root.get("level"), toSqlSearchPattern(level)));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return cb.and(predicates.toArray(new Predicate[predicates.size()]));
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ PageRequest pageRequest = new PageRequest(0, 50, new Sort(Direction.DESC, "updateTime"));
|
|
|
|
+
|
|
|
|
+ Page<ExamCourseRelationEntity> page = examCourseRelationRepo.findAll(specification,
|
|
|
|
+ pageRequest);
|
|
|
|
+
|
|
|
|
+ Iterator<ExamCourseRelationEntity> iterator = page.iterator();
|
|
|
|
+ List<ExamCourseRelationEntity> list = Lists.newArrayList();
|
|
|
|
+
|
|
|
|
+ while (iterator.hasNext()) {
|
|
|
|
+ ExamCourseRelationEntity next = iterator.next();
|
|
|
|
+ list.add(next);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return list;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 方法注释
|
|
* 方法注释
|
|
*
|
|
*
|