feat(in-transit-transfer): 自动调拨联动收料就绪并分层来源错误
- 调度整合:退役 in_transit_receipt_file_job,收料归档收敛 shipping_receipt_rpa_archive,排程注册表统一 - 自动调拨 Job:调拨前确保各来源当日收料文件就绪(缺失自动触发收料 RPA),严格等量匹配后生成 ERP 调拨单 - worker 手动唤醒:排程工作台支持手动唤醒与 runs 透视,heartbeat 协议同步 - 收料缺失幸存 T2:parse_failed 状态落库(迁移 q4c5) - 来源错误分层与 stale 时钟换源:改挂 inventory_checked_at 库存查得时刻,展示阈值与执行门禁解耦(迁移 t5a6) - 新增 wecom_sender 企微通知:每非空 Run 汇总一条,通知失败不影响 ERP 结果 - 同步排程工作台/调拨卡片前端、chat/admin 文案四语言、RPA 脚本与测试全家
This commit is contained in:
1 parent
993e581135
commit
abf3d48927
144 files changed
+10161
-2132
No files matched your search
@@ -1,8 +1,10 @@
|
||||
"""在途调拨策略硬门禁。
|
||||
|
||||
用途:一期策略禁止部分数量调拨、数量容差与 外部系统 自动重试;
|
||||
confirm_ttl_seconds 为纯展示阈值(默认 10 分钟 stale 徽标判定窗口,
|
||||
不再作为执行门禁——2026-09-25 退役)。
|
||||
confirm_ttl_seconds 与 inventory_stale_ttl_seconds 均为纯展示阈值
|
||||
(stale 徽标判定窗口,不再作为执行门禁——2026-09-25 退役);
|
||||
2026-09-29 起 stale 时钟换源:挂 inventory_checked_at(库存查得
|
||||
时刻),阈值默认 24 小时——证据同步换戳不续期该时钟。
|
||||
依赖:app.core.errors.AppError、standard decimal。
|
||||
逻辑:任何策略变体触碰三项禁令之一即抛 StrategyViolationError,
|
||||
阻止发布/执行(fail-closed)。
|
||||
@@ -17,6 +19,7 @@ from app.core.errors import AppError
|
||||
|
||||
STRATEGY_VIOLATION_CODE = "TRANSFER.STRATEGY_VIOLATION"
|
||||
DEFAULT_CONFIRM_TTL_SECONDS = 600 # 10 分钟
|
||||
DEFAULT_INVENTORY_STALE_TTL_SECONDS = 86400 # 24 小时
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
@@ -30,6 +33,10 @@ class TransferStrategyPolicy:
|
||||
# 不再作为执行门禁(2026-09-25 退役)——防错由文件版本对账 + worker 写前
|
||||
# 库存复查承担(见 execution_service)。
|
||||
confirm_ttl_seconds: int = DEFAULT_CONFIRM_TTL_SECONDS
|
||||
# 纯展示阈值:stale 徽标判定窗口,时钟=inventory_checked_at(库存查得
|
||||
# 时刻,仅匹配评估/重查/写前复查写入;2026-09-29 起替换原 updated_at
|
||||
# 时钟——后者被证据同步换戳每日续期,徽标对老行永不触发)。
|
||||
inventory_stale_ttl_seconds: int = DEFAULT_INVENTORY_STALE_TTL_SECONDS
|
||||
|
||||
|
||||
class StrategyViolationError(AppError):
|
||||
@@ -61,5 +68,6 @@ def validate_strategy(strategy: TransferStrategyPolicy) -> None:
|
||||
|
||||
|
||||
def default_strategy() -> TransferStrategyPolicy:
|
||||
"""返回一期默认策略(全部禁令关闭,stale 展示阈值 600 秒)。"""
|
||||
"""返回一期默认策略(全部禁令关闭;stale 展示阈值:行新鲜度 600 秒 /
|
||||
库存查得时刻 24 小时)。"""
|
||||
return TransferStrategyPolicy()
|
||||
Reference in new issue
Block a user