5、组织机构与权限
更新时间: 2024-05-06 浏览次数: {{ hits }}

类名

H3.Organization.IOrganization

接口清单

序号

接口名称

说明

1

Company

公司信息

2

GetUnit

通过ID获取组织单元

3

GetUnits

通过ID批量获取组织单元

4

GetUnitByProperty

根据属性获取单个组织单元

5

GetUnitsByProperty

根据属性获取多个组织单元

6

GetUnitNameTable

通过ID批量获取组织名称

7

GetName

获得单元的实际名称

8

GetUnitLevel

获取组织层级

9

GetManager

获得组织单元的经理ID

10

GetManagersByLevel

获得某个组织的跨级经理

11

GetManagersByRole

获取离指定组织最近标签的成员

12

GetParent

获得父组织单元ID

13

GetParentUnit

获得父组织单元

14

GetParentUnits

根据条件获得父组织单元

15

GetParentUnitByLevel

通过子组织单元ID和层次获取父组织单元

16

GetParentUnitsByLevel

通过多个子组织单元ID和层次获取父组织单元

17

GetParents

获得父/祖先组织单元数组

18

GetMembers

获取组织成员

19

GetMemberUsers

获得组织的用户成员

20

GetChildren

获得子组织单元ID

21

GetChildUnits

获得子组织单元

22

GetChildrenByLevel

根据层级获得子组织ID

23

GetChildUnitsByLevel

根据层级获得子组织

24

IsAncestor

判断某一个组织单元是否是另外一个组织单元的祖先

25

GetUserPosts

获得用户的岗位

26

GetUserRoles

获得用户的角色

27

GetUserRoleIds

获得用户的角色ID

28

GetAllRoles

获得所有的角色

29

GetPostServiceUnitsJson

获取岗位的服务部门

30

GetAllRoleGroups

获取所有角色分组

31

GetChildUserSummaries

获取组织单元的用户信息摘要

基本用法

上述清单中的接口均归属在this.Engine.Organization下,如 通过ID批量获取组织机构单元 ,可使用如下代码形式:

string[] ids = new string[] {"u1","u2"};
H3.Organization.Unit[] units = this.Engine.Organization.GetUnits(ids);

其他接口使用方式与此类似。

接口说明

1. Company

公司信息,是一个普通属性,而非方法。

类型

说明

H3.Organization.Company

公司信息

2. GetUnit(string id)

2.1. 说明

通过ID获取组织单元。

2.2. 参数

参数名

说明

id

组织单元ID

2.3. 返回值

类型

说明

H3.Organization.Unit

组织单元

3. GetUnits(string[] ids)

3.1. 说明

通过ID批量获取组织单元。

3.2. 参数

参数名

说明

ids

组织单元ID

3.3. 返回值

类型

说明

H3.Organization.Unit[]

组织单元

4. GetUnitByProperty(DomainType domainType, UnitType type, string propertyName, string propertyValue, State state)

4.1. 说明

根据属性获取单个组织单元。

4.2. 参数

参数名

说明

domainType

组织机构范围类型,详见H3.Organization.DomainType

type

类型,详见H3.Organization.UnitType

propertyName

属性名

propertyValue

属性值

state

状态,详见H3.Organization.State

4.3. 返回值

类型

说明

H3.Organization.Unit

组织单元

5. GetUnitsByProperty(DomainType domainType, UnitType type, string propertyName, string propertyValue, State state)

5.1. 说明

根据属性获取多个组织单元。

5.2. 参数

参数名

说明

domainType

组织机构范围类型,详见H3.Organization.DomainType

type

类型,详见H3.Organization.UnitType

propertyName

属性名

propertyValue

属性值

state

状态,详见H3.Organization.State

5.3. 返回值

类型

说明

H3.Organization.Unit[]

组织单元

6. GetUnitNameTable(string[] ids, NameType type)

6.1. 说明

通过ID批量获取组织名称。

6.2. 参数

参数名

说明

ids

组织单元ID

type

名称类型,详见H3.Organization.NameType

