|
@@ -54,10 +54,25 @@ public class OrgApi {
|
|
|
@PathVariable Integer pageSize){
|
|
|
return new ResponseEntity(orgService.findAll(orgCriteria,new PageRequest(curPage - 1,pageSize)), HttpStatus.OK);
|
|
|
}
|
|
|
+
|
|
|
+ @ApiOperation(value="查询顶层机构分页带查询",notes="分页带查询")
|
|
|
+ @GetMapping("/parent/{curPage}/{pageSize}")
|
|
|
+ public ResponseEntity getParentOrg(@ModelAttribute Org orgCriteria,
|
|
|
+ @PathVariable Integer curPage,
|
|
|
+ @PathVariable Integer pageSize){
|
|
|
+ orgCriteria.setParentId(0L);
|
|
|
+ orgCriteria.setRootId(0L);
|
|
|
+ return new ResponseEntity(orgService.findAll(orgCriteria,new PageRequest(curPage - 1,pageSize)), HttpStatus.OK);
|
|
|
+ }
|
|
|
|
|
|
@ApiOperation(value="查询机构不分页带查询",notes = "不分页带查询")
|
|
|
@GetMapping("/all")
|
|
|
- public ResponseEntity getAllExam(@ModelAttribute Org orgCriteria){
|
|
|
+ public ResponseEntity getAllExam(@ModelAttribute Org orgCriteria,
|
|
|
+ HttpServletRequest request){
|
|
|
+ AccessUser accessUser = (AccessUser) request.getAttribute("accessUser");
|
|
|
+ if(accessUser != null){
|
|
|
+ return new ResponseEntity(orgRepo.findAllByParentId(accessUser.getRootOrgId()), HttpStatus.OK);
|
|
|
+ }
|
|
|
return new ResponseEntity(orgService.findAll(orgCriteria), HttpStatus.OK);
|
|
|
}
|
|
|
|
|
@@ -79,6 +94,7 @@ public class OrgApi {
|
|
|
@PathVariable Long parentId,
|
|
|
@PathVariable Integer curPage,
|
|
|
@PathVariable Integer pageSize){
|
|
|
+
|
|
|
orgCriteria.setParentId(parentId);
|
|
|
return new ResponseEntity(orgService.findAll(orgCriteria,new PageRequest(curPage - 1,pageSize)), HttpStatus.OK);
|
|
|
}
|
|
@@ -165,6 +181,6 @@ public class OrgApi {
|
|
|
@ApiOperation(value="按code查询机构(学习中心)",notes="code查询")
|
|
|
@GetMapping()
|
|
|
public ResponseEntity getCourseByCode(@RequestParam Long parentId,@RequestParam String code){
|
|
|
- return new ResponseEntity(orgRepo.findByParentIdAndCode(parentId, code),HttpStatus.OK);
|
|
|
+ return new ResponseEntity(orgRepo.findFirstByParentIdAndCode(parentId, code),HttpStatus.OK);
|
|
|
}
|
|
|
}
|