|
@@ -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();
|