|
@@ -10,6 +10,7 @@ import java.util.Date;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.data.domain.Page;
|
|
import org.springframework.data.domain.PageRequest;
|
|
import org.springframework.data.domain.PageRequest;
|
|
import org.springframework.http.HttpStatus;
|
|
import org.springframework.http.HttpStatus;
|
|
import org.springframework.http.ResponseEntity;
|
|
import org.springframework.http.ResponseEntity;
|
|
@@ -51,22 +52,21 @@ public class StudentController extends ControllerSupport{
|
|
@Autowired
|
|
@Autowired
|
|
UserRepo userRepo;
|
|
UserRepo userRepo;
|
|
|
|
|
|
- @ApiOperation(value="查询所有学生",notes="分页")
|
|
|
|
- @GetMapping("/{curPage}/{pageSize}")
|
|
|
|
- public ResponseEntity getAllStudent(HttpServletRequest request,
|
|
|
|
- @ModelAttribute Student studentCriteria,
|
|
|
|
- @PathVariable Integer curPage,
|
|
|
|
- @PathVariable Integer pageSize){
|
|
|
|
- cn.com.qmth.examcloud.commons.web.security.bean.User accessUser = getAccessUser();
|
|
|
|
- if(accessUser != null){
|
|
|
|
- if(accessUser.getRootOrgId().longValue() == accessUser.getOrgId().longValue()){
|
|
|
|
- studentCriteria.setRootOrgId(accessUser.getRootOrgId());
|
|
|
|
- }else{
|
|
|
|
- studentCriteria.setOrgId(accessUser.getOrgId());
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- return new ResponseEntity(studentService.getAllStudent(studentCriteria,new PageRequest(curPage,pageSize)),HttpStatus.OK);
|
|
|
|
- }
|
|
|
|
|
|
+ @ApiOperation(value = "查询所有学生", notes = "分页")
|
|
|
|
+ @GetMapping("/{curPage}/{pageSize}")
|
|
|
|
+ public Page<Student> getAllStudent(HttpServletRequest request,
|
|
|
|
+ @ModelAttribute Student studentCriteria, @PathVariable Integer curPage,
|
|
|
|
+ @PathVariable Integer pageSize) {
|
|
|
|
+ cn.com.qmth.examcloud.commons.web.security.bean.User accessUser = getAccessUser();
|
|
|
|
+
|
|
|
|
+ if (!isSuperAdmin()) {
|
|
|
|
+ studentCriteria.setRootOrgId(accessUser.getRootOrgId());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ Page<Student> studentList = studentService.getAllStudent(studentCriteria,
|
|
|
|
+ new PageRequest(curPage, pageSize));
|
|
|
|
+ return studentList;
|
|
|
|
+ }
|
|
|
|
|
|
@ApiOperation(value="查询所有学生",notes="不分页")
|
|
@ApiOperation(value="查询所有学生",notes="不分页")
|
|
@GetMapping
|
|
@GetMapping
|