| | |
| | | */ |
| | | package cn.gistack.system.controller; |
| | | |
| | | import cn.gistack.common.node.DeptUserTreeNode; |
| | | import cn.gistack.common.node.TreeNode; |
| | | import cn.gistack.common.utils.NodeTreeUtil; |
| | | import cn.gistack.system.vo.DeptVO; |
| | | import cn.gistack.system.wrapper.DeptWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | |
| | | @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); |
| | | } |
| | | |
| | | /** |
| | | * 懒加载获取部门树形结构 |
| | | */ |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询组织机构树数据(下级包含人员信息) |
| | | * @param treeNode |
| | | * @return |
| | | */ |
| | | @GetMapping("/getDeptAndUserTree") |
| | | @ApiOperation(value = "查询组织机构树数据(下级包含人员信息)") |
| | | public R getDeptAndUserTree(DeptUserTreeNode treeNode) { |
| | | return R.data(deptService.getDeptAndUserTree(treeNode)); |
| | | } |
| | | |
| | | @GetMapping("updateAllDept") |
| | | public R updateAllDept(){ |
| | | int number = deptService.updateAllDept(); |
| | | return R.data(number); |
| | | } |
| | | |
| | | |
| | | } |