feat(shipping-notice): 新增发货通知自动上传功能与候选资格评估

- 在环境配置中新增 SHIPPING_NOTICE_AUTO_UPLOAD_ENABLED 选项,默认关闭,需显式开启以支持自动上传。
- 引入新的 pytest.ini 文件,增加测试标记以支持自动化测试。
- 删除不再使用的 seed_shipping_notice_agents.py 文件,简化代码库。
- 更新相关 API,增强发货通知与候选资格评估功能,支持多种筛选条件。
- 增强文档与代码注释,反映新的业务逻辑与功能要求。
This commit is contained in:
hugo committed 2026-08-02 19:26:35 +08:00
1 parent cef3d5b26a
commit 3a9fbac2fc
226 files changed
+25010 -2098

No files matched your search

+128 -3
View File
@@ -194,11 +194,31 @@
"reasonCode": "處理原因",
"diagnosticHint": "處理建議",
"responsibleParty": "責任方",
"attemptCount": "執行嘗試",
"attemptCountValue": "{current} / {max}(技術自動重試上限)",
"viewAudit": "檢視審計",
"hideAudit": "收起審計",
"auditLoading": "正在載入審計…",
"auditEmpty": "暫無門禁審計事件",
"auditLoadFailed": "載入門禁審計失敗",
"auditEventFallback": "門禁處理紀錄",
"auditEvents": {
"process_gate_created": "已建立處理環節",
"process_gate_attempt_started": "開始執行處理",
"process_gate_passed": "處理環節已通過",
"process_gate_blocked": "處理環節已阻斷",
"process_gate_recovery_requested": "已請求恢復處理",
"process_gate_idempotent_replay": "已依冪等規則複用結果",
"process_gate_manual_override": "已人工覆蓋處理結果",
"process_gate_rule_suggestion_generated": "已產生規則建議",
"process_gate_suggestion_adopted": "已採用規則建議",
"process_gate_suggestion_rejected": "已拒絕規則建議",
"process_gate_downstream_invalidated": "下游結果已失效",
"process_gate_technical_retry": "系統已自動重試",
"process_gate_lease_taken_over": "處理任務已由其他 Worker 接管",
"process_gate_artifact_superseded": "產物已被新版本取代",
"process_gate_permission_denied": "無權限執行該操作"
},
"parties": {
"owner": "訂單覆核 / 任務負責人",
"worker": "系統 Worker",
@@ -231,6 +251,8 @@
"retry_task_creation": "重試建立任務",
"retry_inventory_preparation": "重試庫存準備",
"regenerate_excel_artifact": "重新產生 Excel",
"poll_freight_upload_rpa": "重新整理貨代上傳進度",
"retry_freight_upload_rpa": "重試貨代上傳 RPA",
"regenerate_manual_upload_todo": "重新產生待上傳待辦"
},
"reasons": {
@@ -241,9 +263,112 @@
"customer_ambiguous": "客戶識別存在歧義",
"field_conflict": "欄位存在衝突,需人工裁決",
"duplicate_unresolved": "重複訂單尚未處理",
"require_manual_review": "需要人工覆核",
"no_inventory_source_candidates": "未找到可用庫存源",
"inventory_source_unavailable": "庫存源不可用"
"require_manual_review": "庫存源規則衝突或要求人工確認",
"no_inventory_source_candidates": "未匹配到庫存源規則",
"inventory_source_unavailable": "規則命中的庫存源目前不可用",
"inventory_rpa_queued": "RPA 任務已排隊等待執行",
"inventory_rpa_timeout": "RPA 執行逾時",
"inventory_rpa_login_failed": "庫存平台登入失敗",
"inventory_rpa_export_failed": "庫存報表匯出失敗",
"inventory_rpa_exhausted": "庫存源重試次數已耗盡",
"inventory_file_missing": "未產生庫存檔案",
"inventory_file_empty": "庫存檔案為空或沒有有效庫存記錄",
"inventory_preparation_waiting": "庫存檔案準備中,請稍後重新整理",
"inventory_preparation_failed": "庫存準備失敗,請重試或上傳庫存檔案",
"upload_rpa_pending": "貨代平台上傳任務等待執行",
"upload_rpa_failed": "貨代平台上傳失敗,可重試 RPA",
"upload_rpa_login_failed": "貨代平台登入失敗,請檢查憑據後重試",
"upload_platform_rejected": "貨代平台拒絕上傳,請核對檔案後重試",
"upload_result_unknown": "上傳結果暫時無法確認",
"manual_upload_pending": "請下載 Excel 後在貨代平台上傳並登記結果",
"technical_retry_exhausted": "系統自動重試已耗盡",
"order_extraction_failed": "訂單欄位抽取失敗",
"order_extraction_cancelled": "訂單抽取已取消",
"customer_out_of_scope": "客戶不在目前業務範圍內",
"reservation_missing": "缺少有效 Reservation",
"reservation_invalid": "Reservation 格式或規則校驗未通過",
"reservation_duplicate": "Reservation 已在其他訂單中使用",
"required_field_missing": "缺少建立訂單所需欄位",
"field_value_invalid": "部分欄位格式不正確",
"field_low_confidence": "部分識別結果置信度較低",
"effective_reservation_missing": "缺少有效的預約單號",
"document_unavailable": "發貨通知文件不可用,請重新上傳或物化文件",
"layout_parse_failed": "PDF 版面解析失敗,請重試解析",
"profile_not_matched": "未能匹配文件模板,請人工確認 Profile",
"profile_ambiguous": "文件模板存在歧義,請人工確認 Profile",
"profile_drift": "文件結構與模板版本不一致",
"extraction_incomplete": "訂單欄位抽取未完成,請重試或進入複核",
"cross_source_conflict": "跨來源欄位衝突,請解決衝突後繼續",
"evidence_missing": "關鍵識別結果缺少有效證據",
"auto_freeze_not_enabled": "自動建單策略尚未啟用",
"task_creation_failed": "履約任務建立失敗",
"inventory_file_identity_mismatch": "返回檔案與所選庫存源不一致",
"inventory_mapping_required": "庫存欄位對應待確認",
"inventory_match_failed": "庫存匹配失敗",
"inventory_insufficient": "庫存不足",
"inventory_shortage_review_required": "存在庫存缺口,需要人工處理",
"excel_not_ready": "目前尚不滿足 Excel 產生條件",
"artifact_generation_failed": "Excel 產生失敗",
"upload_rpa_login_failed": "貨代平台登入失敗",
"upload_platform_rejected": "貨代平台拒絕本次上傳",
"attachment_format_unsupported": "附件格式不支援",
"attachment_size_exceeded": "附件超過系統大小限制",
"attachment_corrupted": "附件檔案損壞,無法讀取",
"attachment_duplicate": "已存在相同內容的附件",
"attachment_storage_failed": "附件儲存失敗",
"attachment_security_blocked": "附件包含被禁止的指令碼或巨集",
"attachment_replaced": "已重新上傳並覆蓋目前發貨通知附件",
"document_text_unavailable": "未能從文件中擷取可用文字",
"business_table_not_found": "未找到訂單明細表",
"business_table_empty": "找到訂單表,但沒有有效業務列",
"multiple_business_tables": "發現多個可能的訂單明細表",
"document_password_protected": "文件受密碼保護",
"generic_gate_blocked": "通用訂單識別門禁未通過,需要人工複核",
"gate_invalidated": "上游結果已變化,目前門禁需重新評估",
"task_cancelled_by_user": "任務已由使用者取消",
"task_voided_for_correction": "任務已作廢以進行更正",
"task_archived": "任務已歸檔",
"task_rejected_by_user": "訂單候選/任務已由使用者駁回",
"task_closed_after_upload": "上傳完成後任務已關閉",
"void_blocked_external_uploaded": "已存在外部履約,禁止作廢,請歸檔",
"unknown_business_failure": "業務處理失敗,請憑請求編號聯繫管理員",
"inventory_source_conflicted": "多條規則產生衝突,需要人工確認",
"inventory_source_changed": "原已確認庫存源配置已變化",
"inventory_source_identity_mismatch": "目前任務與庫存源/倉庫身分不一致",
"inventory_multi_file_conflict": "多庫存檔案結果衝突",
"inventory_sku_not_found": "庫存中未找到對應 SKU",
"inventory_reservation_not_found": "庫存中未找到對應 Reservation",
"inventory_warehouse_mismatch": "倉庫與訂單要求不一致",
"inventory_required_column_missing": "庫存檔案缺少必填欄",
"inventory_column_ambiguous": "庫存欄對應存在歧義",
"excel_template_missing": "發貨 Excel 模板缺失",
"excel_input_incomplete": "產生 Excel 所需輸入不完整",
"artifact_validation_failed": "Excel 產物校驗失敗",
"late_callback_ignored": "遲到的外部回呼已忽略",
"close_blocked_missing_receipt": "缺少上傳回執,暫不可關閉"
},
"nextAction": "下一步",
"nextActionHint": "下一步:{action}",
"detailFacts": "關鍵事實",
"detailKeys": {
"source_code": "庫存源",
"source_codes": "庫存源",
"unavailable_source_codes": "不可用庫存源",
"unavailable_reasons": "不可用原因",
"matched_rule_codes": "命中規則",
"raw_rule_source_codes": "規則原始候選",
"candidate_inventory_source_codes": "有效候選",
"line_key": "明細行",
"line_index": "行號",
"field_code": "欄位",
"request_id": "請求編號",
"process_status": "處理狀態",
"match_status": "匹配狀態",
"task_no": "任務編號",
"has_inventory_lines": "是否已有庫存行",
"has_export": "是否已產生 Excel",
"execution_no": "執行編號",
"inventory_file_id": "庫存檔案"
}
},
"myTodos": {