From 5f3c55f32b825641700f7467ee86af9f799052e9 Mon Sep 17 00:00:00 2001 From: umsangdon Date: Mon, 14 Sep 2026 13:37:15 +0900 Subject: [PATCH] =?UTF-8?q?fix(b08):=20=5Fcollect=5Fstructures=20=EA=B0=80?= =?UTF-8?q?=20=ED=9A=A1=EB=8B=A8=20=EC=84=A4=EA=B3=84=EB=A5=BC=20=EB=B0=9B?= =?UTF-8?q?=EC=95=84=20=EB=8B=A4=EB=8B=A8=20=EB=B2=BD=20=EB=AA=A9=EB=A1=9D?= =?UTF-8?q?=EC=9D=84=20=EB=84=98=EA=B9=80=20=E2=80=94=20=EC=9D=B8=EC=9E=90?= =?UTF-8?q?=20=ED=95=98=EB=82=98=20+=20=ED=98=B8=EC=B6=9C=EB=B6=80=20?= =?UTF-8?q?=EC=A0=84=EB=8B=AC=EB=A7=8C(=E2=91=A3=20=C2=B7=20=EB=A9=94?= =?UTF-8?q?=EC=9D=B8=20=ED=8C=8C=EC=9D=BC=20=EC=86=90=EC=A7=88=20=EB=94=B0?= =?UTF-8?q?=EB=A1=9C=20=EB=97=8C)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_016VBGFXB9AbJBwXP19z75Qq --- B08_Quantity/B08_Quantity_Router_Material.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) 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(