feat(shipping_notice): 完成货代发货通知全流程功能迭代与重构
主要变更: 1. 移除废弃的发货通知字段抽取独立Workflow Agent相关代码 2. 重构Dify服务调用,新增inputs参数支持注入环境变量配置的工具API地址与密钥 3. 新增auto_progress工具API与checkpoint catalog接口,支持流程自动推进 4. 统一字段命名,将column_mapping_json改为map_json并兼容旧有调用 5. 重构库存匹配、解析结果的展示格式,改为标准化多语言Markdown表格 6. 新增ODM ID库存字段支持,优化库存解析与映射逻辑 7. 新增LibreOffice转换隔离Profile配置,避免多实例运行冲突 8. 新增完整环境变量配置、数据库迁移脚本与测试用例 9. 适配前端代码,更新字段命名与聊天跳转逻辑 10. 更新OpenAPI规范适配Dify工具调用,删除已归档的旧部署文档
This commit is contained in:
1 parent
2ce5256483
commit
c18c0394d0
50 files changed
+6088
-2407
No files matched your search
@@ -7,7 +7,7 @@
|
||||
},
|
||||
"servers": [
|
||||
{
|
||||
"url": "http://127.0.0.1:5052/api/shipping-notice"
|
||||
"url": "http://192.168.36.108:5052/api/shipping-notice"
|
||||
}
|
||||
],
|
||||
"paths": {
|
||||
@@ -53,7 +53,7 @@
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Tool response (status: ok|running|needs_human|failed)",
|
||||
"description": "Tool response (status: ok|running|needs_human|failed). May include checkpoint, human_options, action_buttons.",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
@@ -80,7 +80,7 @@
|
||||
"properties": {
|
||||
"task_id": {
|
||||
"type": "string",
|
||||
"description": "发货任务编号,如 SN-20260529-ABCD1234"
|
||||
"description": "发货任务编号(task id),如 SN-20260529-ABCD1234"
|
||||
},
|
||||
"raw_text": {
|
||||
"type": "string",
|
||||
@@ -96,7 +96,7 @@
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Tool response (status: ok|running|needs_human|failed)",
|
||||
"description": "Tool response (status: ok|running|needs_human|failed). May include checkpoint, human_options, action_buttons.",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
@@ -123,17 +123,17 @@
|
||||
"properties": {
|
||||
"task_id": {
|
||||
"type": "string",
|
||||
"description": "发货任务编号,如 SN-20260529-ABCD1234"
|
||||
"description": "发货任务编号(task id),如 SN-20260529-ABCD1234"
|
||||
},
|
||||
"use_uploaded_file": {
|
||||
"type": "string",
|
||||
"description": "true=解析该 task 已上传的 Excel(服务端直传,不经过 LLM)",
|
||||
"description": "true=解析该任务已上传的 Excel(服务端直传,不经过 LLM)",
|
||||
"enum": [
|
||||
"true",
|
||||
"false"
|
||||
]
|
||||
},
|
||||
"column_mapping_json": {
|
||||
"map_json": {
|
||||
"type": "string",
|
||||
"description": "可选,列映射 JSON 字符串,如 {\"sku\":\"AWS Sku\",\"available_qty\":\"Qty Available\"}"
|
||||
},
|
||||
@@ -155,7 +155,7 @@
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Tool response (status: ok|running|needs_human|failed)",
|
||||
"description": "Tool response (status: ok|running|needs_human|failed). May include checkpoint, human_options, action_buttons.",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
@@ -182,7 +182,7 @@
|
||||
"properties": {
|
||||
"task_id": {
|
||||
"type": "string",
|
||||
"description": "发货任务编号,如 SN-20260529-ABCD1234"
|
||||
"description": "发货任务编号(task id),如 SN-20260529-ABCD1234"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
@@ -194,7 +194,7 @@
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Tool response (status: ok|running|needs_human|failed)",
|
||||
"description": "Tool response (status: ok|running|needs_human|failed). May include checkpoint, human_options, action_buttons.",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
@@ -221,16 +221,16 @@
|
||||
"properties": {
|
||||
"task_id": {
|
||||
"type": "string",
|
||||
"description": "发货任务编号,如 SN-20260529-ABCD1234"
|
||||
"description": "发货任务编号(task id),如 SN-20260529-ABCD1234"
|
||||
},
|
||||
"column_mapping_json": {
|
||||
"map_json": {
|
||||
"type": "string",
|
||||
"description": "列映射 JSON,如 {\"sku\":\"料号\",\"reservation_id\":\"COM ID\",\"available_qty\":\"Qty Available\"}"
|
||||
"description": "列映射 JSON,含 sku/reservation_id/available_qty;可选 match_rule(LLM 自然语言匹配说明,缺省则后端动态兜底)"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"task_id",
|
||||
"column_mapping_json"
|
||||
"map_json"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -238,7 +238,7 @@
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Tool response (status: ok|running|needs_human|failed)",
|
||||
"description": "Tool response (status: ok|running|needs_human|failed). May include checkpoint, human_options, action_buttons.",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
@@ -265,7 +265,7 @@
|
||||
"properties": {
|
||||
"task_id": {
|
||||
"type": "string",
|
||||
"description": "发货任务编号,如 SN-20260529-ABCD1234"
|
||||
"description": "发货任务编号(task id),如 SN-20260529-ABCD1234"
|
||||
},
|
||||
"mode": {
|
||||
"type": "string",
|
||||
@@ -289,7 +289,47 @@
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Tool response (status: ok|running|needs_human|failed)",
|
||||
"description": "Tool response (status: ok|running|needs_human|failed). May include checkpoint, human_options, action_buttons.",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/tools/auto_progress": {
|
||||
"post": {
|
||||
"operationId": "auto_progress",
|
||||
"summary": "按后端全局配置自动推进:RPA 获取库存 → 字段对齐(满足条件可自动确认)→ 匹配 → 生成 Excel →(可选)上传。遇到人工节点会停住返回 action_buttons。",
|
||||
"description": "按后端全局配置自动推进:RPA 获取库存 → 字段对齐(满足条件可自动确认)→ 匹配 → 生成 Excel →(可选)上传。遇到人工节点会停住返回 action_buttons。",
|
||||
"parameters": [],
|
||||
"requestBody": {
|
||||
"required": true,
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"task_id": {
|
||||
"type": "string",
|
||||
"description": "发货任务编号(task id),如 SN-20260529-ABCD1234"
|
||||
},
|
||||
"conversation_id": {
|
||||
"type": "string",
|
||||
"description": "Dify 会话 ID(可选,用于仅知道会话时定位任务)"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Tool response (status: ok|running|needs_human|failed). May include checkpoint, human_options, action_buttons.",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
@@ -316,7 +356,7 @@
|
||||
"properties": {
|
||||
"task_id": {
|
||||
"type": "string",
|
||||
"description": "发货任务编号,如 SN-20260529-ABCD1234"
|
||||
"description": "发货任务编号(task id),如 SN-20260529-ABCD1234"
|
||||
},
|
||||
"inventory_lines_json": {
|
||||
"type": "string",
|
||||
@@ -332,7 +372,7 @@
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Tool response (status: ok|running|needs_human|failed)",
|
||||
"description": "Tool response (status: ok|running|needs_human|failed). May include checkpoint, human_options, action_buttons.",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
@@ -347,8 +387,8 @@
|
||||
"/tools/submit_decision": {
|
||||
"post": {
|
||||
"operationId": "submit_decision",
|
||||
"summary": "人工复核决策",
|
||||
"description": "人工复核决策",
|
||||
"summary": "人工复核决策。task_id 与 conversation_id 至少传一个;用户确认时禁止 create_task",
|
||||
"description": "人工复核决策。task_id 与 conversation_id 至少传一个;用户确认时禁止 create_task",
|
||||
"parameters": [],
|
||||
"requestBody": {
|
||||
"required": true,
|
||||
@@ -359,17 +399,23 @@
|
||||
"properties": {
|
||||
"task_id": {
|
||||
"type": "string",
|
||||
"description": "发货任务编号,如 SN-20260529-ABCD1234"
|
||||
"description": "发货任务编号(task id),如 SN-20260529-ABCD1234"
|
||||
},
|
||||
"conversation_id": {
|
||||
"type": "string",
|
||||
"description": "Dify 会话 ID;用户仅回复「确认」时用于定位任务"
|
||||
},
|
||||
"decision": {
|
||||
"type": "string",
|
||||
"description": "confirm=确认继续;reject=驳回;rematch=重新匹配;reparse=重新解析;confirm_inventory_mapping=确认库存字段对齐;reparse_inventory=重新上传库存",
|
||||
"description": "confirm=确认继续;reject=驳回;rematch=重新匹配;reparse=重新解析;confirm_inventory_mapping=确认库存字段对齐;correct_inventory_mapping=更正列映射;reparse_inventory=重新上传库存",
|
||||
"enum": [
|
||||
"confirm",
|
||||
"confirm_parse",
|
||||
"reject",
|
||||
"rematch",
|
||||
"reparse",
|
||||
"confirm_inventory_mapping",
|
||||
"correct_inventory_mapping",
|
||||
"reparse_inventory"
|
||||
]
|
||||
},
|
||||
@@ -379,7 +425,6 @@
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"task_id",
|
||||
"decision"
|
||||
]
|
||||
}
|
||||
@@ -388,7 +433,7 @@
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Tool response (status: ok|running|needs_human|failed)",
|
||||
"description": "Tool response (status: ok|running|needs_human|failed). May include checkpoint, human_options, action_buttons.",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
@@ -403,8 +448,8 @@
|
||||
"/tools/generate_shipment_excel": {
|
||||
"post": {
|
||||
"operationId": "generate_shipment_excel",
|
||||
"summary": "生成固定模板发货 Excel",
|
||||
"description": "生成固定模板发货 Excel",
|
||||
"summary": "生成固定模板发货 Excel(须 match_inventory 成功且 process_status=matched)",
|
||||
"description": "生成固定模板发货 Excel(须 match_inventory 成功且 process_status=matched)",
|
||||
"parameters": [],
|
||||
"requestBody": {
|
||||
"required": true,
|
||||
@@ -415,7 +460,7 @@
|
||||
"properties": {
|
||||
"task_id": {
|
||||
"type": "string",
|
||||
"description": "发货任务编号,如 SN-20260529-ABCD1234"
|
||||
"description": "发货任务编号(task id),如 SN-20260529-ABCD1234"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
@@ -427,7 +472,7 @@
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Tool response (status: ok|running|needs_human|failed)",
|
||||
"description": "Tool response (status: ok|running|needs_human|failed). May include checkpoint, human_options, action_buttons.",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
@@ -454,7 +499,7 @@
|
||||
"properties": {
|
||||
"task_id": {
|
||||
"type": "string",
|
||||
"description": "发货任务编号,如 SN-20260529-ABCD1234"
|
||||
"description": "发货任务编号(task id),如 SN-20260529-ABCD1234"
|
||||
},
|
||||
"mode": {
|
||||
"type": "string",
|
||||
@@ -467,7 +512,7 @@
|
||||
},
|
||||
"freight_ref_no": {
|
||||
"type": "string",
|
||||
"description": "货代系统单号(manual_confirm 时填写)"
|
||||
"description": "货代系统单号(可选;manual_confirm 通常无需填写)"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
@@ -479,7 +524,7 @@
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Tool response (status: ok|running|needs_human|failed)",
|
||||
"description": "Tool response (status: ok|running|needs_human|failed). May include checkpoint, human_options, action_buttons.",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
@@ -494,8 +539,8 @@
|
||||
"/tools/get_task_status": {
|
||||
"post": {
|
||||
"operationId": "get_task_status",
|
||||
"summary": "查询 task 当前状态与 human_options",
|
||||
"description": "查询 task 当前状态与 human_options",
|
||||
"summary": "查询任务当前状态与 human_options。task_id 与 conversation_id 至少传一个",
|
||||
"description": "查询任务当前状态与 human_options。task_id 与 conversation_id 至少传一个",
|
||||
"parameters": [],
|
||||
"requestBody": {
|
||||
"required": true,
|
||||
@@ -506,19 +551,20 @@
|
||||
"properties": {
|
||||
"task_id": {
|
||||
"type": "string",
|
||||
"description": "发货任务编号,如 SN-20260529-ABCD1234"
|
||||
"description": "发货任务编号(task id),如 SN-20260529-ABCD1234"
|
||||
},
|
||||
"conversation_id": {
|
||||
"type": "string",
|
||||
"description": "Dify 会话 ID"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"task_id"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Tool response (status: ok|running|needs_human|failed)",
|
||||
"description": "Tool response (status: ok|running|needs_human|failed). May include checkpoint, human_options, action_buttons.",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
@@ -531,4 +577,4 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user