feat(rpa): 收料配置与库存同构并统一站点启停
- 删除收料配置 enabled 与 warehouse_ids_json 列(迁移 rc1a2b3c4d5e、rc2b3c4d5e6f,含存量清单转 Warehouse 条件的数据保全) - Warehouse 改为查询条件(多值即逐仓拆分维度),排程/按需触发运行时派生仓库清单并在单元快照剥离该条件 - 站点开关即总开关:四处收料门禁只看站点 enabled;校验要求 DBS 恰一条非空 Warehouse 条件,日期禁填不变 - 站点抽屉改纵向折叠卡片与统一「保存更改」,就绪卡压缩为单行状态条并下移 - technical.md 同步设计边界与接口契约
This commit is contained in:
1 parent
eed1068ae3
commit
2199370065
18 files changed
+412
-223
No files matched your search
@@ -18,6 +18,35 @@ def receipt_trigger_dir() -> Path | None:
|
||||
return Path(value) if value else None
|
||||
|
||||
|
||||
def receipt_warehouse_values(config: Any) -> list[str]:
|
||||
"""从收料配置的查询条件中提取 Warehouse 条件值(去空去重,保持顺序)。
|
||||
|
||||
Warehouse 条件即逐仓拆分维度(与库存配置同构,不单独持久化仓库清单);
|
||||
排程/触发按返回值逐仓展开执行单元。DBS 配置由校验保证恰一条非空条件。
|
||||
"""
|
||||
values: list[str] = []
|
||||
for item in (config.query_parameters_json or []):
|
||||
if not isinstance(item, dict) or str(item.get('name') or '').strip().lower() != 'warehouse':
|
||||
continue
|
||||
for raw in (item.get('values') or []):
|
||||
cleaned = str(raw or '').strip()
|
||||
if cleaned and cleaned not in values:
|
||||
values.append(cleaned)
|
||||
return values
|
||||
|
||||
|
||||
def receipt_unit_parameters(config: Any) -> list[dict[str, Any]]:
|
||||
"""构建单个执行单元的受控条件:剥离 Warehouse 条件。
|
||||
|
||||
Worker 会按单元的 warehouse_id 自动追加单值 Warehouse 条件,
|
||||
快照里保留用户维护的 Warehouse 条件会与之重复冲突。
|
||||
"""
|
||||
return [
|
||||
dict(item) for item in (config.query_parameters_json or [])
|
||||
if not (isinstance(item, dict) and str(item.get('name') or '').strip().lower() == 'warehouse')
|
||||
]
|
||||
|
||||
|
||||
def write_receipt_export_batch_trigger(run_no: str, units: list[dict[str, Any]], payload: dict[str, Any] | None = None) -> str | None:
|
||||
"""写入收料批量 trigger;worker 仅允许消费 shipping_receipt_rpa.v1。"""
|
||||
trigger_dir = receipt_trigger_dir()
|
||||
|
||||
Reference in new issue
Block a user