feat(freight-rpa): 增加出站报表配置与回调支持,重构相关服务
- 将 RPA 管理 API 扩展至出站报表配置,新增出站相关的回调接口。 - 重构 freight_rpa_report_config_service,支持入站与出站报表配置的管理。 - 更新 ORM 模型,增加出站报表相关的持久化模型。 - 统一命名规范,确保在手、入站与出站的概念一致性。
This commit is contained in:
1 parent
39fe3c05f2
commit
911afa0f73
152 files changed
+9861
-2984
No files matched your search
@@ -2,7 +2,8 @@
|
||||
backend/app/api/internal/jobs.py
|
||||
|
||||
用途:平台内置 Job 内部 API(POST /api/internal/jobs/<job_key>)。
|
||||
依赖:job_registry、schedule_contract、scheduler_service。
|
||||
依赖:job_registry、schedule_contract、scheduler_service、
|
||||
freight_rpa_onhand_finalize / inbound_finalize / outbound_finalize(awaiting 延后终态)。
|
||||
逻辑:标准化 job key → registry 查 handler → 解析 ScheduleRun → 返回统一结构。
|
||||
"""
|
||||
from __future__ import annotations
|
||||
@@ -25,9 +26,14 @@ from app.services.schedule.freight_rpa_onhand_finalize import (
|
||||
should_defer_schedule_run_finalization,
|
||||
)
|
||||
from app.services.schedule.freight_rpa_inbound_finalize import (
|
||||
apply_deferred_receipt_schedule_run_state,
|
||||
recover_stale_receipt_rpa_schedule_runs,
|
||||
should_defer_receipt_schedule_run,
|
||||
apply_deferred_inbound_schedule_run_state,
|
||||
recover_stale_inbound_rpa_schedule_runs,
|
||||
should_defer_inbound_schedule_run,
|
||||
)
|
||||
from app.services.schedule.freight_rpa_outbound_finalize import (
|
||||
apply_deferred_outbound_schedule_run_state,
|
||||
recover_stale_outbound_rpa_schedule_runs,
|
||||
should_defer_outbound_schedule_run,
|
||||
)
|
||||
|
||||
internal_jobs_bp = Blueprint('internal_jobs', __name__)
|
||||
@@ -139,7 +145,8 @@ def run_internal_job(name: str):
|
||||
|
||||
task, run = _resolve_schedule_task_and_run(key, data)
|
||||
recover_stale_awaiting_rpa_schedule_runs(task)
|
||||
recover_stale_receipt_rpa_schedule_runs(task)
|
||||
recover_stale_inbound_rpa_schedule_runs(task)
|
||||
recover_stale_outbound_rpa_schedule_runs(task)
|
||||
try:
|
||||
total_count, success_count, failed_count, skipped_count, details, errors, step_logs = run_platform_job(
|
||||
key, task, run, data,
|
||||
@@ -189,8 +196,8 @@ def run_internal_job(name: str):
|
||||
'awaiting_rpa_callback': True,
|
||||
})
|
||||
|
||||
if should_defer_receipt_schedule_run(task, step_logs):
|
||||
apply_deferred_receipt_schedule_run_state(
|
||||
if should_defer_inbound_schedule_run(task, step_logs):
|
||||
apply_deferred_inbound_schedule_run_state(
|
||||
run, task, total_count=total_count, details=details, errors=errors, step_logs=step_logs,
|
||||
)
|
||||
return jsonify({
|
||||
@@ -199,7 +206,20 @@ def run_internal_job(name: str):
|
||||
'failed_count': failed_count, 'skipped_count': skipped_count,
|
||||
},
|
||||
'details': details, 'errors': errors, 'step_logs': step_logs,
|
||||
'awaiting_receipt_rpa_callback': True,
|
||||
'awaiting_inbound_rpa_callback': True,
|
||||
})
|
||||
|
||||
if should_defer_outbound_schedule_run(task, step_logs):
|
||||
apply_deferred_outbound_schedule_run_state(
|
||||
run, task, total_count=total_count, details=details, errors=errors, step_logs=step_logs,
|
||||
)
|
||||
return jsonify({
|
||||
'summary': {
|
||||
'total_count': total_count, 'success_count': success_count,
|
||||
'failed_count': failed_count, 'skipped_count': skipped_count,
|
||||
},
|
||||
'details': details, 'errors': errors, 'step_logs': step_logs,
|
||||
'awaiting_outbound_rpa_callback': True,
|
||||
})
|
||||
|
||||
_finalize_run(
|
||||
|
||||
Reference in new issue
Block a user