POST高危 发起入职/离职办理
参数位置:body:type、employeeId、employeeName、deptId、position、onboardDate、mentorId、offboardDate、offboardReason、offboardType、handlerId、notes、checklistTemplateId、checklistTemplateName、checklistTemplateVersion、onboardSnapshot、previousEmployeeStatus、checklistItems、employmentPeriodId、onboardingSource、plannedEmploymentSequence。 必填:employeeId(员工ID)、type(0入职/1离职);type=1 离职时必填 offboardType(0主动离职/1合同到期/2辞退/3退休)、offboardDate(离职日期 yyyy-MM-dd)、offboardReason(离职原因);可选:deptId、position、onboardDate、mentorId、handlerId(经办人,默认当前用户)、notes、checklistTemplateId(入职清单模板,不传自动匹配)。发起离职会把员工置为离职处理中;已有进行中离职记录时返回该记录(existing=true)。调用前请与用户确认。
| 接口编码 | 所需范围 | 后端接口 |
|---|---|---|
office.onboard-offboard.create | office:write | POST /v1/onboard-offboard/create(comap-office) |
⚠️ 高危接口:删除或状态变更类操作,MCP 调用须先向用户复述并获同意后携 confirm: true。
必填字段
| 字段 | 依据 |
|---|---|
employeeId | 参数说明 |
type | 参数说明 |
条件必填(如「某状态时必填」)不在此表,以上方参数说明为准。 判定规则见必填字段的判定。
请求体字段(body)
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
type | integer(int32) | — | — |
employeeId | integer(int64) | — | — |
employeeName | string | — | — |
deptId | integer(int64) | — | — |
position | string | — | — |
onboardDate | string | — | — |
mentorId | integer(int64) | — | — |
offboardDate | string | — | — |
offboardReason | string | — | — |
offboardType | integer(int32) | — | — |
handlerId | integer(int64) | — | — |
notes | string | — | — |
checklistTemplateId | integer(int64) | — | — |
checklistTemplateName | string | — | — |
checklistTemplateVersion | integer(int32) | — | — |
onboardSnapshot6 | OnboardingSnapshotVO | — | — |
previousEmployeeStatus | integer(int32) | — | — |
checklistItems12 | ChecklistItemDTO[] | — | — |
employmentPeriodId | integer(int64) | — | — |
onboardingSource | string | — | — |
plannedEmploymentSequence | integer(int32) | — | — |
「必填」仅反映接口规格声明的部分。服务内还有未体现在规格里的校验, 标「—」不等于可以不传;租户在主站配置的字段必填不约束本接口。 详见必填字段的判定与字段清单与自定义字段。
请求示例
curl -X POST https://open.risemap.cn/v1/api/invoke \
-H "Authorization: Bearer <访问令牌>" \
-H "Content-Type: application/json" \
-d '{
"apiCode": "office.onboard-offboard.create",
"body": {}
}'
响应 data 字段
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
id | integer(int64) | — | — |
type | integer(int32) | — | — |
employeeId | integer(int64) | — | — |
employeeName | string | — | — |
avatar | string | — | — |
deptId | integer(int64) | — | — |
deptName | string | — | — |
position | string | — | — |
mentorId | integer(int64) | — | — |
onboardDate | string(date-time) | — | — |
onboardStatus | integer(int32) | — | — |
onboardChecklist20 | ChecklistItemVO[] | — | — |
offboardDate | string(date-time) | — | — |
offboardStatus | integer(int32) | — | — |
offboardReason | string | — | — |
offboardType | integer(int32) | — | — |
offboardChecklist20 | ChecklistItemVO[] | — | — |
createDate | string(date-time) | — | — |
handlerId | integer(int64) | — | — |
handler | string | — | — |
notes | string | — | — |
flowInstanceCode | string | — | — |
recordNo | string | — | — |
employeeNo | string | — | — |
mentorName | string | — | — |
handlerName | string | — | — |
checklistTemplateId | integer(int64) | — | — |
checklistTemplateName | string | — | — |
checklistTemplateVersion | integer(int32) | — | — |
onboardSnapshot6 | OnboardingSnapshotVO | — | — |
previousEmployeeStatus | integer(int32) | — | — |
completedChecklistCount | integer(int32) | — | — |
totalChecklistCount | integer(int32) | — | — |
nextChecklistItemName | string | — | — |
nextChecklistAssigneeName | string | — | — |
existing | boolean | — | — |
employmentPeriodId | integer(int64) | — | — |
onboardingSource | string | — | — |
employmentSequence | integer(int32) | — | — |
plannedEmploymentSequence | integer(int32) | — | — |
错误处理
响应统一信封 { code, message, data },code == 200 为成功。以下是本接口可能返回的开放平台层错误:
| 错误码 | 说明 | 可重试 |
|---|---|---|
| 92101 | 访问凭证无效 | 否 |
| 92201 | 接口未登记或已停用 | 否 |
| 92202 | 超出凭证授权范围——本接口需 office:write | 否 |
| 92204 | 绑定员工无此接口的功能权限 | 否 |
| 92203 | 上游服务调用失败 | 先查询处理结果,禁止盲目重试 |
| 92301 | 请求过于频繁 | 是 |
| 92205 | 写操作处理超时,结果未知(下游可能仍在执行) | 否,先查询确认结果 |
| 92302 | 有参数相同的写请求正在处理中 | 等待并确认前一次结果,勿重复提交 |
除此之外,comap-office 自身的业务校验失败会原样透传其业务码与提示
(如字段校验、状态不允许、数据不存在),这类码不在开放平台的号段内,
以响应里的 message 为准。完整的平台层错误码见错误码说明。
← 返回入职离职