跳到主要内容

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.createoffice:writePOST /v1/onboard-offboard/create(comap-office)

⚠️ 高危接口:删除或状态变更类操作,MCP 调用须先向用户复述并获同意后携 confirm: true。

必填字段

字段依据
employeeId参数说明
type参数说明

条件必填(如「某状态时必填」)不在此表,以上方参数说明为准。 判定规则见必填字段的判定。

请求体字段(body)

字段类型必填说明
typeinteger(int32)——
employeeIdinteger(int64)——
employeeNamestring——
deptIdinteger(int64)——
positionstring——
onboardDatestring——
mentorIdinteger(int64)——
offboardDatestring——
offboardReasonstring——
offboardTypeinteger(int32)——
handlerIdinteger(int64)——
notesstring——
checklistTemplateIdinteger(int64)——
checklistTemplateNamestring——
checklistTemplateVersioninteger(int32)——
onboardSnapshot6OnboardingSnapshotVO——
previousEmployeeStatusinteger(int32)——
checklistItems12ChecklistItemDTO[]——
employmentPeriodIdinteger(int64)——
onboardingSourcestring——
plannedEmploymentSequenceinteger(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 字段

字段类型必填说明
idinteger(int64)——
typeinteger(int32)——
employeeIdinteger(int64)——
employeeNamestring——
avatarstring——
deptIdinteger(int64)——
deptNamestring——
positionstring——
mentorIdinteger(int64)——
onboardDatestring(date-time)——
onboardStatusinteger(int32)——
onboardChecklist20ChecklistItemVO[]——
offboardDatestring(date-time)——
offboardStatusinteger(int32)——
offboardReasonstring——
offboardTypeinteger(int32)——
offboardChecklist20ChecklistItemVO[]——
createDatestring(date-time)——
handlerIdinteger(int64)——
handlerstring——
notesstring——
flowInstanceCodestring——
recordNostring——
employeeNostring——
mentorNamestring——
handlerNamestring——
checklistTemplateIdinteger(int64)——
checklistTemplateNamestring——
checklistTemplateVersioninteger(int32)——
onboardSnapshot6OnboardingSnapshotVO——
previousEmployeeStatusinteger(int32)——
completedChecklistCountinteger(int32)——
totalChecklistCountinteger(int32)——
nextChecklistItemNamestring——
nextChecklistAssigneeNamestring——
existingboolean——
employmentPeriodIdinteger(int64)——
onboardingSourcestring——
employmentSequenceinteger(int32)——
plannedEmploymentSequenceinteger(int32)——

错误处理​

响应统一信封 { code, message, data },code == 200 为成功。以下是本接口可能返回的开放平台层错误:

错误码说明可重试
92101访问凭证无效否
92201接口未登记或已停用否
92202超出凭证授权范围——本接口需 office:write否
92204绑定员工无此接口的功能权限否
92203上游服务调用失败先查询处理结果,禁止盲目重试
92301请求过于频繁是
92205写操作处理超时,结果未知(下游可能仍在执行)否,先查询确认结果
92302有参数相同的写请求正在处理中等待并确认前一次结果,勿重复提交

除此之外,comap-office 自身的业务校验失败会原样透传其业务码与提示 (如字段校验、状态不允许、数据不存在),这类码不在开放平台的号段内, 以响应里的 message 为准。完整的平台层错误码见错误码说明。

← 返回入职离职