6.3. 返回值

类型

说明

Dictionary<string, string>

<ID, 全名称>

7. GetName(string id, NameType type)

7.1. 说明

获得单元的实际名称,比如张三,李四之类的。

7.2. 参数

参数名

说明

id

组织单元ID

type

名称类型,详见H3.Organization.NameType

7.3. 返回值

类型

说明

string

组织单元名称

8. GetUnitLevel(string id)

8.1. 说明

获取组织层级。

8.2. 参数

参数名

说明

id

组织单元ID

8.3. 返回值

类型

说明

int

组织的层级

9. GetManager(string id, ManagerType type)

9.1. 说明

获得组织单元的经理ID,如用户/组/OU(Organizational Unit)/公司的经理,但不能获得群的经理。

9.2. 参数

参数名

说明

id

组织单元ID

type

经理类型,详见H3.Organization.ManagerType

9.3. 返回值

类型

说明

string

经理ID

10. GetManagersByLevel(string[] units, int level)

10.1. 说明

获得某个组织的跨级经理,组织如果组织是群,那么获得群的子对象,并针对各个子对象获得相应的跨级经理;如果是非群,那么直接获得跨级经理。

10.2. 参数

参数名

说明

units

组织单元ID

level

级别,0表示公司,1表示公司的直接下属OU,依次类推

10.3. 返回值

类型

说明

string[]

经理ID

11. GetManagersByRole(string[] units, string roleId)

11.1. 说明

获取离指定组织最近标签的成员。

11.2. 参数

参数名

说明

units

组织单元ID

roleId

角色ID

11.3. 返回值

类型

说明

string[]

经理ID

12. GetParent(string id)

12.1. 说明

获得父组织单元ID。

12.2. 参数

参数名

说明

id

组织单元ID

12.3. 返回值

类型

说明

string

父组织的ID

13. GetParentUnit(string id)

13.1. 说明

获得父组织单元。

13.2. 参数

参数名

说明

id

组织单元ID

13.3. 返回值

类型

说明

H3.Organization.Unit

父组织单元

14. GetParentUnits(string id, UnitType parentUnitType, bool recursive, State state)

14.1. 说明

根据条件获得父组织单元。

14.2. 参数

参数名

说明

id

组织单元ID

parentUnitType

要获得的父/祖先的类型,详见H3.Organization.UnitType

recursive

是否递归

state

状态,详见H3.Organization.State

14.3. 返回值

类型

说明

H3.Organization.Unit[]

父组织单元

15. GetParentUnitByLevel(string id, int level)

15.1. 说明

通过子组织单元ID和层次获取父组织单元。

15.2. 参数

参数名

说明

id

组织单元ID

level

层级

15.3. 返回值

类型

说明

H3.Organization.Unit

父组织单元

16. GetParentUnitsByLevel(string[] ids, int level)

16.1. 说明

通过多个子组织单元ID和层次获取父组织单元。

16.2. 参数

参数名

说明

ids

组织单元ID

level

层级

16.3. 返回值

类型

说明

Dictionary<string, H3.Organization.Unit>

父组织单元字典,键为组织单元ID

17. GetParents(string id, UnitType parentUnitType, bool recursive, State state)

17.1. 说明

获得父/祖先组织单元数组。

17.2. 参数

参数名

说明

id

组织单元ID

parentUnitType

要获得的父/祖先的类型,详见H3.Organization.UnitType

recursive

是否递归

state

状态,详见H3.Organization.State

17.3. 返回值

类型

说明

string

父组织单元的ID

18. GetMembers(string[] parents, State state)

18.1. 说明

获取组织成员。

18.2. 参数

参数名

说明

parents

父组织单元ID

state

状态,详见H3.Organization.State

18.3. 返回值

类型

说明

string[]

成员ID

19. GetMemberUsers(string[] units)

19.1. 说明

获得组织的用户成员。

19.2. 参数

参数名

说明

units

组织单元ID

19.3. 返回值

类型

说明

H3.Organization.User[]

