refactor(shipping-notice): 统一料号字段,移除过时的 SKU 相关字段,更新相关逻辑以支持新字段命名

This commit is contained in:
hugo committed 2026-07-16 20:02:33 +08:00
1 parent dde25344ca
commit 46eb63f5bb
111 files changed
+3116 -1250

No files matched your search

+2 -2
View File
@@ -39,8 +39,8 @@
| **发货通知** | **点击发送进入现有 Chatflow** | 已预处理 Intake 点击发送走普通 `/api/chat/completions`,携带 `shipping_intake_nos`,不调用本地建批 Action。 | `useChatShippingSendHandler.spec.ts` / chat runtime context 测试 | 空文本或自然语言 + parsed Intake | 使用默认/用户 query 调 `sendMessage`;上下文含 Intake;SSE 后仅清理 consumed 附件。 |
| **发货通知** | **一附件多订单与部分成功** | 一个 Document 可形成多个 Candidate;高置信订单自动建 Task,低置信订单保留。 | `test_shipping_notice_order_extraction.py::test_submit_order_extraction_supports_multiple_orders_partial_success_and_replay` | 同一附件 2 个订单,其中 1 个低置信 | 2 Candidate、1 Task、1 pending;Intake=`partially_completed`;重放不重复建单。 |
| **发货通知** | **订单抽取快照与权限** | Tool 从 agent_runtime_context 会话反查用户;附件来源变化后拒绝旧 LLM 结果。 | `test_shipping_notice_order_extraction.py` | 合法上下文、修改 Document 文本后的旧 snapshot | 合法上下文可读取;漂移返回 `CANDIDATE_SOURCE_CHANGED`;不创建 Candidate。 |
| **发货通知** | **自动建单与流程字段门禁** | 分类、SKU/Qty 置信度与原文证据达标即建 Task;缺 Reservation 仍建单但禁止库存链;订单行 Source Type 仅作可选路由线索。 | `test_shipping_notice_order_extraction.py` / `test_shipping_notice_tools.py` | 高置信 SKU+Qty,Reservation 为空、Source Type 可选 | Task=`pending_review/rsv_req`;`auto_progress` 返回 needs_human 且禁止库存/匹配/Excel;Source Type 缺失不单独阻断。 |
| **发货通知** | **库存连接器 API 命名** | 连接器候选使用 `connector_type`,任务 API 使用 `inventory_connector_type`;不得返回旧 `inventory_source_type`。 | `test_shipping_notice_openapi_contract.py` | 获取动态 OpenAPI 与静态 Dify 快照 | 订单行保留可选 `source_type` 且不暴露废弃路由字段;状态查询说明仅含 `inventory_connector_type`。 |
| **发货通知** | **自动建单与流程字段门禁** | 分类、`part_number`/Qty 置信度与原文证据达标即建 Task;缺 Reservation 仍建单但禁止库存链;`inventory_source_hint` 仅作可选路由线索。 | `test_shipping_notice_order_extraction.py` / `test_shipping_notice_tools.py` | 高置信 `part_number`+Qty,Reservation 为空、库存源线索可选 | Task=`pending_review/rsv_req`;`auto_progress` 返回 needs_human 且禁止库存/匹配/Excel;库存源线索缺失不单独阻断。 |
| **发货通知** | **库存连接器 API 命名** | 连接器候选使用 `connector_type`,任务 API 使用 `inventory_connector_type`;不得返回旧 `inventory_source_type`。 | `test_shipping_notice_openapi_contract.py` | 获取动态 OpenAPI 与静态 Dify 快照 | 订单行仅保留可选 `inventory_source_hint` 且不暴露废弃路由字段;状态查询说明仅含 `inventory_connector_type`。 |
| **发货通知** | **Candidate 双指纹判重** | 同身份同内容与同身份修订必须给出不同重复状态。 | `test_shipping_notice_business_dedup.py::test_candidate_content_fingerprint_distinguishes_same_content_and_revision` | 相同 PO/Reservation,不同或相同行数量 | 分别返回 `same_business_content`、`possible_revision`。 |
| **发货通知** | **Candidate 审核 API** | owner 可选择/修订/刷新/决策;越权不可见;已消费不可修改。 | `test_shipping_notice_intakes.py::test_candidate_review_duplicate_api_and_access_guards` | owner/other 用户、已消费 Candidate | 成功路径 200,越权 404,已消费 409,修订后清空旧重复决策。 |
| **发货通知** | **Candidate 安全门禁** | 空摘要、无效行、附件不完整、过期、选择漂移、无候选旧路径均不可建单。 | `test_shipping_notice_intakes.py` Candidate validation/gate 用例 | 非法摘要与异常 Intake | API 返回明确 400/409;不创建 Task;合法幂等重放不受影响。 |