feat(shipping-notice): 新增库存快照管理与RPA批量导出功能

This commit is contained in:
hugo committed 2026-07-08 08:59:08 +08:00
1 parent fc694a8f43
commit d54f51ddc3
48 files changed
+4970 -543

No files matched your search

+18 -1
View File
@@ -6,7 +6,7 @@ Hxops 与货代系统之间通过 **目录 + JSON 触发文件** 解耦,RPA
| 环境变量 | 用途 |
|---------|------|
| `FREIGHT_RPA_INVENTORY_TRIGGER_DIR` | hxops 写入 `inventory_export_{task_no}.json`,RPA 读取后导库存 |
| `FREIGHT_RPA_INVENTORY_TRIGGER_DIR` | hxops 写入 `inventory_export_{task_no}.json` 或 `inventory_export_batch_{run_no}.json`,RPA 读取后导库存 |
| `FREIGHT_INVENTORY_DROP_DIR` | RPA 落盘库存 Excel(`.xlsx`),hxops / worker 回调 ingest |
| `FREIGHT_RPA_UPLOAD_TRIGGER_DIR` | hxops 写入 `upload_{task_no}.json` |
| `FREIGHT_UPLOAD_QUEUE_DIR` | hxops 复制待上传发货 Excel |
@@ -77,6 +77,23 @@ python scripts/rpa/freight_rpa_worker.py
| `dsv360` | 打开 DSV 360,进入 Reports / Program / Inventory 报表并下载 |
| `crane_footprint` | 打开 Crane FootPrint On Hand Details Query,选择 Owner/Project/Warehouse 后下载 |
### 批量库存导出(`inventory_export_batch`)
定时排程或后台预热会写入 `inventory_export_batch_{run_no}.json`,字段示例:
```json
{
"action": "inventory_export_batch",
"run_no": "RUN20260707030000",
"trigger_type": "scheduled",
"inventory_sources": [{ "source_code": "DSV360_AWSDU", "source_type": "dsv360", "warehouse_id": "AWSDU" }]
}
```
Worker 按 `source_type` 分组:**DSV 一次登录**循环各 Warehouse,**Crane 一次登录**循环各 Warehouse;完成后回调 `POST /api/shipping-notice/rpa/inventory-batch-ready`。
库存源定义见 `backend/config/shipping_inventory_sources.json`(新增 Warehouse 只改 JSON)。
页面控件如果默认可见文本无法稳定点击,可通过环境变量覆盖 selector:
| 环境变量 | 用途 |