feat(shipping_notice): 支持客户 ODM 白名单与整单 ODM 选择收敛导出
- 客户主数据新增 odm_ids 白名单字段(含 Alembic 迁移),表单与管理端支持维护 - 导出库存命中行按客户白名单与整单 ODM 裁决收敛,新增 notice_odm_choice_service - 工作台新增 odm-options / odm-choice 接口,投影行级候选并持久化用户选择 - 修复复核工作台跨 Run 切换时接收解析上下文残留 - 同步四语言 i18n、测试用例、funclist 与 shipping-notice 技术文档
This commit is contained in:
1 parent
a032354cb9
commit
d396371020
51 files changed
+2717
-109
No files matched your search
@@ -212,6 +212,35 @@ def test_reservation_region_requires_review_when_numbered_value_has_no_line_targ
|
||||
assert applied.review_reasons == ('line_field_unavailable',)
|
||||
|
||||
|
||||
def test_reservation_region_matches_line_by_printed_ln_number_not_position():
|
||||
"""LN 非连续(部分行已拆单)时必须按 LN 值定位逻辑行,禁止位置错配或误报越界。"""
|
||||
applied = apply_reservation_region_candidates(
|
||||
candidates=extract_reservation_from_region_text(
|
||||
"Reservation L#1: 1000159370\nReservation L#2: 1000159366\n"
|
||||
"Reservation L#4: 1000159379\nReservation L#5: 1000159236"
|
||||
),
|
||||
header_field_id='header-reservation', line_field_id='line-reservation',
|
||||
line_count=4, line_numbers=[1, 2, 4, 5],
|
||||
)
|
||||
|
||||
assert applied.needs_review is False
|
||||
# 键是逻辑行序号:L#4→第 3 行(LN=4)、L#5→第 4 行(LN=5)。
|
||||
assert applied.line_values == {1: '1000159370', 2: '1000159366', 3: '1000159379', 4: '1000159236'}
|
||||
|
||||
|
||||
def test_reservation_region_flags_review_when_referenced_ln_number_is_absent():
|
||||
"""被引用的印刷行号在解析行中不存在时必须转复核,不得静默按位置写入。"""
|
||||
applied = apply_reservation_region_candidates(
|
||||
candidates=extract_reservation_from_region_text("Reservation L#5: 1000159236"),
|
||||
header_field_id='header-reservation', line_field_id='line-reservation',
|
||||
line_count=2, line_numbers=[1, 2],
|
||||
)
|
||||
|
||||
assert applied.line_values == {}
|
||||
assert applied.needs_review is True
|
||||
assert applied.review_reasons == ('line_out_of_range',)
|
||||
|
||||
|
||||
def test_reservation_gate_blocks_empty_and_malformed_order_lines():
|
||||
"""空订单或畸形行都不能被视为 Reservation 门禁通过。"""
|
||||
from app.services.shipping_notice.reservation_gate import reservation_gate_issues
|
||||
|
||||
Reference in new issue
Block a user