diff --git a/B08_Quantity/B08_Quantity_Router_Material.py b/B08_Quantity/B08_Quantity_Router_Material.py index 09edd1f7..09fbb35e 100644 --- a/B08_Quantity/B08_Quantity_Router_Material.py +++ b/B08_Quantity/B08_Quantity_Router_Material.py @@ -57,6 +57,7 @@ router = APIRouter(prefix="/api/projects", tags=["B08 Quantity"]) def _collect_structures( project_root: str, + designs: list[dict[str, Any]] | None = None, ) -> tuple[list[dict[str, Any]], dict[str, str], list[str]]: """전개 대상 구조물·타입명·건너뛴 사유를 함께 낸다. @@ -66,7 +67,7 @@ def _collect_structures( ⚠ 관 지점 종류(`managed_by`)가 `structures.json` 에 옛 저장분으로 남아 있어도 안 셈 — 관 지점 정본이 주인이라 두 번 세지 않음(구조물 집계표와 같은 규칙). """ - from B08_Quantity.B08_Quantity_Engine_Pipe import facility_structures + from B08_Quantity.B08_Quantity_Engine_Pipe import extra_walls_from_designs, facility_structures from common_util.common_util_drainage_pipes import pipe_points_path_in, read_pipe_points_file _revision, items = load_structures(project_root) @@ -102,7 +103,9 @@ def _collect_structures( continue targets.append(payload) points = read_pipe_points_file(pipe_points_path_in(Path(project_root))) - for row in facility_structures([point.as_dict() for point in points]): + # 다단 추가 기슭막이(④) — 횡단 설계에 남은 「선 다단 벽 목록」도 줄로 세움. + extra_walls = extra_walls_from_designs(designs) + for row in facility_structures([point.as_dict() for point in points], extra_walls): for type_id in (row["type_id"], row.get("attachment_parent_type")): if type_id in types: names[type_id] = types[type_id].name @@ -190,7 +193,7 @@ async def get_material_summary(project_id: UUID) -> JSONResponse: ) try: - structures, names, skipped = _collect_structures(project_root) + structures, names, skipped = _collect_structures(project_root, await _designs(project_id)) except Exception: logger.exception("B08 구조물 정본 읽기 실패: project_id=%s", project_id) return JSONResponse( @@ -405,7 +408,7 @@ async def project_haul_inputs(project_id: UUID) -> dict[str, Any]: try: stored_path = await run_with_connection(get_project_storage_relative_path, project_id) project_root = resolve_stored_project_path(stored_path) - structures, names, _skipped = _collect_structures(project_root) + structures, names, _skipped = _collect_structures(project_root, await _designs(project_id)) settings = quantity_settings(project_root) unit_table = build_unit_table( structures, @@ -448,7 +451,7 @@ async def get_handoff(project_id: UUID) -> JSONResponse: content={"status": "error", "message": "프로젝트 저장 폴더를 찾지 못했습니다."}, ) - structures, names, skipped = _collect_structures(project_root) + structures, names, skipped = _collect_structures(project_root, await _designs(project_id)) settings = quantity_settings(project_root) modes = await _section_modes(project_id) unit_table = build_unit_table( @@ -539,7 +542,7 @@ async def structure_bill_prices(project_id: UUID, build: Any) -> dict[str, dict[ stored_path = await run_with_connection(get_project_storage_relative_path, project_id) project_root = resolve_stored_project_path(stored_path) - structures, names, _skipped = _collect_structures(project_root) + structures, names, _skipped = _collect_structures(project_root, await _designs(project_id)) settings = quantity_settings(project_root) modes = await _section_modes(project_id) unit_table = build_unit_table(