| 参数 | 参数类型 | 必填 | 描述 |
|---|---|---|---|
| taskId | string | Y | 任务的唯一标识符,由提交接口返回 |
| 输出参数 | 类型 | 参数说明 |
|---|---|---|
| errcode | String | 返回码("0000" 表示请求成功) |
| description | String | 操作信息描述 |
| data.taskId | String | 任务的唯一标识 |
| data.status | String | 任务状态:COMPLETED / PROCESSING / FAILED |
| data.result | Object | 导入结果明细,仅 COMPLETED 时返回,字段见下表 |
| data.taskTraceId | String | 任务执行时的 trace_id |
| data.error | String | 错误描述,仅 FAILED 时返回 |
| traceId | String | 请求唯一标识 |
| 字段 | 类型 | 说明 |
|---|---|---|
| clientId / supplierId | String | 本次导入的租户与供应商(回显请求入参;一批只有一个,见「批次粒度」) |
| targetItemsWritten | Number | 写入的发票明细条数 |
| candidateItemsWritten | Number | 写入的入库明细条数 |
| labelPairsWritten | Number | 写入标注匹配对表的条数 |
| historySkipped | Boolean | 历史库是否被跳过(降级) |
| historySkipReason | String | 跳过原因,仅 historySkipped=true 时返回 |
| historyPairsWritten | Number | 写入历史匹配库的匹配对数(余弦低于阈值的那些) |
| historyVectorsWritten | Number | 写入向量库的向量数(按发票侧向量去重,≤ 匹配对数) |
| historyPairsAboveThreshold | Number | 因 余弦 ≥ 阈值而未写历史库的匹配对数 |
| historySimilarityThreshold | Number | 本次生效的写入阈值 |
| elapsedSeconds | Number | 任务耗时 |
{
"errcode": "0000",
"description": "Success",
"data": {
"taskId": "8a99a18a3ca66a8fb332c66130b09f44",
"status": "COMPLETED",
"result": {
"clientId": "client_001",
"supplierId": "supplier_001",
"targetItemsWritten": 2,
"candidateItemsWritten": 3,
"labelPairsWritten": 3,
"historySkipped": false,
"historyPairsWritten": 1,
"historyVectorsWritten": 1,
"historyPairsAboveThreshold": 2,
"historySimilarityThreshold": 0.7,
"elapsedSeconds": 2.4
},
"taskTraceId": "d4e5e33e57bf0237"
},
"traceId": "abf23ef9bde547789193e5338b622cad"
}| 返回码 | 描述 | 常见原因 |
|---|---|---|
| 0000 | 操作成功 | — |
| 2001 | 参数错误 | 必填字段缺失、请求体超过 10MB、匹配对超过 5000、item_id 重复、match_result 引用了不存在的 item_id、明细里有未被 match_result 引用的 item_id |
| 3001 | 服务暂不可用 | Kafka 发送缓冲区已满,稍后重试 |
| 3000 | 服务器错误 | MySQL 未配置、内部异常 |
历史库不可用不会导致错误码 —— 它走降级路径,任务仍为 COMPLETED,
通过data.result.historySkipped判断。