# Yach部门管理
# 创建部门
# host: https://yach-oapi.zhiyinlou.com 正式环境
# host: https://yach-oapi-test.zhiyinlou.com 测试环境
# 概述
名称 | 值 |
---|---|
地址 | /department/create?access_token=ACCESS_TOKEN |
请求方式 | POST |
参数 | 见【参数】 |
返回值 | 见【返回值】 |
# 请求包结构体
{
"og_name": "xxx",
"p_id": "1",
"visable" : true,
"ehr_og_id": "D100001",
"vis_permits" : {
"depts":"23|24",
"users":"userid1|userid2"
},
"out_dept" : true,
"out_permits" : [
{
"user_type":"全职员工",
"depts":"23|24",
"users":"userid1|userid2"
},
{
"user_type":"兼职员工",
"depts":"23|24",
"users":"userid1|userid2"
}
]
}
# 参数
参数 | 参数类型 | 必须 | 说明 |
---|---|---|---|
access_token | String | 是 | 调用接口凭证 |
og_name | String | 是 | 部门名称,长度限制为1~64个字符,不允许包含字符‘-’‘,’以及‘,’ |
p_id | String | 是 | 父部门id,根部门id为5 |
manager_userid | String | 是 | 部门manager userid |
visable | Json | 否 | 是否隐藏部门,true表示隐藏,false表示显示 |
vis_permits | String | 否 | |
vis_permits.depts | String | 否 | visablet为true时,可以配置该字段,取值为部门id组成的字符串使用“|”符号进行分割 |
vis_permits.users | String | 否 | visablet为true时,可以配置该字段,取值为人员的userid组成的字符串使用“|”符号进行分割 |
out_dept | String | 否 | 限制本部门成员查看通讯录,限制开启后,本部门成员只能看到限定范围内的通讯录,true表示限制开启 |
out_permits | String | 否 | |
out_permits.user_type | String | 否 | out_dept为true时,可以指定当前部门那些员工类型限制了通讯录可见范围,员工类型包括:全职员工、兼职员工、实习生、全职教师、兼职员工、在编实习 |
out_permits.depts | String | 否 | out_dept为true时,可以配置该字段,取值为部门id组成的字符串使用“|”符号进行分割 |
out_permits.users | String | 否 | out_dept为true时,可以配置该字段,取值为人员的userid组成的字符串使用“|”符号进行分割 |
out_permits.out_dept_or_user | String | 否 | out_dept为true时,可以配置该字段,true生效 |
out_permits.out_user_only_self | String | 否 | out_dept为true时,可以配置该字段,true生效 |
out_permits.out_corp_all | String | 否 | out_dept为true时候,可以配置该字段,true生效 |
out_permits.out_dept_only_self | String | 否 | out_dept为true时候,可以配置该字段,true生效 |
ehr_og_id | String | 否 | EHR 部门编号 |
og_order | String | 否 | 部门排序标识,示例:3 |
# 备注:
1、当visable 为 true 时可以设置 vis_permits.depts或者vis_permits.users 这个两个字段,不设置默认对全公司隐藏。
2、当out_dept 为 true时 out_permits.user_type 必填不能为空,必须指定那些员工类型限制了通讯录可见范围,有四种单选如下:
- 设置通讯录可见范围为指定的部门out_permits.depts 和 指定的人 out_permits.users (二者必填一个)此时out_permits.out_dept_or_user 为 true。
- 设置通讯录可见范围为只能看到所在部门及下级部门通讯录, 对应字段out_permits.out_dept_only_self 为 true。
- 设置通讯录可见范围为只能看到自己 对应字段 out_permits.out_user_only_self 为true。
- 设置通讯录可见范围为全公司 对应字段为 out_permits.out_corp_all 为 true,
返回值
{
"code": 200,
"msg": "",
"obj": {
"id": 2
}
}
# 更新部门
# host: https://yach-oapi.zhiyinlou.com 正式环境
# host: https://yach-oapi-test.zhiyinlou.com 测试环境
# 概述
名称 | 值 |
---|---|
地址 | /department/update?access_token=ACCESS_TOKEN |
请求方式 | POST |
参数 | 见【参数】 |
返回值 | 见【返回值】 |
# 请求包结构体
{
"og_name": "xxx红太阳",
"p_id": "6912",
"id": 1
}
# 参数
参数 | 参数类型 | 必须 | 说明 |
---|---|---|---|
access_token | String | 是 | 调用接口凭证 |
id | String | 是 | 部门id |
og_name | String | 是 | 部门名称,长度限制为1~64个字符,不允许包含字符‘-’‘,’以及‘,’ |
p_id | String | 是 | 父部门id,根部门id为5 |
manager_userid | String | 是 | 部门manager userid |
visable | Json | 否 | 是否隐藏部门,true表示隐藏,false表示显示 |
vis_permits | String | 否 | |
vis_permits.depts | String | 否 | visablet为true时,可以配置该字段,取值为部门id组成的字符串使用“|”符号进行分割 |
vis_permits.users | String | 否 | visablet为true时,可以配置该字段,取值为人员的userid组成的字符串使用“|”符号进行分割 |
out_dept | String | 否 | 限制本部门成员查看通讯录,限制开启后,本部门成员只能看到限定范围内的通讯录,true表示限制开启 |
out_permits | String | 否 | |
out_permits.user_type | String | 否 | out_dept为true时,可以指定当前部门那些员工类型限制了通讯录可见范围,员工类型包括:全职员工、兼职员工、实习生、全职教师、兼职员工、在编实习 |
out_permits.depts | String | 否 | out_dept为true时,可以配置该字段,取值为部门id组成的字符串使用“|”符号进行分割 |
out_permits.users | String | 否 | out_dept为true时,可以配置该字段,取值为人员的userid组成的字符串使用“|”符号进行分割 |
out_permits.out_dept_or_user | String | 否 | out_dept为true时,可以配置该字段,true生效 |
out_permits.out_user_only_self | String | 否 | out_dept为true时,可以配置该字段,true生效 |
out_permits.out_corp_all | String | 否 | out_dept为true时候,可以配置该字段,true生效 |
out_permits.out_dept_only_self | String | 否 | out_dept为true时候,可以配置该字段,true生效 |
ehr_og_id | String | 否 | EHR 部门编号 |
og_order | String | 否 | 部门排序标识 |
# 备注:
1、当visable 为 true 时可以设置 vis_permits.depts或者vis_permits.users 这个两个字段,不设置默认对全公司隐藏。
2、当out_dept 为 true时 out_permits.user_type 必填不能为空,必须指定那些员工类型限制了通讯录可见范围,有四种单选如下:
- 设置通讯录可见范围为指定的部门out_permits.depts 和 指定的人 out_permits.users (二者必填一个)此时out_permits.out_dept_or_user 为 true。
- 设置通讯录可见范围为只能看到所在部门及下级部门通讯录, 对应字段out_permits.out_dept_only_self 为 true。
- 设置通讯录可见范围为只能看到自己 对应字段 out_permits.out_user_only_self 为true。
- 设置通讯录可见范围为全公司 对应字段为 out_permits.out_corp_all 为 true,
返回值
{
"code": 200,
"msg": "",
"obj": {
"list": [
{
"id": "2044",
"p_id": "84",
"og_name": "杨付光",
"ehr_og_id": "D1002043",
"manager_userid": "000020"
},
{
"id": "2045",
"p_id": "84",
"og_name": "田密",
"ehr_og_id": "D1002044",
"manager_userid": "134245"
},
{
"id": "2046",
"p_id": "84",
"og_name": "刘开",
"ehr_og_id": "D1002045",
"manager_userid": "000054"
},
{
"id": "2898",
"p_id": "84",
"og_name": "张双",
"ehr_og_id": "D1002899",
"manager_userid": "000646"
},
{
"id": "2899",
"p_id": "84",
"og_name": "王磊",
"ehr_og_id": "D1002900",
"manager_userid": "001065"
},
{
"id": "2948",
"p_id": "84",
"og_name": "李健",
"ehr_og_id": "D1002949",
"manager_userid": "037298"
},
{
"id": "3024",
"p_id": "84",
"og_name": "李林",
"ehr_og_id": "D1003025",
"manager_userid": "001536"
},
{
"id": "4335",
"p_id": "84",
"og_name": "李正堂",
"ehr_og_id": "D1004341",
"manager_userid": "001826"
},
{
"id": "5756",
"p_id": "84",
"og_name": "孙晨皓",
"ehr_og_id": "D1005767",
"manager_userid": "013193"
},
{
"id": "9929",
"p_id": "84",
"og_name": "郝月菲",
"ehr_og_id": "D1010941",
"manager_userid": "002327"
},
{
"id": "18532",
"p_id": "84",
"og_name": "张明颂",
"ehr_og_id": "D1019285",
"manager_userid": "002017"
}
],
"total": "11",
"has_more": false
}
}
# 删除部门
# host: https://yach-oapi.zhiyinlou.com 正式环境
# host: https://yach-oapi-test.zhiyinlou.com 测试环境
# 概述
名称 | 值 |
---|---|
地址 | /department/delete?access_token=ACCESS_TOKEN |
请求方式 | GET |
参数 | 见【参数】 |
返回值 | 见【返回值】 |
# 参数
参数 | 参数类型 | 必须 | 说明 |
---|---|---|---|
access_token | String | 是 | 调用接口凭证 |
id | String | 是 | 部门id(注:不能删除根部门;当部门里有员工,或者部门的子部门里有员工,也不能删除) |
返回值
{
"code": 200,
"msg": ""
}
# 获取部门列表
# host: https://yach-oapi.zhiyinlou.com 正式环境
# host: https://yach-oapi-test.zhiyinlou.com 测试环境
# 概述
名称 | 值 |
---|---|
地址 | /department/list?access_token=ACCESS_TOKEN |
请求方式 | GET |
参数 | 见【参数】 |
返回值 | 见【返回值】 |
# 参数
参数 | 参数类型 | 必须 | 说明 |
---|---|---|---|
access_token | String | 是 | 调用接口凭证 |
id | String | 是 | 父部门id(如果不传,默认部门为根部门,根部门ID为5) |
fetch_child | String | 是 | 是否递归部门的全部子部门 |
page | String | 是 | 当前分页 |
limit | String | 是 | 默认100条 |
返回值
{
"code": 200,
"msg": ""
}
# 获取部门详情
# host: https://yach-oapi.zhiyinlou.com 正式环境
# host: https://yach-oapi-test.zhiyinlou.com 测试环境
# 概述
名称 | 值 |
---|---|
地址 | /department/get?access_token=ACCESS_TOKEN |
请求方式 | GET |
参数 | 见【参数】 |
返回值 | 见【返回值】 |
# 参数
参数 | 参数类型 | 必须 | 说明 |
---|---|---|---|
access_token | String | 是 | 调用接口凭证 |
id | String | 是 | 部门id |
返回值
{
"code": 200,
"msg": "",
"obj": [
{
"id": "2289",
"p_id": "6912",
"og_name": "流程与信息管理部",
"manager_userid": "Yach121942",
"visable": "1",
"out_dept": "1",
"vis_permits": {
"depts": "23|24",
"users": "Yach076429|Yach091805"
},
"ehr_og_id": "D1018524",
"out_permits": [
{
"user_type": "全职教师",
"depts": "23|24",
"users": "Yach076429|Yach091805"
},
{
"user_type": "专职教师",
"depts": "24|25",
"users": "Yach076429|Yach091805"
},
{
"user_type": "兼职员工",
"out_user_only_self": true
}
]
}
]
}
{
"code": 200,
"msg": "",
"obj": [
{
"id": "17492",
"p_id": "6912",
"og_name": "主数据产品团队",
"manager_userid": "Yach132793",
"visable": "0",
"ehr_og_id": "D1018524",
"out_dept": "1",
"out_permits": [
{
"user_type": "专职教师",
"out_dept_only_self": true
},
{
"user_type": "兼职员工",
"out_user_only_self": true
},
{
"user_type": "全职员工",
"out_corp_all": true
},
{
"user_type": "全职教师",
"out_corp_all": true
}
]
}
]
}