feat(shipping-notice): 添加订单文档 Profile 盲测集和样本管理功能,支持创建、执行和批准盲测,增强订单冻结和库存核验功能
This commit is contained in:
1 parent
c35223d49d
commit
abd8fc1e16
98 files changed
+4629
-528
No files matched your search
@@ -17,6 +17,7 @@ from app.models import (
|
||||
ShippingCase, ShippingInventoryFile, ShippingInventoryRoutingRuleCondition, ShippingTask,
|
||||
ShippingOrderExtraction, ShippingOrderField, ShippingOrderFieldDecision, ShippingOrderFieldValue,
|
||||
ShippingOrderLine, ShippingOrderSchema, ShippingOrderSchemaVersion,
|
||||
ShippingOrderSnapshot, ShippingOrderSnapshotLine,
|
||||
ShippingTaskEvent, ShippingTaskInventoryLink,
|
||||
)
|
||||
from app.services.shipping_notice.match import match_notice_lines
|
||||
@@ -77,6 +78,23 @@ def _attach_dynamic_order(task: ShippingTask, *, part_number: str, reservation_i
|
||||
value_json=value,
|
||||
))
|
||||
task.current_order_extraction_id = extraction.id
|
||||
# RPA/库存链路只消费冻结订单快照;此辅助保留动态字段测试证据的同时
|
||||
# 建立最小履约真相,避免旧测试绕过阶段 1 门禁。
|
||||
snapshot = ShippingOrderSnapshot(
|
||||
task_id=task.id, extraction_id=extraction.id, schema_version_id=published['id'],
|
||||
order_data_version=task.order_data_version or 1, rule_versions_json={}, header_values_json={},
|
||||
)
|
||||
db.session.add(snapshot)
|
||||
db.session.flush()
|
||||
db.session.add(ShippingOrderSnapshotLine(
|
||||
snapshot_id=snapshot.id, position=0, part_number=part_number, reservation_id=reservation_id,
|
||||
qty=quantity, field_values_json={
|
||||
str(fields['part_number']['id']): part_number,
|
||||
str(fields['reservation_id']['id']): reservation_id,
|
||||
str(fields['qty']['id']): quantity,
|
||||
},
|
||||
))
|
||||
task.order_snapshot_id = snapshot.id
|
||||
db.session.flush()
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user