feat(invoice-check): ww OA下载销货放行单
This commit is contained in:
1 parent
f25f59142a
commit
d13f1035cc
40 files changed
+2284
-103
No files matched your search
@@ -2,7 +2,7 @@
|
||||
backend/app/services/schedule/job_registry.py
|
||||
|
||||
用途:平台内置排程 Job Registry(任务契约中心:key → handler + 展示信息 + params_schema + defaults)。
|
||||
依赖:shipping_inventory_rpa_job、faq_hot_aggregate_job、fixed_assets_snapshot_job、voucher_check_job、voucher_po_print_job、job_params。
|
||||
依赖:shipping_inventory_rpa_job、faq_hot_aggregate_job、fixed_assets_snapshot_job、voucher_check_job、voucher_po_print_job、voucher_oa_sales_release_job、job_params。
|
||||
逻辑:internal_jobs API 与 platform_job 排程通过 platform_api_path 引用已注册 key;
|
||||
api/schedule/platform_tasks.py 下发 params_schema 供前端 DynamicTaskParamsForm 通用渲染。
|
||||
"""
|
||||
@@ -140,12 +140,17 @@ def _register_builtin_platform_jobs() -> None:
|
||||
run_shipping_post_ot_auto_fulfill_compensation_schedule,
|
||||
)
|
||||
from app.services.schedule.voucher_check_job import run_voucher_check_schedule
|
||||
from app.services.schedule.voucher_oa_sales_release_job import run_voucher_oa_sales_release_schedule
|
||||
from app.services.schedule.voucher_po_print_job import run_voucher_po_print_schedule
|
||||
from app.services.schedule.contract_payment_job import (
|
||||
run_contract_payment_alert_schedule,
|
||||
run_contract_payment_sync_schedule,
|
||||
)
|
||||
from app.services.voucher_check.config import DEFAULT_JOB_PARAMS, DEFAULT_PO_PRINT_JOB_PARAMS
|
||||
from app.services.voucher_check.config import (
|
||||
DEFAULT_JOB_PARAMS,
|
||||
DEFAULT_OA_SALES_RELEASE_JOB_PARAMS,
|
||||
DEFAULT_PO_PRINT_JOB_PARAMS,
|
||||
)
|
||||
from app.services.schedule.contract_payment_job import (
|
||||
run_contract_payment_alert_schedule,
|
||||
run_contract_payment_sync_schedule,
|
||||
@@ -430,6 +435,43 @@ def _register_builtin_platform_jobs() -> None:
|
||||
),
|
||||
defaults=dict(DEFAULT_PO_PRINT_JOB_PARAMS),
|
||||
))
|
||||
register_platform_job(PlatformJobDefinition(
|
||||
key="accounting-voucher-oa-sales-release",
|
||||
label="立账凭证销货放行单拉取",
|
||||
label_key="admin.schedule.form.platformJobAccountingVoucherOaSalesRelease",
|
||||
handler=run_voucher_oa_sales_release_schedule,
|
||||
description="每周二 05:30 从 E10 筛上月已归档销货放行单,下载表单 PDF 并上传到「销货单」;早于 06:00 检核周批。",
|
||||
description_key="admin.schedule.form.accountingVoucherOaSalesReleaseHint",
|
||||
category="finance",
|
||||
params_schema=(
|
||||
{
|
||||
"key": "scope_code",
|
||||
"type": "select",
|
||||
"label": "账套",
|
||||
"label_key": "admin.schedule.form.voucherCheckScope",
|
||||
"required": True,
|
||||
"default": "HXJM",
|
||||
"options": [{"value": "HXJM", "label": "HXJM"}],
|
||||
},
|
||||
{
|
||||
"key": "profile_code",
|
||||
"type": "text",
|
||||
"label": "业务方 Profile",
|
||||
"label_key": "admin.schedule.form.voucherCheckProfile",
|
||||
"required": True,
|
||||
"default": "sales",
|
||||
},
|
||||
{
|
||||
"key": "notify_failure_enabled",
|
||||
"type": "boolean",
|
||||
"label": "失败告警",
|
||||
"label_key": "admin.schedule.form.voucherCheckNotifyFailure",
|
||||
"required": False,
|
||||
"default": True,
|
||||
},
|
||||
),
|
||||
defaults=dict(DEFAULT_OA_SALES_RELEASE_JOB_PARAMS),
|
||||
))
|
||||
register_platform_job(PlatformJobDefinition(
|
||||
key="in-transit-receipt-file",
|
||||
label="在途收料文件抓取",
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
"""
|
||||
backend/app/services/schedule/voucher_oa_sales_release_job.py
|
||||
|
||||
用途:立账凭证销货放行单拉取 platform_job 薄封装。
|
||||
依赖:voucher_check.oa_sales_release_runner。
|
||||
逻辑:job_registry 注册 accounting-voucher-oa-sales-release 后由 schedule worker 调用;早于检核周批。
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from app.models import ScheduleRun, ScheduleTask
|
||||
from app.services.voucher_check.oa_sales_release_runner import (
|
||||
ScheduleExecuteResult,
|
||||
run_oa_sales_release_batch,
|
||||
)
|
||||
|
||||
|
||||
def run_voucher_oa_sales_release_schedule(task: ScheduleTask, run: ScheduleRun) -> ScheduleExecuteResult:
|
||||
"""
|
||||
执行立账凭证销货放行单拉取排程。
|
||||
核心逻辑:委托 oa_sales_release_runner;默认周二 05:30,检核周批 06:00 只扫目录。
|
||||
"""
|
||||
return run_oa_sales_release_batch(task, run)
|
||||
Reference in new issue
Block a user