| | |
| | | import java.util.List;
|
| | | 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.DeleteMapping;
|
| | | import org.springframework.web.bind.annotation.GetMapping;
|
| | | import org.springframework.web.bind.annotation.PathVariable;
|
| | |
| | | import org.springframework.web.bind.annotation.PutMapping;
|
| | | import org.springframework.web.bind.annotation.RequestBody;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.ResponseBody;
|
| | | import org.springframework.web.bind.annotation.RestController;
|
| | | import com.ruoyi.common.constant.UserConstants;
|
| | | import com.ruoyi.common.utils.SecurityUtils;
|
| | |
| | | /**
|
| | | * 获取部门下拉树列表
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('system:dept:query')")
|
| | | @GetMapping("/treeselect")
|
| | | public AjaxResult treeselect(SysDept dept)
|
| | | {
|
| | |
| | | /**
|
| | | * 加载对应角色部门列表树
|
| | | */
|
| | | @PreAuthorize("@ss.hasPermi('system:dept:query')")
|
| | | @GetMapping(value = "/roleDeptTreeselect/{roleId}")
|
| | | @ResponseBody
|
| | | public AjaxResult roleDeptTreeselect(@PathVariable("roleId") Long roleId)
|
| | | {
|
| | | return AjaxResult.success(deptService.selectDeptListByRoleId(roleId));
|
| | |
| | | @PreAuthorize("@ss.hasPermi('system:dept:add')")
|
| | | @Log(title = "部门管理", businessType = BusinessType.INSERT)
|
| | | @PostMapping
|
| | | public AjaxResult add(@RequestBody SysDept dept)
|
| | | public AjaxResult add(@Validated @RequestBody SysDept dept)
|
| | | {
|
| | | if (UserConstants.NOT_UNIQUE.equals(deptService.checkDeptNameUnique(dept)))
|
| | | {
|
| | |
| | | @PreAuthorize("@ss.hasPermi('system:dept:edit')")
|
| | | @Log(title = "部门管理", businessType = BusinessType.UPDATE)
|
| | | @PutMapping
|
| | | public AjaxResult edit(@RequestBody SysDept dept)
|
| | | public AjaxResult edit(@Validated @RequestBody SysDept dept)
|
| | | {
|
| | | if (UserConstants.NOT_UNIQUE.equals(deptService.checkDeptNameUnique(dept)))
|
| | | {
|