组织人员树避免死循环
This commit is contained in:
parent
319e98f1a3
commit
1403165f3e
|
|
@ -24,6 +24,11 @@ public class SysDept extends BaseEntity {
|
|||
*/
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 人员部门树节点id
|
||||
*/
|
||||
private Long nodeId;
|
||||
|
||||
/**
|
||||
* 父部门ID
|
||||
*/
|
||||
|
|
@ -287,6 +292,14 @@ public class SysDept extends BaseEntity {
|
|||
this.deptId = deptId;
|
||||
}
|
||||
|
||||
public Long getNodeId() {
|
||||
return nodeId;
|
||||
}
|
||||
|
||||
public void setNodeId(Long nodeId) {
|
||||
this.nodeId = nodeId;
|
||||
}
|
||||
|
||||
public Long getParentId() {
|
||||
return parentId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -490,7 +490,7 @@ public class SysUserController extends BaseController {
|
|||
/**
|
||||
* 查询部门人员树列表
|
||||
*/
|
||||
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth, requiresPermissions = @RequiresPermissions("system:user:list"))
|
||||
//@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth, requiresPermissions = @RequiresPermissions("system:user:list"))
|
||||
@PostMapping("/deptUserTree")
|
||||
public AjaxResult deptUserTree(@RequestBody SysUser sysUser) {
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -25,6 +25,8 @@ public class TreeSelect implements Serializable {
|
|||
/** 父部门ID */
|
||||
private Long parentId;
|
||||
|
||||
private Long nodeId;
|
||||
|
||||
/**
|
||||
* 节点名称
|
||||
*/
|
||||
|
|
@ -48,6 +50,7 @@ public class TreeSelect implements Serializable {
|
|||
public TreeSelect(SysDept dept) {
|
||||
this.id = dept.getDeptId();
|
||||
this.parentId = dept.getParentId();
|
||||
this.nodeId = dept.getNodeId();
|
||||
this.status = dept.getStatus();
|
||||
this.label = dept.getDeptName();
|
||||
this.level = dept.getLevel();
|
||||
|
|
@ -85,6 +88,14 @@ public class TreeSelect implements Serializable {
|
|||
this.parentId = parentId;
|
||||
}
|
||||
|
||||
public Long getNodeId() {
|
||||
return nodeId;
|
||||
}
|
||||
|
||||
public void setNodeId(Long nodeId) {
|
||||
this.nodeId = nodeId;
|
||||
}
|
||||
|
||||
public String getLabel() {
|
||||
return label;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -115,6 +115,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
SELECT
|
||||
d.dept_id AS deptId,
|
||||
d.parent_id AS parentId,
|
||||
d.dept_id as nodeId,
|
||||
d.dept_name AS deptName,
|
||||
LENGTH( d.ancestors ) - LENGTH(
|
||||
REPLACE ( d.ancestors, ',', '' )) AS LEVEL
|
||||
|
|
@ -129,6 +130,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
SELECT
|
||||
CONCAT(sd.dept_id,'9999',su.user_id) AS deptId,
|
||||
sd.dept_id AS parentId,
|
||||
su.user_id as nodeId,
|
||||
su.nick_name AS deptName,
|
||||
99 AS LEVEL
|
||||
FROM
|
||||
|
|
|
|||
Loading…
Reference in New Issue