feat(shipping): 新增货代发货批量自动处理与任务重试功能

本次提交完整实现货代发货通知的自动化批量处理能力:
1.  新增发货单票后台任务类型与专用worker队列,实现任务持久化调度
2.  实现发货批次后台编排器,支持上传后自动逐票推进解析、匹配、导出全流程
3.  新增单票重试、批次待处理重试的API与前端操作界面
4.  补充全量多语言翻译,新增重试、任务列表、状态展示相关文案
5.  优化上传交互逻辑,改为后台自动处理任务,无需手动触发解析指令
6.  修复文件检核工具无数据预检逻辑,避免创建空检核批次
7.  调整发货工作流细节,优化Excel生成幂等性与任务状态同步
8.  更新环境配置与API文档,修正货代工具接口地址端口
This commit is contained in:
hugo committed 2026-06-23 11:22:09 +08:00
1 parent 70e8f700ff
commit 08360a4142
40 files changed
+2515 -371

No files matched your search

@@ -15,6 +15,9 @@ from app.services.shipping_notice.agent_resolver import CHAT_AGENT_NAME
SHIPPING_CONVERSATION_ID_INPUT = "conversation_id"
SHIPPING_CURRENT_BATCH_NO_INPUT = "current_batch_no"
SHIPPING_CURRENT_TASK_NO_INPUT = "current_task_no"
SHIPPING_ENTRY_MODE_INPUT = "entry_mode"
SHIPPING_USER_MESSAGE_INPUT = "user_message"
SHIPPING_TRIGGER_SOURCE_INPUT = "trigger_source"
def is_shipping_notice_chat_agent(agent) -> bool:
@@ -52,6 +55,9 @@ def build_dify_chat_inputs(
*,
task_id: str | None = None,
batch_no: str | None = None,
entry_mode: str | None = None,
user_message: str | None = None,
trigger_source: str | None = None,
) -> dict[str, str]:
"""
构建发货通知 Dify Chatflow inputs。
@@ -87,7 +93,10 @@ def build_dify_chat_inputs(
current_batch_no = str(task.batch.batch_no or "").strip().upper()
return {
SHIPPING_ENTRY_MODE_INPUT: str(entry_mode or "").strip(),
SHIPPING_CONVERSATION_ID_INPUT: conv_id,
SHIPPING_CURRENT_BATCH_NO_INPUT: current_batch_no,
SHIPPING_CURRENT_TASK_NO_INPUT: current_task_no,
SHIPPING_USER_MESSAGE_INPUT: str(user_message or "").strip(),
SHIPPING_TRIGGER_SOURCE_INPUT: str(trigger_source or "").strip(),
}