feat(shipping_notice): 新增货代订单全流程业务模块及配套基建

本次提交新增货代订单处理全流程的完整业务能力、数据库迁移与测试用例:
1.  统一追加式审计事件体系,支持全链路不可篡改的业务追溯
2.  货代任务撤销、版本替代管控逻辑,规范已上传订单的合规版本更替
3.  订单抽取路由审计、模板自动冻结资格、路由计数等核心业务基建
4.  EML订单补充表解析契约与合并逻辑,完善订单补全能力
5.  Chatflow只读能力令牌校验机制,保障工具调用安全
6.  人工复核证据校验服务,规范人工审核的证据留存
所有变更均配套完整的单元测试与迁移契约测试,支持受控回退
This commit is contained in:
hugo committed 2026-07-28 08:56:58 +08:00
1 parent 90f77634d6
commit 1f3ecb87b7
128 files changed
+3635 -2074

No files matched your search

+22 -2
View File
@@ -63,8 +63,23 @@
"workflowRunId": "Workflow Run ID",
"errorCode": "Error code",
"jobAttempts": "Job attempts",
"units": "Document unit diagnostics",
"lifecycle": "Redacted node lifecycle",
"units": "Document unit diagnostics",
"routeDecision": "Template routing decision",
"executionMode": "Execution path",
"matchStatus": "Template match",
"selectedProfile": "Selected template",
"autoCreateApproved": "Blind-test approved",
"fallbackReasons": "Fallback reasons",
"candidates": "Candidate templates",
"hardMatch": "Hard match passed",
"hardMismatch": "Hard match failed",
"missingAnchors": "Missing anchors: {ids}",
"yes": "Yes",
"no": "No",
"executionModes": { "deterministic": "Backend deterministic parsing", "dify": "Dify supplemental extraction", "blocked": "Blocked; manual action required" },
"matchStatuses": { "unique_match": "Unique match", "no_match": "No match", "ambiguous": "Multiple templates matched", "layout_drift": "Layout drift", "evidence_insufficient": "Insufficient evidence" },
"reasonCodes": { "profile_evidence_insufficient": "Insufficient template evidence", "profile_no_match": "No eligible template", "profile_ambiguous": "Candidate margin is insufficient", "profile_layout_drift": "Table or anchor differs from the template", "profile_not_auto_create_approved": "Template is not approved for automatic creation", "multiple_tables_detected": "Multiple tables detected", "no_parsed_lines": "No valid lines parsed", "row_needs_review": "A line requires review", "header_value_conflict": "Order field values conflict", "required_header_missing": "Required order field missing", "required_line_field_missing": "Required line field missing", "profile_schema_field_mismatch": "Template fields differ from frozen Schema" },
"lifecycle": "Redacted node lifecycle",
"statuses": {
"queued": "Queued",
"running": "Running",
@@ -2615,6 +2630,11 @@
"updated": "Profile draft updated",
"cloned": "New version draft created; select a sample to reconfirm mappings",
"published": "Profile published",
"autoFreezeQualification": {
"manual_confirmation": "Manual confirmation only (auto-freeze disabled)",
"auto_freeze_approved": "Auto-freeze approved",
"auto_freeze_suspended": "Auto-freeze suspended"
},
"retired": "Profile retired",
"deleted": "Profile draft deleted",
"deleteConfirm": "Delete this profile draft?",
+3
View File
@@ -14,6 +14,7 @@
"pending": "Ready to send",
"uploading": "Uploading",
"processing": "Processing",
"layoutProcessing": "Parsing order layout",
"ready": "Ready",
"parsing": "Parsing",
"parseSucceeded": "Parsed successfully",
@@ -55,6 +56,7 @@
"shippingNoticeParsing": "Parsing",
"shippingNoticeParsed": "Parsed",
"shippingNoticeAttachmentHint": "Attachments {ok}/{total}",
"shippingNoticeAttachmentHintLayoutProcessing": "Attachments {ok}/{total}, parsing order layout",
"shippingNoticeAttachmentHintPartial": "Attachments {ok}/{total} ({failed} incomplete)",
"shippingNoticeAttachmentHintWithDup": "Attachments {ok}/{total} ({duplicates} duplicates skipped)",
"shippingNoticeAttachmentIncompleteWarn": "Attachment parse incomplete",
@@ -217,6 +219,7 @@
"evidenceTitle": "Field evidence",
"unknownField": "Unknown field",
"documentId": "Document #{id}",
"pageNumber": "Page {page}",
"issueMissing": "Missing",
"issueInvalid": "Invalid format",
"issueConflict": "Source conflict",
+1
View File
@@ -247,6 +247,7 @@
"SHIPPING_NOTICE_DUPLICATE_ACTION_UNAVAILABLE": "This duplicate action is not allowed for the current state.",
"SHIPPING_NOTICE_ORDER_EXTRACTION_CONTEXT_INVALID": "The order extraction context is invalid. Send the current email again.",
"SHIPPING_NOTICE_ORDER_EXTRACTION_PENDING": "Email preprocessing is incomplete or order extraction is still in progress.",
"SHIPPING_NOTICE_ORDER_EXTRACTION_LAYOUT_PENDING": "Order attachment layout parsing is still in progress. Please wait before sending.",
"SHIPPING_NOTICE_ORDER_EXTRACTION_ALREADY_COMPLETED": "The order extraction result has already been saved. Review the candidates or existing tasks.",
"SHIPPING_NOTICE_ORDER_EXTRACTION_INVALID_RESULT": "The extracted order result does not match the contract. Parse it again.",
"SHIPPING_NOTICE_ORDER_EXTRACTION_FAILED": "Order identification failed. Send the current email again.",
+22 -2
View File
@@ -62,8 +62,23 @@
"workflowRunId": "Workflow Run ID",
"errorCode": "รหัสข้อผิดพลาด",
"jobAttempts": "ความพยายามของ Job",
"units": "การวินิจฉัยหน่วยเอกสาร",
"lifecycle": "วงจรโหนดที่ปกปิดข้อมูล",
"units": "การวินิจฉัยหน่วยเอกสาร",
"routeDecision": "การตัดสินใจเส้นทางเทมเพลต",
"executionMode": "เส้นทางการดำเนินการ",
"matchStatus": "การจับคู่เทมเพลต",
"selectedProfile": "เทมเพลตที่เลือก",
"autoCreateApproved": "ผ่านการทดสอบแบบปิดบัง",
"fallbackReasons": "เหตุผลการถอยกลับ",
"candidates": "เทมเพลตที่เป็นไปได้",
"hardMatch": "ผ่านเงื่อนไขบังคับ",
"hardMismatch": "ไม่ผ่านเงื่อนไขบังคับ",
"missingAnchors": "จุดยึดที่ขาด: {ids}",
"yes": "ใช่",
"no": "ไม่ใช่",
"executionModes": { "deterministic": "การแยกข้อมูลแบบกำหนดแน่นอนโดยแบ็กเอนด์", "dify": "การแยกข้อมูลเสริมด้วย Dify", "blocked": "ถูกบล็อก ต้องดำเนินการด้วยตนเอง" },
"matchStatuses": { "unique_match": "จับคู่ได้เพียงหนึ่ง", "no_match": "ไม่พบการจับคู่", "ambiguous": "พบหลายเทมเพลต", "layout_drift": "รูปแบบเลื่อน", "evidence_insufficient": "หลักฐานไม่เพียงพอ" },
"reasonCodes": { "profile_evidence_insufficient": "หลักฐานเทมเพลตไม่เพียงพอ", "profile_no_match": "ไม่มีเทมเพลตที่ผ่านเกณฑ์", "profile_ambiguous": "ส่วนต่างคะแนนผู้สมัครไม่เพียงพอ", "profile_layout_drift": "ตารางหรือจุดยึดไม่ตรงกับเทมเพลต", "profile_not_auto_create_approved": "เทมเพลตไม่ได้รับอนุมัติให้สร้างอัตโนมัติ", "multiple_tables_detected": "ตรวจพบหลายตาราง", "no_parsed_lines": "ไม่พบรายการที่แยกได้", "row_needs_review": "มีรายการที่ต้องตรวจทาน", "header_value_conflict": "ค่าฟิลด์คำสั่งซื้อขัดแย้งกัน", "required_header_missing": "ไม่มีฟิลด์คำสั่งซื้อที่จำเป็น", "required_line_field_missing": "ไม่มีฟิลด์รายการที่จำเป็น", "profile_schema_field_mismatch": "ฟิลด์เทมเพลตไม่ตรงกับ Schema ที่ตรึงไว้" },
"lifecycle": "วงจรโหนดที่ปกปิดข้อมูล",
"statuses": {
"queued": "รอการดำเนินการ",
"running": "กำลังดำเนินการ",
@@ -2483,6 +2498,11 @@
"updated": "อัปเดตฉบับร่างโปรไฟล์แล้ว",
"cloned": "สร้างฉบับร่างเวอร์ชันใหม่แล้ว โปรดเลือกตัวอย่างเพื่อยืนยันการแมปอีกครั้ง",
"published": "เผยแพร่โปรไฟล์แล้ว",
"autoFreezeQualification": {
"manual_confirmation": "ยืนยันด้วยตนเองเท่านั้น (ปิดการแช่แข็งอัตโนมัติ)",
"auto_freeze_approved": "อนุมัติการแช่แข็งอัตโนมัติแล้ว",
"auto_freeze_suspended": "ระงับการแช่แข็งอัตโนมัติแล้ว"
},
"retired": "ยกเลิกใช้งานโปรไฟล์แล้ว",
"deleted": "ลบฉบับร่างโปรไฟล์แล้ว",
"deleteConfirm": "ยืนยันการลบฉบับร่างโปรไฟล์นี้หรือไม่",
+3
View File
@@ -14,6 +14,7 @@
"pending": "พร้อมส่ง",
"uploading": "กำลังอัปโหลด",
"processing": "กำลังประมวลผล",
"layoutProcessing": "กำลังแยกโครงร่างคำสั่งซื้อ",
"ready": "พร้อมใช้งาน",
"parsing": "กำลังแยกวิเคราะห์",
"parseSucceeded": "แยกวิเคราะห์สำเร็จ",
@@ -55,6 +56,7 @@
"shippingNoticeParsing": "กำลังแยกข้อความ",
"shippingNoticeParsed": "แยกข้อความเสร็จแล้ว",
"shippingNoticeAttachmentHint": "ไฟล์แนบ {ok}/{total}",
"shippingNoticeAttachmentHintLayoutProcessing": "ไฟล์แนบ {ok}/{total} กำลังแยกโครงร่างคำสั่งซื้อ",
"shippingNoticeAttachmentHintPartial": "ไฟล์แนบ {ok}/{total} (ไม่ครบ {failed})",
"shippingNoticeAttachmentHintWithDup": "ไฟล์แนบ {ok}/{total} (ซ้ำ {duplicates})",
"shippingNoticeAttachmentIncompleteWarn": "แยกข้อความไฟล์แนบไม่ครบ",
@@ -217,6 +219,7 @@
"evidenceTitle": "หลักฐานฟิลด์",
"unknownField": "ฟิลด์ไม่ทราบ",
"documentId": "เอกสาร #{id}",
"pageNumber": "หน้า {page}",
"issueMissing": "ขาดหาย",
"issueInvalid": "รูปแบบไม่ถูกต้อง",
"issueConflict": "แหล่งข้อมูลขัดแย้ง",
+1
View File
@@ -247,6 +247,7 @@
"SHIPPING_NOTICE_DUPLICATE_ACTION_UNAVAILABLE": "สถานะรายการซ้ำปัจจุบันไม่อนุญาตการดำเนินการนี้",
"SHIPPING_NOTICE_ORDER_EXTRACTION_CONTEXT_INVALID": "บริบทการแยกคำสั่งซื้อไม่ถูกต้อง โปรดส่งอีเมลปัจจุบันอีกครั้ง",
"SHIPPING_NOTICE_ORDER_EXTRACTION_PENDING": "การประมวลผลอีเมลเบื้องต้นยังไม่เสร็จ หรือกำลังแยกคำสั่งซื้ออยู่",
"SHIPPING_NOTICE_ORDER_EXTRACTION_LAYOUT_PENDING": "กำลังแยกโครงร่างไฟล์แนบคำสั่งซื้อ โปรดรอก่อนส่ง",
"SHIPPING_NOTICE_ORDER_EXTRACTION_ALREADY_COMPLETED": "บันทึกผลการแยกคำสั่งซื้อของอีเมลนี้แล้ว โปรดตรวจสอบรายการคำสั่งซื้อที่เสนอหรืองานที่มีอยู่",
"SHIPPING_NOTICE_ORDER_EXTRACTION_INVALID_RESULT": "ผลการแยกคำสั่งซื้อไม่ตรงตามสัญญาข้อมูล โปรดลองแยกข้อความใหม่",
"SHIPPING_NOTICE_ORDER_EXTRACTION_FAILED": "การระบุคำสั่งซื้อล้มเหลว โปรดส่งอีเมลปัจจุบันอีกครั้ง",
+22 -2
View File
@@ -63,8 +63,23 @@
"workflowRunId": "Workflow Run ID",
"errorCode": "错误码",
"jobAttempts": "Job 执行尝试",
"units": "文档单元诊断",
"lifecycle": "脱敏节点生命周期",
"units": "文档单元诊断",
"routeDecision": "模板路由判断",
"executionMode": "执行路径",
"matchStatus": "模板匹配",
"selectedProfile": "选中模板",
"autoCreateApproved": "盲测批准",
"fallbackReasons": "回退原因",
"candidates": "候选模板",
"hardMatch": "硬条件通过",
"hardMismatch": "硬条件未通过",
"missingAnchors": "缺失锚点:{ids}",
"yes": "是",
"no": "否",
"executionModes": { "deterministic": "后端确定性解析", "dify": "Dify 补充识别", "blocked": "阻断,需人工处理" },
"matchStatuses": { "unique_match": "唯一命中", "no_match": "未命中", "ambiguous": "多个模板命中", "layout_drift": "版式漂移", "evidence_insufficient": "证据不足" },
"reasonCodes": { "profile_evidence_insufficient": "模板证据不足", "profile_no_match": "无合格模板", "profile_ambiguous": "候选模板分差不足", "profile_layout_drift": "表格或锚点与模板不符", "profile_not_auto_create_approved": "模板尚未获得自动建单批准", "multiple_tables_detected": "检测到多个表格", "no_parsed_lines": "未解析到有效明细", "row_needs_review": "存在需复核的明细行", "header_value_conflict": "订单字段值冲突", "required_header_missing": "缺少必填订单字段", "required_line_field_missing": "缺少必填明细字段", "profile_schema_field_mismatch": "模板字段与冻结 Schema 不一致" },
"lifecycle": "脱敏节点生命周期",
"statuses": {
"queued": "等待执行",
"running": "执行中",
@@ -2593,6 +2608,11 @@
"updated": "模板草稿已更新",
"cloned": "新版本草稿已创建,请选择样本重新确认映射",
"published": "模板已发布",
"autoFreezeQualification": {
"manual_confirmation": "仅人工确认(自动冻结未启用)",
"auto_freeze_approved": "已批准自动冻结",
"auto_freeze_suspended": "自动冻结已暂停"
},
"retired": "模板已退役",
"deleted": "模板草稿已删除",
"deleteConfirm": "确认删除此模板草稿?",
+3
View File
@@ -14,6 +14,7 @@
"pending": "待发送",
"uploading": "上传中",
"processing": "处理中",
"layoutProcessing": "正在解析订单版面",
"ready": "处理完成",
"parsing": "解析中",
"parseSucceeded": "解析成功",
@@ -55,6 +56,7 @@
"shippingNoticeParsing": "解析中",
"shippingNoticeParsed": "解析完成",
"shippingNoticeAttachmentHint": "附件 {ok}/{total}",
"shippingNoticeAttachmentHintLayoutProcessing": "附件 {ok}/{total},正在解析订单版面",
"shippingNoticeAttachmentHintPartial": "附件 {ok}/{total}({failed} 未完整)",
"shippingNoticeAttachmentHintWithDup": "附件 {ok}/{total}({duplicates} 重复已去重)",
"shippingNoticeAttachmentIncompleteWarn": "附件解析不完整",
@@ -227,6 +229,7 @@
"evidenceTitle": "字段证据",
"unknownField": "未知字段",
"documentId": "文档 #{id}",
"pageNumber": "第 {page} 页",
"issueMissing": "缺失",
"issueInvalid": "格式非法",
"issueConflict": "来源冲突",
+1
View File
@@ -247,6 +247,7 @@
"SHIPPING_NOTICE_DUPLICATE_ACTION_UNAVAILABLE": "当前重复状态不允许该处理方式。",
"SHIPPING_NOTICE_ORDER_EXTRACTION_CONTEXT_INVALID": "订单识别上下文无效,请重新发送当前邮件。",
"SHIPPING_NOTICE_ORDER_EXTRACTION_PENDING": "邮件预处理尚未完成,或本次订单识别仍在处理中。",
"SHIPPING_NOTICE_ORDER_EXTRACTION_LAYOUT_PENDING": "订单附件版面仍在解析,请稍候再发送。",
"SHIPPING_NOTICE_ORDER_EXTRACTION_ALREADY_COMPLETED": "该邮件的订单识别结果已保存,请查看订单候选或已有任务。",
"SHIPPING_NOTICE_ORDER_EXTRACTION_INVALID_RESULT": "订单识别结果不符合协议,请重新解析。",
"SHIPPING_NOTICE_ORDER_EXTRACTION_FAILED": "订单识别失败,请重新发送当前邮件。",
+22 -2
View File
@@ -62,8 +62,23 @@
"workflowRunId": "Workflow Run ID",
"errorCode": "錯誤碼",
"jobAttempts": "Job 執行嘗試",
"units": "文件單元診斷",
"lifecycle": "脫敏節點生命週期",
"units": "文件單元診斷",
"routeDecision": "範本路由判斷",
"executionMode": "執行路徑",
"matchStatus": "範本匹配",
"selectedProfile": "選定範本",
"autoCreateApproved": "盲測核准",
"fallbackReasons": "回退原因",
"candidates": "候選範本",
"hardMatch": "硬條件通過",
"hardMismatch": "硬條件未通過",
"missingAnchors": "缺少錨點:{ids}",
"yes": "是",
"no": "否",
"executionModes": { "deterministic": "後端確定性解析", "dify": "Dify 補充識別", "blocked": "已阻斷,需人工處理" },
"matchStatuses": { "unique_match": "唯一命中", "no_match": "未命中", "ambiguous": "多個範本命中", "layout_drift": "版式漂移", "evidence_insufficient": "證據不足" },
"reasonCodes": { "profile_evidence_insufficient": "範本證據不足", "profile_no_match": "無合格範本", "profile_ambiguous": "候選範本分差不足", "profile_layout_drift": "表格或錨點與範本不符", "profile_not_auto_create_approved": "範本尚未獲得自動建單核准", "multiple_tables_detected": "偵測到多個表格", "no_parsed_lines": "未解析到有效明細", "row_needs_review": "存在需複核的明細行", "header_value_conflict": "訂單欄位值衝突", "required_header_missing": "缺少必填訂單欄位", "required_line_field_missing": "缺少必填明細欄位", "profile_schema_field_mismatch": "範本欄位與凍結 Schema 不一致" },
"lifecycle": "脫敏節點生命週期",
"statuses": {
"queued": "等待執行",
"running": "執行中",
@@ -2483,6 +2498,11 @@
"updated": "範本草稿已更新",
"cloned": "新版本草稿已建立,請選擇樣本重新確認對應",
"published": "範本已發布",
"autoFreezeQualification": {
"manual_confirmation": "僅人工確認(自動凍結未啟用)",
"auto_freeze_approved": "已核准自動凍結",
"auto_freeze_suspended": "自動凍結已暫停"
},
"retired": "範本已退役",
"deleted": "範本草稿已刪除",
"deleteConfirm": "確認刪除此範本草稿?",
+3
View File
@@ -14,6 +14,7 @@
"pending": "待發送",
"uploading": "上傳中",
"processing": "處理中",
"layoutProcessing": "正在解析訂單版面",
"ready": "處理完成",
"parsing": "解析中",
"parseSucceeded": "解析成功",
@@ -55,6 +56,7 @@
"shippingNoticeParsing": "解析中",
"shippingNoticeParsed": "解析完成",
"shippingNoticeAttachmentHint": "附件 {ok}/{total}",
"shippingNoticeAttachmentHintLayoutProcessing": "附件 {ok}/{total},正在解析訂單版面",
"shippingNoticeAttachmentHintPartial": "附件 {ok}/{total}({failed} 未完整)",
"shippingNoticeAttachmentHintWithDup": "附件 {ok}/{total}({duplicates} 重複已去重)",
"shippingNoticeAttachmentIncompleteWarn": "附件解析不完整",
@@ -217,6 +219,7 @@
"evidenceTitle": "欄位證據",
"unknownField": "未知欄位",
"documentId": "文件 #{id}",
"pageNumber": "第 {page} 頁",
"issueMissing": "缺失",
"issueInvalid": "格式非法",
"issueConflict": "來源衝突",
+1
View File
@@ -247,6 +247,7 @@
"SHIPPING_NOTICE_DUPLICATE_ACTION_UNAVAILABLE": "目前重複狀態不允許此處理方式。",
"SHIPPING_NOTICE_ORDER_EXTRACTION_CONTEXT_INVALID": "訂單識別上下文無效,請重新傳送目前郵件。",
"SHIPPING_NOTICE_ORDER_EXTRACTION_PENDING": "郵件預處理尚未完成,或本次訂單識別仍在處理中。",
"SHIPPING_NOTICE_ORDER_EXTRACTION_LAYOUT_PENDING": "訂單附件版面仍在解析,請稍候再發送。",
"SHIPPING_NOTICE_ORDER_EXTRACTION_ALREADY_COMPLETED": "該郵件的訂單識別結果已儲存,請查看訂單候選或既有任務。",
"SHIPPING_NOTICE_ORDER_EXTRACTION_INVALID_RESULT": "訂單識別結果不符合協議,請重新解析。",
"SHIPPING_NOTICE_ORDER_EXTRACTION_FAILED": "訂單識別失敗,請重新傳送目前郵件。",