refactor(rpa): 重构 scripts/rpa 目录结构与命名

按 common/connectors/inventory/receipt 分层并重命名

- common/: rpa_common, rpa_heartbeat, download_artifact_fallback,
  new_rpa_worker_secret
- connectors/dsv|crane/: 登录网站连接器,库存与收料共用
- inventory/: inventory_rpa_worker, run_inventory_batch_trigger,
  start_inventory_worker, register_inventory_worker_tasks
- receipt/: receipt_rpa_worker, receipt_crane/dbs_export,
  start_receipt_worker

保留裸 import + sys.path 引导;修正懒加载路径;
按范围命名 register_rpa_background_tasks -> register_inventory_worker_tasks;
同步 backend 测试、start_local.ps1、.env 注释、docs 与 README 路径。

(cherry picked from commit f3050164d0)
This commit is contained in:
hugo committed 2026-08-28 17:23:39 +08:00
1 parent 09deada712
commit 12521489c6
40 files changed
+384 -172

No files matched your search

+2 -2
View File
@@ -72,7 +72,7 @@ function Stop-StaleHxopsPythonProcesses {
[regex]::Escape((Join-Path $BackendPath "workers\worker_kb.py")),
[regex]::Escape((Join-Path $BackendPath "workers\worker_shipping_notice.py")),
[regex]::Escape((Join-Path $BackendPath "workers\worker_scheduler.py")),
[regex]::Escape((Join-Path $RepoRoot "scripts\rpa\freight_rpa_worker.py"))
[regex]::Escape((Join-Path $RepoRoot "scripts\rpa\inventory\inventory_rpa_worker.py"))
)
# 说明:上面同时包含 backend/ 根目录的旧部署入口与 workers/ 目录的新单实例入口。
# 两套在仓库中并存(旧路径用于生产多进程部署,新路径推荐用于本地 IDE 单实例调试)。
@@ -445,7 +445,7 @@ function Start-FreightRpaWorkerWindow {
-Title "freight-rpa-worker" `
-WorkingDirectory $RepoRoot `
-EnvPrefix $envPrefix `
-Command "& '$BackendPath\.venv\Scripts\python.exe' .\scripts\rpa\freight_rpa_worker.py"
-Command "& '$BackendPath\.venv\Scripts\python.exe' .\scripts\rpa\inventory\inventory_rpa_worker.py"
}
function Start-FrontendWindow {