feat(831-1): 단가산출 기초 목록 책 차례 = 건설품셈 → 산림품셈 → 자체
- 정본 = 장 파일 머리 「차례」(order_chapters) — 건설 공통·토목·건축·기계설비·유지관리 → 산림 → 자체 로 다시 매김(소요량 · 계수 · 로직 144 파일 머리 한 줄씩) - 「차례」 없는 파일(자체)은 맨 뒤 — chapter_order 한 곳 · M01 목록 · 로직 목록 · M02 기준 목록 셈 순서가 같이 따름 - 낡은 시험 test_m01_api 의 산림 먼저 단정 2 줄 고침 · 지킴 시험 test_843_book_order 추가 - 로직 내용 · 키 · 금액 그대로 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -115,6 +115,11 @@ def groups() -> list[dict]:
|
||||
return list(out.values())
|
||||
|
||||
|
||||
def chapter_order(data: dict) -> int:
|
||||
"""장 파일 머리 「차례」 — 없으면(자체 등) 맨 뒤."""
|
||||
return data.get("차례") or 9999
|
||||
|
||||
|
||||
def files_of(group: str) -> list[dict]:
|
||||
if group not in cm.mf.GROUPS:
|
||||
raise StoreError(404, f"없는 그룹 「{group}」")
|
||||
@@ -131,7 +136,7 @@ def files_of(group: str) -> list[dict]:
|
||||
"edition": data.get("판"),
|
||||
"rows": len(data.get(items_key(data)) or []),
|
||||
"version": version,
|
||||
"order": data.get("차례") or 0,
|
||||
"order": chapter_order(data),
|
||||
}
|
||||
)
|
||||
return sorted(out, key=lambda f: (f["order"], f["file"]))
|
||||
@@ -349,7 +354,7 @@ def logics(sub: str, detail: str, q: str, blocked: int | None, owner: str = "")
|
||||
files, _ = loaded()
|
||||
why_of = blocks()
|
||||
out = []
|
||||
for name, data in sorted(_logic_files(files), key=lambda f: f[1].get("차례") or 0):
|
||||
for name, data in sorted(_logic_files(files), key=lambda f: chapter_order(f[1])):
|
||||
for row in data.get("줄") or []:
|
||||
if (sub and row.get("구분") != sub) or (detail and row.get("상세구분") != detail):
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user