|
@@ -64,16 +64,25 @@ public class StudentController extends ControllerSupport {
|
|
* @param pageSize
|
|
* @param pageSize
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- @ApiOperation(value = "查询所有学生", notes = "分页")
|
|
|
|
|
|
+ @ApiOperation(value = "查询学生分页数据", notes = "分页")
|
|
@GetMapping("studentPage/{curPage}/{pageSize}")
|
|
@GetMapping("studentPage/{curPage}/{pageSize}")
|
|
- public Page<StudentEntity> getStudentPage(@RequestParam String name,
|
|
|
|
|
|
+ public Page<StudentEntity> getStudentPage(@PathVariable Integer curPage,
|
|
|
|
+ @PathVariable Integer pageSize, @RequestParam String name,
|
|
@RequestParam String studentCode, @RequestParam String identityNumber,
|
|
@RequestParam String studentCode, @RequestParam String identityNumber,
|
|
- @PathVariable Integer curPage, @PathVariable Integer pageSize) {
|
|
|
|
|
|
+ @RequestParam(required = false) Long rootOrgId) {
|
|
|
|
+
|
|
User accessUser = getAccessUser();
|
|
User accessUser = getAccessUser();
|
|
|
|
+ if (null == rootOrgId) {
|
|
|
|
+ rootOrgId = accessUser.getRootOrgId();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ validateRootOrgIsolation(rootOrgId);
|
|
|
|
+
|
|
|
|
+ final Long finalRootOrgId = rootOrgId;
|
|
|
|
|
|
Specification<StudentEntity> specification = (root, query, cb) -> {
|
|
Specification<StudentEntity> specification = (root, query, cb) -> {
|
|
List<Predicate> predicates = new ArrayList<>();
|
|
List<Predicate> predicates = new ArrayList<>();
|
|
- predicates.add(cb.equal(root.get("rootOrgId"), accessUser.getRootOrgId()));
|
|
|
|
|
|
+ predicates.add(cb.equal(root.get("rootOrgId"), finalRootOrgId));
|
|
|
|
|
|
if (StringUtils.isNotEmpty(name)) {
|
|
if (StringUtils.isNotEmpty(name)) {
|
|
predicates.add(cb.like(root.get("name"), toSqlSearchPattern(name)));
|
|
predicates.add(cb.like(root.get("name"), toSqlSearchPattern(name)));
|