部门管理接口
添加部门
接口概述
- 功能:添加新部门,并返回创建成功的部门信息及层级关系
- 请求方式:GET
- 请求地址: /dw-open-api/dept/add.do
请求参数
| 参数名 | 类型 | 必填 | 描述 |
|---|---|---|---|
| appId | string | 是 | 平台分配的appId |
| name | string | 否 | 部门名称 |
| nonce | string | 是 | 随机字符串 |
| parentId | string | 否 | 父级部门ID |
| signature | string | 是 | 签名 |
| thirdDeptId | string | 否 | 第三方部门ID |
| timestamp | string | 是 | 当前时间戳 |
请求示例
http://192.168.5.43:9999/dw-open-api/dept/add.do?appId=mncbn&name=product%20dept&nonce=proorpor&parentId=propropro&signature=afds&thirdDeptId=dsaf×tamp=123666返回值
json
{
"resultCode": 200,
"resultMsg": "执行成功",
"data": {
"id": "37ec443e-5b90-4bd1-aa24-6fb9bdfbc6af",
"name": "product dept",
"deptCode": null,
"parentId": "propropro",
"orderNo": null,
"createDate": "2025-08-20 15:32:21",
"thirdDeptId": "dsaf",
"deptLevel": null,
"parentName": null,
"childDepts": [],
"parentDept": null
}
}删除部门
接口概述
- 功能:删除指定部门,并返回操作结果
- 请求方式:DELETE
- 请求地址: /dw-open-api/dept/delete.do
请求参数
| 参数名 | 类型 | 必填 | 描述 |
|---|---|---|---|
| appId | string | 是 | 平台分配的appId |
| nonce | string | 是 | 随机字符串 |
| signature | string | 是 | 签名 |
| timestamp | string | 是 | 当前时间戳 |
请求示例
http://192.168.5.43:9999/dw-open-api/dept/delete.do?appId=gfdgs&nonce=sfdgfds&signature=adsf×tamp=dsf返回值
json
{
"resultCode": 200,
"resultMsg": "执行成功",
"data": null
}修改部门
接口概述
- 功能:修改指定部门信息,并返回操作结果
- 请求方式:PUT
- 请求地址: /dw-open-api/dept/edit.do
请求参数
| 参数名 | 类型 | 必填 | 描述 |
|---|---|---|---|
| appId | string | 是 | 平台分配的appId |
| id | string | 否 | 部门ID |
| name | string | 否 | 部门名称 |
| nonce | string | 是 | 随机字符串 |
| parentId | string | 否 | 父级部门ID |
| signature | string | 是 | 签名 |
| thirdDeptId | string | 否 | 第三方部门ID |
| timestamp | string | 是 | 当前时间戳 |
请求示例
http://192.168.5.43:9999/dw-open-api/dept/edit.do?appId=zsghs&id=5185129d-3127-4b63-b219-169c8559a4a3&name=%E7%A0%94%E5%8F%91%E9%83%A8&nonce=dasf&parentId=-1&signature=asd×tamp=456789返回值
json
{
"resultCode": 200,
"resultMsg": "执行成功",
"data": null
}系统所有部门列表
接口概述
- 功能:获取系统所有部门列表及分页信息
- 请求方式:GET
- 请求地址: /dw-open-api/dept/list.do
请求参数
| 参数名 | 类型 | 必填 | 描述 |
|---|---|---|---|
| appId | string | 是 | 平台分配的appId |
| name | string | 否 | 部门名称 |
| nonce | string | 是 | 随机字符串 |
| pageNo | integer($int32) | 否 | 页码,默认值1 |
| pageSize | integer($int32) | 否 | 页数据大小,默认值10 |
| parentId | string | 否 | 父级部门ID |
| signature | string | 是 | 签名 |
| timestamp | string | 是 | 当前时间戳 |
请求示例
http://192.168.5.43:9999/dw-open-api/dept/list.do?appId=qerwpoui&name=333&nonce=afds&pageNo=1&pageSize=1&parentId=5185129d-3127-4b63-b219-169c8559a4a3&signature=adsfds×tamp=asdfd返回值
json
{
"resultCode": 200,
"resultMsg": "执行成功",
"data": {
"pageNo": 1,
"pageSize": 1,
"orderBy": "orderNo",
"orderDir": "desc",
"countTotal": true,
"pageNos": null,
"totalPage": 1,
"islastpage": false,
"result": [
{
"id": "990166b3-2f6f-4459-a059-68dd13acc71c",
"name": "333",
"deptCode": "2PWHCB",
"parentId": "5185129d-3127-4b63-b219-169c8559a4a3",
"orderNo": null,
"createDate": "2025-08-11 12:31:06",
"thirdDeptId": null,
"deptLevel": 2,
"parentName": "研发部",
"childDepts": [],
"parentDept": null
}
],
"totalItems": 1,
"startpage": 1,
"endpage": 1,
"scrollId": null,
"totalPages": 1,
"lastPage": true,
"nextPage": 1,
"firstPage": true,
"prePage": 1,
"offset": 0,
"sort": [
{
"property": "orderNo",
"dir": "desc"
}
],
"orderBySetted": true
}
}
