feat(in-transit-transfer): 打通ERP 写路径按票执行与已执行调拨单卡片入口
- 新增 TransferDocument 按票执行模型与单据号序列生成(document_id 独立模块,迁移 tt0d/tt8b) - 发票行新增单位字段、matching_id 放宽可空,支持行与票两级执行口径(迁移 tt9c/tt1a) - capability_client 新增 create_transfer 写契约与六态结果裁决,执行链补写前复查门禁 - 抽取/匹配/执行 Job 按 run/item/match 拆分并入 jobs store 队列,transfer 队列单实例 worker 配套本地启动脚本 - 首页新增「已执行调拨单」四统计卡入口与明细列表子视图,重查/重试/关闭/重新触发与筛选分页齐全 - 行评估新鲜度 TTL 从 10 分钟放宽为当日有效(86400s),跨日由文件版本对账门禁兜底 - 同步 chat/errors 文案四语言、测试全家与两份实施计划文档
This commit is contained in:
1 parent
e750fa8602
commit
9f2b023a10
101 files changed
+11109
-2112
No files matched your search
+24
-2
@@ -4,6 +4,7 @@ scripts/start_local.ps1
|
||||
依赖:backend venv、frontend npm、.env.shared / .env.dev(worker 与 RPA 读取)。
|
||||
逻辑:先停止本仓库遗留的 backend/worker/frontend 进程并释放 5052/8881 端口 → 执行 DB 迁移(flask db upgrade)→ 再分别在新 PowerShell 窗口启动各服务。
|
||||
Worker 使用 backend/ 根目录的并发入口(worker_kb.py / worker_shipping.py),内部通过 multiprocessing 自分叉子进程池;并发数由 -KbConcurrency / -ShippingConcurrency 透传到环境变量。
|
||||
调拨 transfer 队列使用 backend/workers/worker_in_transit_transfer.py 单实例入口(与 Compose hxops-transfer-worker 对齐)。
|
||||
#>
|
||||
param(
|
||||
[ValidateSet("sqlite", "postgres")]
|
||||
@@ -72,6 +73,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 $BackendPath "workers\worker_in_transit_transfer.py")),
|
||||
[regex]::Escape((Join-Path $RepoRoot "scripts\freight_rpa\inventory\inventory_rpa_worker.py"))
|
||||
)
|
||||
# 说明:上面同时包含 backend/ 根目录的旧部署入口与 workers/ 目录的新单实例入口。
|
||||
@@ -417,6 +419,25 @@ function Start-ShippingWorkerWindow {
|
||||
-Command ".\.venv\Scripts\python.exe .\worker_shipping.py"
|
||||
}
|
||||
|
||||
function Start-TransferWorkerWindow {
|
||||
param(
|
||||
[string]$BackendPath,
|
||||
[string]$Mode,
|
||||
[string]$DbUrl
|
||||
)
|
||||
|
||||
# transfer 队列(在途调拨预检/Run/Item)无根目录并发封装,直接用 workers/ 单实例薄入口;
|
||||
# ENV_NAME='dev' 与 kb/shipping worker 对齐,保证本地读取 development 配置(含 sqlite 默认库)。
|
||||
$envPrefix = Get-DatabaseUrlExport -Mode $Mode -DbUrl $DbUrl
|
||||
$envPrefix += " `$env:ENV_NAME='dev';"
|
||||
|
||||
Start-WorkerWindow `
|
||||
-Title "transfer-worker" `
|
||||
-WorkingDirectory $BackendPath `
|
||||
-EnvPrefix $envPrefix `
|
||||
-Command ".\.venv\Scripts\python.exe .\workers\worker_in_transit_transfer.py"
|
||||
}
|
||||
|
||||
function Start-ScheduleWorkerWindow {
|
||||
param(
|
||||
[string]$BackendPath,
|
||||
@@ -522,8 +543,9 @@ Start-BackendWindow -BackendPath $backendDir -Mode $DbMode -DbUrl $effectiveDbUr
|
||||
if (-not $SkipWorker.IsPresent) {
|
||||
Start-KbWorkerWindow -BackendPath $backendDir -Mode $DbMode -DbUrl $DatabaseUrl
|
||||
Start-ShippingWorkerWindow -BackendPath $backendDir -Mode $DbMode -DbUrl $DatabaseUrl
|
||||
Start-TransferWorkerWindow -BackendPath $backendDir -Mode $DbMode -DbUrl $DatabaseUrl
|
||||
Start-ScheduleWorkerWindow -BackendPath $backendDir -Mode $DbMode -DbUrl $DatabaseUrl
|
||||
$windowCount += 3
|
||||
$windowCount += 4
|
||||
if (-not $SkipRpaWorker.IsPresent) {
|
||||
Start-FreightRpaWorkerWindow -RepoRoot $repoRoot -BackendPath $backendDir -EnvFiles $envFiles
|
||||
$windowCount += 1
|
||||
@@ -535,7 +557,7 @@ $windowCount += 1
|
||||
Write-Host ""
|
||||
Write-Host "Started in $windowCount new PowerShell windows." -ForegroundColor Green
|
||||
if (-not $SkipWorker.IsPresent) {
|
||||
Write-Host "Workers: kb-worker, shipping-worker, schedule-worker$(if (-not $SkipRpaWorker.IsPresent) { ', freight-rpa-worker (mock)' })" -ForegroundColor Green
|
||||
Write-Host "Workers: kb-worker, shipping-worker, transfer-worker, schedule-worker$(if (-not $SkipRpaWorker.IsPresent) { ', freight-rpa-worker (mock)' })" -ForegroundColor Green
|
||||
}
|
||||
Write-Host "Frontend URL: http://127.0.0.1:8881" -ForegroundColor Green
|
||||
Write-Host "Backend URL: http://127.0.0.1:5052" -ForegroundColor Green
|
||||
|
||||
Reference in new issue
Block a user