feat(schedule): 增加库存源选项描述字段与站点ID支持
This commit is contained in:
1 parent
f4e74f7b07
commit
8b1efbedb9
37 files changed
+8488
-4126
No files matched your search
@@ -52,11 +52,11 @@ def _build_source_from_config(source_code: str) -> dict:
|
||||
|
||||
navigation = dict(raw.get("navigation") or {})
|
||||
parameters = [dict(item) for item in (raw.get("parameters") or []) if isinstance(item, dict)]
|
||||
site = str(raw.get("site") or "dsv360").strip().lower()
|
||||
warehouse_id = str(raw.get("warehouse_id") or raw.get("warehouse_code") or "").strip()
|
||||
source_type = str(raw.get("source_type") or "dsv360").strip().lower()
|
||||
warehouse_id = str(raw.get("warehouse_id") or "").strip()
|
||||
|
||||
query: dict[str, object] = {}
|
||||
if site == "dsv360":
|
||||
if source_type == "dsv360":
|
||||
for key in ("program_group", "program_label", "report_group", "report_name"):
|
||||
if navigation.get(key):
|
||||
query[key] = navigation[key]
|
||||
@@ -88,12 +88,12 @@ def _build_source_from_config(source_code: str) -> dict:
|
||||
|
||||
return {
|
||||
"source_code": str(raw.get("source_code") or source_code).upper(),
|
||||
"source_type": "dsv360" if site == "dsv360" else site,
|
||||
"source_type": source_type,
|
||||
"site_id": str(raw.get("site_id") or "").strip().upper(),
|
||||
"display_name": str(raw.get("display_name") or source_code),
|
||||
"enabled": bool(raw.get("enabled", True)),
|
||||
"entry_url": str(raw.get("entry_url") or "https://s360.dbschenker.com/"),
|
||||
"warehouse_id": warehouse_id,
|
||||
"warehouse_code": str(raw.get("warehouse_code") or warehouse_id),
|
||||
"navigation": navigation,
|
||||
"parameters": parameters,
|
||||
"query": query,
|
||||
|
||||
Reference in new issue
Block a user