feat(shipping-notice): 完善发货通知自动推进与多库存源复核闭环
This commit is contained in:
1 parent
cfa19a0b7b
commit
8e0bbf7a81
180 files changed
+31210
-1864
No files matched your search
@@ -0,0 +1,26 @@
|
||||
"""
|
||||
jobs/handlers/shipping_auto_progress.py
|
||||
|
||||
用途:消费 P0-3 Task 级 AutoProgress Job。
|
||||
依赖:JobContext、auto_progress_controller。
|
||||
逻辑:Job 已由通用队列领取为 running;本 Handler 只委托正式控制器执行一个 Gate,不再调用旧全链路 facade。
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from app.jobs.context import JobContext
|
||||
from app.jobs.registry import register_handler
|
||||
from app.jobs.types import JobType
|
||||
from app.services.shipping_notice.auto_progress_controller import run_auto_progress_job
|
||||
|
||||
|
||||
@register_handler(JobType.SHIPPING_AUTO_PROGRESS)
|
||||
def run_shipping_auto_progress(ctx: JobContext, payload: dict) -> None:
|
||||
"""执行一个正式 Gate;payload 必须含队列注入的 job_id。"""
|
||||
raw_job_id = payload.get('job_id')
|
||||
if not raw_job_id:
|
||||
raise RuntimeError('missing_job_id_for_shipping_auto_progress')
|
||||
run_auto_progress_job(
|
||||
job_id=int(raw_job_id),
|
||||
worker_id=str(ctx.extras.get('worker_label') or f'shipping-auto-progress-{raw_job_id}'),
|
||||
)
|
||||
Reference in new issue
Block a user