|
@@ -33,11 +33,13 @@ import cn.com.qmth.examcloud.commons.web.support.ControllerSupport;
|
|
|
import cn.com.qmth.examcloud.core.examwork.base.enums.ExamProperty;
|
|
|
import cn.com.qmth.examcloud.core.examwork.dao.ExamCourseRelationRepo;
|
|
|
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.entity.ExamCourseRelationEntity;
|
|
|
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.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;
|
|
@@ -45,7 +47,9 @@ import cn.com.qmth.examcloud.core.examwork.service.impl.ExamServiceImpl;
|
|
|
import cn.com.qmth.examcloud.examwork.api.ExamCloudService;
|
|
|
import cn.com.qmth.examcloud.examwork.api.bean.ExamBean;
|
|
|
import cn.com.qmth.examcloud.examwork.api.bean.ExamCourseRelationBean;
|
|
|
+import cn.com.qmth.examcloud.examwork.api.bean.ExamPaperTypeRelation;
|
|
|
import cn.com.qmth.examcloud.examwork.api.request.GetExamCourseListReq;
|
|
|
+import cn.com.qmth.examcloud.examwork.api.request.GetExamCoursePaperTypeListReq;
|
|
|
import cn.com.qmth.examcloud.examwork.api.request.GetExamListReq;
|
|
|
import cn.com.qmth.examcloud.examwork.api.request.GetExamPropertyReq;
|
|
|
import cn.com.qmth.examcloud.examwork.api.request.GetExamReq;
|
|
@@ -55,6 +59,7 @@ import cn.com.qmth.examcloud.examwork.api.request.SaveExamReq;
|
|
|
import cn.com.qmth.examcloud.examwork.api.request.SetExamPropertyReq;
|
|
|
import cn.com.qmth.examcloud.examwork.api.request.UnlockExamStudentsReq;
|
|
|
import cn.com.qmth.examcloud.examwork.api.response.GetExamCourseListResp;
|
|
|
+import cn.com.qmth.examcloud.examwork.api.response.GetExamCoursePaperTypeListResp;
|
|
|
import cn.com.qmth.examcloud.examwork.api.response.GetExamListResp;
|
|
|
import cn.com.qmth.examcloud.examwork.api.response.GetExamPropertyResp;
|
|
|
import cn.com.qmth.examcloud.examwork.api.response.GetExamResp;
|
|
@@ -66,10 +71,11 @@ import cn.com.qmth.examcloud.examwork.api.response.UnlockExamStudentsResp;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
|
/**
|
|
|
- * @author chenken
|
|
|
- * @date 2018年5月3日 下午2:08:59
|
|
|
- * @company QMTH
|
|
|
- * @description ExamProvider.java
|
|
|
+ * 类注释
|
|
|
+ *
|
|
|
+ * @author WANGWEI
|
|
|
+ * @date 2018年11月23日
|
|
|
+ * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
|
|
|
*/
|
|
|
@Transactional
|
|
|
@RestController
|
|
@@ -93,6 +99,9 @@ public class ExamCloudServiceProvider extends ControllerSupport implements ExamC
|
|
|
@Autowired
|
|
|
ExamCourseRelationRepo examCourseRelationRepo;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ ExamPaperTypeRelationRepo examPaperTypeRelationRepo;
|
|
|
+
|
|
|
@ApiOperation(value = "保存考试批次", notes = "保存")
|
|
|
@PostMapping("saveExam")
|
|
|
@Override
|
|
@@ -473,4 +482,54 @@ public class ExamCloudServiceProvider extends ControllerSupport implements ExamC
|
|
|
return resp;
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation(value = "查询考试课程的试卷类型集")
|
|
|
+ @PostMapping("getExamCoursePaperTypeList")
|
|
|
+ @Override
|
|
|
+ public GetExamCoursePaperTypeListResp getExamCoursePaperTypeList(
|
|
|
+ @RequestBody GetExamCoursePaperTypeListReq req) {
|
|
|
+
|
|
|
+ Long examId = req.getExamId();
|
|
|
+
|
|
|
+ final long start = null == req.getStart() ? 1 : req.getStart();
|
|
|
+
|
|
|
+ Pageable pageable = new PageRequest(0, 100, Sort.Direction.ASC, "courseId");
|
|
|
+
|
|
|
+ Specification<ExamPaperTypeRelationEntity> specification = (root, query, cb) -> {
|
|
|
+ List<Predicate> predicates = new ArrayList<>();
|
|
|
+ predicates.add(cb.equal(root.get("examId"), examId));
|
|
|
+
|
|
|
+ predicates.add(cb.greaterThanOrEqualTo(root.get("courseId"), start));
|
|
|
+
|
|
|
+ return cb.and(predicates.toArray(new Predicate[predicates.size()]));
|
|
|
+ };
|
|
|
+
|
|
|
+ Page<ExamPaperTypeRelationEntity> page = examPaperTypeRelationRepo.findAll(specification,
|
|
|
+ pageable);
|
|
|
+
|
|
|
+ Iterator<ExamPaperTypeRelationEntity> iterator = page.iterator();
|
|
|
+
|
|
|
+ List<ExamPaperTypeRelation> list = Lists.newArrayList();
|
|
|
+ long next = start;
|
|
|
+ while (iterator.hasNext()) {
|
|
|
+ ExamPaperTypeRelationEntity e = iterator.next();
|
|
|
+ ExamPaperTypeRelation b = new ExamPaperTypeRelation();
|
|
|
+ b.setCourseId(e.getCourseId());
|
|
|
+ b.setExamId(e.getExamId());
|
|
|
+ b.setPaperType(e.getPaperType());
|
|
|
+
|
|
|
+ next = e.getCourseId();
|
|
|
+ list.add(b);
|
|
|
+ }
|
|
|
+
|
|
|
+ GetExamCoursePaperTypeListResp resp = new GetExamCoursePaperTypeListResp();
|
|
|
+ if (next != start) {
|
|
|
+ next++;
|
|
|
+ }
|
|
|
+ resp.setNext(next);
|
|
|
+ resp.setRelationList(list);
|
|
|
+
|
|
|
+ return resp;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
}
|