| | |
| | | package com.ruoyi.web.controller.system; |
| | | |
| | | import cn.dev33.satoken.annotation.SaCheckPermission; |
| | | import cn.hutool.core.lang.tree.Tree; |
| | | import cn.hutool.core.util.ArrayUtil; |
| | | import com.ruoyi.common.annotation.Log; |
| | |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | * 获取部门列表 |
| | | */ |
| | | @ApiOperation("获取部门列表") |
| | | @PreAuthorize("@ss.hasPermi('system:dept:list')") |
| | | @SaCheckPermission("system:dept:list") |
| | | @GetMapping("/list") |
| | | public AjaxResult<List<SysDept>> list(SysDept dept) { |
| | | List<SysDept> depts = deptService.selectDeptList(dept); |
| | |
| | | * 查询部门列表(排除节点) |
| | | */ |
| | | @ApiOperation("查询部门列表(排除节点)") |
| | | @PreAuthorize("@ss.hasPermi('system:dept:list')") |
| | | @SaCheckPermission("system:dept:list") |
| | | @GetMapping("/list/exclude/{deptId}") |
| | | public AjaxResult<List<SysDept>> excludeChild(@ApiParam("部门ID") @PathVariable(value = "deptId", required = false) Long deptId) { |
| | | List<SysDept> depts = deptService.selectDeptList(new SysDept()); |
| | |
| | | * 根据部门编号获取详细信息 |
| | | */ |
| | | @ApiOperation("根据部门编号获取详细信息") |
| | | @PreAuthorize("@ss.hasPermi('system:dept:query')") |
| | | @SaCheckPermission("system:dept:query") |
| | | @GetMapping(value = "/{deptId}") |
| | | public AjaxResult<SysDept> getInfo(@ApiParam("部门ID") @PathVariable Long deptId) { |
| | | deptService.checkDeptDataScope(deptId); |
| | |
| | | * 新增部门 |
| | | */ |
| | | @ApiOperation("新增部门") |
| | | @PreAuthorize("@ss.hasPermi('system:dept:add')") |
| | | @SaCheckPermission("system:dept:add") |
| | | @Log(title = "部门管理", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult<Void> add(@Validated @RequestBody SysDept dept) { |
| | |
| | | * 修改部门 |
| | | */ |
| | | @ApiOperation("修改部门") |
| | | @PreAuthorize("@ss.hasPermi('system:dept:edit')") |
| | | @SaCheckPermission("system:dept:edit") |
| | | @Log(title = "部门管理", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult<Void> edit(@Validated @RequestBody SysDept dept) { |
| | |
| | | * 删除部门 |
| | | */ |
| | | @ApiOperation("删除部门") |
| | | @PreAuthorize("@ss.hasPermi('system:dept:remove')") |
| | | @SaCheckPermission("system:dept:remove") |
| | | @Log(title = "部门管理", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{deptId}") |
| | | public AjaxResult<Void> remove(@ApiParam("部门ID串") @PathVariable Long deptId) { |