feat(b09): 운반 줄 단가연결 = 거리이정표 연결 · 연결 줄 모음 한 곳(ref_rows) (251-5)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LLCk2y5xE8YGVgjbTntWsY
This commit is contained in:
@@ -94,6 +94,21 @@ def _text(value: Any) -> str:
|
||||
return str(value)[:200] if isinstance(value, (str, int, float)) else ""
|
||||
|
||||
|
||||
def ref_rows(user: dict[str, Any] | None) -> list[dict[str, Any]]:
|
||||
"""연결 있는 줄 모음 — 설계내역서 덮개 줄 + 거리이정표 운반 연결
|
||||
(251-5 · `haul_refs{줄 키: ref}` · 서버 셈 때만 붙임) ·
|
||||
같은 줄 키에 사용자 연결 덮개가 있으면 그것만."""
|
||||
rows = [r for r in ((user or {}).get("bill") or {}).get("rows") or [] if isinstance(r, dict)]
|
||||
covered = {r.get("key") for r in rows if "ref" in r}
|
||||
haul = (user or {}).get("haul_refs") or {}
|
||||
extra = [
|
||||
{"key": key, "name": "", "ref": ref}
|
||||
for key, ref in haul.items()
|
||||
if key not in covered and isinstance(ref, dict)
|
||||
]
|
||||
return [*rows, *extra]
|
||||
|
||||
|
||||
def _clean_ref(ref: Any) -> dict[str, Any] | None:
|
||||
"""손 줄 연결 — dg · sg = 호표 키 · logic = M01 로직(입력값 · 켜쌓기율 · 고름) ·
|
||||
dg `lib` = 서고 사본 폴더(204-2 · [저장] 때 안 쓰는 사본 지움)."""
|
||||
|
||||
Reference in New Issue
Block a user