feat(shipping-notice): 添加 MinerU 订单附件表格结构化功能,更新环境配置和数据模型以支持新布局解析和文档模板管理
This commit is contained in:
1 parent
c4095b08da
commit
c35223d49d
148 files changed
+15709
-1353
No files matched your search
@@ -956,6 +956,36 @@ def workspace_retry_shipping_order_extraction_run(run_no: str):
|
||||
)
|
||||
|
||||
|
||||
@workspace_shipping_notice_bp.route('/shipping-notice/order-extraction-runs/<run_no>/reparse', methods=['POST'])
|
||||
def workspace_reparse_shipping_order_extraction_run(run_no: str):
|
||||
"""
|
||||
使用当前发布规则重新识别一个终态订单抽取 Run。
|
||||
|
||||
核心逻辑:只接收受控原因与可选备注,服务层复用原始 Intake 创建新的版本化 Run;
|
||||
不复用失败重试的冻结 Provider 缓存,也不允许前端传入 Schema、Binding 或附件内容。
|
||||
"""
|
||||
user = _require_user()
|
||||
body = request.get_json(silent=True)
|
||||
if not isinstance(body, dict):
|
||||
raise ValidationError('Request body must be an object')
|
||||
from app.services.shipping_notice.order_extraction_run_service import (
|
||||
reparse_order_extraction_run,
|
||||
serialize_order_extraction_run,
|
||||
)
|
||||
|
||||
run, reused = reparse_order_extraction_run(
|
||||
user_id=user.id,
|
||||
run_no=run_no,
|
||||
reason=str(body.get('reason') or ''),
|
||||
comment=str(body.get('comment') or '') or None,
|
||||
)
|
||||
db.session.commit()
|
||||
return ok(
|
||||
{'run': serialize_order_extraction_run(run), 'reused': reused},
|
||||
request_id=getattr(g, 'request_id', None), status=202,
|
||||
)
|
||||
|
||||
|
||||
@workspace_shipping_notice_bp.route('/shipping-notice/order-extraction-runs', methods=['GET'])
|
||||
def workspace_list_shipping_order_extraction_runs():
|
||||
"""列出当前用户订单抽取 Run,可按 HXOPS 会话过滤。"""
|
||||
|
||||
Reference in new issue
Block a user