feat(shipping-notice): 新增订单行与字段冲突管理功能,支持字段冲突查询与解决

This commit is contained in:
hugo committed 2026-07-16 13:03:11 +08:00
1 parent 4fbaed2b4c
commit 9da0481fc3
74 files changed
+4861 -375

No files matched your search

+2
View File
@@ -46,4 +46,6 @@
| **发货通知** | **Candidate 安全门禁** | 空摘要、无效行、附件不完整、过期、选择漂移、无候选旧路径均不可建单。 | `test_shipping_notice_intakes.py` Candidate validation/gate 用例 | 非法摘要与异常 Intake | API 返回明确 400/409;不创建 Task;合法幂等重放不受影响。 |
| **发货通知** | **关键字段真值校验** | LLM 候选必须经后端格式、来源和列证据裁决;多模板字母/数字 ID 兼容,内部 hex/UUID 与来源冲突必须阻断。 | `test_shipping_notice_reservation_id.py`、`test_shipping_notice_extract.py`、`test_shipping_notice_tools.py` | External Reservation、COM ID、PR Number、AWS-311、32 位 hex、拍平文本、冲突 TSV | 有唯一列证据时纠正并留痕;无证据或冲突时进入 `rsv_req/parse_review`;确认与匹配旁路均不可绕过。 |
| **发货通知** | **Candidate 迁移往返** | 内容指纹、订单抽取状态与多 Candidate 唯一键迁移须可独立 upgrade/downgrade。 | `test_shipping_notice_candidate_migration.py` | 前一版本最小 schema;同 Document 多 Candidate | 新列/约束存在;安全场景完整降级;多 Candidate 场景明确拒绝降级。 |
| **发货通知** | **订单行双写与切读** | dual 写同事务更新 JSON+规范表;shadow 对外仍读 JSON;table 读以规范表为准;回填/校验可运维。 | `test_shipping_task_line_store.py`;脚本 `backfill_shipping_task_lines.py` / `verify_shipping_task_lines.py` | dual/shadow/table 配置;非法 qty;人为 JSON 漂移 | dual 成功落两侧;shadow 打 mismatch 日志;table 忽略漂移;verify mismatch 退出码 1。 |
| **发货通知** | **字段对账与冲突门禁** | Candidate 空字段可补齐;双方非空不同落冲突;未解决冲突阻断库存/RPA/匹配/导出;改单带版本。 | `test_shipping_task_field_reconciliation.py` | open_existing 补 Reservation;多行同字段冲突;行重建后冲突存活 | applied/conflicted 可区分;下游入口无副作用;resolve 后重算 Gate。 |