wangwei před 6 roky
rodič
revize
fb1eb5582a

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

@@ -578,9 +578,15 @@ public class ExamController extends ControllerSupport {
 	public PageInfo<ExamOrgDomain> getExamOrgList(@PathVariable Integer curPage,
 			@PathVariable Integer pageSize, @ModelAttribute ExamOrgDomain examOrgDomain) {
 
+		Long examId = examOrgDomain.getExamId();
 		if (null == examOrgDomain.getExamId()) {
 			throw new StatusException("E-001210", "examId is null");
 		}
+		ExamEntity examEntity = examRepo.findOne(examId);
+		if (null == examEntity) {
+			throw new StatusException("E-001250", "examId is wrong");
+		}
+		validateRootOrgIsolation(examEntity.getRootOrgId());
 
 		Specification<ExamOrgEntity> specification = (root, query, cb) -> {
 			List<Predicate> predicates = new ArrayList<>();
@@ -594,8 +600,7 @@ public class ExamController extends ControllerSupport {
 			return cb.and(predicates.toArray(new Predicate[predicates.size()]));
 		};
 
-		Pageable pageable = new PageRequest(curPage - 1, pageSize, Sort.Direction.DESC,
-				"updateTime");
+		Pageable pageable = new PageRequest(curPage, pageSize, Sort.Direction.DESC, "updateTime");
 		Page<ExamOrgEntity> page = examOrgRepo.findAll(specification, pageable);
 
 		Iterator<ExamOrgEntity> iterator = page.iterator();