| | |
| | | @Autowired |
| | | private ISysDeptService deptService; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取部门列表 |
| | | */ |
| | |
| | | * 新增部门 |
| | | */ |
| | | @RequiresPermissions("system:dept:add") |
| | | @Log(title = "部门管理", businessType = BusinessType.INSERT) |
| | | @Log(title = "部门管理", businessType = BusinessType.INSERT,operContent = "新增部门") |
| | | @PostMapping |
| | | public AjaxResult add(@Validated @RequestBody SysDept dept) |
| | | { |
| | |
| | | { |
| | | return error("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在"); |
| | | } |
| | | dept.setParentId(100L); |
| | | dept.setOrderNum(1); |
| | | dept.setCreateBy(SecurityUtils.getUsername()); |
| | | return toAjax(deptService.insertDept(dept)); |
| | | } |
| | |
| | | * 修改部门 |
| | | */ |
| | | @RequiresPermissions("system:dept:edit") |
| | | @Log(title = "部门管理", businessType = BusinessType.UPDATE) |
| | | @Log(title = "部门管理", businessType = BusinessType.UPDATE,operContent = "修改部门") |
| | | @PutMapping |
| | | public AjaxResult edit(@Validated @RequestBody SysDept dept) |
| | | { |
| | |
| | | * 删除部门 |
| | | */ |
| | | @RequiresPermissions("system:dept:remove") |
| | | @Log(title = "部门管理", businessType = BusinessType.DELETE) |
| | | @Log(title = "部门管理", businessType = BusinessType.DELETE,operContent = "删除部门") |
| | | @DeleteMapping("/{deptId}") |
| | | public AjaxResult remove(@PathVariable Long deptId) |
| | | { |