|
@@ -45,6 +45,7 @@ import cn.com.qmth.examcloud.commons.web.security.bean.User;
|
|
|
import cn.com.qmth.examcloud.commons.web.support.ControllerSupport;
|
|
|
import cn.com.qmth.examcloud.core.examwork.api.controller.bean.CourseGroupDomain;
|
|
|
import cn.com.qmth.examcloud.core.examwork.api.controller.bean.ExamDomain;
|
|
|
+import cn.com.qmth.examcloud.core.examwork.api.controller.bean.ExamOrgDomain;
|
|
|
import cn.com.qmth.examcloud.core.examwork.base.enums.ExamProperty;
|
|
|
import cn.com.qmth.examcloud.core.examwork.dao.CourseGroupRelationRepo;
|
|
|
import cn.com.qmth.examcloud.core.examwork.dao.CourseGroupRepo;
|
|
@@ -566,19 +567,36 @@ public class ExamController extends ControllerSupport {
|
|
|
* 方法注释
|
|
|
*
|
|
|
* @author WANGWEI
|
|
|
- * @param examId
|
|
|
* @param curPage
|
|
|
* @param pageSize
|
|
|
+ * @param examOrgDomain
|
|
|
* @return
|
|
|
*/
|
|
|
@ApiOperation(value = "查询考试相关的学习中心设置", notes = "")
|
|
|
- @GetMapping("getExamOrgList/{examId}/{curPage}/{pageSize}")
|
|
|
- public List<?> getExamOrgList(@PathVariable Long examId, @PathVariable Integer curPage,
|
|
|
- @PathVariable Integer pageSize) {
|
|
|
+ @GetMapping("getExamOrgList/{curPage}/{pageSize}")
|
|
|
+ public Page<ExamOrgEntity> getExamOrgList(@PathVariable Integer curPage,
|
|
|
+ @PathVariable Integer pageSize, @ModelAttribute ExamOrgDomain examOrgDomain) {
|
|
|
+
|
|
|
+ if (null == examOrgDomain.getExamId()) {
|
|
|
+ throw new StatusException("E-001210", "examId is null");
|
|
|
+ }
|
|
|
+
|
|
|
+ Specification<ExamOrgEntity> specification = (root, query, cb) -> {
|
|
|
+ List<Predicate> predicates = new ArrayList<>();
|
|
|
+
|
|
|
+ predicates.add(cb.equal(root.get("examId"), examOrgDomain.getExamId()));
|
|
|
+
|
|
|
+ if (null != examOrgDomain.getOrgId()) {
|
|
|
+ predicates.add(cb.equal(root.get("orgId"), examOrgDomain.getOrgId()));
|
|
|
+ }
|
|
|
+
|
|
|
+ return cb.and(predicates.toArray(new Predicate[predicates.size()]));
|
|
|
+ };
|
|
|
+
|
|
|
Pageable pageable = new PageRequest(curPage - 1, pageSize, Sort.Direction.DESC,
|
|
|
"updateTime");
|
|
|
- List<ExamOrgEntity> allByExamId = examOrgRepo.findAllByExamId(examId, pageable);
|
|
|
- return allByExamId;
|
|
|
+ Page<ExamOrgEntity> page = examOrgRepo.findAll(specification, pageable);
|
|
|
+ return page;
|
|
|
}
|
|
|
|
|
|
/**
|