23 lines
1.1 KiB
Python
23 lines
1.1 KiB
Python
"""
|
|
backend/app/services/schedule/lean_training_job.py
|
|
|
|
用途:将精益培训逾期提醒接入平台排程契约。
|
|
依赖:ScheduleTask/ScheduleRun、lean_training_reminder_service。
|
|
逻辑:平台调度器调用本入口;本入口执行提醒扫描并返回标准七元组执行结果。
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
from app.models import ScheduleRun, ScheduleTask
|
|
from app.services.lean_training_reminder_service import run_lean_training_reminders
|
|
from app.services.schedule.job_registry import ScheduleExecuteResult
|
|
|
|
|
|
def run_lean_training_reminder_schedule(task: ScheduleTask, run: ScheduleRun) -> ScheduleExecuteResult:
|
|
"""执行精益培训提醒扫描并返回发送统计,供排程运行记录和运维页面展示。"""
|
|
_ = task, run
|
|
result = run_lean_training_reminders()
|
|
total = result["created"] + result["skipped"]
|
|
failed = result["failed"]
|
|
return total, result["sent"], failed, result["skipped"], [result], [], [{"step": "lean_training_reminder", "status": "success" if not failed else "partial", "detail": result}]
|