public class DepartmentControl
extends java.lang.Object
构造器和说明 |
---|
DepartmentControl() |
限定符和类型 | 方法和说明 |
---|---|
boolean |
addDepartment(Department department)
添加部门
|
boolean |
deleteDepartment(long id)
删除部门
|
Department |
findDepartmentByNameAndParentName(java.lang.String departmentName,
java.lang.String parentDepartmentName)
兼容老版本,根据父子部门名来查找部门
|
Department |
findDepartmentByNameAndPID(java.lang.String departmentNamePID)
根据部门名和父部门id获取部门
|
java.util.List<Department> |
getAllDepartment()
查询所有部门
|
JSONArray |
getAllDepartmentInfo(boolean containNoCheck)
获取所有部门信息
|
Department |
getDepartment(long id)
根据部门id查询部门
|
Department |
getDepartmentByNameAndPid(java.lang.String name,
long pid)
根据部门名字和父部门id查询部门
|
java.lang.Long[] |
getDepartmentIDPath(long id)
或取部门id路径
|
JSONArray |
getDepartmentInfoPrivilege(long userId,
boolean containNoCheck)
获取机构部门信息
|
java.lang.String |
getDepartmentShowName(long id)
获取部门别称
|
java.lang.String |
getDepartmentShowName(long id,
java.lang.String prefix)
拼接部门别称
|
java.lang.Long[] |
getDpidsByPid(long pid)
获取指定部门下所有子部门的id
|
static DepartmentControl |
getInstance()
唯一实例化(部门相关操作方法调用入口)
demo: DepartmentControl.getInstance().getDepartment(1)
|
java.util.List |
getUserAndPosts(long id)
获取部门下所有职位-用户关系对象
|
JSONArray |
getUserAndPostsInfo(long id)
获取部门下所有职位-用户关系对象(返回json数组)
|
java.util.Set<java.lang.Long> |
getUserIds(long id) |
JSONArray |
getUserInfoByDepartAndPost(long did,
long pid)
根据部门id和职位id获取所有用户
|
java.util.Set<User> |
getUsers(long id)
获取部门下所有用户
|
java.util.Set<java.lang.Long> |
getUsersByDepartAndPost(long did,
long pid)
根据部门id和职位id获取所有用户id
|
boolean |
updateDepartment(Department dept)
更新部门
|
boolean |
updateDepartmentName(long did,
java.lang.String newName)
更新部门名称
|
public static DepartmentControl getInstance()
public Department getDepartment(long id)
id
- 部门idpublic Department getDepartmentByNameAndPid(java.lang.String name, long pid) throws java.lang.Exception
name
- 部门名称pid
- 父部门idjava.lang.Exception
public java.lang.Long[] getDpidsByPid(long pid) throws java.lang.Exception
pid
- 指定部门idjava.lang.Exception
public java.util.Set<User> getUsers(long id) throws java.lang.Exception
id
- 部门idjava.lang.Exception
public java.util.List getUserAndPosts(long id) throws java.lang.Exception
id
- 部门idjava.lang.Exception
public Department findDepartmentByNameAndPID(java.lang.String departmentNamePID) throws java.lang.Exception
departmentNamePID
- 部门名称+父部门idjava.lang.Exception
public JSONArray getUserAndPostsInfo(long id) throws java.lang.Exception
id
- 部门idjava.lang.Exception
public java.util.Set<java.lang.Long> getUsersByDepartAndPost(long did, long pid) throws java.lang.Exception
did
- 部门idpid
- 职位idjava.lang.Exception
public JSONArray getUserInfoByDepartAndPost(long did, long pid) throws java.lang.Exception
did
- 部门idpid
- 职位idjava.lang.Exception
public boolean updateDepartmentName(long did, java.lang.String newName) throws java.lang.Exception
did
- 部门idnewName
- 新名称java.lang.Exception
public boolean updateDepartment(Department dept) throws java.lang.Exception
dept
- 新部门java.lang.Exception
public Department findDepartmentByNameAndParentName(java.lang.String departmentName, java.lang.String parentDepartmentName) throws java.lang.Exception
departmentName
- 部门名称parentDepartmentName
- 父部门名称java.lang.Exception
public boolean addDepartment(Department department) throws java.lang.Exception
department
- 部门对象java.lang.Exception
public java.lang.String getDepartmentShowName(long id)
id
- 部门idpublic java.lang.String getDepartmentShowName(long id, java.lang.String prefix)
id
- 部门idprefix
- 前缀public java.lang.Long[] getDepartmentIDPath(long id)
id
- 部门idpublic boolean deleteDepartment(long id) throws java.lang.Exception
id
- 部门idjava.lang.Exception
public JSONArray getDepartmentInfoPrivilege(long userId, boolean containNoCheck) throws java.lang.Exception
userId
- 用户IDcontainNoCheck
- 是否包含所有不部门节点java.lang.Exception
public JSONArray getAllDepartmentInfo(boolean containNoCheck) throws java.lang.Exception
containNoCheck
- 是否包含所有部门java.lang.Exception
public java.util.List<Department> getAllDepartment() throws java.lang.Exception
java.lang.Exception
public java.util.Set<java.lang.Long> getUserIds(long id) throws java.lang.Exception
java.lang.Exception