停用部门
接口描述
此接口用于停用部门。
限制・前提条件
部门下面的员工移动・离职后,部门无效
接口权限
本接口需要集团权限
请求URI
/api/openapi/departments
请求方式
DELETE
请求参数示例
- /api/openapi/departments?departmentCode=TEC-1&fromDate=2021-01-01
- /api/openapi/departments?departmentOID=58516027-c0c9-420a-aedf-f9d74ca4b2ed&fromDate=2021-01-01
请求参数说明
departmentCode和departmentOID二选一,都用取departmentOID
参数名 | 类型 | 是否必填 | 主键 | 規則 | 说明 |
---|---|---|---|---|---|
departmentCode | String | 否 | ○ | 最大长度36 | 部门编码 |
departmentOID | UUID | 否 | 长度36 | 部门OID | |
fromDate | String | 否 | 日期格式:yyyy-MM-dd | 无效开始日 |
接口返回示例
成功
{
"message": "success",
"oid": "3249b50a-1e29-4cae-93ea-bfec4955fafa",
"key": "TEC-1"
}
失败示例
{
"message": "部门不存在",
"errorCode": "120103"
}
字段说明
字段名称 | 类型 | 说明 |
---|---|---|
message | String | 返回信息说明 |
errorCode | String | 返回错误码 |
oid | UUID | 部门OID |
key | String | 部门编码 |
错误代码
errorCode | message | 说明 |
---|---|---|
120001 | 当前操作需要租户权限 | |
6044010 | 部门编码必填 | |
6044003 | 部门存在员工 | |
9312009 | 部门不存在或已失效 | |
6044011 | 存在有效的子部门(部门名:{0}, 开始日期:{1}), 停用失败 |