refactor(db)!: adopt project-routed pooled databases
Reorganize WNDB by responsibility and remove legacy scheme endpoints.\n\nRoute analysis and time-series access through project pools, preserve transactional realtime replacement, and refresh GIS materialized views after writes.\n\nAdd database architecture documentation, live pooling coverage, API contract updates, and executable container verification.\n\nBREAKING CHANGE: legacy scheme APIs and flat app.native.wndb module imports are removed.
This commit is contained in:
@@ -194,18 +194,18 @@ def get_leakage_identify_scheme_detail(
|
||||
|
||||
|
||||
def _get_pressure_sensor_nodes(network: str) -> list[str]:
|
||||
scada_info = get_all_scada_info(network)
|
||||
scada_devices = get_all_scada_info(network)
|
||||
sensor_nodes: list[str] = []
|
||||
for item in scada_info:
|
||||
scada_type = str(item.get("type", "")).lower()
|
||||
for item in scada_devices:
|
||||
scada_type = str(item.get("device_type", "")).lower()
|
||||
if scada_type != "pressure":
|
||||
continue
|
||||
node_id = item.get("associated_element_id")
|
||||
node_id = item.get("node_id")
|
||||
if isinstance(node_id, str) and node_id:
|
||||
sensor_nodes.append(node_id)
|
||||
sensor_nodes = list(dict.fromkeys(sensor_nodes))
|
||||
if not sensor_nodes:
|
||||
raise ValueError("未找到压力传感器对应节点(scada_info.type=pressure)。")
|
||||
raise ValueError("未找到关联节点的压力 SCADA 设备。")
|
||||
return sensor_nodes
|
||||
|
||||
|
||||
@@ -462,9 +462,9 @@ def _build_observed_pressure_from_scada(
|
||||
|
||||
node_query_id: dict[str, str] = {}
|
||||
for item in get_all_scada_info(network):
|
||||
if str(item.get("type", "")).lower() != "pressure":
|
||||
if str(item.get("device_type", "")).lower() != "pressure":
|
||||
continue
|
||||
node_id = item.get("associated_element_id")
|
||||
node_id = item.get("node_id")
|
||||
query_id = item.get("api_query_id")
|
||||
if (
|
||||
isinstance(node_id, str)
|
||||
|
||||
Reference in New Issue
Block a user