| | |
| | | @AllArgsConstructor |
| | | @RequestMapping("/dept") |
| | | @Api(value = "部门", tags = "部门") |
| | | @PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | //@PreAuth(RoleConstant.HAS_ROLE_ADMIN) |
| | | public class DeptController extends BladeController { |
| | | |
| | | private final IDeptService deptService; |
| | |
| | | return R.data(tree); |
| | | } |
| | | |
| | | @GetMapping("/treeByParentId") |
| | | @ApiOperationSupport(order = 10) |
| | | @ApiOperation(value = "树形结构", notes = "树形结构") |
| | | public R<List<DeptVO>> treeByParentId(String parentId) { |
| | | List<DeptVO> tree = deptService.treeByParentId(parentId); |
| | | return R.data(tree); |
| | | } |
| | | |
| | | /** |
| | | * 懒加载获取部门树形结构 |
| | | */ |
| | | @GetMapping("/lazy-tree") |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "懒加载树形结构", notes = "树形结构") |
| | | public R<List<DeptVO>> lazyTree(String tenantId, Long parentId, BladeUser bladeUser) { |
| | | public R<List<DeptVO>> lazyTree(String tenantId, String parentId, BladeUser bladeUser) { |
| | | List<DeptVO> tree = deptService.lazyTree(Func.toStrWithEmpty(tenantId, bladeUser.getTenantId()), parentId); |
| | | return R.data(tree); |
| | | } |
| | |
| | | return R.data(deptService.getDeptAndUserTree(treeNode)); |
| | | } |
| | | |
| | | @GetMapping("updateAllDept") |
| | | public R updateAllDept(){ |
| | | int number = deptService.updateAllDept(); |
| | | return R.data(number); |
| | | } |
| | | |
| | | |
| | | } |