Merge remote-tracking branch 'origin/main_desktop_1' into sub_laptop_1
This commit is contained in:
@@ -906,6 +906,25 @@ def verify_no_mix_components(quantities: Iterable[StructureQuantity]) -> list[st
|
|||||||
return found
|
return found
|
||||||
|
|
||||||
|
|
||||||
|
def section_modes_from_designs(designs: Iterable[dict[str, Any]]) -> dict[float, str]:
|
||||||
|
"""저장된 횡단 설계 목록 → `{측점: 단면유형}`.
|
||||||
|
|
||||||
|
⚠ **부르는 쪽마다 다시 짜지 말라고 여기 둔다.** 구조물 전개(B08)와 표준도(B07)가
|
||||||
|
같은 표를 써야 기울기 판정이 두 곳에서 갈리지 않는다.
|
||||||
|
`design.section_mode` 가 없는 측점은 담지 않는다 — 빈 값을 담으면 「가를 근거 없음」과
|
||||||
|
「모드가 빈 문자열」이 뒤섞인다.
|
||||||
|
"""
|
||||||
|
modes: dict[float, str] = {}
|
||||||
|
for item in designs or ():
|
||||||
|
design = item.get("design") if isinstance(item, dict) else None
|
||||||
|
mode = str((design or {}).get("section_mode") or "").strip()
|
||||||
|
if not mode:
|
||||||
|
continue
|
||||||
|
chainage = _num(item.get("chainage_m"))
|
||||||
|
modes[float(chainage)] = mode
|
||||||
|
return modes
|
||||||
|
|
||||||
|
|
||||||
def _section_mode_at(
|
def _section_mode_at(
|
||||||
structure: dict[str, Any], section_modes: dict[float, str] | None
|
structure: dict[str, Any], section_modes: dict[float, str] | None
|
||||||
) -> str | None:
|
) -> str | None:
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ from B05_Profile.B05_Profile_Structures_Schema import structure_type_map
|
|||||||
from B08_Quantity.B08_Quantity_Engine_Handoff import build_handoff, load_mapping, summarize
|
from B08_Quantity.B08_Quantity_Engine_Handoff import build_handoff, load_mapping, summarize
|
||||||
from B08_Quantity.B08_Quantity_Engine_MaterialSummary import build_table as build_material_table
|
from B08_Quantity.B08_Quantity_Engine_MaterialSummary import build_table as build_material_table
|
||||||
from B08_Quantity.B08_Quantity_Engine_UnitQuantity import build_table as build_unit_table
|
from B08_Quantity.B08_Quantity_Engine_UnitQuantity import build_table as build_unit_table
|
||||||
|
from B08_Quantity.B08_Quantity_Engine_UnitQuantity import section_modes_from_designs
|
||||||
from common_util.common_util_project_settings import (
|
from common_util.common_util_project_settings import (
|
||||||
concrete_placing_method,
|
concrete_placing_method,
|
||||||
quantity_settings,
|
quantity_settings,
|
||||||
@@ -95,11 +96,7 @@ async def _section_modes(project_id: UUID) -> dict[float, str]:
|
|||||||
except Exception:
|
except Exception:
|
||||||
logger.exception("B08 단면유형 조회 실패: project_id=%s", project_id)
|
logger.exception("B08 단면유형 조회 실패: project_id=%s", project_id)
|
||||||
return {}
|
return {}
|
||||||
return {
|
return section_modes_from_designs(designs)
|
||||||
float(item["chainage_m"]): str((item.get("design") or {}).get("section_mode") or "")
|
|
||||||
for item in designs
|
|
||||||
if (item.get("design") or {}).get("section_mode")
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@router.get("/{project_id}/quantity/material-summary")
|
@router.get("/{project_id}/quantity/material-summary")
|
||||||
|
|||||||
Reference in New Issue
Block a user