feat(shipping-notice): 添加识别定义和规则集管理功能,支持客户和站点的可配置识别规则
This commit is contained in:
1 parent
88408490d7
commit
34d489a2d1
167 files changed
+10365
-7978
No files matched your search
@@ -64,6 +64,10 @@ def _should_requeue_waiting_external_result(task_no: str) -> bool:
|
||||
task = get_task_by_ref(task_no)
|
||||
if not task:
|
||||
return False
|
||||
from app.services.shipping_notice.task_disposition_service import task_is_active
|
||||
|
||||
if not task_is_active(task):
|
||||
return False
|
||||
process_status = str(task.process_status or '').strip()
|
||||
pending_reason = str(task.pending_human_reason or '').strip()
|
||||
return (
|
||||
@@ -189,7 +193,18 @@ def run_shipping_notice_job(payload: dict[str, Any], logger: logging.Logger | No
|
||||
if not task_no:
|
||||
return False, 'missing_task_no'
|
||||
|
||||
result = _run_single_task(task_no)
|
||||
from app.services.shipping_notice.query_service import get_task_by_ref
|
||||
from app.services.shipping_notice.task_disposition_service import task_execution_block_reason
|
||||
|
||||
task = get_task_by_ref(task_no)
|
||||
disposition_reason = task_execution_block_reason(task) if task is not None else None
|
||||
# [STEP 1] 已领取的 Job 即使任务被删除,也必须走 finish_job 收口,不能提前 return 留在 running。
|
||||
if task is None:
|
||||
result = {'status': 'skipped', 'message': 'task not found'}
|
||||
elif disposition_reason:
|
||||
result = {'status': 'skipped', 'message': disposition_reason}
|
||||
else:
|
||||
result = _run_single_task(task_no)
|
||||
status = str(result.get('status') or '').strip().lower()
|
||||
success = status in {'ok', 'running', 'needs_human', 'skipped'}
|
||||
|
||||
|
||||
Reference in new issue
Block a user