|
@@ -44,8 +44,17 @@ public class SysDeptController extends BaseController
|
|
|
@PreAuthorize("@ss.hasPermi('system:dept:list')")
|
|
|
@GetMapping("/list")
|
|
|
@ApiOperation("获取部门列表")
|
|
|
- public AjaxResult list(SysDept dept)
|
|
|
- {
|
|
|
+ public AjaxResult list(SysDept dept) {
|
|
|
+ List<SysDept> depts = deptService.selectDeptList(dept);
|
|
|
+ return success(depts);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取部门列表
|
|
|
+ */
|
|
|
+ @GetMapping("/listByUser")
|
|
|
+ @ApiOperation("获取部门列表")
|
|
|
+ public AjaxResult listByUser() {
|
|
|
List<SysDept> depts = deptService.selectDeptList(dept);
|
|
|
return success(depts);
|
|
|
}
|
|
@@ -56,8 +65,7 @@ public class SysDeptController extends BaseController
|
|
|
@PreAuthorize("@ss.hasPermi('system:dept:list')")
|
|
|
@GetMapping("/list/exclude/{deptId}")
|
|
|
@ApiOperation("查询部门列表(排除节点)")
|
|
|
- public AjaxResult excludeChild(@PathVariable(value = "deptId", required = false) Long deptId)
|
|
|
- {
|
|
|
+ public AjaxResult excludeChild(@PathVariable(value = "deptId" , required = false) Long deptId) {
|
|
|
List<SysDept> depts = deptService.selectDeptList(new SysDept());
|
|
|
depts.removeIf(d -> d.getDeptId().intValue() == deptId || ArrayUtils.contains(StringUtils.split(d.getAncestors(), ","), deptId + ""));
|
|
|
return success(depts);
|