| 项目 | 内容 |
|---|---|
| 请求方式 | POST |
| 请求地址 | /ai/knowledge/aiService/feedback |
| Content-Type | application/json |
| taskType | three_way_match |
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
| taskType | string | 是 | 固定为 three_way_match |
| clientId | string | 是 | 客户 ID |
| taskData | object | 是 | 本次发票反馈数据 |
| taskData.supplierId | string | 是 | 供应商 ID |
| taskData.targetDocId | string | 是 | 发票单据 ID;上报的发票行必须属于该单据 |
| taskData.userResult | array | 是 | 本次上报的发票明细,至少一条;targetItemId 不可重复 |
| taskData.extraCandidateUrl | string | 条件必填 | 有任意非空 candidateItem 时必传,见第 4 节 |
| taskData.extraTargetUrl | string | 条件必填 | 有 MANUAL 行时必传,见第 4 节 |
| taskData.settings | object/null | 否 | 用于 MANUAL 行;算法来源行使用原任务配置 |
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
| targetItemId | string | 是 | 发票明细 ID |
| feedbackType | string/null | 是 | ACCEPT、MODIFY、MANUAL 或 JSON null,见第 3 节 |
| sourceTaskId | string/null | 是 | 算法来源行传当前页面展示的 task ID;MANUAL 传 JSON null |
| candidateItem | array | 是 | 客户确认的完整匹配列表;未勾选传 [] |
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
| candidateDocId | string | 是 | 入库单 ID,与候选文件中的 doc_id 一致 |
| candidateItemId | string | 是 | 入库单明细 ID;同一发票行内不可重复 |
| allocatedAmount | number | 按匹配维度 | 分配金额 |
| allocatedQuantity | number | 按匹配维度 | 分配数量,使用入库单明细自身的单位 |
| 页面操作 | feedbackType | sourceTaskId | candidateItem |
|---|---|---|---|
| 勾选并接受系统的非空结果 | ACCEPT | 当前展示 task ID | 完整非空确认列表 |
| 修改候选或分配额后勾选;或系统无结果、人工补出非空结果后勾选 | MODIFY | 当前展示 task ID | 修改后的完整非空确认列表 |
| 未勾选:保留系统结果、编辑但未确认、清空结果、系统无结果 | null | 当前展示 task ID | [] |
| 无算法来源的人工行,确认非空匹配 | MANUAL | null | 完整非空确认列表 |
| 字段 | 要求 |
|---|---|
| extraCandidateUrl | 只要任一行的 candidateItem 非空就必传。UTF-8 CSV 必须覆盖本次引用的全部 candidateItemId,每个 ID 一条完整明细;包括原池内、池外和已入库的候选。仅上报未勾选行时可省略。 |
| extraTargetUrl | 有 MANUAL 行时必传。UTF-8 CSV 必须覆盖本次全部 MANUAL targetItemId,且这些行的 doc_id 等于 targetDocId。 |
| settings | 与匹配主接口配置规则一致,仅作用于 MANUAL;不传、null 或 {} 使用默认配置,matchMode 默认字符串 "0"。显式非法配置会报错。 |
{
"taskType": "three_way_match",
"clientId": "client_123",
"taskData": {
"supplierId": "supplier_456",
"targetDocId": "invoice_A",
"userResult": [
{"targetItemId": "A_1", "feedbackType": "ACCEPT", "sourceTaskId": "task_001",
"candidateItem": [{"candidateDocId": "receipt_1", "candidateItemId": "R_1", "allocatedAmount": 1200}]}
],
"extraCandidateUrl": "https://files.example.com/receipt_R1.csv"
}
}{
"taskType": "three_way_match",
"clientId": "client_123",
"taskData": {
"supplierId": "supplier_456",
"targetDocId": "invoice_A",
"userResult": [
{"targetItemId": "A_2", "feedbackType": "MODIFY", "sourceTaskId": "task_002",
"candidateItem": [
{"candidateDocId": "receipt_2", "candidateItemId": "R_2", "allocatedAmount": 300},
{"candidateDocId": "receipt_3", "candidateItemId": "R_3", "allocatedAmount": 200}
]}
],
"extraCandidateUrl": "https://files.example.com/receipts_R2_R3.csv"
}
}{
"taskType": "three_way_match",
"clientId": "client_123",
"taskData": {
"supplierId": "supplier_456",
"targetDocId": "invoice_A",
"userResult": [
{"targetItemId": "A_3", "feedbackType": null, "sourceTaskId": "task_003", "candidateItem": []}
]
}
}{
"taskType": "three_way_match",
"clientId": "client_123",
"taskData": {
"supplierId": "supplier_456",
"targetDocId": "invoice_A",
"userResult": [
{"targetItemId": "A_4", "feedbackType": "MANUAL", "sourceTaskId": null,
"candidateItem": [{"candidateDocId": "receipt_4", "candidateItemId": "R_4", "allocatedAmount": 100}]}
],
"extraTargetUrl": "https://files.example.com/invoice_A_manual.csv",
"extraCandidateUrl": "https://files.example.com/receipt_R4.csv"
}
}{
"taskType": "three_way_match",
"clientId": "client_123",
"taskData": {
"supplierId": "supplier_456",
"targetDocId": "invoice_A",
"userResult": [
{"targetItemId": "A_1", "feedbackType": "ACCEPT", "sourceTaskId": "task_001",
"candidateItem": [{"candidateDocId": "receipt_1", "candidateItemId": "R_1", "allocatedAmount": 1200}]},
{"targetItemId": "A_2", "feedbackType": "MODIFY", "sourceTaskId": "task_002",
"candidateItem": [{"candidateDocId": "receipt_2", "candidateItemId": "R_2", "allocatedAmount": 300}]},
{"targetItemId": "A_3", "feedbackType": null, "sourceTaskId": "task_003", "candidateItem": []},
{"targetItemId": "A_4", "feedbackType": "MANUAL", "sourceTaskId": null,
"candidateItem": [{"candidateDocId": "receipt_4", "candidateItemId": "R_4", "allocatedAmount": 100}]}
],
"extraTargetUrl": "https://files.example.com/invoice_A_manual.csv",
"extraCandidateUrl": "https://files.example.com/receipts_R1_R2_R4.csv"
}
}{
"taskType": "three_way_match",
"clientId": "client_123",
"taskData": {
"supplierId": "supplier_456",
"targetDocId": "invoice_A",
"userResult": [
{"targetItemId": "A_5", "feedbackType": "MANUAL", "sourceTaskId": null,
"candidateItem": [{"candidateDocId": "receipt_5", "candidateItemId": "R_5",
"allocatedAmount": 260, "allocatedQuantity": 10}]}
],
"extraTargetUrl": "https://files.example.com/invoice_A_manual.csv",
"extraCandidateUrl": "https://files.example.com/receipt_R5.csv",
"settings": {"matchMode": "2"}
}
}{"errcode":"0000","description":"Success"}| errcode | 含义 | 处理建议 |
|---|---|---|
| 0000 | 请求处理成功 | 无须重试 |
| 2001 | 参数错误 | 根据错误描述修正请求 |
| 3000 | 服务处理失败 | 使用原请求重试 |