feat(shipping-order): 迭代货代订单提取与履约全流程功能

添加订单字段自动标注配置,默认仅关键字段参与自动框选
完善字段规范化逻辑,支持更多日期格式解析
添加订单候选人工采纳、驳回的完整流程,包含API、前端交互与状态管理
完善盲测功能,支持订单级字段真值校验,调整盲测集唯一性约束
加固库存校验逻辑,防止重复预约与数量不一致问题
优化坐标匹配逻辑,支持表格外的锚点定位
新增上传结果未知的状态处理,完善任务状态机
更新多语言文案与文档说明,补充功能细节
修复订单合并、重解析的边缘情况问题
补充相关测试用例,完善质量保障
This commit is contained in:
hugo committed 2026-07-27 20:48:40 +08:00
1 parent 11079910ec
commit 90f77634d6
76 files changed
+5056 -338

No files matched your search

@@ -145,6 +145,7 @@ def record_inventory_verification(
db.session.add(verification)
db.session.flush()
available_count = 0
seen_reservation_ids: set[str] = set()
for item in line_results:
reservation_id = validated_reservation_id(item.get('reservation_id'))
part_number = str(item.get('part_number') or '').strip()
@@ -152,6 +153,11 @@ def record_inventory_verification(
if reservation is None or reservation.part_number != part_number:
raise ValidationError('Inventory result does not map to a frozen reservation', code='SHIPPING.RESERVATION_MISMATCH')
required = _decimal(item.get('required_qty'))
# The frozen order is the quantity authority. A reduced or duplicate result
# must not turn an insufficient reservation into an exportable line.
if reservation_id in seen_reservation_ids or required != reservation.required_qty:
raise ValidationError('Inventory result quantity is inconsistent with the frozen reservation', code='SHIPPING.RESERVATION_MISMATCH')
seen_reservation_ids.add(reservation_id)
available = _decimal(item.get('available_qty')) if Decimal(str(item.get('available_qty') or 0)) > 0 else Decimal('0')
status = 'available' if available >= required else 'shortage'
db.session.add(ShippingInventoryVerificationLine(