feat(shipping-order): 迭代货代订单提取与履约全流程功能
添加订单字段自动标注配置,默认仅关键字段参与自动框选 完善字段规范化逻辑,支持更多日期格式解析 添加订单候选人工采纳、驳回的完整流程,包含API、前端交互与状态管理 完善盲测功能,支持订单级字段真值校验,调整盲测集唯一性约束 加固库存校验逻辑,防止重复预约与数量不一致问题 优化坐标匹配逻辑,支持表格外的锚点定位 新增上传结果未知的状态处理,完善任务状态机 更新多语言文案与文档说明,补充功能细节 修复订单合并、重解析的边缘情况问题 补充相关测试用例,完善质量保障
This commit is contained in:
1 parent
11079910ec
commit
90f77634d6
76 files changed
+5056
-338
No files matched your search
@@ -48,6 +48,37 @@ def test_rolling_verification_keeps_shortage_pending_and_later_releases_it(app):
|
||||
assert second.result_json['available_count'] == 1
|
||||
|
||||
|
||||
def test_inventory_verification_uses_frozen_quantity_and_rejects_duplicate_result(app):
|
||||
"""关键断言:库存侧不得缩小需求数量或用重复结果覆盖同一冻结预约单。"""
|
||||
with app.app_context():
|
||||
task, user = _build_accepted_order(suffix='quantity-authority')
|
||||
snapshot = freeze_order_snapshot(task, actor_id=user.id, expected_order_data_version=7)
|
||||
db.session.commit()
|
||||
line = snapshot.lines[0]
|
||||
frozen_quantity = str(line.qty)
|
||||
result = {
|
||||
'reservation_id': line.reservation_id,
|
||||
'part_number': line.part_number,
|
||||
'required_qty': '1',
|
||||
'available_qty': '1',
|
||||
'line_status': 'ok',
|
||||
}
|
||||
|
||||
with pytest.raises(ValidationError) as quantity_error:
|
||||
record_inventory_verification(
|
||||
task, inventory_snapshot_id=None, source_config_version='v1', line_results=[result],
|
||||
)
|
||||
assert quantity_error.value.code == 'SHIPPING.RESERVATION_MISMATCH'
|
||||
db.session.rollback()
|
||||
|
||||
result['required_qty'] = frozen_quantity
|
||||
with pytest.raises(ValidationError) as duplicate_error:
|
||||
record_inventory_verification(
|
||||
task, inventory_snapshot_id=None, source_config_version='v1', line_results=[result, result.copy()],
|
||||
)
|
||||
assert duplicate_error.value.code == 'SHIPPING.RESERVATION_MISMATCH'
|
||||
|
||||
|
||||
def test_rolling_reservation_only_selects_unoccupied_lines_in_later_round(app):
|
||||
"""A/B 首轮占用后,C 补货只能进入第二轮;首轮 Artifact 不得被覆盖或重复占用。"""
|
||||
with app.app_context():
|
||||
|
||||
Reference in new issue
Block a user