feat(shipping-notice): 落地 XFA 拆分、版面签名、统一进度与处理域履约

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
hugoandCursor committed 2026-08-06 10:18:37 +08:00
1 parent 3a9fbac2fc
commit d2b3d74def
571 files changed
+78064 -24681

No files matched your search

@@ -2,7 +2,7 @@
services/shipping_notice/rpa_attempts.py
用途:统计任务的 RPA 库存导出与货代上传重试次数,并返回统一上限。
依赖:ShippingTask、ShippingTaskEvent 模型与事件查询逻辑。
依赖:ShippingNotice、ShippingTaskEvent 模型与事件查询逻辑。
逻辑:由 inventory_rpa_workflow、fulfillment_workflow 等模块调用本文件,决定是否还能继续触发 RPA 重试。
"""
@@ -11,7 +11,7 @@ from __future__ import annotations
import os
from datetime import datetime
from app.models import ShippingTask, ShippingTaskEvent
from app.models import ShippingNotice, ShippingTaskEvent
FIXED_RPA_INVENTORY_MAX_ATTEMPTS = 1
DEFAULT_RPA_UPLOAD_MAX_ATTEMPTS = 3
@@ -34,7 +34,7 @@ _UPLOAD_SUCCESS_EVENTS = {
}
def inventory_rpa_attempts(task: ShippingTask | None) -> int:
def inventory_rpa_attempts(task: ShippingNotice | None) -> int:
"""统计自上次库存成功事件以来的 RPA 库存导出触发/失败次数。"""
if not task or task.id is None:
return 0
@@ -60,7 +60,7 @@ def inventory_rpa_attempts(task: ShippingTask | None) -> int:
return max(triggered.count(), failed.count())
def upload_rpa_attempts(task: ShippingTask | None) -> int:
def upload_rpa_attempts(task: ShippingNotice | None) -> int:
"""统计自上次上传成功事件以来的 RPA 货代上传触发/失败次数。"""
if not task or task.id is None:
return 0