30 lines
923 B
Python
30 lines
923 B
Python
"""
|
|
scripts/rpa/dsv_driver.py
|
|
|
|
用途:DSV 360 库存 RPA 对外编排入口(session → 导航 → 导出)。
|
|
依赖:dsv_report_export。
|
|
逻辑:freight_rpa_worker 在 source_type=dsv360 时仅调用本模块公开函数。
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
from typing import Any
|
|
|
|
from dsv_report_export import (
|
|
ensure_dsv_session,
|
|
export_dsv_inventory_source,
|
|
prepare_dsv_batch_export_step,
|
|
)
|
|
|
|
|
|
def download_dsv360_inventory(page: Any, trigger: dict[str, Any], source: dict[str, Any]) -> Any:
|
|
"""
|
|
单票 trigger 的 DSV 360 导出。
|
|
核心逻辑:ensure session → 导航至参数页 → 填参并导出 Excel。
|
|
"""
|
|
entry_url = str(source.get("entry_url") or "").strip()
|
|
if not entry_url:
|
|
raise RuntimeError("DSV360 inventory source missing entry_url")
|
|
ensure_dsv_session(page, entry_url)
|
|
return export_dsv_inventory_source(page, trigger, source)
|