用户成员

20. GetChildren(string id, UnitType childUnitType, bool recursive, State state)

20.1. 说明

获得子组织单元ID。

20.2. 参数

参数名

说明

id

组织单元ID

childUnitType

子组织单元类型,详见H3.Organization.UnitType

recursive

是否递归

state

状态,详见H3.Organization.State

20.3. 返回值

类型

说明

string[]

子组织单元的ID

21. GetChildUnits(string[] ids, UnitType childUnitType, bool recursive, State state)

21.1. 说明

获得子组织单元。

21.2. 参数

参数名

说明

ids

组织单元ID

childUnitType

子组织单元类型,详见H3.Organization.UnitType

recursive

是否递归

state

状态,详见H3.Organization.State

21.3. 返回值

类型

说明

H3.Organization.Unit[]

子组织单元

22. GetChildrenByLevel(string id, UnitType childUnitType, int level, State state)

22.1. 说明

根据层级获得子组织ID。

22.2. 参数

参数名

说明

id

组织单元ID

childUnitType

子组织单元类型,详见H3.Organization.UnitType

level

层级

state

状态,详见H3.Organization.State

22.3. 返回值

类型

说明

string[]

子组织单元的ID

23. GetChildUnitsByLevel(string id, UnitType childUnitType, int level, State state)

23.1. 说明

获得父组织单元ID。

23.2. 参数

参数名

说明

id

组织单元ID

childUnitType

子组织单元类型,详见H3.Organization.UnitType

level

层级

state

状态,详见H3.Organization.State

23.3. 返回值

类型

说明

H3.Organization.Unit[]

子组织单元

24. IsAncestor(string childId, string ancestorId)

24.1. 说明

判断某一个组织单元是否是另外一个组织单元的祖先。

24.2. 参数

参数名

说明

childId

子孙组织单元ID

ancestorId

祖先组织单元ID

24.3. 返回值

类型

说明

bool

如果是祖先关系,则返回true,否则返回false

25. GetUserPosts(string userId, bool includeInherited)

25.1. 说明

获得用户的岗位。

25.2. 参数

参数名

说明

userId

用户ID

includeInherited

是否包括继承的

25.3. 返回值

类型

说明

H3.Organization.OrgPost[]

用户岗位

26. GetUserRoles(string userId, bool includeInherited)

26.1. 说明

获得用户的角色。

26.2. 参数

参数名

说明

userId

用户ID

includeInherited

是否包括继承的

26.3. 返回值

类型

说明

H3.Organization.OrgRole[]

用户角色

27. GetUserRoleIds(string userId, bool includeInherited)

27.1. 说明

获得用户的角色ID。

27.2. 参数

参数名

说明

userId

用户ID

includeInherited

是否包括继承的

27.3. 返回值

类型

说明

string[]

角色ID

28. GetAllRoles()

28.1. 说明

获得所有的角色。

28.2. 参数

参数名

说明

28.3. 返回值

类型

说明

H3.Organization.OrgRole[]

所有的角色

29. GetPostServiceUnitsJson(string roleId, string userId)

29.1. 说明

获取岗位的服务部门。

29.2. 参数

参数名

说明

roleId

角色ID

userId

用户ID

29.3. 返回值

类型

说明

H3.Organization.GetPostServiceUnitsResponse

服务部门

30. GetAllRoleGroups()

30.1. 说明

获取所有角色分组。

30.2. 参数

参数名

说明

30.3. 返回值

类型

说明

H3.Organization.OrgRoleGroup[]

角色分组

31. GetChildUserSummaries(string unitId, UnitType type, int fromNum, int toNum, bool includeManger, out int count)

31.1. 说明

获取组织单元的用户信息摘要。

31.2. 参数

参数名

说明

unitId

组织单元ID

type

组织单元类型,详见H3.Organization.UnitType

fromNum

开始行

toNum

结束行

includeManger

是否包括经理

count

获取总数量

31.3. 返回值

类型

说明

List<H3.Organization.UserSummary>

用户信息摘要