diff --git a/backend/app/jobs/queue.py b/backend/app/jobs/queue.py index 158407c4..7080b5cf 100644 --- a/backend/app/jobs/queue.py +++ b/backend/app/jobs/queue.py @@ -118,58 +118,6 @@ def enqueue( if existing: return int(existing.id) -<<<<<<< HEAD - raise ValidationError(f'JobType {job_type} enqueue not implemented in Wave 2') - - -def enqueue_kb_job(job_id: int) -> tuple[bool, str]: - """ - 提交 KB 类 KbJob 执行(兼容旧 queue_service 签名)。 - 核心逻辑:委托 knowledge_cleaning.queue_service;返回域内 (ok, message) 供 API 写 queue_result。 - Args: - job_id: 已持久化的 KbJob 主键。 - Returns: - (是否成功, 队列结果说明,如 queued_for_worker / queued_manual)。 - """ - from app.services.knowledge_cleaning.queue_service import enqueue_kb_job as _enqueue_kb_job - - return _enqueue_kb_job(int(job_id)) - - -def enqueue_clean_job(job_id: int) -> tuple[bool, str]: - """ - 提交 clean/path_upload 类 KbJob(enqueue_kb_job 别名)。 - Args: - job_id: KbJob 主键。 - Returns: - 同 enqueue_kb_job。 - """ - return enqueue_kb_job(job_id) - - -def enqueue_shipping_notice_job( - *, - task_no: str, - created_by_id: int | None = None, - batch_no: str | None = None, -) -> tuple[bool, str]: - """ - 持久化并提交单票发货后台任务。 - Args: - task_no: 发货 task 编号。 - created_by_id: 创建人 user id(可选)。 - batch_no: 所属批次号(可选)。 - Returns: - (是否成功, 结果说明)。 - """ - from app.services.shipping_notice.queue_service import enqueue_shipping_notice_job as _enqueue_shipping - - return _enqueue_shipping( - task_no=task_no, - created_by_id=created_by_id, - batch_no=batch_no, - ) -======= now = datetime.utcnow() queue_at = scheduled_at if isinstance(scheduled_at, datetime) else now job = Job( @@ -344,4 +292,3 @@ def process_next_job( if refreshed: fail_job(refreshed, error=str(exc), retryable=True) raise ->>>>>>> hugo-shipping-notice diff --git a/backend/app/services/shipping_notice/batch_orchestrator.py b/backend/app/services/shipping_notice/batch_orchestrator.py index 4f4e3be5..84c87f32 100644 --- a/backend/app/services/shipping_notice/batch_orchestrator.py +++ b/backend/app/services/shipping_notice/batch_orchestrator.py @@ -14,12 +14,8 @@ from typing import Any from flask import current_app from app import db -<<<<<<< HEAD -from app.jobs import enqueue_shipping_notice_job -======= from app.services.shipping_notice.constants import PH_RPA_EXHAUSTED, PH_RPA_PENDING from app.services.shipping_notice.queue_service import enqueue_shipping_notice_job ->>>>>>> hugo-shipping-notice from app.services.shipping_notice.dify_executor import run_shipping_parse_via_dify from app.services.shipping_notice.query_service import get_batch_by_no, get_task_by_ref, list_sorted_batch_tasks from app.services.shipping_notice.task_workflow import recompute_batch_summary