From f6d7fd14f1a6391303ec7e1bb6e9adfea5cacb3c Mon Sep 17 00:00:00 2001 From: umsangdon Date: Tue, 17 Nov 2026 17:22:41 +0900 Subject: [PATCH 01/30] =?UTF-8?q?test(855-F):=20B9-0=20B08=20=C2=B7=20B09?= =?UTF-8?q?=20=EB=8B=B5=20=EC=A7=80=EB=AC=B8=20=E2=80=94=20=EC=9E=84?= =?UTF-8?q?=EC=8B=9C=20=EC=B8=B5=20=EA=B2=AC=EB=B3=B8=20=C2=B7=20=EC=82=AC?= =?UTF-8?q?=EB=B3=B8=20=EC=A7=80=EA=B8=88=20=EA=B8=B8=20=C2=B7=20=EC=86=90?= =?UTF-8?q?=20=EC=A4=84=20=C2=B7=20=EB=8B=A4=EB=A5=B4=EB=A9=B4=20=EC=8B=A4?= =?UTF-8?q?=ED=8C=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - test_855_b09_golden + golden_855_b09.json: 개인 층 견본(SK 바탕 · 율 더한줄 · 형제 · 따로 · 가져온 식 · 기계 · 재료 / SC 참조 · 고정 · 로직 + 자재) → 구조물 사본(labor_doc_rows · price_bundle) · B09 서고 사본(import_copy) · 설계내역서 손 줄(율 · 고른 재료 · 입력 · 운반공 거리 채움) - 지문 갈래 15: calc_user · daega_inputs · 단가 수요 키 · 산근(관급 있음 · 없음 · 값 / 글 따로) · logic_preview 손 줄마다(값 / 글) · B08 snapshot_units - 다르면 실패 + 다시 뜨기(--write) 글 · 세 번 돌려 같음 · 제품 코드 고침 0 Co-Authored-By: Claude Opus 5.5 --- resources/tester/golden_855_b09.json | 20 ++ resources/tester/test_855_b09_golden.py | 264 ++++++++++++++++++++++++ 2 files changed, 284 insertions(+) create mode 100644 resources/tester/golden_855_b09.json create mode 100644 resources/tester/test_855_b09_golden.py diff --git a/resources/tester/golden_855_b09.json b/resources/tester/golden_855_b09.json new file mode 100644 index 000000000..b811ea2e8 --- /dev/null +++ b/resources/tester/golden_855_b09.json @@ -0,0 +1,20 @@ +{ + "판": 1, + "지문": { + "키": "e68369418202e5ee", + "calc_user": "6d74551273d6735f", + "daega_inputs": "0ef81c80bc45ae0b", + "수요": "f793204cf95c45c4", + "산근 값": "c486d041a3246ffb", + "산근 글": "a21b34ec13661f0c", + "산근 관급 값": "c5c3daf85d9bd01b", + "산근 관급 글": "a65b945fc8582ca3", + "미리보기 hand:rate 값": "091690571b7dc54b", + "미리보기 hand:rate 글": "c49b1bc692d59fe5", + "미리보기 hand:pick 값": "6c7f426d37e31998", + "미리보기 hand:pick 글": "96a9de9a02e3d124", + "미리보기 hand:net 값": "b1c2c650567a14ae", + "미리보기 hand:net 글": "be7884bdbeb29ed3", + "B08 단위수량": "896710398b04b4fd" + } +} diff --git a/resources/tester/test_855_b09_golden.py b/resources/tester/test_855_b09_golden.py new file mode 100644 index 000000000..2d1daf1b3 --- /dev/null +++ b/resources/tester/test_855_b09_golden.py @@ -0,0 +1,264 @@ +# ruff: noqa: F811, E402 — 임시 층 fixture(world)를 test_m02_labor_ref 에서 받아 씀 · `--write` 때 길을 먼저 둠 +"""855-F B9-0 — B08 · B09 답 지문(옛 엔진 부름을 걷는 걸음 B9-1 ~ B9-6 의 「다름 0」 자). + +임시 storage(개인 층 7/42) · 견본을 시험이 지음 → 사본 만들기(지금 길) → 답 지문: +- 층 견본 — 단가산출(SK): 바탕 로직 · 율 더한줄 · 형제(바탕 참조) · 「따로」 · 가져온 식 · 기계 · 재료 / + 일위대가(SC): SK 참조 · 고정 · 로직 줄 + 자재 +- 구조물 사본 = 일위대가 열 문서(위 참조 + 로직 · 고른 재료 · 자재) → `labor_doc_rows` · `price_bundle` + · B09 서고 사본 = `Bill_Library.import_copy`(SK 따로 · SK 가져온 식 · SC) +- 손 줄 = 설계내역서 로직 줄(율 · 고른 재료 · 입력) + 운반공(거리 채움) +- 답 = B09 `calc_user` · `daega_inputs` · 단가 수요 키(`_demand`) · 산근(`Sangeun.build` · 관급 있음 · 없음) + · `logic_preview`(손 줄마다) · B08 `snapshot_units` — 갈래마다 지문(값 · 글 따로). + +지문 = `golden_855_b09.json` · 다르면 실패 — 뜻대로 금액 · 글을 바꾼 걸음만 다시 뜸: +`./venv/Scripts/python.exe resources/tester/test_855_b09_golden.py --write`(바뀐 갈래를 커밋 글에). +""" + +from __future__ import annotations + +import asyncio +import copy +import hashlib +import json +import os +import re +import sys +from pathlib import Path + +import pytest + +ROOT = Path(__file__).resolve().parents[2] +if str(ROOT) not in sys.path: # `--write` 로 바로 돌릴 때 + sys.path.insert(0, str(ROOT)) + +from B08_Quantity import B08_Quantity_Router_Material as b08 +from B09_Estimation import B09_Estimation_Bill_Library as library +from B09_Estimation import B09_Estimation_Router as b09 +from B09_Estimation import B09_Estimation_Sangeun as sangeun +from B09_Estimation import B09_Estimation_Store as b09_store +from B09_Estimation.B09_Estimation_Labor_Source import daega_inputs +from M02_MasterTemplete import M02_Doc_Sk_Path as sk_path +from M02_MasterTemplete import M02_Item_Snapshot as snapshots +from M02_MasterTemplete import M02_Item_Source as source +from M02_MasterTemplete import M02_Labor_Doc as labor +from M02_MasterTemplete import M02_Labor_Ref as refs +from M02_MasterTemplete import M02_MasterTemplete_Store as store +from M02_MasterTemplete import M02_Sangeun_Imported as imported +from resources.tester.test_145_2_b09_labor_calc import _item, _project +from resources.tester.test_793_2_sangeun_imported import _bonghwa +from resources.tester.test_m02_labor_ref import MINE, world # noqa: F401 — 같은 임시 층 + +HERE = Path(__file__).resolve().parent +FILE = HERE / "golden_855_b09.json" +REDO = "./venv/Scripts/python.exe resources/tester/test_855_b09_golden.py --write" +WRITE = os.environ.get("S855B09_WRITE") == "1" +OWNER = "7/42" + +FORM = "GC000211" # 합판거푸집 — 옵션 · 재료 · 인력 +PCT = "GC001109" # 인력 둘 + 「노무비 * 3 / 100」 덧줄(율) +SUB = "GC000999" # 원/주 · 고소작업차 로직 줄 + 덧줄 공구손료 % +NET = "GC000337" # 낙석방지망 — 노무 · 크레인(중기) · 자재 셋 +NET_IN = {"구분": "기계식", "방지망": "포켓식", "지역": "전국평균", "크레인": "2104-0010"} +DIG = "GF000089" # 토사깍기(기계) — 굴착기 시간당 +STONE = "GF000219" # 돌쌓기 메쌓기(인력) +TWO_MATS = "GC000565" # 재료 줄 둘(고른 재료 열쇠) +HAUL = "GF000134" # 골재운반(운반공 · 거리로 입력 채움) +FIXED = { + "고정": { + "이름": "sub6임시 손 단가", + "규격": "", + "단위": "식", + "단가": {"노무비": 12000, "재료비": 3000, "경비": 500}, + "이음": {"노임": "LB000002", "자재": None, "기계": None, "유가": None}, + }, + "수량": {"손": 2}, +} +RATE = { + "고정": {"이름": "공구손료", "단가": {}, "이음": {}, "비율": {"기준": "인력", "비목": "경비"}} +} + + +def _sk(**doc) -> str: + return refs.create("sangeun", {"이름": "sub6임시", "단위": "㎡", "더한줄": [], **doc})["이름"] + + +def _layer_samples(me: Path) -> dict[str, str]: + """개인 층 견본 — {갈래: 키}.""" + with store.at(me): + keys = { + "바탕": _sk(바탕={"로직": FORM}, 입력값={"유형": "복잡", "사용횟수": "3회"}), + "율": _sk(바탕={"로직": SUB}, 단위="주", 더한줄=[{**RATE, "수량": 2}]), + "기계": _sk(바탕={"로직": DIG}, 단위="㎥"), + "재료": _sk(바탕={"로직": NET}, 입력값=NET_IN), + } + keys["형제"] = _sk(바탕={"참조": {**MINE, "키": keys["바탕"]}}) + keys["따로"] = _sk(바탕={"로직": PCT}) + read = sk_path.read(keys["따로"]) + twice = copy.deepcopy(read["문서"]) + twice["금액"][0]["수량"] = f"({twice['금액'][0].get('수량') or 1}) × 2" + sk_path.save(keys["따로"], {"문서": twice, "판": read["판"]}) + row, src = _bonghwa() + keys["가져온"] = imported.create(row, src, "sub6임시 가져온")["이름"] + sc = { + "이름": "sub6임시 일위대가", + "단위": "㎡", + "담은로직": [ + {"참조": {**MINE, "키": keys["바탕"]}, "수량": {"손": 1}}, + FIXED, + {"로직": STONE, "입력값": {}, "수량": {"손": 1}}, + ], + "자재": [{"코드": "MT003810", "수량": {"손": 2}}], + } + keys["일위대가"] = refs.create("precombo", sc)["이름"] + return keys + + +def _structure(world, keys: dict[str, str], root: Path) -> None: + """구조물 사본(pipe@100.0) — 일위대가 열 문서를 지금 사본 길(`labor_doc_rows` · `price_bundle`)로.""" + me = world["personal"] + lines = [ + {"참조": {**MINE, "키": keys[k]}, "수량": {"손": q}} + for k, q in (("바탕", 2), ("율", 1), ("형제", 1), ("따로", 1), ("가져온", 1), ("기계", 3)) + ] + lines += [ + {"참조": {**MINE, "키": keys["재료"]}, "수량": {"손": 1}}, + {"참조": {**MINE, "키": keys["일위대가"]}, "수량": {"손": 1}}, + {"로직": STONE, "입력값": {}, "수량": {"손": 1}}, + {"로직": TWO_MATS, "수량": {"손": 1}}, + ] + with store.at(me): + doc = labor.clean( + {"열": "rv", "담은로직": lines, "자재": [{"코드": "MT003810", "수량": {"손": 2}}]} + ) + rows = source.labor_doc_rows(doc) + files = { + source.LABOR_FILE: rows, + source.PRICE_FILE: source.price_bundle(rows, me), + snapshots.VALUES_FILE: {STONE: {"높이": {"값": 1.5}}}, + snapshots.PICKS_FILE: {TWO_MATS: {"1": "MT003196", "2": "MT003173"}}, + snapshots.MANIFEST_NAME: {"원본": {**_item("SS000901"), "경로": ["x"]}}, + } + folder = snapshots.structures_dir(root) / snapshots.folder_name("pipe@100.0") + folder.mkdir(parents=True) + for name, data in files.items(): + text = json.dumps(data, ensure_ascii=False, default=str) + (folder / name).write_text(text, encoding="utf-8") + + +HAND = [ + {"key": "hand:rate", "section": "1.1", "after": "", "spec": "", "name": "율 줄", "unit": "㎡", "qty": 2, + "ref": {"tab": "logic", "code": PCT, "given": {}, "rate": None, "picks": None}}, + {"key": "hand:pick", "section": "1.1", "after": "hand:rate", "spec": "", "name": "고른 재료", "unit": "㎡", "qty": 1, + "ref": {"tab": "logic", "code": TWO_MATS, "given": {}, "rate": None, "picks": {"1": "MT003196", "2": "MT003173"}}}, + {"key": "hand:net", "section": "1.1", "after": "hand:pick", "spec": "", "name": "입력", "unit": "㎡", "qty": 3, + "ref": {"tab": "logic", "code": NET, "given": NET_IN, "rate": 90, "picks": None}}, +] # fmt: skip +HAUL_REF = {"tab": "logic", "code": HAUL, "name": "골재운반", "given": {"Cm": 1}, "cycle": {}} +USER = { + "bill": {"qty": {}, "rows": HAND}, + "haul_refs": {"haul:r-u1": HAUL_REF}, + "haul_dist": {"haul:r-u1": {"L1": 25.1, "L2": 0.8}}, +} + + +def _clean(value, root: Path): + """지문 꼴 — 임시 경로 · 때(날짜 · 시각)는 지움 · 수는 글로.""" + text = json.dumps(value, ensure_ascii=False, sort_keys=True, default=str) + text = text.replace(str(root).replace("\\", "\\\\"), "").replace(str(root), "") + return re.sub( + r"\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}(:\d{2}(\.\d+)?)?(Z|[+-]\d{2}:?\d{2})?", "<때>", text + ) + + +def _split_text(value): + """(값, 글) — 산출근거 글(`text` · `head` · `foot` · `lines` 글 목록)을 따로 떼어 지문을 나눔.""" + words = [] + + def walk(v): + if isinstance(v, dict): + out = {} + for k, x in v.items(): + if k in ("text", "head", "foot"): + words.append(x) + else: + out[k] = walk(x) + return out + if isinstance(v, list): + return [walk(x) for x in v] + return v + + return walk(value), words + + +def answers(world, tmp_path) -> dict[str, object]: + keys = _layer_samples(world["personal"]) + root = _project(tmp_path / "proj", [(100, "SS000901")]) + _structure(world, keys, root) + for kind, key in ( + ("sangeun", keys["따로"]), + ("sangeun", keys["가져온"]), + ("precombo", keys["일위대가"]), + ): + library.import_copy(root, kind, "personal", OWNER, key) + b09_store.write_user(root, USER) + haul = {k: USER[k] for k in ("haul_refs", "haul_dist")} # 운반 연결 = 셈 때 거리이정표에서 붙음 + user = {**b09_store.read_user(root), **haul} + out: dict[str, object] = {"키": keys} + out["calc_user"] = b09.calc_user(root) + out["daega_inputs"] = daega_inputs(root) + out["수요"] = asyncio.run(b09._demand(root)) + for name, supply in (("산근", None), ("산근 관급", lambda _k: "관급")): + sg = sangeun.build(root, user, None, supply) + out[f"{name} 값"], out[f"{name} 글"] = _split_text(sg) + for row in HAND: + ref = row["ref"] + body = b09.PreviewBody( + code=ref["code"], given=ref["given"], rate=ref["rate"], picks=ref["picks"] + ) + got = b09.logic_preview(root, body) + got, words = _split_text(got) + out[f"미리보기 {row['key']} 값"] = {k: v for k, v in got.items() if k != "lines"} + out[f"미리보기 {row['key']} 글"] = [got.get("lines"), words] + linked = snapshots.linked_snapshots(root) + summary = { + "linked": linked, + "sources": [["rv:x", 12.0, folder, ["system||SS000901"]] for folder in sorted(linked)], + "total": {"rv:x": 12.0}, + } + out["B08 단위수량"] = b08.snapshot_units(root, summary) + return {k: _clean(v, root) for k, v in out.items()} + + +def _hash(text: str) -> str: + return hashlib.sha256(text.encode("utf-8")).hexdigest()[:16] + + +@pytest.fixture(autouse=True) +def _manual(monkeypatch): + """자동 따라옴 끔 — 저장본 그대로(층 꼴만 봄 · 자동은 test_836_2).""" + from M02_MasterTemplete import M02_Sk_AutoRenew as renew + + monkeypatch.setattr(renew, "on", lambda: False) + + +def test_B08_B09_답_지문_같음(world, tmp_path): + got = {k: _hash(v) for k, v in answers(world, tmp_path).items()} + if WRITE: + body = {"판": 1, "지문": got} + FILE.write_text(json.dumps(body, ensure_ascii=False, indent=1) + "\n", "utf-8") + want = json.loads(FILE.read_text("utf-8"))["지문"] + bad = sorted(k for k in want.keys() | got.keys() if want.get(k) != got.get(k)) + assert not bad, ( + f"B08 · B09 답 지문 다름 — {bad}\n" + f"뜻대로 금액 · 글을 바꾼 걸음이면 다시 뜸: {REDO} (아니면 고친 코드를 되짚음)" + ) + + +if __name__ == "__main__": + if "--write" not in sys.argv: + sys.exit(f"다시 뜨기 = {REDO}") + os.environ["S855B09_WRITE"] = "1" + import tempfile + + temp = str(Path(tempfile.gettempdir()) / "s855b09_pt") # 공용 임시 폴더 권한 막힘 피함 + sys.exit(pytest.main([__file__, "-q", "-p", "no:cacheprovider", "--basetemp", temp])) From bf407c49d1a0310bc031816c333220c141c99eb0 Mon Sep 17 00:00:00 2001 From: umsangdon Date: Tue, 17 Nov 2026 17:35:02 +0900 Subject: [PATCH 02/30] =?UTF-8?q?fix(854-3):=20=EC=A4=84=20=EC=8C=93?= =?UTF-8?q?=EA=B8=B0=20=ED=99=94=EB=A9=B4=20=EC=B0=BD=20=ED=81=AC=EA=B8=B0?= =?UTF-8?q?=20=EB=93=A3=EA=B8=B0=20=ED=95=B4=EC=A0=9C=20=E2=80=94=20destro?= =?UTF-8?q?y=20=EA=B8=B8=20=C2=B7=20=EB=8B=AB=EC=9D=84=20=EB=95=8C=20?= =?UTF-8?q?=EB=B6=80=EB=A6=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - createStackScreen 에 destroy(창 크기 듣기 해제) · 단가산출 그릇(Sangeun_Tabs) → mountSangeunDetail.destroy 가 부름 (M02 단가산출 · 일위대가 참조 줄 창 · 불러온 단가산출 창 모두 이 길) - M01 단가산출 기초 화면은 M01 페이지를 다시 그릴 때 지난 화면 destroy · M01 읽기 창(부품)은 앱 하나로 재사용 - 시험 test_854_3_screen_leak(가짜 DOM · 열고 닫기 5 회 = 열린 동안 1 · 닫으면 0) Co-Authored-By: Claude Sonnet 5.5 --- A00_Common/line_stack_screen.ts | 2 + M01_MasterData/M01_MasterData_UI_LogicLab.ts | 4 +- M01_MasterData/M01_MasterData_UI_Page.ts | 5 + M01_MasterData/M01_MasterData_UI_Parts.ts | 12 +- .../M02_MasterTemplete_Sangeun_Detail.ts | 1 + .../M02_MasterTemplete_Sangeun_Tabs.ts | 3 + resources/tester/helper_854_3_screen_leak.cjs | 115 ++++++++++++++++++ resources/tester/test_854_3_screen_leak.py | 30 +++++ 8 files changed, 168 insertions(+), 4 deletions(-) create mode 100644 resources/tester/helper_854_3_screen_leak.cjs create mode 100644 resources/tester/test_854_3_screen_leak.py diff --git a/A00_Common/line_stack_screen.ts b/A00_Common/line_stack_screen.ts index 10bb90115..3f686bf8d 100644 --- a/A00_Common/line_stack_screen.ts +++ b/A00_Common/line_stack_screen.ts @@ -659,6 +659,8 @@ export function createStackScreen(opt: StackScreenOptions) { return { root, + /** 화면을 닫거나 다른 문서로 바꿀 때 — 창 크기 듣기 해제(안 부르면 열 때마다 하나씩 남음) */ + destroy: (): void => window.removeEventListener("resize", fit), /** 로직 · SK 키로 그림(빈 키 = 저장 전 새 것) — 같은 키는 그대로 · `force` = 다시 읽음(탭 바꿈) */ draw: (next: string, force = false): void => { if (force || next !== shown) loading = open(next); diff --git a/M01_MasterData/M01_MasterData_UI_LogicLab.ts b/M01_MasterData/M01_MasterData_UI_LogicLab.ts index a406920eb..d15e0934e 100644 --- a/M01_MasterData/M01_MasterData_UI_LogicLab.ts +++ b/M01_MasterData/M01_MasterData_UI_LogicLab.ts @@ -83,6 +83,8 @@ function loadDrafts(): Record { export interface LogicHandle { /** 밖(요소 화면)에서 이 키를 바로 엶 — 소요량·계수 표의 「쓰는 로직」 눌렀을 때. */ openKey: (key: string) => Promise; + /** 화면을 버릴 때 — 줄 쌓기 창 크기 듣기 해제 */ + destroy: () => void; } export async function mountM01LogicLab( @@ -512,5 +514,5 @@ export async function mountM01LogicLab( hideLoadingOverlay(); } setLogicOpener((key) => void openKeyOn(key)); - return { openKey: openKeyOn }; + return { openKey: openKeyOn, destroy: stack.destroy }; } diff --git a/M01_MasterData/M01_MasterData_UI_Page.ts b/M01_MasterData/M01_MasterData_UI_Page.ts index efe9b1c63..9342849bb 100644 --- a/M01_MasterData/M01_MasterData_UI_Page.ts +++ b/M01_MasterData/M01_MasterData_UI_Page.ts @@ -64,7 +64,11 @@ const MACHINE_BACK = "m01.machine.back"; const machineUrl = (target?: string): string => `#/${ROUTES.M01_MASTER_DATA}${target ? `?machine=${encodeURIComponent(target)}` : ""}`; +let lastLogic: LogicHandle | null = null; + export async function renderM01MasterData(root: HTMLElement): Promise { + lastLogic?.destroy(); // 지난 화면의 줄 쌓기 창 크기 듣기 해제 + lastLogic = null; const user = await fetchSessionUser().catch(() => null); if (user?.role !== "SYSTEM_ADMIN") { showToast(L("M01_AdminOnly"), "error"); @@ -300,6 +304,7 @@ function buildPage(): HTMLElement { void import("./M01_MasterData_UI_LogicLab").then(async (m) => { const pending = takePendingLogicKey(); logicHandle = await m.mountM01LogicLab(logicHost, side, pending ?? undefined); + lastLogic = logicHandle; }); }; diff --git a/M01_MasterData/M01_MasterData_UI_Parts.ts b/M01_MasterData/M01_MasterData_UI_Parts.ts index e6b864cc3..246e44db2 100644 --- a/M01_MasterData/M01_MasterData_UI_Parts.ts +++ b/M01_MasterData/M01_MasterData_UI_Parts.ts @@ -36,16 +36,22 @@ const T = { const tx = (k: keyof typeof T): string => T[k][currentLanguageIndex === 1 ? 1 : 0]; const KINDS = ["기계경비식", "작업량 틀", "계수식"] as const; +/** 읽기 창은 앱 하나 — 창 크기 듣기가 부품 칸을 그릴 때마다 늘지 않음 */ +let partsStack: ReturnType | null = null; + /** 표 아래 부품 칸 — 기계(상세구분 있음) · 계수만 · 그 밖 = 비움 */ export function renderParts(host: HTMLElement, pick: Pick, openLogic: (key: string) => void): void { host.replaceChildren(); const group = pick.group === "계수" ? "계수식" : pick.group === "기계" ? "기계" : ""; if (!group || (group === "기계" && !pick.detail)) return; - let stack: ReturnType | null = null; /** 줄 쌓기 읽기 창 — 고침 없음 · [단가산출 기초에서 열기] = 수식 탭에서 고침 */ const show = (p: Part): void => { - stack ??= createStackScreen({ base: "/m01/logic/doc", admin: false, cache: "m01_parts_view" }); - const view = stack; + partsStack ??= createStackScreen({ + base: "/m01/logic/doc", + admin: false, + cache: "m01_parts_view", + }); + const view = partsStack; openModal({ title: `${p.키} · ${p.이름}`, closeLabel: tx("Close"), diff --git a/M02_MasterTemplete/M02_MasterTemplete_Sangeun_Detail.ts b/M02_MasterTemplete/M02_MasterTemplete_Sangeun_Detail.ts index 8dd2e7d24..0d78feee3 100644 --- a/M02_MasterTemplete/M02_MasterTemplete_Sangeun_Detail.ts +++ b/M02_MasterTemplete/M02_MasterTemplete_Sangeun_Detail.ts @@ -490,6 +490,7 @@ export function mountSangeunDetail( destroy: () => { alive = false; if (tabs.dirty()) void tabs.discard(); // 페이지가 버리고 떠남 — 수식 캐시도 비움 + tabs.destroy(); host.replaceChildren(); }, }; diff --git a/M02_MasterTemplete/M02_MasterTemplete_Sangeun_Tabs.ts b/M02_MasterTemplete/M02_MasterTemplete_Sangeun_Tabs.ts index 75df34578..2e09f9c5e 100644 --- a/M02_MasterTemplete/M02_MasterTemplete_Sangeun_Tabs.ts +++ b/M02_MasterTemplete/M02_MasterTemplete_Sangeun_Tabs.ts @@ -48,6 +48,8 @@ export function createSangeunTabs( dirty: () => boolean; save: () => Promise; discard: () => Promise; + /** 줄 쌓기 화면의 창 크기 듣기 해제 */ + destroy: () => void; } { const tools = el("span", { className: "m02-sk__tools", attrs: { "data-sk-tools": "" } }); // [단가 갱신] · [재생성](808-1) const stack = createStackScreen({ @@ -78,5 +80,6 @@ export function createSangeunTabs( dirty: () => stack.dirty(), save: () => stack.save(), discard: () => stack.discard(), + destroy: () => stack.destroy(), }; } diff --git a/resources/tester/helper_854_3_screen_leak.cjs b/resources/tester/helper_854_3_screen_leak.cjs new file mode 100644 index 000000000..40c071558 --- /dev/null +++ b/resources/tester/helper_854_3_screen_leak.cjs @@ -0,0 +1,115 @@ +/* 854-3 헬퍼 — 줄 쌓기 화면 열고 닫기를 되풀이해도 창 크기 듣기가 안 늘고 · M01 화면 들어올 때 상세 길이 M01 로 돌아옴 + * 가짜 DOM · 진짜 코드(line_stack_screen · Sangeun_Tabs · M01 Logic_Api · M01 Page) · 나머지 이웃 파일은 빈 부품 */ +const fs = require("fs"); +const path = require("path"); +const ROOT = path.resolve(__dirname, "..", ".."); +const ts = require(path.join(ROOT, "config", "node_modules", "typescript")); + +class Fake { + constructor(tag) { + this.tagName = String(tag).toUpperCase(); + this.children = []; + this.parentElement = null; + this.dataset = {}; + this.style = { setProperty() {} }; + this.offsetHeight = 0; + this.clientHeight = 0; + this.hidden = false; + } + append(...xs) { + for (const x of xs) if (x instanceof Fake) (x.parentElement = this), this.children.push(x); + } + replaceChildren(...xs) { + this.children = []; + this.append(...xs); + } + addEventListener() {} + setAttribute() {} +} + +let listeners = 0; // window 의 resize 듣기 수 +globalThis.window = globalThis; +globalThis.addEventListener = (type) => type === "resize" && listeners++; +globalThis.removeEventListener = (type) => type === "resize" && listeners--; +globalThis.getComputedStyle = () => ({ overflowY: "visible" }); +globalThis.innerHeight = 800; +globalThis.HTMLElement = Fake; +globalThis.document = { createElement: (t) => new Fake(t), body: new Fake("body") }; +globalThis.sessionStorage = { getItem: () => null, setItem() {}, removeItem() {} }; + +const empty = () => new Proxy(function () {}, { get: (_, k) => (k === "then" ? undefined : empty()), apply: () => undefined }); +const own = { + ui_template_elements: { showToast() {}, el: (tag, o = {}) => { const n = new Fake(tag); n.append(...(o.children ?? [])); return n; } }, +}; + +function makeLoader(stubs) { + const cache = new Map(); + const resolve = (from, p) => { + if (p.startsWith("@ui/")) return path.join(ROOT, "ui_template", `${p.slice(4)}.ts`); + if (p.startsWith("@config/")) return path.join(ROOT, "config", `${p.slice(8)}.ts`); + if (p.startsWith(".")) return `${path.resolve(path.dirname(from), p)}.ts`; + return null; + }; + function load(at) { + if (cache.has(at)) return cache.get(at); + const js = ts.transpileModule(fs.readFileSync(at, "utf8"), { + compilerOptions: { module: ts.ModuleKind.CommonJS, target: ts.ScriptTarget.ES2020 }, + }).outputText; + const box = { exports: {} }; + cache.set(at, box.exports); + const need = (p) => { + const name = path.basename(p); + if (p.endsWith(".css")) return {}; + if (stubs[name]) return stubs[name]; + const r = resolve(at, p); + // 읽어 올 몸 = 진짜 · 그 밖 = 빈 부품 + return r && real.has(path.basename(r, ".ts")) ? load(r) : empty(); + }; + new Function("exports", "module", "require", js)(box.exports, box, need); + return box.exports; + } + return (rel) => load(path.join(ROOT, rel)); +} +const real = new Set([ + "line_stack_screen", + "M02_MasterTemplete_Sangeun_Tabs", + "M01_MasterData_UI_Logic_Api", + "M01_MasterData_UI_Page", +]); +const state = { user: null }; +const load = makeLoader({ + ...own, + A06_Login_Api_Fetch: { fetchSessionUser: async () => state.user }, +}); + +const out = { screen: [], tabs: [], page: {} }; + +// ① 줄 쌓기 화면 — 열고 닫기 다섯 번 +const { createStackScreen } = load("A00_Common/line_stack_screen.ts"); +const base = listeners; +for (let i = 0; i < 5; i++) { + const s = createStackScreen({ base: "/m01/logic/doc", admin: false, cache: "x" }); + out.screen.push(listeners - base); // 열린 동안 +1 + s.destroy(); + out.screen.push(listeners - base); +} + +// ② M02 단가산출 줄 쌓기 그릇 — 열고 닫기 다섯 번 +const { createSangeunTabs } = load("M02_MasterTemplete/M02_MasterTemplete_Sangeun_Tabs.ts"); +const b2 = listeners; +for (let i = 0; i < 5; i++) { + const t = createSangeunTabs(new Fake("div"), { edit: false, scope: { layer: "system", owner: null } }); + out.tabs.push(listeners - b2); + t.destroy(); + out.tabs.push(listeners - b2); +} + +// ③ M01 화면에 들어오면 상세 길이 M01 기본으로 +const api = load("M01_MasterData/M01_MasterData_UI_Logic_Api.ts"); +api.setLogicApiPaths({ read: "/m02/logic-lib", calc: "/m02/logic-lib" }); +out.page.before = api.logicApiPaths().read; +const { renderM01MasterData } = load("M01_MasterData/M01_MasterData_UI_Page.ts"); +renderM01MasterData(new Fake("div")).then(() => { + out.page.after = api.logicApiPaths().read; + console.log(JSON.stringify(out)); +}); diff --git a/resources/tester/test_854_3_screen_leak.py b/resources/tester/test_854_3_screen_leak.py new file mode 100644 index 000000000..86f9a42bd --- /dev/null +++ b/resources/tester/test_854_3_screen_leak.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +"""PLAN 854-3 — 줄 쌓기 창 크기 듣기 해제(가짜 DOM · 진짜 코드). + +① 줄 쌓기 화면 · M02 단가산출 그릇 = 열고 닫기를 다섯 번 되풀이해도 열린 동안 하나 · 닫으면 0 +""" + +from __future__ import annotations + +import json +import os +import subprocess + +HERE = os.path.dirname(os.path.abspath(__file__)) + + +def _run() -> dict: + proc = subprocess.run( + ["node", os.path.join(HERE, "helper_854_3_screen_leak.cjs")], + capture_output=True, + text=True, + encoding="utf-8", + ) + assert proc.returncode == 0, proc.stderr[-3000:] + return json.loads(proc.stdout) + + +def test_listeners_do_not_grow_and_m01_path_returns() -> None: + got = _run() + assert got["screen"] == [1, 0] * 5 + assert got["tabs"] == [1, 0] * 5 From a02bd5b436984785579ce4a3c644b5c747c9b964 Mon Sep 17 00:00:00 2001 From: umsangdon Date: Tue, 17 Nov 2026 17:35:34 +0900 Subject: [PATCH 03/30] =?UTF-8?q?fix(854-3):=20M01=20=ED=99=94=EB=A9=B4?= =?UTF-8?q?=EC=97=90=20=EB=93=A4=EC=96=B4=EC=98=AC=20=EB=95=8C=20=EC=83=81?= =?UTF-8?q?=EC=84=B8=20=EB=B6=80=ED=92=88=20=EA=B8=B8=EC=9D=84=20M01=20?= =?UTF-8?q?=EA=B8=B0=EB=B3=B8=EC=9C=BC=EB=A1=9C=20=EB=90=98=EB=8F=8C?= =?UTF-8?q?=EB=A6=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - M02 단가산출이 바꿔 둔 상세 부품 길(/m02/logic-lib)이 같은 탭에서 M01 로 가도 남아, M01 로직 목록 · 읽기가 M02 길로 가던 것 (M01 열 묶음 · 작업량 · 부모 · 관련 · 지문 칸이 M02 답엔 없음 · 로직 입력 · 개정 칸도 다름) - renderM01MasterData 처음에 setLogicApiPaths() 한 줄 - 시험 test_854_3_screen_leak 에 M01 진입 뒤 길 = /m01 점검 Co-Authored-By: Claude Sonnet 5.5 --- M01_MasterData/M01_MasterData_UI_Page.ts | 2 ++ resources/tester/test_854_3_screen_leak.py | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/M01_MasterData/M01_MasterData_UI_Page.ts b/M01_MasterData/M01_MasterData_UI_Page.ts index 9342849bb..b25f37b62 100644 --- a/M01_MasterData/M01_MasterData_UI_Page.ts +++ b/M01_MasterData/M01_MasterData_UI_Page.ts @@ -32,6 +32,7 @@ import { fetchSessionUser } from "../A06_Login/A06_Login_Api_Fetch"; import { saveFiles, type FileInfo } from "./M01_MasterData_Api_Fetch"; import { discard, isStale, onDraftChange, payload, totalCount } from "./M01_MasterData_Draft"; import { buildHeadBar, buildHeadFilters } from "./M01_MasterData_UI_Head"; +import { setLogicApiPaths } from "./M01_MasterData_UI_Logic_Api"; import { renderRows } from "./M01_MasterData_UI_Rows"; import { renderMachines } from "./M01_MasterData_UI_Machine"; import { openMachineDetail } from "./M01_MasterData_UI_MachineDetail"; @@ -69,6 +70,7 @@ let lastLogic: LogicHandle | null = null; export async function renderM01MasterData(root: HTMLElement): Promise { lastLogic?.destroy(); // 지난 화면의 줄 쌓기 창 크기 듣기 해제 lastLogic = null; + setLogicApiPaths(); // M02 단가산출이 바꿔 둔 상세 부품 길 → M01 기본 길로 const user = await fetchSessionUser().catch(() => null); if (user?.role !== "SYSTEM_ADMIN") { showToast(L("M01_AdminOnly"), "error"); diff --git a/resources/tester/test_854_3_screen_leak.py b/resources/tester/test_854_3_screen_leak.py index 86f9a42bd..a07c85045 100644 --- a/resources/tester/test_854_3_screen_leak.py +++ b/resources/tester/test_854_3_screen_leak.py @@ -1,7 +1,8 @@ # -*- coding: utf-8 -*- -"""PLAN 854-3 — 줄 쌓기 창 크기 듣기 해제(가짜 DOM · 진짜 코드). +"""PLAN 854-3 — 줄 쌓기 창 크기 듣기 해제 · M01 상세 길 되돌림(가짜 DOM · 진짜 코드). ① 줄 쌓기 화면 · M02 단가산출 그릇 = 열고 닫기를 다섯 번 되풀이해도 열린 동안 하나 · 닫으면 0 +② M02 가 상세 길을 M02 로 바꿔 둔 뒤 M01 화면에 들어오면 M01 기본 길(`/m01`) """ from __future__ import annotations @@ -28,3 +29,8 @@ def test_listeners_do_not_grow_and_m01_path_returns() -> None: got = _run() assert got["screen"] == [1, 0] * 5 assert got["tabs"] == [1, 0] * 5 + + +def test_m01_entry_resets_logic_api_paths() -> None: + # M02 단가산출이 상세 길을 M02 로 바꿔 둔 뒤 M01 화면에 들어오면 M01 기본 길 + assert _run()["page"] == {"before": "/m02/logic-lib", "after": "/m01"} From a251bf663166a303c9373677634e7aeaf7c979ef Mon Sep 17 00:00:00 2001 From: umsangdon Date: Tue, 17 Nov 2026 17:45:49 +0900 Subject: [PATCH 04/30] =?UTF-8?q?refactor(855-B2):=20=EA=B8=B0=EA=B3=84=20?= =?UTF-8?q?=EC=8B=9C=EA=B0=84=EB=8B=B9=20=EC=98=9B=20=EC=97=94=EC=A7=84=20?= =?UTF-8?q?=ED=8F=B4=EB=B0=B1=20=EA=B1=B7=EC=9D=8C=20=E2=80=94=20=EC=88=98?= =?UTF-8?q?=EC=8B=9D=20=EB=AC=B8=EC=84=9C=20=EC=97=86=EC=9D=8C=20=3D=20?= =?UTF-8?q?=EB=AA=BB=20=EC=85=88=20+=20=EA=B9=8C=EB=8B=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - `M02_Machine_Hourly.hourly`(M01 `store.calc`) · `brief`(`mf.run`) · `M02_MyMachine.hourly`(`mf.run`) 세 폴백 걷음 - 세 곳의 같은 몸 = 새 `M02_Machine_Hourly.hour`(문서 계산기 한 길) · `doc_sums` 는 None 대신 {ok False, reason 「식 문서 없음 — 「키」」, 로직} - 854-1 잠금 · 판 · 메모 지킴 그대로 - 대조: M01 기계 655 대 hourly · brief 옛 코드와 다름 0(문서 없음 0 · 못 셈 44 는 원래 그대로) · 관련 309 통과 · 빌더 같음 Co-Authored-By: Claude Opus 5.5 --- M02_MasterTemplete/M02_Machine_Hourly.py | 70 ++++++++---------------- M02_MasterTemplete/M02_MyMachine.py | 20 +------ 2 files changed, 25 insertions(+), 65 deletions(-) diff --git a/M02_MasterTemplete/M02_Machine_Hourly.py b/M02_MasterTemplete/M02_Machine_Hourly.py index 1911f808c..fb43f70dc 100644 --- a/M02_MasterTemplete/M02_Machine_Hourly.py +++ b/M02_MasterTemplete/M02_Machine_Hourly.py @@ -8,7 +8,7 @@ 기계표 = M01 + 지금 층 내 기계(821-1 · `M02_MyMachine` — 식은 채운 칸으로 고른 같은 GC 식 · 직접 = 그 값) · 층을 모르는 길(`/api/m02/logic-lib/machine-hourly`)은 M01 만. 셈 한 길(842-3) = 식 문서 계산기(`master_doc_calc` · 기계 줄 인력 · 잡품 목록을 바탕 덮음으로 얹음 — -`master_doc_cover.row_entry`) · 식 문서 없는 식만 옛 로직 엔진 · 조종원 유무 = 인력 줄(`master_machine_crew.view`). +`master_doc_cover.row_entry`) · 식 문서 없는 식 = 못 셈 + 까닭(855 2-B2 · 옛 엔진 폴백 걷음) · 조종원 유무 = 인력 줄(`master_machine_crew.view`). 식 고름 한 곳(822-2 · `pick`) = ㉠ 원문번호가 식 「기계」 목록에 있으면 그 식(짝 차례) ㉡ 그 기계만의 식 (`_own`) ㉢ 없으면 꼴(채운 칸 · `M02_MyMachine.logic_key`) — M01 [새 기계] · 불러오기 · 데이터 흐름 · 줄 쌓기 · 단가산출 기초가 다 이것을 씀 · 못 고름 · 값 모자람 = 까닭 글(`why`). @@ -183,39 +183,22 @@ def hourly(key: str) -> dict[str, Any]: logic = pick(row) if lack := why(row, logic): return {"ok": False, "reason": lack, **({"로직": logic["키"]} if logic else {})} - args = "".join( # 빈칸 든 입력 이름(「전력 계약종별」 · 820-1 파워트로웰)은 따옴표로 - f", {n if (n := i['이름']).isidentifier() else repr(n)}='{(i.get('고르기') or [''])[0]}'" - for i in logic.get("입력") or [] - if i.get("이름") != "기계" - ) - if (got := doc_sums(row, logic, whole)) is not None: - return got if not got["ok"] else {"ok": True, "이름": row.get("이름"), "규격": row.get("규격"), - "로직": logic["키"], "원문번호": code, **got["합"]} # fmt: skip - mine = f", 기계='{code}'" if takes_machine(logic) else "" - call = f"로직({logic['키']}{mine}{args})" - line = {"종류": "로직", "요소": call, "이름": "기계", "단위": "시간", "수량": "1"} - holder = { - "키": "", "원문번호": "", "이름": "기계 시간", "결과단위": "원/식", "출처": "자체", - "입력": [], "중간": [], "호표": [line], "덧줄": [], "끝수": None, - } # fmt: skip - got = store.calc("", {}, holder, None) - if not got.get("ok") or "sums" not in got: - return {"ok": False, "reason": got.get("reason") or "셈 못 함"} - sums = {k: float(got["sums"][k]) for k in (*cm.mf.COST_ITEMS, "계")} - # 804-3 줄 쌓기 기계 줄 = 이 로직 + 기계='원문번호' - return { - "ok": True, - "이름": row.get("이름"), - "규격": row.get("규격"), - "로직": logic["키"], - "원문번호": code, - **sums, - } + got = hour(row, logic, whole) # 804-3 줄 쌓기 기계 줄 = 이 로직 + 기계='원문번호' + if not got["ok"]: + return got + return {"ok": True, "이름": row.get("이름"), "규격": row.get("규격"), "원문번호": code, **got} + + +def hour(row: dict, logic: dict, index: Any) -> dict[str, Any]: + """시간당 한 몸(`hourly` · `brief` · `M02_MyMachine.hourly`) — {ok, 로직, 노무비 · 재료비 · 경비 · 계} | + {ok False, reason, 로직}.""" + got = doc_sums(row, logic, index) + return {"ok": True, "로직": logic["키"], **got["합"]} if got["ok"] else got def doc_sums(row: dict, logic: dict, index: Any) -> dict | None: """셈 한 길(842-3) — 식 문서 계산기 + 기계 줄 목록(바탕 덮음) · 입력 = 식 기본값 · - {ok, 합 {노무비 · 재료비 · 경비 · 계}} | {ok False, reason} · 식 문서 없음 = None(옛 로직 엔진).""" + {ok, 합 {노무비 · 재료비 · 경비 · 계}} | {ok False, reason, 로직} · 식 문서 없음 = 못 셈(855 2-B2).""" import master_doc_calc as mc import master_doc_cover as mcv import master_doc_link as ml @@ -224,8 +207,12 @@ def doc_sums(row: dict, logic: dict, index: Any) -> dict | None: docs = m01doc.docs() doc = docs.get(str(logic.get("키"))) - if doc is None: - return None + if doc is None: # 854-2 이후 수식 문서 없는 로직 0 — 옛 엔진 폴백 없음 + return { + "ok": False, + "reason": f"식 문서 없음 — 「{logic.get('키')}」", + "로직": logic.get("키"), + } given = {"기계": str(row.get("원문번호"))} if takes_machine(logic) else {} shaped = mcv.cover_doc(doc, given, None, mcv.row_entry(doc, row.get("값"))) got = mc.calc(shaped, ml.Links(index, docs), given) @@ -243,8 +230,6 @@ _BRIEF_OF: list[Any] = [None] def brief(keys: list[str]) -> list[dict[str, Any]]: """기계 창 목록 · 양식(827-1) — M01 기계 줄 값 + 시간당(`hourly` 와 같은 식 · 입력 기본값 · 마스터를 다시 읽지 않고 색인 위에서 셈 · 색인마다 메모) · 키 · 원문번호로 찾음 · 없는 키 = 뺌.""" - import master_cut as mcut - from M02_MasterTemplete.M02_Item_Prices import to_json index, mf = store.loaded()[1], cm.mf @@ -265,20 +250,9 @@ def brief(keys: list[str]) -> list[dict[str, Any]]: continue logic = pick(row) head = {k: row.get(k) for k in ("키", "원문번호", "이름", "규격")} - if lack := why(row, logic): - hour = {"ok": False, "reason": lack} - elif (by_doc := doc_sums(row, logic, index)) is not None: - hour = {"ok": True, "로직": logic["키"], **by_doc["합"]} if by_doc["ok"] else by_doc - else: - given = {i["이름"]: (i.get("고르기") or [""])[0] for i in logic.get("입력") or []} - if takes_machine(logic): - given["기계"] = str(row.get("원문번호")) - sums = mcut.engine( - index, logic["키"], mf.run(index, logic["키"], mf.fill_empty(logic, given)) - ) - hour = {"ok": True, "로직": logic["키"]} - hour |= {k: float(sums[k]) for k in (*cm.mf.COST_ITEMS, "계")} - got = {**head, "값": to_json(row.get("값")), "시간당": hour} + lack = why(row, logic) + hours = {"ok": False, "reason": lack} if lack else hour(row, logic, index) + got = {**head, "값": to_json(row.get("값")), "시간당": hours} _BRIEF[key] = (index, got) out.append(got) return out diff --git a/M02_MasterTemplete/M02_MyMachine.py b/M02_MasterTemplete/M02_MyMachine.py index 7778fc825..33859078c 100644 --- a/M02_MasterTemplete/M02_MyMachine.py +++ b/M02_MasterTemplete/M02_MyMachine.py @@ -254,28 +254,14 @@ def hourly(row: dict, index: Any) -> dict[str, Any]: **sums, "계": sum(sums.values()), } - import master_cut as mcut - - mf = m01.cm.mf key = logic_key(row) if key is None: return {"ok": False, **head, "reason": "식 없음 — 조종원직종 없음"} logic = index.logic(key) - from M02_MasterTemplete import M02_Machine_Hourly as mh # 셈 한 길(842-3) + from M02_MasterTemplete import M02_Machine_Hourly as mh # 셈 한 길(842-3 · 855 2-B2) - if (by_doc := mh.doc_sums(row, logic, index)) is not None: - got = by_doc.get("합") or {"reason": by_doc.get("reason")} - return {"ok": by_doc["ok"], **head, "로직": logic["키"], **got} - given = {i["이름"]: (i.get("고르기") or [""])[0] for i in logic.get("입력") or []} - given["기계"] = str(row.get("원문번호")) - try: - got = mcut.engine( - index, logic["키"], mf.run(index, logic["키"], mf.fill_empty(logic, given)) - ) - except (mf.FormulaError, ArithmeticError, KeyError, TypeError, ValueError) as e: - return {"ok": False, "reason": str(e) or type(e).__name__} - sums = {k: float(got[k]) for k in (*COSTS, "계")} - return {"ok": True, **head, "로직": logic["키"], **sums} + got = mh.hour(row, logic, index) + return {"ok": got["ok"], **head, **got} # ── 검사 ────────────────────────────────────────────────────────────── From d6f35e16a54279689e4a82d1f6697e485a2358f1 Mon Sep 17 00:00:00 2001 From: umsangdon Date: Tue, 17 Nov 2026 17:49:50 +0900 Subject: [PATCH 05/30] =?UTF-8?q?feat(855-F=20B9-1):=20=EB=AC=B8=EC=84=9C?= =?UTF-8?q?=20=EC=85=88=20=EA=B8=B0=EB=A1=9D=20=E2=80=94=20=EC=A4=84?= =?UTF-8?q?=EB=A7=88=EB=8B=A4=20=EB=B6=80=EB=A5=B8=20=EC=9E=90=EC=9B=90=20?= =?UTF-8?q?=ED=82=A4=20=C2=B7=20=ED=95=98=EC=9C=84=20=EB=AC=B8=EC=84=9C(?= =?UTF-8?q?=ED=82=A4=20+=20=EC=9E=85=EB=A0=A5)=20=C2=B7=20=EA=B3=A0?= =?UTF-8?q?=EB=A5=B8=20=ED=92=88=EB=AA=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 새 master_doc_trace.py(서버 단독 · TS 짝 없음) — Links 를 이어받아 마스터 get 을 감싸 연결마다 부른 것을 적음 · 셈 답에 「부름」 · 「자원」 · 줄마다 「부름」 차례 번호 · 기계경비 부름 「기계」 키 - master_doc_calc 훅 두 곳(link · 금액 줄) — links 에 at 이 없으면 안 탐 = 기록 안 켜면 지금 길 그대로 - 재료 찾기 = 고른 품목 하나만(첫 찾기 색인 짓기 때 훑는 후보 읽음은 캐시 따라 들쭉날쭉이라 뺌) - 새 시험 test_855_trace — 로직 1,521 기본 입력: 기록 켜도 셈 답 같음 · 자원 키 = 옛 whole.get 가로채기 키(새 쪽에만 더 있음 10 문서 = 새 계산기는 이름마다 셈 · 까닭 목록) · 하위 부름 = 옛 B09 line_calls(다름 7 = 옛 빈 입력 멈춤) · 고른 품목 = master_pick.priced 품목 - _수식문서_틀.md 파일 목록 한 줄 Co-Authored-By: Claude Opus 5.5 --- resources/master_data/_수식문서_틀.md | 1 + .../master_data/scripts/master_doc_calc.py | 4 + .../master_data/scripts/master_doc_trace.py | 175 ++++++++++++++++++ resources/tester/test_855_trace.py | 170 +++++++++++++++++ 4 files changed, 350 insertions(+) create mode 100644 resources/master_data/scripts/master_doc_trace.py create mode 100644 resources/tester/test_855_trace.py diff --git a/resources/master_data/_수식문서_틀.md b/resources/master_data/_수식문서_틀.md index 4171ac42f..b96b58a6f 100644 --- a/resources/master_data/_수식문서_틀.md +++ b/resources/master_data/_수식문서_틀.md @@ -5,6 +5,7 @@ - 셈 = `scripts/master_doc_calc.py` ↔ `common_util/common_util_formula_doc_calc.ts`(짝) - 풀이 · 글 · 검사 = `scripts/master_doc.py` ↔ `common_util/common_util_formula_doc.ts`(짝) - 표 찾기 · M01 연결 풀이 = `scripts/master_doc_link.py` ↔ `common_util/common_util_formula_doc_table.ts`(표 찾기 짝) +- 셈 기록(줄마다 부른 자원 · 하위 문서 · 고른 품목 · 서버 단독) = `scripts/master_doc_trace.py`(B08 · B09 가 답을 갈라 합산) - 옛 로직 변환 = `scripts/master_doc_convert.py` · 빌더 `scripts/build_수식문서_802_2.py`(`--check`) - 거울 · 꼴 시험 = `resources/tester/test_802_1_formula_doc.py` · 변환 대조 = `test_802_2_convert.py` diff --git a/resources/master_data/scripts/master_doc_calc.py b/resources/master_data/scripts/master_doc_calc.py index 0f6f5be68..07de3aee1 100644 --- a/resources/master_data/scripts/master_doc_calc.py +++ b/resources/master_data/scripts/master_doc_calc.py @@ -275,6 +275,8 @@ class _Run: for k in ("칸", "단위"): if link.get(k): payload[k] = link[k] + if hasattr(self.links, "at"): # 855-F 셈 기록(`master_doc_trace`) — 기록 안 켬 = 안 탐 + self.links.at(self.stack, name, kind, payload) try: if kind == "요소": return number(self.links.element(payload)) @@ -407,6 +409,8 @@ def _money(run: _Run, doc: dict, rules: dict): for i, line in enumerate(lines): scope = _scope(doc, outs, dict(running), cover, syms) where = str(line.get("이름") or f"금액 {i + 1}") + if hasattr(run.links, "at"): # 855-F 셈 기록 — 이 줄 읽음(시간당 작업량) + run.links.at(run.stack, i, "금액", {}) swapped, more, work = mw.line_work(run, line, scope) # 846-1 시간당 작업량 text = line.get("수량") if swapped is None else swapped qty = ( diff --git a/resources/master_data/scripts/master_doc_trace.py b/resources/master_data/scripts/master_doc_trace.py new file mode 100644 index 000000000..07e0278b1 --- /dev/null +++ b/resources/master_data/scripts/master_doc_trace.py @@ -0,0 +1,175 @@ +# -*- coding: utf-8 -*- +"""수식 문서 셈 기록 — 줄마다 부른 것(PLAN 855-F B9-1 · 설계 855 보충 1-3). + +서버 단독(TS 짝 없음) — B08 · B09 가 문서 셈 답을 갈라 합산할 때 「이 줄이 어느 노임 · 자재 · +기계 · 표 · 하위 단가산출을 불렀나」 를 읽음. 셈은 그대로: `Trace` = `master_doc_link.Links` + +기록 · `master_doc_calc` 의 훅(`links.at`)이 연결마다 알림 — `Links` 에는 `at` 이 없어 기록을 안 +켜면 지금 길 그대로. + +`calc(doc, Trace(master, docs), given)` → 셈 답 + +- `부름` = 연결 부른 차례 [{문서, 깊이, 이름, 갈래(요소 · 표 · 단가산출), 부름(넘긴 꼴 — 키 · 표 · + 조건 · 입력 · 재료 …), 자원[{키, 갈래(인력 · 재료 · 기계 · 표)}], 품목?(고른 재료 키) · + 기계?(기계경비 부름 = 결과단위 원/시간 돈 문서의 기계 키)}] — + 하위 문서 안 부름도 깊이를 달고 같이(같은 하위 · 같은 입력 두 번째는 셈 답을 다시 씀 = 안 적음) +- `줄[i].부름` = 그 금액 줄 식(수량 · 단가 · 비목곱)이 닿는 이름의 맨 위 부름 차례 번호 + 그 줄 + 셈 중 읽음(갈래 「금액」 · 이름 = 줄 차례 · 시간당 작업량 기계 칸) +- `자원` = 문서 전체(하위 포함) 자원 키 차례 · 겹침 없음(표 빼고 · 단가 책 수요) +""" + +from __future__ import annotations + +import inspect +import re +import types +from itertools import takewhile + +import master_doc as md +import master_doc_calc as mc +import master_doc_link as ml + +CAT = {"LB": "인력", "MT": "재료", "MO": "재료", "EQ": "기계"} # `master_equation_view.CAT` 같은 말 +_SLOTS = ("키", "표", "칸", "단위", "재료", "조건", "입력", "지역", "계약종별") + + +class _Seen: + """마스터 감쌈 — `get` 이 돌려준 줄을 알림 · + 마스터 메서드도 이 감쌈에 묶어 안쪽 `self.get` 까지 잡음.""" + + def __init__(self, master, note): + self._m, self._note = master, note + + def get(self, ref): + row = self._m.get(ref) + self._note(row) + return row + + def __setattr__(self, name, value): # 마스터 칸(찾기 색인 `_found` 등)은 마스터에 + if name in ("_m", "_note"): + object.__setattr__(self, name, value) + else: + setattr(self._m, name, value) + + def __getattr__(self, name): + raw = inspect.getattr_static(self._m, name) + if isinstance(raw, types.FunctionType): + return raw.__get__(self) + return getattr(self._m, name) + + +class Trace(ml.Links): + """기록 켠 연결 — `calls` 에 부른 차례대로 쌓임(여러 문서 셈에 다시 써도 됨).""" + + def __init__(self, master, docs: dict[str, dict] | None = None): + super().__init__(_Seen(master, self._note), docs) + self.calls: list[dict] = [] + self._now: dict | None = None + self._last: str | None = None + + def at( + self, stack: tuple, name, kind: str, payload: dict + ) -> None: # 셈 훅(이름 | 금액 줄 차례) + self._now = { + "문서": stack[-1] if stack else "", + "깊이": len(stack), + "이름": name, + "갈래": kind, + "부름": {k: payload[k] for k in _SLOTS if k in payload}, + "자원": [], + } + self.calls.append(self._now) + + def _note(self, row: dict) -> None: + key = self._last = str(row.get("키") or "") + kind = CAT.get(key[:2]) or ("표" if "줄" in row and "조건" in row else None) + if not kind: + return + if self._now is None: # 연결 밖 부름(이름 없는 기계 줄 읽기) — 이름 빈 기록 + self.at((), "", "", {}) + got = self._now["자원"] + if not any(x["키"] == key for x in got): + got.append({"키": key, "갈래": kind}) + + def element(self, p: dict): + if p.get("재료") is None or self._now is None: + return super().element(p) + got, before, self._last = self._now["자원"], len(self._now["자원"]), None + try: + return super().element(p) + finally: # 재료 찾기 = 고른 품목 하나 — 찾을 때 훑은 후보 · 색인 짓기 읽음은 뺌 + del got[before:] + if self._last and CAT.get(self._last[:2]) == "재료": # 마지막 읽음 = 고른 품목 + self._now["품목"] = self._last # (`mp.priced` 출처 · 값 없음 = 그 이름 글 읽음) + if not any(x["키"] == self._last for x in got): + got.append({"키": self._last, "갈래": "재료"}) + + +def _names(text) -> list[str]: + if text in (None, ""): + return [] + try: + return md.names(md.parse(str(text))) + except md.DocError: + return [] + + +def reach(doc: dict, texts: list) -> set[str]: + """식 글들이 닿는 이름 전부 — 식 줄 · 연결 구멍(`{이름}`) · 조건 · 입력 식 · 지역 칸을 + 따라감.""" + vars_ = {md.var_id(v): v for v in doc.get("변수") or []} + lines = {str(x.get("기호") or ""): x for x in doc.get("식") or []} + todo = [n for t in texts for n in _names(t)] + seen: set[str] = set() + while todo: + name = todo.pop() + if name in seen: + continue + seen.add(name) + if name in lines: + todo += _names(lines[name].get("식")) + link = (vars_.get(name) or {}).get("연결") or {} + for k in ("키", "표"): + todo += md.HOLE.findall(str(link.get(k) or "")) + for v in (link.get("재료") or {}).values() if isinstance(link.get("재료"), dict) else (): + todo += md.HOLE.findall(str(v)) + for k in ("조건", "입력"): + for v in (link.get(k) or {}).values() if isinstance(link.get(k), dict) else (): + todo += _names(v) + todo += [str(link[k]) for k in ("지역", "계약종별") if link.get(k)] + return seen + + +def _machines(trace: Trace, calls: list[dict]) -> None: + """기계경비 부름(결과단위 원/시간 돈 문서 · `master_bundle.is_machine` 같은 판별)에 「기계」 = + 그 부름 안에서 처음 읽은 기계 키(옛 `B09 call_of` 의 machine) · 같은 부름 두 번째 = 앞 답.""" + seen: dict[str, str | None] = {} + for i, c in enumerate(calls): + doc = trace.doc(str(c["부름"].get("키"))) if c["갈래"] == "단가산출" else None + unit = re.sub(r"\s", "", str((doc or {}).get("결과단위") or "")) + if not doc or doc.get("결과") or unit != "원/시간": + continue + tag = repr((c["부름"].get("키"), sorted((c["부름"].get("입력") or {}).items()))) + inner = [c, *takewhile(lambda x: x["깊이"] > c["깊이"], calls[i + 1 :])] + got = [x["키"] for one in inner for x in one["자원"] if x["갈래"] == "기계"] + c["기계"] = seen[tag] = got[0] if got else seen.get(tag) + + +def calc(doc: dict, trace: Trace, given: dict | None = None, cover: dict | None = None) -> dict: + """문서 셈(`master_doc_calc.calc` 그대로) + 기록 — 모듈 머리 꼴.""" + start = len(trace.calls) + trace._now = None + got = mc.calc(doc, trace, given, cover=cover) + calls = [c for c in trace.calls[start:] if c["갈래"] != "금액" or c["자원"]] # 빈 줄 읽음 뺌 + top = 1 if doc.get("키") else 0 + for i, (line, out) in enumerate(zip(doc.get("금액") or [], got.get("줄") or [])): + texts = [line.get("수량"), line.get("단가"), *(line.get(mc.TIMES) or {}).values()] + names = reach(doc, texts) | {i} # 이 줄 읽음(갈래 「금액」 · 이름 = 줄 차례) + out["부름"] = [ + j + for j, c in enumerate(calls) + if c["깊이"] == top and c["이름"] in names and (c["갈래"] == "금액") == (c["이름"] == i) + ] + _machines(trace, calls) + keys: list[str] = [] + for c in calls: + keys += [x["키"] for x in c["자원"] if x["갈래"] != "표" and x["키"] not in keys] + return {**got, "부름": calls, "자원": keys} diff --git a/resources/tester/test_855_trace.py b/resources/tester/test_855_trace.py new file mode 100644 index 000000000..1be8cbb9e --- /dev/null +++ b/resources/tester/test_855_trace.py @@ -0,0 +1,170 @@ +"""855-F B9-1 지킴 — 문서 셈 기록(`master_doc_trace`) · 로직 전수 기본 입력. + +- 기록을 켜도 셈 답 같음(줄 `부름` · 답 `부름` `자원` 칸만 더해짐). +- 자원 키 = 옛 엔진 셈 중 `whole.get` 가로채기 키(B09 `hand_resource_keys` 방식 · + 찾기 색인 데운 뒤) — 다름 = `MORE` 뿐(새 계산기는 이름마다 셈 — 옛은 안 고른 「만약」 갈래 · + 빈 수량 줄 · 앞서 멈춘 줄을 안 읽음 · 새 쪽에만 더 있음). +- 하위 부름 = 옛 `B09 line_calls`(돈 문서 {code, given} · 기계경비 {machine}) — 다름 = 옛이 입력 + 기본값을 못 세 빈 답인 문서뿐 · 새 쪽 결과 문서 부름(작업량 등 중간 값)은 하위 산근 아님. +- 고른 품목 = `master_pick.priced` 의 품목 키 · 줄 `부름` = 그 줄 자원. +- 옛 엔진을 지우는 걸음(2-E4)에서 옛 대조(자원 · 하위)는 은퇴. +""" + +from __future__ import annotations + +import importlib +import json +from functools import lru_cache + +import helper_855_engine as h + +mt = importlib.import_module("master_doc_trace") +mp = importlib.import_module("master_pick") +mm = importlib.import_module("master_material") + +MORE = { # 새 쪽에만 더 있는 자원 키 — 까닭 + "GC001200": "옛 엔진이 빈 입력에서 멈춤 · 새는 전력 재료 이름도 셈", + "GC001201": "옛 엔진이 빈 입력에서 멈춤 · 새는 전력 재료 이름도 셈", + "GF000312": "「만약(기종 …)」 안 고른 갈래 기계도 이름으로 셈", + "GF000313": "「만약(기종 …)」 안 고른 갈래 기계도 이름으로 셈", + "GF000320": "「만약(기종 …)」 안 고른 갈래 기계도 이름으로 셈", + "GF000192": "옛은 수량 빈 줄의 재료 단가를 안 읽음", + "GF000200": "옛은 수량 빈 줄의 재료 단가를 안 읽음", + "GF000203": "옛은 수량 빈 줄의 재료 단가를 안 읽음", + "GF000209": "옛은 수량 빈 줄의 재료 단가를 안 읽음", +} + + +def sg(): + from B09_Estimation import B09_Estimation_Sangeun as mod + + return mod + + +def mc_calc(doc: dict, links) -> dict: + return importlib.import_module("master_doc_calc").calc(doc, links) + + +def _old_keys(whole, row: dict, given: dict) -> set[str]: + seen: set[str] = set() + base = whole.get + + def get(ref): + got = base(ref) + key = str(got.get("키") or "") + if key[:2] in mt.CAT: + seen.add(key) + return got + + whole.get = get + try: + h.old_run(row, given) + finally: + del whole.get + return seen + + +def _strip(got: dict) -> dict: + out = {k: v for k, v in got.items() if k not in ("부름", "자원")} + if "줄" in out: + out["줄"] = [{k: v for k, v in ln.items() if k != "부름"} for ln in out["줄"]] + return out + + +def _calls(old: dict, new: dict, docs: dict) -> tuple[set, set]: + a = {json.dumps(v, ensure_ascii=False, sort_keys=True, default=str) for v in old.values()} + b = set() + for c in new["부름"]: + if c["깊이"] != 1 or c["갈래"] != "단가산출": + continue + if (docs.get(str(c["부름"].get("키"))) or {}).get("결과"): + continue # 결과 문서 = 중간 값 + one = ( + {"machine": c["기계"]} + if "기계" in c + else {"code": c["부름"]["키"], "given": sg()._clean_given(c["부름"].get("입력"))} + ) + b.add(json.dumps(one, ensure_ascii=False, sort_keys=True, default=str)) + return a, b + + +@lru_cache(maxsize=1) +def survey() -> dict: + rows, whole, docs, links = h.world() + rows = [r for r in rows if str(r["키"]) in docs] + for row in rows: # 재료 찾기 색인 데움(첫 찾기 때 훑은 후보 읽음 빼려고) + h.old_run(row, h.cases(row, False)[0][1]) + trace = mt.Trace(whole, docs) + out = {"답 다름": [], "자원": {}, "하위": {}, "품목": [], "줄": [], "옛 빈 답": set()} + for row in rows: + key = str(row["키"]) + doc, given = docs[key], h.cases(row, False)[0][1] + old = _old_keys(whole, row, given) + got = mt.calc(doc, trace) + if _strip(got) != mc_calc(doc, links): + out["답 다름"].append(key) + new = set(got["자원"]) + if old != new: + out["자원"][key] = (sorted(old - new), sorted(new - old)) + lines = sg().line_calls(whole, key, given) + a, b = _calls(lines, got, docs) + if a != b: + out["하위"][key] = (sorted(a), sorted(b)) + if not lines: + try: + sg()._env(whole, row, sg()._clean_given(given)) + except Exception: + out["옛 빈 답"].add(key) + for c in got["부름"]: + p = c["부름"] + if c["깊이"] == 1 and "품목" in c and p.get("재료") is not None: + env = {mm.REGION: p["지역"]} if p.get("지역") is not None else {} + if p.get("계약종별") is not None: + env[mm.TARIFF] = p["계약종별"] + want = mp.priced(whole, {"단위": p.get("단위")}, p["재료"], env, None)[3] + if want.get("품목") and want["품목"]["키"] != c["품목"]: + out["품목"].append((key, c["이름"], want["품목"]["키"], c["품목"])) + for ln in got.get("줄") or []: + for i in ln["부름"]: + if not (0 <= i < len(got["부름"])) or got["부름"][i]["깊이"] != 1: + out["줄"].append((key, ln["이름"], i)) + return out + + +def test_기록_켜도_셈_답_같음(): + assert survey()["답 다름"] == [] + + +def test_자원_키_옛_가로채기와_같음_다름은_까닭_목록뿐(): + got = survey()["자원"] + assert all(not old for old, _ in got.values()), {k: v for k, v in got.items() if v[0]} + assert sorted(got) == sorted(MORE), sorted(got) + + +def test_하위_부름_옛_call_of_와_같음_다름은_옛_빈_답뿐(): + s = survey() + assert set(s["하위"]) == s["옛 빈 답"], { + k: s["하위"][k] for k in set(s["하위"]) - s["옛 빈 답"] + } + assert all(not old for old, _ in s["하위"].values()) + + +def test_고른_품목_줄_부름(): + s = survey() + assert s["품목"] == [] + assert s["줄"] == [] + + +def test_기계경비_부름_기계_키_줄마다_부름(): + _, whole, docs, _ = h.world() + got = mt.calc( + docs["GC000337"], mt.Trace(whole, docs) + ) # 낙석방지망 — 인력 둘 · 크레인 · 재료 셋 + lines = {ln["이름"]: [got["부름"][i] for i in ln["부름"]] for ln in got["줄"]} + crane = [c for c in lines["크레인"] if c["갈래"] == "단가산출"] + assert [c["부름"]["키"] for c in crane] == ["GC000268"] and crane[0]["기계"][:2] == "EQ" + assert {x["키"][:2] for c in lines["특별인부"] for x in c["자원"]} == {"LB", "QC"} + assert [c["품목"] for c in lines["에폭시"] if "품목" in c] == [got["자원"][-1]] + assert set(got["자원"]) >= { + x["키"] for c in got["부름"] for x in c["자원"] if x["갈래"] != "표" + } From c42d66ad68f77aba6ffe446f60def4fc72cb4c4d Mon Sep 17 00:00:00 2001 From: umsangdon Date: Tue, 17 Nov 2026 17:59:31 +0900 Subject: [PATCH 06/30] =?UTF-8?q?feat(855-C):=202-C4=20=EA=B8=B0=EC=A4=80?= =?UTF-8?q?=20=EB=AA=A9=EB=A1=9D=20=C2=B7=20=EA=B3=84=EC=82=B0=EC=84=9C?= =?UTF-8?q?=EB=A5=BC=20=EC=88=98=EC=8B=9D=20=EB=AC=B8=EC=84=9C=20=EC=85=88?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C=20=C2=B7=20=EC=84=9C=EB=B2=84=20=EC=82=B0?= =?UTF-8?q?=EC=B6=9C=EA=B7=BC=EA=B1=B0=20=EA=B8=80=20=EB=AA=A8=EB=93=88=20?= =?UTF-8?q?=EC=83=88=EB=A1=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 새 `master_doc_text.py` — 문서 셈 답 → 산출근거 글(금액 줄 · 묶음 줄 · 계 줄 · 계산서 묶음) · 화면 짝(line_stack_out · eqText · unitText · moneyUnits · offLine) 규칙을 옮김 · 거울 시험 `test_855_c4_doc_text`(+ helper .cjs) - `M02_Logic_Standard` — 기준 목록 축 = 문서 선택 변수 · 표 조건 입력 변수 · 바탕 = 문서 기본값 · 금액 = 문서 셈 · 계산서 = 문서 셈 + 새 글 · 파생 저장본 열쇠에 수식 문서 지문(SHAPE 4) · 답 꼴 그대로(화면 안 고침) · `M02_Logic_Settle` 은 B09 짝이라 남김 - 전수(1,521 기초 · 옛 줄 11,267): 같은 입력이면 금액 같음 11,165 · 다름 101 = 옛 목록만의 B09 산근 끝수(settle) — 새 값 = 옛 엔진 값 = M02 단가산출 값 · 옛 엔진 멈춤 1(새 0 원 줄은 목록에서 빠짐) - 바탕 = 문서 기본값(옛 = master_auto 자동값) — 114 기초의 바탕 줄 규격이 바뀜(시험입력 · 기본 칸을 담은 문서 기본값) - 시험 고침: test_704_logic_standard(옛 엔진 끝수 차 3 원 허용 → 수식 탭 셈과 같음) · test_704_settle(축 · 금액 인자가 문서) · test_714_1 의 「M01 /text 와 M02 계산서가 같은 줄 꼴」 시험 지움(M02 계산서가 옛 덧칸 길을 안 탐 — 까닭: 855-C 새 길) Co-Authored-By: Claude Opus 5.5 --- M02_MasterTemplete/M02_Logic_Standard.py | 164 +++++---- .../master_data/scripts/master_doc_text.py | 327 ++++++++++++++++++ resources/tester/helper_855_c4_doc_text.cjs | 71 ++++ resources/tester/test_704_logic_standard.py | 16 +- resources/tester/test_704_settle.py | 8 +- resources/tester/test_714_1_sheet_line.py | 18 +- resources/tester/test_855_c4_doc_text.py | 155 +++++++++ 7 files changed, 672 insertions(+), 87 deletions(-) create mode 100644 resources/master_data/scripts/master_doc_text.py create mode 100644 resources/tester/helper_855_c4_doc_text.cjs create mode 100644 resources/tester/test_855_c4_doc_text.py diff --git a/M02_MasterTemplete/M02_Logic_Standard.py b/M02_MasterTemplete/M02_Logic_Standard.py index 71f78dc4a..953cd8ba7 100644 --- a/M02_MasterTemplete/M02_Logic_Standard.py +++ b/M02_MasterTemplete/M02_Logic_Standard.py @@ -1,17 +1,20 @@ -"""M02 기준 목록 · 계산서 보기(PLAN 704-1 · 704-2 · 요구서 4장 8) — 로직 고르기 창이 읽음. +"""M02 기준 목록 · 계산서 보기(PLAN 704-1 · 704-2 · 855-C 2-C4 · 요구서 4장 8) — 로직 고르기 창. -기준 목록 = 단가산출 로직 하나를 대표 규격으로 펼친 줄(품명 · 규격 · 단위 · 금액 · 출처 · 공종). -대표 규격 = 고르기 입력 값 전부 · 표 찾기 조건으로 쓰이는 수 입력은 그 표 줄마다 값 하나(범위 줄은 -위 끝) · 그 밖 연속 값 입력은 견본 자동값(`master_auto.values`) 한 줄 · 지역 = 자동값(전국평균). -펼침 = 바탕(자동값 · 규격 축은 첫 대표 값) 한 줄 + 규격 축마다 값 하나씩 바꾼 줄(곱하지 않음 · +기준 목록 = 단가산출 기초 하나를 대표 규격으로 펼친 줄(품명 · 규격 · 단위 · 금액 · 출처 · 공종). +대표 규격 = 수식 문서 선택 변수(`선택 목록`) 값 전부 · 표 조건으로 바로 쓰이는 입력 변수는 +그 표 줄마다 값 하나(범위 줄은 위 끝) · 지역 = 문서 기본값(전국평균) 한 벌 · +바탕 = 문서 변수 기본값(`연결.값`). +펼침 = 바탕(규격 축은 첫 대표 값) 한 줄 + 규격 축마다 값 하나씩 바꾼 줄(곱하지 않음 · 바꾼 줄이 0 원이면 표에 없는 조합으로 보고 뺌). -금액 = M01 엔진 식 + B09 산근 끝수(줄마다 버림 · `M02_Logic_Settle` · 근거 지식DB -`technical_info/01_임도/05_원가정보/단수처리_규칙.md`) · 최신 판 노임(마스터 판). -목록은 서버가 뒤에서 한 번 셈(프로세스 `WORKERS` 개 · 수 분) → 프로세스 메모리 + 파생 저장본 -(storage `_derived/m02_logic_standard/`) · 열쇠 = 마스터 내용 지문 + `SHAPE` · 같으면 안 셈 · +금액 · 계산서 = 수식 문서 셈(`master_doc_calc` · M02 단가산출과 같은 계산기 · 끝수 = 문서 끝수) · +계산서 줄 글 = `master_doc_text`(줄 쌓기 산출근거와 같은 글 규칙) · 최신 판 노임(마스터 판). +(855-C 전 옛 길 = 옛 엔진 + B09 산근 끝수 `M02_Logic_Settle` — 그 파일은 B09 짝이라 남음.) +목록은 서버가 뒤에서 한 번 셈(프로세스 `WORKERS` 개) → 프로세스 메모리 + 파생 저장본 +(storage `_derived/m02_logic_standard/`) · 열쇠 = 마스터 · 수식 문서 내용 지문 + `SHAPE` · +같으면 안 셈 · 셈 도중 목록 = 빈 줄 `준비: false`(화면은 로직 줄 그대로 · 금액 빈칸). 실무 낱말(`WORDS`) = 별칭 칸에 덧붙여 찾기(공용 `matchLogic`)가 「석축」 → 돌쌓기를 찾음. -계산서 = `master_text.lines`(줄 「석공 | 268,908 * 0.1 = 26,891」 · 비목 소계 · 계) + 같은 끝수 값. +이름표(이름 · 구분 · 출처 · 별칭)는 아직 로직 줄에서 읽음(855 보충 L2 몫). M01 은 읽기만 · 권한은 부르는 쪽 몫(로그인). """ @@ -26,15 +29,18 @@ from decimal import Decimal from typing import Any from common_util.common_util_derived_store import derived_key, read_derived, write_derived +from M01_MasterData import M01_MasterData_Doc as m01_doc from M01_MasterData import M01_MasterData_Store as m01 from M02_MasterTemplete import M02_Labor_Inputs as labor_inputs -from M02_MasterTemplete import M02_Logic_Settle as settle from M02_MasterTemplete import M02_Template_Layers as layers mf = m01.cm.mf -import master_sheet_line as msl # noqa: E402 — 계산서 줄 덧칸(714-1) · scripts 길은 `m01` 이 둠 +import master_doc as md # noqa: E402 — scripts 길은 `m01` 이 둠 +import master_doc_calc as mc # noqa: E402 +import master_doc_link as ml # noqa: E402 +import master_doc_text as mdt # noqa: E402 — 계산서 줄 글(줄 쌓기 산출근거와 같은 규칙) -SHAPE = 3 # 줄 꼴이 바뀌면 올림 — 옛 저장본을 안 씀 +SHAPE = 4 # 줄 꼴 · 셈이 바뀌면 올림 — 옛 저장본을 안 씀(4 = 855-C 문서 셈) KIND = "m02_logic_standard" REGION = "지역" # 지역 = 자동값 한 벌(정함 8) QUIET = ("해당 없음", "없음") # 규격 글에서 뺄 값 @@ -95,7 +101,7 @@ def words_of(row: dict) -> list[str]: def _range_label(table: dict, low: Any, high: Any, unit: str) -> str: - f = m01.mtx.fmt + f = mdt.eq_text if low is None: return f"{f(high)}{unit} 이하" if high is None: @@ -118,29 +124,52 @@ def _table_reps(whole: Any, ref: str, cond: str, unit: str) -> list[tuple[Any, s continue if not ranged: if isinstance(have, Decimal): - out.setdefault(have, f"{m01.mtx.fmt(have)}{unit}") + out.setdefault(have, f"{mdt.eq_text(have)}{unit}") continue low, high = have tries = [v for v in (high, low, (low or 0) + 1) if isinstance(v, Decimal)] - got = next((v for v in tries if m01.cm.mf._match(table, r, cond, v)), None) + got = next((v for v in tries if ml._match(table, r, cond, v)), None) if got is not None: out.setdefault(got, _range_label(table, low, high, unit)) return sorted(out.items()) -def axes(whole: Any, logic: dict) -> tuple[dict, list[tuple[str, list[tuple[Any, str]]]]]: - """(바탕 입력, [(입력 이름, [(값, 글) …]) …]) — 규격 축 = 지역 뺀 고르기 · 표 찾기 수 입력.""" - base = m01.mau.values(whole, logic) - finds, _ = m01.mau._uses(logic) +def _default(var: dict) -> Any: + """문서 변수 기본값(`연결.값`) — 수 글은 수로.""" + value = (var.get("연결") or {}).get("값") + if isinstance(value, str) and value.strip(): + num = mdt._dec(value) + return value if num is None else num + return value + + +def axes(whole: Any, doc: dict) -> tuple[dict, list[tuple[str, list[tuple[Any, str]]]]]: + """(바탕 입력, [(변수 열쇠, [(값, 글) …]) …]) — 규격 축 = 지역 뺀 선택 변수(`선택 목록`) · + 표 조건으로 바로 쓰이는 입력 변수(그 표 줄마다 값 하나) · 바탕 = 문서 기본값.""" + found = [ + v for v in doc.get("변수") or [] if (v.get("연결") or {}).get("갈래") in ("선택", "입력") + ] + base = {str(v["열쇠"]): _default(v) for v in found} + ids = {md.var_id(v): str(v["열쇠"]) for v in found} + finds: dict[str, list[tuple[str, str]]] = {} + for v in doc.get("변수") or []: + link = v.get("연결") or {} + if link.get("갈래") != "표": + continue + for cond, expr in (link.get("조건") or {}).items(): + node = mdt.node_of(expr) + if node and node[0] == "var" and node[1] in ids: + finds.setdefault(ids[node[1]], []).append((str(link.get("표")), cond)) out = [] - for spec in logic.get("입력") or []: - name = spec["이름"] + for var in found: + name, link = str(var["열쇠"]), var["연결"] if name == REGION: continue - unit = str(spec.get("단위") or "") - if spec.get("고르기"): + unit = str(var.get("단위") or "") + if link["갈래"] == "선택": + spec = {"이름": name, "고르기": link.get("목록") or []} labels = labor_inputs._labels(whole, spec) - reps = [(v, str(labels.get(v, m01.mtx.fmt(v) if isinstance(v, Decimal) else v))) + reps = [(v, str(labels.get(v, mdt.eq_text(v) if isinstance(v, Decimal) else v))) for v in spec["고르기"]] # fmt: skip elif name in finds: seen: dict[Any, str] = {} @@ -172,18 +201,34 @@ def _unit(logic: dict) -> str: return unit[2:] if unit.startswith("원/") else ("" if unit == "원" else unit) -def _money(whole: Any, logic: dict, given: dict) -> Decimal | None: - if not str(logic.get("결과단위") or "").startswith("원"): - return None +def _links(whole: Any) -> Any: + return ml.Links(whole, m01_doc.docs()) + + +def _calc(doc: dict, links: Any, given: dict) -> dict | None: try: - got = settle.settle(whole, str(logic["키"]), m01.cm.mf.fill_empty(logic, given)) - except (m01.cm.mf.FormulaError, ArithmeticError, KeyError, TypeError, ValueError): + got = mc.calc(doc, links, given) + except Exception: # noqa: BLE001 — 계산기는 예외 없음이 원칙 · 혹시 = 못 셈 return None - return got.get("계", got.get("결과")) + return got if got.get("셈됨") else None -def _rows_of(whole: Any, logic: dict, blocked: bool) -> list[dict]: - base, ax = axes(whole, logic) +def _money(doc: dict, links: Any, given: dict) -> Decimal | None: + """돈 기초(결과단위 「원…」)의 계(돈 아닌 결과 문서 = 결과) — 못 셈 = None.""" + if not str(doc.get("결과단위") or "").startswith("원"): + return None + got = _calc(doc, links, given) + if got is None: + return None + return got.get("계") if got.get("계") is not None else got.get("결과") + + +def _rows_of(whole: Any, logic: dict, blocked: bool, links: Any = None) -> list[dict]: + doc = m01_doc.docs().get(str(logic.get("키"))) + if doc is None: + return [] + links = links or _links(whole) + base, ax = axes(whole, doc) changes: list[dict] = [{}] for name, reps in ax: changes += [{name: v} for v, _ in reps if v != base.get(name)] @@ -201,7 +246,7 @@ def _rows_of(whole: Any, logic: dict, blocked: bool) -> list[dict]: out = [] for change in changes: given = {**base, **change} - money = _money(whole, logic, given) + money = _money(doc, links, given) if change and money == 0: # 표에 없는 규격 조합(견치돌 · 뒷길이 25 따위) — 0 원 줄은 뺌 continue out.append( @@ -231,15 +276,19 @@ def _stamp() -> str: if not name.startswith("_"): sha.update(name.encode()) sha.update(hashlib.sha1(m01.cm.mmf.raw(m01.FOLDER, name)).digest()) + for path in sorted(m01_doc.folder().glob("수식_*.json")): # 수식 문서(855-C · 셈 정본) + sha.update(path.name.encode()) + sha.update(hashlib.sha1(path.read_bytes()).digest()) return sha.hexdigest() def _chunk(keys: list[str], blocked: set[str]) -> list[dict]: """일꾼 프로세스 몫 — 로직 키들의 줄(마스터는 그 프로세스가 읽음).""" whole = m01.loaded()[1] + links = _links(whole) out = [] for key in keys: - out += _rows_of(whole, whole.logic(key), key in blocked) + out += _rows_of(whole, whole.logic(key), key in blocked, links) return out @@ -268,23 +317,25 @@ def _make(files: dict, whole: Any, key: str) -> None: value = build(files, WORKERS) write_derived(layers.storage_root(), KIND, key, value) with _LOCK: - if _MEMO.get("whole") is whole: + if _MEMO.get("key") == key: _MEMO.update(value=value) except Exception as e: # noqa: BLE001 — 다음 요청이 다시 셈 print(f"[M02 기준 목록] 셈 실패: {e}", file=sys.stderr) finally: with _LOCK: - if _MEMO.get("whole") is whole: + if _MEMO.get("key") == key: _MEMO["job"] = None def listing() -> dict: """기준 목록 `{판, 공종, 줄, 준비}` — 메모리 → 파생 저장본 → 뒤에서 셈(그동안 빈 줄).""" files, whole = m01.loaded() + docs = m01_doc.docs() # 수식 문서를 고치면 새 묶음(같은 내용이면 같은 묶음) with _LOCK: - if _MEMO.get("whole") is not whole: + if _MEMO.get("whole") is not whole or _MEMO.get("docs") is not docs: _MEMO.clear() - _MEMO.update(whole=whole, key=derived_key(KIND, SHAPE, _stamp()), value=None, job=None) + key = derived_key(KIND, SHAPE, _stamp()) + _MEMO.update(whole=whole, docs=docs, key=key, value=None, job=None) if _MEMO["value"] is None and _MEMO["job"] is None: got = read_derived(layers.storage_root(), KIND, _MEMO["key"]) if got: @@ -312,8 +363,8 @@ def _quiet(fn) -> None: print(f"[M02 기준 목록] 데움 실패: {e}", file=sys.stderr) -def _given(whole: Any, logic: dict, change: dict) -> tuple[dict, list]: - base, ax = axes(whole, logic) +def _given(whole: Any, doc: dict, change: dict) -> tuple[dict, list]: + base, ax = axes(whole, doc) known = {name: dict(reps) for name, reps in ax} for name, value in (change or {}).items(): if name not in known: @@ -326,28 +377,19 @@ def _given(whole: Any, logic: dict, change: dict) -> tuple[dict, list]: def sheet(key: str, change: dict) -> dict: - """계산서 한 장 — 머리(품명 · 규격 · 단위 · 출처 · 판) + 비목 묶음 줄 · 소계 · 계(엔진 값).""" + """계산서 한 장 — 머리(품명 · 규격 · 단위 · 출처 · 판) + 비목 묶음 줄 · 소계 · 계(문서 셈).""" files, whole = m01.loaded() + doc = m01_doc.docs().get(key) try: logic = whole.logic(key) except m01.cm.mf.FormulaError as e: raise m01.StoreError(404, str(e)) from e - given, ax = _given(whole, logic, change) - filled = m01.cm.mf.fill_empty(logic, given) - got = msl.annotate(files, key, filled, m01.mtx.lines(files, key, filled)) # 줄 덧칸(714-1) - done = settle.settle(whole, key, filled) - if "결과" not in done: # 돈 로직 — 줄마다 버림(B09 산근 규칙) - settle.apply(got.get("groups") or [], m01.cm.mf.run(whole, key, filled), done) - got["계"] = done["계"] - groups = [ - { - "비목": g["비목"], - "소계": g.get("소계"), - "끝수": g.get("끝수") or "", - "줄": [{k: line.get(k) for k in ("이름", "글", "금액", *msl.KEYS)} for line in g["줄"]], - } - for g in got.get("groups") or [] - ] + if doc is None: + raise m01.StoreError(404, f"수식 문서 없음 「{key}」") + given, ax = _given(whole, doc, change) + links = _links(whole) + got = _calc(doc, links, given) or {} + money = str(doc.get("결과단위") or "").startswith("원") and "결과" not in doc return labor_inputs._num( { "키": key, @@ -357,8 +399,8 @@ def sheet(key: str, change: dict) -> dict: "출처": labor_inputs.sources(logic) or "", "판": edition(files), "입력": given, - "묶음": groups, - "계": got.get("계"), - "기준단위": got.get("기준단위"), + "묶음": mdt.sheet_groups(doc, got, links) if got and money else [], + "계": got.get("계") if money else got.get("결과"), + "기준단위": _unit(logic) or None, } ) diff --git a/resources/master_data/scripts/master_doc_text.py b/resources/master_data/scripts/master_doc_text.py new file mode 100644 index 000000000..9e1696287 --- /dev/null +++ b/resources/master_data/scripts/master_doc_text.py @@ -0,0 +1,327 @@ +# -*- coding: utf-8 -*- +"""단가산출 수식 문서 셈 답 → 산출근거 글(PLAN 855-C 2-C4 · 서버 풀이 글) — 셈 안 함(답만 읽음). + +쓰는 곳 = M02 기준 목록 계산서(`M02_Logic_Standard.sheet`) · (뒤에) B09 산출근거(855 보충 B9-4). +⚠ 짝(글 규칙) — 한쪽을 고치면 다른 쪽도 · 거울 시험 `resources/tester/test_855_c4_doc_text.py`: + `A00_Common/line_stack_out.ts`(금액 줄 · 계 줄 꼴 · 수 꼴 `one` · `won` · 비목 이름) · + `ui_template/ui_template_equation.ts`(`eqText`) · + `common_util/common_util_line_stack_unit.ts`(`unitText` · `isAtom` · `moneyUnits`) · + `common_util/common_util_formula_doc_view.ts`(`offLine` — 선택으로 꺼진 줄). +금액 줄 = 「이름 : 단가 원/단위 × 수량 단위 = 금액 원」 · 묶음 줄 = 비목마다 「노무비 : …」 · + 계 = 「노무비 : 줄 + 줄 = 금액 원」 · 「합계 : 금액 원」. +수 꼴 = 화면과 같음 — 단가 · 수량 = `eqText`(소수 여섯 자리까지 · 셈 값 그대로) · + 줄 금액 = 소수 한 자리 · 비목 · 합계 = 원(셈 답의 끝수 그대로 · 여기서 자르지 않음). +옮기지 않은 것(화면만) — 식 조판(KaTeX · 수량 식은 값 하나로) · 공식 줄 · 펼침 · + 작업량 줄(846-2) · 굳은 기계 이름(847-1) · 비목곱 인수 글(848-7 · 금액은 답 그대로) · + 계 덧셈 항 = 줄 금액(화면은 묶음 줄 있는 항목 · 항이 넷 넘으면 항목 소계 — 여기는 금액만). +""" + +from __future__ import annotations + +import re +from decimal import ROUND_FLOOR, ROUND_HALF_UP, Decimal, InvalidOperation + +import master_doc as md +import master_doc_calc as mc + +COSTS = md.COSTS # 노무비 · 재료비 · 경비 +COST_SHOW = {"노무비": "노무비", "재료비": "재료비", "경비": "경 비"} +AMOUNT_UNIT = "원" +LONG_SUM = 4 +_HIDE = ("반올림", "올림", "버림") +_SAME = (("일", "인"), ("㎏", "kg"), ("ℓ", "L")) + + +# ── 수 꼴 ───────────────────────────────────────────────────────────── +def _dec(v) -> Decimal | None: + if isinstance(v, bool) or v is None: + return None + try: + d = Decimal(str(v)) if not isinstance(v, Decimal) else v + except InvalidOperation: + return None + return d if d.is_finite() else None + + +def _group(d: Decimal, places: int, keep: bool) -> str: + q = d.quantize(Decimal(1).scaleb(-places), ROUND_HALF_UP) + sign = "-" if q.is_signed() else "" # Intl 과 같음 — 0 으로 반올림된 음수 = 「-0」 + whole, _, frac = f"{abs(q):f}".partition(".") + frac = frac if keep else frac.rstrip("0") + head = f"{int(whole):,}" + return f"{sign}{head}.{frac}" if frac else f"{sign}{head}" + + +def eq_text(v) -> str: + """`eqText` — 수 = 천 단위 쉼표 · 소수 여섯 자리까지(반올림 · 끝 0 뗌) · 그 밖 = 글 그대로.""" + if v is None or v == "": + return "" + if isinstance(v, bool): + return "true" if v else "false" + d = _dec(v) + if d is None or (isinstance(v, str) and not v.strip()): + return str(v) + return _group(d, 6, False) + + +def one(v) -> str: + """줄 금액 — 소수 한 자리 꼭(「26,890.8」 · 「0.0」).""" + return _group(_dec(v) or Decimal(0), 1, True) + + +def won(v) -> str: + """비목 · 합계 — 원(JS `Math.round` = 0.5 올림).""" + d = _dec(v) or Decimal(0) + r = (d + Decimal("0.5")).to_integral_value(ROUND_FLOOR) + return eq_text(Decimal("-0") if r == 0 and d.is_signed() else r) # JS Math.round(-0.4) = -0 + + +# ── 단위 ───────────────────────────────────────────────────────────── +def unit_text(u) -> str: + """자료 단위 글 → 화면 단위(메타 단위 = 빈 글).""" + s = str(u if u is not None else "").strip() + if not s or re.search(r"따름|원문 단위 없음", s) or re.match(r"^수(\(| 또는|$)", s): + return "" + s = re.sub(r"^%\(.*\)$", "%", s) + return s.replace("10^-7", "10⁻⁷").replace("kWh", "㎾h") + + +def _same(a: str, b: str) -> bool: + return a == b or any((a == x and b == y) or (a == y and b == x) for x, y in _SAME) + + +def is_atom(n) -> bool: + """한 덩이(기호 · 수 · 칸 · 글 — 반올림 · 올림 · 버림 감싸개 안 한 덩이 포함).""" + if not n: + return False + if n[0] == "call" and n[1] in _HIDE and 1 <= len(n[2]) <= 2: + return is_atom(n[2][0]) + return n[0] in ("var", "num", "field", "str") + + +def node_of(text): + if text is None or str(text).strip() == "": + return None + try: + return md.parse(text) + except md.DocError: + return None + + +def money_units( + line: dict, price, qty, price_var: dict | None = None, sub: dict | None = None +) -> dict: + """금액 줄 단위 자리 `{price, qty, wrap}` — 수량이 식이면 괄호 · + 단가 분모가 수량 단위와 같은 뜻이면 수량 단위 글.""" + has = line.get("수량") not in (None, "") + q = unit_text(line.get("단위")) if has else "" + wrap = bool(q) and bool(qty) and not is_atom(qty) + own = next( + ( + u + for u in ( + unit_text((sub or {}).get("결과단위")), + unit_text((price_var or {}).get("단위")), + ) + if u.startswith("원") + ), # fmt: skip + None, + ) + mine = f"{AMOUNT_UNIT}/{q}" if own and q and _same(own[2:], q) else own + fallback = f"{AMOUNT_UNIT}/{q}" if q else "" + price_unit = (mine if mine is not None else fallback) if has and is_atom(price) else "" + return {"price": price_unit, "qty": q, "wrap": wrap} + + +def price_sym(line: dict) -> str | None: + n = node_of(line.get("단가")) + if not n: + return None + if n[0] == "var": + return n[1] + if n[0] == "field" and n[1][0] == "var": + return n[1][1] + return None + + +def line_name(line: dict) -> str: + """이름에 규격이 들면 한 번만(814-1).""" + name, spec = str(line.get("이름") or ""), line.get("규격") + return f"{name} {spec}".strip() if spec and spec not in name else name + + +# ── 선택으로 꺼진 줄(`offLine`) ─────────────────────────────────────── +class _Look: + """셈 답 값으로 조건만 읽음 — 계산기 한 벌(`master_doc_calc._Run.ev`) · 값은 답에서 채움.""" + + def __init__(self, doc: dict, answer: dict, links): + self.run = mc._Run(doc, links, None, (), {}) + got = answer.get("값") or {} + names = {md.var_id(v) for v in doc.get("변수") or []} + names |= {str(x.get("기호") or "") for x in doc.get("식") or []} + for name in names: # 답에 없는 값 = 모름(다시 셈하지 않음 · 화면 `evalNode` 와 같음) + have = got.get(name) + self.run.values[name] = mc.Blank("모름") if have is None else have + self.lines = {str(x.get("기호") or ""): x.get("식") for x in doc.get("식") or []} + + def value(self, n): + try: + v = self.run.ev(n, None, "") + except Exception: # noqa: BLE001 — 그림용 값 · 모르면 없음 + return None + return None if isinstance(v, (mc.Blank, mc.Stop)) else v + + def taken(self, n) -> int: + if not (n and n[0] == "call" and n[1] == "만약" and len(n[2]) == 3): + return 0 + t = self.value(n[2][0]) + return 0 if t is None else (1 if t else 2) + + def off_zero(self, n, path: frozenset = frozenset()) -> bool: + if not n: + return False + at, hop = n, 0 + while pick := self.taken(at): + at, hop = at[2][pick], hop + 1 + if hop and at[0] == "num": + return at[1] == 0 + kind = at[0] + if kind == "var": + name = at[1] + if name not in self.lines or name in path: + return False + return self.off_zero(node_of(self.lines[name]), path | {name}) + if kind in ("neg", "pct"): + return self.off_zero(at[1], path) + if kind == "bin": + if at[1] == "*": + return self.off_zero(at[2], path) or self.off_zero(at[3], path) + if at[1] == "/": + return self.off_zero(at[2], path) + if at[1] in ("+", "-"): + return self.off_zero(at[2], path) and self.off_zero(at[3], path) + return False + + def off_line(self, line: dict) -> bool: + return any(self.off_zero(node_of(line.get(k))) for k in ("수량", "단가")) + + +# ── 줄 글 ──────────────────────────────────────────────────────────── +def _num(v) -> Decimal | None: + return _dec(v) + + +def _u(text: str, unit: str) -> str: + return f"{text} {unit}" if unit else text + + +def money_lines(doc: dict, answer: dict, links) -> list[dict]: + """금액 줄마다 산출근거 조각 `{i, 이름, 비목, 단가, 수량, 금액, 단위, 글, 꺼짐, 합밖, 까닭?}` · + 묶음 줄 = 비목마다 한 조각(`비목` = 노무비 · 재료비 · 경비 · `묶음줄` 참).""" + look = _Look(doc, answer, links) + vars_ = {md.var_id(v): v for v in doc.get("변수") or []} + rows = answer.get("줄") or [] + out: list[dict] = [] + for i, line in enumerate(doc.get("금액") or []): + got = rows[i] if i < len(rows) else {} + name = line_name(line) + ps = price_sym(line) + pv = vars_.get(ps) if ps else None + link = (pv or {}).get("연결") or {} + sub = None + if link.get("갈래") == "단가산출" and link.get("키") and "{" not in str(link["키"]): + try: + sub = links.doc(str(link["키"])) + except Exception: # noqa: BLE001 — 못 읽는 부름 = 단위 없이 + sub = None + mu = money_units(line, node_of(line.get("단가")), node_of(line.get("수량")), pv, sub) + qty = got.get("수량") + base = { + "i": i, + "이름": name, + "수량": _num(qty), + "단위": mu, + "꺼짐": look.off_line(line), + "합밖": bool(got.get("합밖")), + "묶음": line.get("묶음") or "", + } + tail = "" if qty is None else " × " + _u(eq_text(qty), mu["qty"]) + if got.get("까닭") and got.get("금액") is None: + why = got["까닭"] + out.append({**base, "비목": line.get("비목"), "단가": None, "금액": None, "까닭": why, + "글": f"{name} : — {why}"}) # fmt: skip + continue + if line.get("비목") == "묶음": + bundle = got.get("단가") if isinstance(got.get("단가"), dict) else {} + for c in COSTS: + part = (got.get("비목") or {}).get(c) + if _dec(part) is None or (not part and not bundle.get(c)): + continue + price = _u(eq_text(bundle.get(c)), mu["price"]) + text = f"{COST_SHOW[c]} : {price}{tail} = {one(part)} {AMOUNT_UNIT}" + out.append({**base, "비목": c, "묶음줄": True, "단가": _num(bundle.get(c)), + "금액": _num(part), "글": text}) # fmt: skip + continue + amt, price = got.get("금액"), got.get("단가") + text = f"{name} : {_u(eq_text(price), mu['price'])}{tail} = {one(amt or 0)} {AMOUNT_UNIT}" + out.append({**base, "비목": line.get("비목"), "단가": _num(price), "금액": _num(amt), + "글": text}) # fmt: skip + return out + + +def total_lines(answer: dict, lines: list[dict]) -> list[str]: + """계 줄 — 비목마다 「노무비 : 줄 + 줄 = 금액 원」(항이 넷 넘으면 금액만) · + 「합계 : 금액 원」.""" + out = [] + for c in COSTS: + terms = [ + x["금액"] + for x in lines + if x.get("비목") == c and not x["합밖"] and not x["꺼짐"] and x.get("금액") + ] + v = answer.get(c) + if _dec(v) is None: + body = "—" + elif 1 < len(terms) <= LONG_SUM: + body = f"{' + '.join(one(t) for t in terms)} = {won(v)}" + else: + body = won(v) if terms or v else "" + unit = f" {AMOUNT_UNIT}" if _dec(v) is not None and body else "" + out.append(f"{COST_SHOW[c]} : {body}{unit}") + total = answer.get("계") + out.append(f"합계 : {_u(won(total), AMOUNT_UNIT) if _dec(total) is not None else '—'}") + return out + + +def sheet_groups(doc: dict, answer: dict, links) -> list[dict]: + """공용 계산서(`A00_Common/calc_sheet.ts`) 묶음 — 비목마다 줄 + `{이름, 글 「단가 * 수량 = 금액」, 금액, 묶음, 장비, 옵션꺼짐}` · + 소계 = 셈 답 비목 값(끝수 뒤) · + 합 밖 줄 · 비목 없는 줄 = 뺌.""" + groups: dict[str, list] = {c: [] for c in COSTS} + for x in money_lines(doc, answer, links): + c = x.get("비목") + if c not in groups or x["합밖"]: + continue + mu = x["단위"] + if x.get("까닭"): + text = f"— {x['까닭']}" + else: + price = "—" if x["단가"] is None else _u(eq_text(x["단가"]), mu["price"]) + qty = "" if x["수량"] is None else " * " + _u(eq_text(x["수량"]), mu["qty"]) + text = f"{price}{qty} = {one(x['금액'] or 0)}" + groups[c].append( + { + "이름": x["이름"], + "글": text, + "금액": x["금액"], + "묶음": x["묶음"] or None, + "장비": bool(x.get("묶음줄")) or None, + "옵션꺼짐": x["꺼짐"] or None, + } + ) + return [ + {"비목": c, "소계": _num(answer.get(c)), "끝수": "", "줄": groups[c]} + for c in COSTS + if groups[c] or _dec(answer.get(c)) + ] diff --git a/resources/tester/helper_855_c4_doc_text.cjs b/resources/tester/helper_855_c4_doc_text.cjs new file mode 100644 index 000000000..2bc68737e --- /dev/null +++ b/resources/tester/helper_855_c4_doc_text.cjs @@ -0,0 +1,71 @@ +/* 855-C 2-C4 거울 헬퍼 — 산출근거 글 규칙(TS)을 Node 로 돌림(`master_doc_text.py` 짝). + * stdin = {수: [값], 단위: [글], 금액줄: [{줄, 단가변수, 부름}], 꺼짐: [{문서, 값}], 원: [수]} + * stdout = {eq: [eqText], one: [one], won: [won], 단위: [unitText], 금액줄: [moneyUnits], + * 꺼짐: [[offLine …] …], 비목: COST_SHOW, 항: LONG_SUM} + * `one` · `won` · `COST_SHOW` · `LONG_SUM` = `line_stack_out.ts` 안 정의를 그대로 읽어 돌림(내보내지 않는 값). */ +const fs = require("fs"); +const path = require("path"); +const ts = require(path.join(__dirname, "..", "..", "config", "node_modules", "typescript")); + +const cache = new Map(); +function load(at) { + if (cache.has(at)) return cache.get(at); + const js = ts.transpileModule(fs.readFileSync(at, "utf8"), { + compilerOptions: { module: ts.ModuleKind.CommonJS, target: ts.ScriptTarget.ES2020 }, + }).outputText; + const box = { exports: {} }; + cache.set(at, box.exports); + const need = (p) => { + if (p.endsWith(".css")) return {}; + return p.startsWith(".") ? load(path.resolve(path.dirname(at), `${p}.ts`)) : require(p); + }; + new Function("exports", "module", "require", js)(box.exports, box, need); + return box.exports; +} +const ROOT = path.join(__dirname, "..", ".."); +const eq = load(path.join(ROOT, "ui_template", "ui_template_equation.ts")); +const unit = load(path.join(ROOT, "common_util", "common_util_line_stack_unit.ts")); +const view = load(path.join(ROOT, "common_util", "common_util_formula_doc_view.ts")); +const stack = load(path.join(ROOT, "common_util", "common_util_line_stack.ts")); + +// line_stack_out.ts 안 정의(내보내지 않음) — 그 줄 글을 그대로 떼어 돌림 +const out = fs.readFileSync(path.join(ROOT, "A00_Common", "line_stack_out.ts"), "utf8"); +const grab = (re) => { + const m = out.match(re); + if (!m) throw new Error(`line_stack_out.ts 에서 못 찾음: ${re}`); + return m[0]; +}; +const defs = [ + grab(/const COST_SHOW: Record = \{[^}]*\};/), + grab(/const won = \(n: number\): string => [^;]*;/), + grab(/const one = \(n: number\): string =>\s*n\.toLocaleString\([^;]*;/), + grab(/const LONG_SUM = \d+;/), +].join("\n"); +const js = ts.transpileModule(`${defs}\nreturn { COST_SHOW, won, one, LONG_SUM };`, { + compilerOptions: { target: ts.ScriptTarget.ES2020 }, +}).outputText; +const local = new Function("eqText", js)(eq.eqText); + +const input = JSON.parse(fs.readFileSync(0, "utf8")); +const res = { + eq: (input.수 || []).map((v) => eq.eqText(v)), + one: (input.원 || []).map((v) => local.one(v)), + won: (input.원 || []).map((v) => local.won(v)), + 단위: (input.단위 || []).map((u) => unit.unitText(u)), + 금액줄: (input.금액줄 || []).map((x) => + unit.moneyUnits( + x.줄, + view.tryParse(x.줄.단가), + view.tryParse(x.줄.수량), + x.단가변수 || undefined, + x.부름 || null, + ), + ), + 기호: (input.금액줄 || []).map((x) => stack.priceSym(x.줄)), + 꺼짐: (input.꺼짐 || []).map((x) => + (x.문서.금액 || []).map((line) => view.offLine(line, x.값, view.lineMap(x.문서))), + ), + 비목: local.COST_SHOW, + 항: local.LONG_SUM, +}; +process.stdout.write(JSON.stringify(res)); diff --git a/resources/tester/test_704_logic_standard.py b/resources/tester/test_704_logic_standard.py index 133ed7766..fcc306ce0 100644 --- a/resources/tester/test_704_logic_standard.py +++ b/resources/tester/test_704_logic_standard.py @@ -11,10 +11,12 @@ from __future__ import annotations +import json from pathlib import Path import pytest +from M01_MasterData import M01_MasterData_Doc as m01_doc from M01_MasterData import M01_MasterData_Store as m01 from M01_MasterData.M01_MasterData_Store_Find import hit from M02_MasterTemplete import M02_Logic_Standard as st @@ -30,18 +32,20 @@ def _rows(key: str) -> list[dict]: def _given(key: str, change: dict) -> dict: whole = m01.loaded()[1] - return st._given(whole, whole.logic(key), change)[0] + return st._given(whole, m01_doc.docs()[key], change)[0] @pytest.mark.parametrize("key", THREE) -def test_줄_금액은_M01_시험_계산에_끝수만_버림(key: str) -> None: +def test_줄_금액은_M01_수식_탭_셈과_같음(key: str) -> None: + """855-C — 기준 목록 금액 = 수식 문서 셈(M01 수식 탭 미리 셈 · M02 단가산출과 같은 계산기).""" rows = _rows(key) assert rows + doc = json.loads(json.dumps(m01_doc.docs()[key], default=float)) # 화면 JSON 꼴 문서 for row in rows: - got = m01.calc(key, _given(key, row["바꿈"])) - assert got["ok"], got - gap = float(got["sums"]["계"]) - row["금액"] # 줄 · 비목 버림(B09 산근 규칙) — 최대 3 원 - assert -0.01 <= gap < 3.2, row["규격"] + given = st.labor_inputs._num(_given(key, row["바꿈"])) + got = m01_doc.preview(doc, given)["셈"] + assert got["셈됨"], row["규격"] + assert float(got["계"]) == row["금액"], row["규격"] def test_대표_규격_펼침() -> None: diff --git a/resources/tester/test_704_settle.py b/resources/tester/test_704_settle.py index 7e85217bd..2295c13a6 100644 --- a/resources/tester/test_704_settle.py +++ b/resources/tester/test_704_settle.py @@ -13,6 +13,7 @@ if str(ROOT) not in sys.path: sys.path.insert(0, str(ROOT)) from B09_Estimation import B09_Estimation_Sangeun as sg # noqa: E402 +from M01_MasterData import M01_MasterData_Doc as m01_doc # noqa: E402 from M01_MasterData import M01_MasterData_Store as m01 # noqa: E402 from M02_MasterTemplete import M02_Logic_Settle as st # noqa: E402 from M02_MasterTemplete import M02_Logic_Standard as ls # noqa: E402 @@ -39,7 +40,7 @@ def test_줄마다_버림_비목마다_버림_B09와_같음(): for row in data.get("줄") or []: if not _plain(row) or checked >= 60: continue - base, _ = ls.axes(whole, row) + base, _ = ls.axes(whole, m01_doc.docs()[row["키"]]) given = mf.fill_empty(row, base) got = mf.run(whole, row["키"], given) lines = [] @@ -70,6 +71,5 @@ def test_계산서_줄_소계_계가_맞물림(): assert group["소계"] == int(group["소계"]) assert group["소계"] <= sum(lines) < group["소계"] + 1 + Decimal("0.05"), group["비목"] assert got["계"] == sum(g["소계"] for g in got["묶음"]) - assert got["계"] == ls._money( - whole, whole.logic(key), ls._given(whole, whole.logic(key), {})[0] - ) + doc = m01_doc.docs()[key] # 855-C 계산서 = 문서 셈(목록 금액과 같은 값) + assert got["계"] == ls._money(doc, ls._links(whole), ls._given(whole, doc, {})[0]) diff --git a/resources/tester/test_714_1_sheet_line.py b/resources/tester/test_714_1_sheet_line.py index a317f93e4..61cbf574f 100644 --- a/resources/tester/test_714_1_sheet_line.py +++ b/resources/tester/test_714_1_sheet_line.py @@ -1,5 +1,5 @@ -"""714-1 지킴 — 계산서 줄 덧칸(쓰는 입력 · 묶음 · 기준단위 · 환산 근거) · M01 `/text` 와 -M02 `/logic-lib/sheet` 가 같은 줄 꼴(`master_sheet_line`).""" +"""714-1 지킴 — 계산서 줄 덧칸(쓰는 입력 · 묶음 · 기준단위 · 환산 근거) — M01 `/text`. +(M02 `/logic-lib/sheet` 는 855-C 부터 문서 셈 · `master_doc_text` 글 — `test_855_c4_doc_text`.)""" from __future__ import annotations @@ -11,10 +11,8 @@ sys.path.insert(0, str(ROOT)) from M01_MasterData import M01_MasterData_Store as store # noqa: E402 from M01_MasterData import M01_MasterData_Store_Sheet as sheet # noqa: E402 -from M02_MasterTemplete import M02_Logic_Standard as standard # noqa: E402 msl = sheet.msl -num = standard.labor_inputs._num # Decimal → JSON 수(두 길 같은 규칙) def _text(key: str) -> dict: @@ -61,15 +59,3 @@ def test_basis_note_tenfold(): assert one[0]["기준단위"] == "10㎡" and one[0]["환산근거"] == "10㎡당 → 1㎡당 ÷10" ten = _text("GF000124") assert ten["기준단위"] == "10㎡" and all(not x["환산근거"] for x in _lines(ten)) - - -def test_two_routes_same_shape(): - """M01 `/text` 와 M02 계산서 — 줄 차례 · 덧칸 값이 같음(금액 끝수만 다를 수 있음).""" - for key in ("GF000169", "GF000103", "GF000219"): - m01 = _lines(_text(key)) - m02 = _lines(standard.sheet(key, {}), "묶음") - assert len(m01) == len(m02) - for a, b in zip(m01, m02): - assert set(b) == {"이름", "글", "금액", *msl.KEYS} - assert a["이름"] == b["이름"] - assert num([a.get(k) for k in msl.KEYS]) == [b.get(k) for k in msl.KEYS] diff --git a/resources/tester/test_855_c4_doc_text.py b/resources/tester/test_855_c4_doc_text.py new file mode 100644 index 000000000..b94225ef2 --- /dev/null +++ b/resources/tester/test_855_c4_doc_text.py @@ -0,0 +1,155 @@ +"""855-C 2-C4 지킴 — 서버 산출근거 글(`master_doc_text`) · 기준 목록 · 계산서가 문서 셈. + +① 거울 — 글 규칙이 화면 TS 와 같음(헬퍼 `helper_855_c4_doc_text.cjs`): + 수 꼴(`eqText` · 줄 금액 · 원) · 단위 글(`unitText`) · 금액 줄 단위 자리 · 단가 기호 + (`moneyUnits` · `priceSym`) · 선택으로 꺼진 줄(`offLine`) · 비목 이름 — 실제 M01 수식 문서 전부 + (기본 입력 셈 답)로. +② 계산서 — 줄 금액 · 소계 · 계 = 문서 셈 답 그대로 · 소계 합 = 계 · + 줄 글 「단가 원/단위 * 수량 단위 = 금액」. +③ 기준 목록 줄 금액 = 같은 입력의 문서 셈 계. +""" + +from __future__ import annotations + +import importlib +import json +import os +import subprocess +from decimal import Decimal +from functools import lru_cache + +import pytest + +from M01_MasterData import M01_MasterData_Doc as m01_doc +from M01_MasterData import M01_MasterData_Store as m01 +from M02_MasterTemplete import M02_Logic_Standard as st + +mc = importlib.import_module("master_doc_calc") +md = importlib.import_module("master_doc") +mdt = importlib.import_module("master_doc_text") + +HERE = os.path.dirname(os.path.abspath(__file__)) +NUMS = [0, 1, -1, 0.5, 1.5, 2.5, -2.5, 0.05, 0.15, 0.25, 0.35, 1.05, 1.15, 1.25, 2.675, 99.95, + -0.05, 0.1 + 0.2, 1e-7, 1234567.891234567, 59018.0857142857, 284.42142857142, + 123456789012.345, 26890.75, 1502.04999] # fmt: skip + + +def _js(v): + if isinstance(v, Decimal): + return float(v) + if isinstance(v, dict): + return {k: _js(x) for k, x in v.items()} + if isinstance(v, (list, tuple)): + return [_js(x) for x in v] + if isinstance(v, (mc.Blank, mc.Stop)): + return None + return v + + +@lru_cache(maxsize=1) +def world(): + """(문서들, 연결, {키: 기본 셈 답}).""" + whole = m01.loaded()[1] + docs = m01_doc.docs() + links = st._links(whole) + answers = {k: mc.calc(d, links, None) for k, d in docs.items() if d.get("금액")} + return docs, links, answers + + +def _helper(payload: dict) -> dict: + run = subprocess.run( + ["node", os.path.join(HERE, "helper_855_c4_doc_text.cjs")], + input=json.dumps(payload, ensure_ascii=False), + capture_output=True, + text=True, + encoding="utf-8", + check=True, + ) + return json.loads(run.stdout) + + +@lru_cache(maxsize=1) +def mirror(): + docs, links, answers = world() + nums, units, lines, offs, py = list(NUMS), set(), [], [], {"단위": [], "줄": [], "꺼짐": []} + for key, a in answers.items(): + doc = docs[key] + vars_ = {md.var_id(v): v for v in doc.get("변수") or []} + units |= {str(v.get("단위") or "") for v in doc.get("변수") or []} + units.add(str(doc.get("결과단위") or "")) + for row in a.get("줄") or []: + nums += [_js(row.get(k)) for k in ("단가", "수량", "금액")] + for line in doc["금액"]: + units.add(str(line.get("단위") or "")) + sym = mdt.price_sym(line) + pv = vars_.get(sym) if sym else None + link = (pv or {}).get("연결") or {} + sub = None + if link.get("갈래") == "단가산출" and link.get("키") and "{" not in str(link["키"]): + got = links.doc(str(link["키"])) + sub = {"결과단위": got.get("결과단위")} if got else None + lines.append({"줄": _js(line), "단가변수": _js(pv), "부름": sub}) + nodes = (mdt.node_of(line.get("단가")), mdt.node_of(line.get("수량"))) + py["줄"].append((mdt.money_units(line, *nodes, pv, sub), sym)) + look = mdt._Look(doc, a, links) + vals = {k: v for k, v in (a.get("값") or {}).items() if v is not None} + part = {"식": _js(doc.get("식") or []), "금액": _js(doc["금액"])} + offs.append({"문서": part, "값": _js(vals)}) + py["꺼짐"].append([look.off_line(line) for line in doc["금액"]]) + nums = [x for x in nums if isinstance(x, (int, float))] + units |= {"%(인력품 대비)", "10^-7/시간", "kWh/hr", "줄 따름", "수(개)", "원문 단위 없음"} + units = sorted(units) + ts = _helper({"수": nums, "원": nums, "단위": units, "금액줄": lines, "꺼짐": offs}) + return nums, units, py, ts + + +def test_수_꼴_eqText_한자리_원(): + nums, _, _, ts = mirror() + assert len(nums) > 5000 + assert [mdt.eq_text(v) for v in nums] == ts["eq"] + assert [mdt.one(v) for v in nums] == ts["one"] + assert [mdt.won(v) for v in nums] == ts["won"] + texts = ("5401-0017", "", " ", "1048") + assert [mdt.eq_text(v) for v in texts] == ["5401-0017", "", " ", "1,048"] + + +def test_단위_글_금액줄_단위_자리_단가_기호(): + _, units, py, ts = mirror() + assert [mdt.unit_text(u) for u in units] == ts["단위"] + assert len(py["줄"]) > 5000 + assert [u for u, _ in py["줄"]] == ts["금액줄"] + assert [s for _, s in py["줄"]] == ts["기호"] + assert any(u["wrap"] for u, _ in py["줄"]) and any(u["price"] for u, _ in py["줄"]) + + +def test_선택으로_꺼진_줄_비목_이름(): + _, _, py, ts = mirror() + assert py["꺼짐"] == ts["꺼짐"] + assert sum(map(sum, py["꺼짐"])) > 0 # 꺼진 줄이 실제로 있음(판정이 일을 함) + assert mdt.COST_SHOW == ts["비목"] and mdt.LONG_SUM == ts["항"] + + +@pytest.mark.parametrize("key", ("GF000220", "GF000089", "GC000404", "GF000101")) +def test_계산서_문서_셈_답_그대로(key): + got = st.sheet(key, {}) + docs, links, _ = world() + answer = mc.calc(docs[key], links, st._given(m01.loaded()[1], docs[key], {})[0]) + assert got["계"] == float(answer["계"]) and got["계"] == sum(g["소계"] for g in got["묶음"]) + for g in got["묶음"]: + assert g["소계"] == float(answer[g["비목"]]) + for line in g["줄"]: + assert line["글"].endswith(f"= {mdt.one(line['금액'] or 0)}") + assert " * " in line["글"] or line["글"].startswith("—") + first = got["묶음"][0]["줄"][0] + if key == "GF000220": # 석공 노임 — 「268,908 원/인 * 0.1 인 = 26,890.8」 + assert first["이름"] == "석공" and first["글"].startswith("268,908 원/인 * 0.1 인 = ") + + +def test_기준_목록_금액_문서_셈(): + whole = m01.loaded()[1] + docs, links, _ = world() + for key in ("GF000220", "GC000404", "GX000004"): + for row in st._rows_of(whole, whole.logic(key), False, links): + given = st._given(whole, docs[key], row["바꿈"])[0] + want = mc.calc(docs[key], links, given) + assert row["금액"] == round(float(want["계"]), 2), (key, row["규격"]) From 8a9c84b6bedbb62172937f6984fdea801845c03f Mon Sep 17 00:00:00 2001 From: umsangdon Date: Tue, 17 Nov 2026 18:01:05 +0900 Subject: [PATCH 07/30] =?UTF-8?q?chore(ledger):=20=EC=84=A4=EA=B3=84=20858?= =?UTF-8?q?=20=E2=80=94=20=EA=B1=B8=EC=9D=8C=205=20=EC=84=9C=EA=B3=A0=20?= =?UTF-8?q?=ED=95=9C=20=EB=B2=8C(=EC=A7=80=EA=B8=88=20=EB=AA=A8=EC=8A=B5?= =?UTF-8?q?=20=C2=B7=20=ED=95=9C=20=EB=B2=8C=20=ED=8B=80=20=C2=B7=20?= =?UTF-8?q?=EA=B1=B8=EC=9D=8C=205-0=20~=205-8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude --- docs/raw/요구_1104/설계_858_서고한벌.md | 221 ++++++++++++++++++++++++ 1 file changed, 221 insertions(+) create mode 100644 docs/raw/요구_1104/설계_858_서고한벌.md diff --git a/docs/raw/요구_1104/설계_858_서고한벌.md b/docs/raw/요구_1104/설계_858_서고한벌.md new file mode 100644 index 000000000..87d802543 --- /dev/null +++ b/docs/raw/요구_1104/설계_858_서고한벌.md @@ -0,0 +1,221 @@ +# 설계 858 — 걸음 5 「서고 한 벌」 + +요구 896 · 898 · 899 · 2026-11-17 · sub4 · 읽기만(코드 · 자료 · 시험 안 고침). 근거 = `파일:줄`(sub_laptop_4 · 커밋 962476e69). 세기 도구 · 결과 = `tmp/s894/m858/`(끝 절). + +## 0. 한눈 요약 + +- 층 서고 종류 아홉 가운데 **단가산출 · 일위대가 둘만 한 틀**(`Store.write` + `Library_*` + `Precombo_Folders`). 구조물 조합 · 표 · 도면은 같은 `Store.write` 를 쓰나 목록 · 나무 · 번호가 따로. 내 기계 · 내 재료 · 실무자료 · 재료 고름 · 공유 요청은 저장 · 번호 · 목록 · 쓰는 곳 찾기를 **각자** 가짐. +- 같은 일 여러 벌(지금 자리 확인): 층 폴더 찾기 **5**(진짜 몸 2) · 폴더 → 층 판정 **4** · 쓰는 곳 찾기 **10**(서고 참조 4 + 자원 키 6) · 쓰기 권한 판단 **3**(+ TS 짝 1) · 파일 판 `version_of` **M02 3**(+ M01 2) · 쓰기 잠금 **4 벌** + **잠금 없는 여러 파일 쓰기 5 곳** · 번호 체계 **7 갈래** · 목록 **8**. +- 제안 = **새 틀을 만들지 않고 가장 잘 된 것을 넓힘**: 종류 표 하나(`Template_Layers` 안 · 옵션 칸) + 부품 일곱(층 폴더 · 권한 · 판 · 여러 파일 쓰기 · 번호 장부 · 쓰는 곳 색인 · 저장). 새 파일 = 지킴 시험 1 · 쓰는 곳 색인 1(`Labor_Ref` 700 줄 경계 때문에 떼어 냄) 뿐. +- 걸음 = 5-0 지킴 → 5-1 · 5-2 · 5-3(셋 병행) → 5-4 → 5-5 → 5-6 → 5-7(공유 · 판단 뒤) → 5-8 옛 코드 지움. 어림 **서버 +250 / −450 줄**. +- **지금 바로 시작해도 되는 조각** = 5-0 · 5-1 · 5-3(855 남은 걸음 · 856 · 857 과 파일 안 겹침). 실무자료 · 재료 고름은 **857 과 같이**. + +## 1. 지금 모습 + +### 1-1 종류 · 자리 · 서버 길 + +| 종류 | 저장 자리(층 폴더 안) | 층 | 서버 길(묶음) | +| --- | --- | --- | --- | +| 단가산출 SK | `sangeun/SK-######.json` + 뿌리 `sangeun_폴더.json` · `_번호.json` | 마스터 · 회사 · 개인 · 프로젝트(굳힘) | `/layers/{층}/library/{kind}` · `{kind}-tree(/paste)` · `{kind}-same(/merge /undo)` · `-tree/delete-check` · `-flat` · `-reset` · `templates/sangeun/{키}` · `sangeun/{키}/doc/*` | +| 일위대가 SC | `precombo/SC-######.json` + `precombo_폴더.json` | 같음 | 같음(종류 인자) | +| 구조물 조합(항목 · 열) | `table/구조물집계표.json`(열 · 경로 = 나무) + 뿌리 `구조물집계표조합.json`(장부) + `structure/ area/ labor/<열id>.json` | 같음 | `/items` · `/layers/{층}/tree` · `items/paste` · `personal/items/copy` · `structures/*` · `area/*` · `{kind}/{column}/clear·copy` | +| 구조물 표 · 도면 틀(양식) | `table/*.json` · `drawing/*.json` | 같음 + 프로젝트 `_initial/` | `/layers/{층}/templates(/{kind}/{name})` GET · PUT · DELETE | +| 내 기계 | `내기계/EQP{사용자}-####.json` + `내기계/_다음.json` | 개인만 | `/layers/personal/my-machines(/{키})` · `/{키}/impact` · `my-machine-lists · -find` · `machine-sheet` | +| 내 재료 | 뿌리 `개인자재.json`(한 파일 묶음 `{그룹, 원문, 줄, 마지막}`) | 개인만 | `/layers/{층}/materials(/{키})`(**`Labor_Router` 안** · 이름 안 맞음) | +| 실무자료(불러온 것) | `실무자료/HP-######.json` · `격자/` · `산근/` · `불러옴.json{번}` | 개인만 · 하루 지나면 숨김 | `/layers/{층}/hopyo*`(층 글 무시 · 늘 개인) | +| 재료 고름 | `실무자료/재료고름/<파일 지문>.json` | 개인만 | `/layers/{층}/material-picks/{fp}` | +| 공유 요청 | 회사 층 뿌리 `올리기요청.json{줄}` | 회사 | `/share-requests(/{id}/approve·reject · /seen)` | + +서버 길 수(자기 포트 `openapi.json` 읽기 · `routes.tsv`): M02 108 가운데 단가산출 · 일위대가 28 · 구조물 조합 · 표 · 도면 12 · 내 기계 9 · 내 재료 5 · 불러오기 15 · 공유 5. + +### 1-2 일마다 하는 자리 — 저장 쪽 + +| 종류 | 층 폴더 찾기 | 목록 | 폴더(나무) | 만들기 · 번호 | 저장(잠금 · 판 · 원자) | +| --- | --- | --- | --- | --- | --- | +| SK · SC | `Router_Items._root:145`(서고 길) · `Router_Layers._layer_dir:140`(templates 길) | `Router_Layers.list_layer:229` → `Layer_Index.list_rows:90` · `summaries:152` | `Precombo_Folders.view:67` · `edit:180`(**판 대조 · 잠금 없음**) | `Labor_Ref.create:385` · `next_key:367` + `_번호.json`(854-1) | `Store.write:142`(잠금 `_LOCK:80` · 판 409 · 원자) · 프로젝트 = `layers.write_template:251`(판 · **잠금 없음**) | +| 구조물 조합 | `Router_Items._root:145` | `Items.items:62` · `get_tree:219` | 표 안 경로 `Tree.apply:233` → `Store.write`(표) | `Item_Personal.create_item:44` · `Items.copy_item:140` · 장부 키 `Book.key_head:36`(`SC{회사}-` · `SP{사용자}-` · `다음`) · 도번 `Store._serial:326`(지운 번호 `_retired:339` 셈) | `Store.write`(표 · 세 파일 · `sync_combos:629`) | +| 표 · 도면 틀 | `Router_Layers._layer_dir:140` | `Layer_Index.list_rows` · `Template_Layers.list_templates:150` | 없음 | 이름 = 파일 이름(번호 없음) | `Store.write` · 프로젝트 `write_template` | +| 내 기계 | `MyMachine_Router._folder:34`(개인 고정 감쌈) + `MyMachine._user:410`(경로로 층 판정) | `MyMachine.listing` | 없음 | `MyMachine.add`(자기 `_LOCK:60` · `_다음.json`) | `update`(자기 잠금 · 판 · 원자 — 854-1) | +| 내 재료 | `Router_Items._root` + `Material_Own._personal:236` | `Material_Own.rows` | 없음 | `add`(`store._LOCK` · **모든 개인 층 최대 + 1** `_last` + 파일 `마지막`) | `update`(`store._LOCK` · **판 없음** · 원자) | +| 실무자료 | `Hopyo_Router._root:42`(개인 고정 감쌈) | `Hopyo_Store.rows:87`(하루 지난 것 숨김) | 없음 | `Hopyo_Store.save:119`(자기 `_LOCK:37` · `불러옴.json.번`) | `save`(새 키만 · 고침 없음) | +| 재료 고름 | `Hopyo_Router._root` | 없음 | 없음 | 파일 지문이 키 | `San_MatPick.write:97`(**잠금 · 판 없음** · 원자) | +| 공유 요청 | `Share_Request._company:66` + `Router_Items._root` | `listing:145` | 없음 | `uuid` | 자기 `_LOCK:47` · 원자 · 상태 409 | + +### 1-3 일마다 하는 자리 — 고침 · 둘러싼 쪽 + +| 종류 | 지우기 | 복사 · 붙여넣기 | 쓰는 곳 찾기 | 권한 | 지문 · 캐시 | 공유 | +| --- | --- | --- | --- | --- | --- | --- | +| SK · SC | 나무 `edit` → `Library_Delete.remove:166`(쓰는 줄 지움 · `_합친것` 기록 · **잠금 없음 · 앞판 되돌림** `:189`) · `Store.delete:207` | `Precombo_Folders.paste:203` → `Labor_Ref.carry:533`(못 읽는 참조 같이) · 합치기 `Library_Same_Router.merge:206`(**잠금 없음** `:261`) | `Labor_Ref.users:459`(+ `use_files:452` · 기억 `_ids_of:473`) · `Library_Delete.users:76` · `Library_Same_Router._user_index:93` · `Layer_Index._uses:185` | `Layer_Access.require:83` + `Library_Delete.can_write:40` + `Library_Same_Router._can_write:108` · 참조 위 층 규칙 `Labor_Ref.readable:146` | 판 `Store.version_of:89` · 내용 `Library_Same.finger:208` · 캐시 `Layer_Index._MEM:34` · `Labor_Ref._IDS:470` | SC 만 요청 길 · SK 는 승인 `carry` 로 딸려 감 | +| 구조물 조합 | 나무 지움 → `Store.prune_removed_structures:489` | `Item_Paste.paste:44`(층 사이) · `Items.copy_item:140` · 열끼리 `Store.copy_from:442` · `copy_pair:471` | SK 쪽에서 열 이름 `Library_Delete._columns:64` | `Router_Items._root` | `Store.version_of` | 요청 길 있음(`item`) | +| 표 · 도면 틀 | `Router_Layers.delete_layer_template:366` → `Store.delete` · `layers.delete_template:272` | 프로젝트로 `copy_templates:345` · `seed_project:390` · `reset_project:425` | 고정 표 `Store.IN_USE:58`(네 양식) | `_layer_dir` | `Template_Layers.version_of:139` | 없음 | +| 내 기계 | `MyMachine.delete`(잠금) | 없음(층 사이 안 옮김) | `MyMachine.uses:487`(SK 글 훑기) · 영향 `MyMachine_Impact` · M01 `Machine_Uses.uses:265` | `_folder` | 판 `MyMachine.version:116` · 캐시 `_MEMO:169` | 없음 | +| 내 재료 | `Material_Own.remove`(쓰는 곳 409) | 층 사이 같은 키 `carry` · `adopt` | `Material_Own.usage:143`(층 폴더 통째 글 훑기) | `_root` + `_personal` | 캐시 `_MEMO:184` | 없음 | +| 실무자료 | `Hopyo_Store.delete:167` · `Hopyo_Forget.finish:128` · 하루 지남 `sweep:148` | 없음 | 본뜬 키로 사본 걷음 `Hopyo_Forget.forget:102` | `Hopyo_Router._root` | 올린 엑셀 `Hopyo_Store.fingerprint:71` | 없음 | +| 재료 고름 | HP 지울 때 판만 | 없음 | `San_MatPick.made:248` · `uses:333` · `tally:348` | `Hopyo_Router._root` | — | 없음 | +| 공유 요청 | 없음(상태만) | 승인 = 위 두 길 | — | `_company` | — | — | + +### 1-4 같은 일 몇 벌(분석 수 → 지금 자리) + +| 일 | 분석 | 지금 | 자리 | +| --- | --- | --- | --- | +| 층 폴더 찾기(세션 → 폴더) | 4 | **5**(몸 2 + 감쌈 2 + 프로젝트 1) | `Router_Items._root:145` · `Router_Layers._layer_dir:140` · 감쌈 `Hopyo_Router._root:42` · `MyMachine_Router._folder:34` · 프로젝트 `Project_Items_Router._root:87` | +| 폴더 → 층 판정 | — | **4** | `Labor_Ref.where:77`(몸) · `MyMachine._user:410`(경로 부모 이름) · `Material_Own._personal:236`(→ `where`) · 키 → 층 `Combo_Store.where:86` | +| 쓰는 곳 찾기 | 6 | **10** | 서고 참조 4: `Labor_Ref.users:459` · `Library_Delete.users:76` · `Library_Same_Router._user_index:93` · `Layer_Index._uses:185` / 자원 키 6: `MyMachine.uses:487` · `Material_Own.usage:143` · `Labor_Spec.users:143`(규격 열) · `San_MatPick.made:248 · uses:333` · M01 `Machine_Uses.uses:265` · M01 `Doc.users:268` | +| 쓰기 권한 판단 | 여러 곳 | **3 + TS 1** | `Layer_Access.grant:61 · require:83`(몸) · `Library_Delete.can_write:40` · `Library_Same_Router._can_write:108` · TS `M02_MasterTemplete_Layer.ts:107 accessFor`(거울 시험 없음) | +| 파일 판 `version_of` | 3 | **M02 3 + M01 2** | `Store.version_of:89`(바이트) · `Template_Layers.version_of:139`(경로 · 같은 sha256[:16]) · `Item_Source.version_of:79`(JSON 정렬 — 실은 내용 지문) · M01 `Store.version_of:56` · `Doc.version_of:46` | +| 내용 지문 | 7 | 7(855 몫) + 서고 2 | 서고 쪽 `Library_Same.finger:208` · `Hopyo_Store.fingerprint:71` | +| 쓰기 잠금 | — | **4 벌** | `Store._LOCK:80`(서고 · 표 · 재료 공용 · `Lock` = 안에서 다시 잡으면 교착) · `MyMachine._LOCK:60`(RLock) · `Hopyo_Store._LOCK:37` · `Share_Request._LOCK:47` | +| 잠금 없는 쓰기 | B 5-4 · 5-5 | **5 곳** | `Precombo_Folders.edit:180`(판 대조와 쓰기 사이 열림) · `Library_Delete.remove:166` · `Library_Same_Router.merge:206 · undo:285` · `Template_Layers.write_template:251` · `San_MatPick.write:97` | +| 번호 체계 | 9 갈래(E 4-1) | 서고 **7** | SK · SC `next_key` + `_번호.json` · 장부 `Book`(`다음`) · 도번 `Store._serial`(지운 번호) · HP `불러옴.json.번` · PM 전 층 최대 + `마지막` · EQP `_다음.json` · 요청 `uuid` | +| 목록 | — | **8** | `Layer_Index.list_rows` · `Precombo_Folders.view` · `Items.items` · `MyMachine.listing` · `Material_Own.rows` · `Hopyo_Store.rows` · `Share_Request.listing` · `Combo_Store.listing:159` | + +### 1-5 storage 실측(꼴 · 개수만 · `census_storage.tsv`) + +| 층 | 수 | 폴더별 json(층 합) | 뿌리 파일 | +| --- | --- | --- | --- | +| 마스터 | 1 | drawing 5 · table 1 · report 1 · stability 2 · 구조물정의_이력 22 | `구조물정의.json` · `구조물집계표조합.json` · `calc_sites.json` | +| 회사 | 2 | table 2 · drawing 1 · 나머지 0 | `구조물집계표조합.json` 2 · `00_template_A1.json` 1(종류 폴더 밖에 놓인 양식 — 확인 거리) | +| 개인 | 6 | sangeun 15 · precombo 6 · `_합친것` 16 · table 4 · 내기계 1(`_다음` 만) · 실무자료 7 · 빈 폴더 `area drawing inputs labor material promote structure` | `구조물집계표조합.json` 4 · `sangeun_폴더` 2 · `precombo_폴더` 2 · `개인자재.json` 1 · `manifest.json` 1 · `_번호.json` 1 | + +## 2. 한 벌 틀 제안 + +### 2-1 바탕 — 이미 잘 된 것 + +- **저장** `Store.write:142` — 잠금 · 판 409 · 원자 쓰기 · 서버 정본 다시 셈(`_server:566`) · 서고 키 = 파일 이름. 한 파일 한 문서 꼴의 정본 길. +- **나무** `Precombo_Folders` — `{종류}_폴더.json{폴더, 자리}` · 종류 인자 한 벌. +- **지우기 · 합치기 · 되돌림** `Library_Delete` · `Library_Same(_Router)` — 쓰는 줄 정리 · `_합친것` 기록 · 되돌림. +- **권한** `Layer_Access` 한 벌 · **층 폴더** `Router_Items._root` 한 벌(대부분 가져다 씀). + +### 2-2 종류 표 하나(새 파일 없음 · `Template_Layers` 안 · 어림 +40) + +지금 `KINDS · LIBRARY_KINDS`(`Template_Layers:34-35`) · `Labor_Ref.PREFIX · TITLE` · `Share_Request` `Literal`(종류 글) · TS `Api_Fetch.Kind` 로 흩어진 종류 정의를 한 표로. + +| 칸(옵션) | 뜻 | SK | SC | 내 기계 | 내 재료 | 실무자료(857) | +| --- | --- | --- | --- | --- | --- | --- | +| `폴더` | 층 안 자리 | `sangeun` | `precombo` | `내기계` | 판단 1 | `실무자료` | +| `키꼴` · `머리` | 번호 꼴 | `SK-######` | `SC-######` | `EQP{사용자}-####` | `PM######`(전 층) | `HP-######` | +| `층` | 놓일 층 | 넷 | 넷 | 개인만 | 개인만 | 개인만 | +| `번호` | 장부 자리 | 층 `_번호.json` | 같음 | 같음(`_다음.json` 걷음) | 전 층 최대 + `마지막` 그대로 | `불러옴.json.번` 그대로(857) | +| `나무` | 폴더 장부 | 있음 | 있음 | 없음 | 없음 | 없음 | +| `숨김` | 하루 지나면 | — | — | — | — | 1 일 | +| `쓰는곳` | 쓰는 곳의 뜻 | 참조 `{층 주인 키}` | 같음 | 자원 키 글(`개인 EQP…`) | 자원 키 글(`PM…`) | 본뜬 키 | +| `공유` | 회사에 올리기 | 판단 2 | 있음 | 판단 2 | 판단 2 | 없음 | +| `셈` | 저장 때 서버 정본 | `Store._server` | 같음 | 시간당(`Machine_Hourly.hour`) | 없음 | 없음 | + +구조물 조합 · 표 · 도면 틀은 이미 `Store.write` 를 쓰고 번호가 표 장부와 같이 움직임 → 표에 「양식 종류」 로만 올리고 번호 · 나무는 지금 것 그대로. + +### 2-3 부품 일곱(지금 것을 넓힘) + +| 부품 | 한 벌로 삼을 것 | 걷을 것 | 어림 | +| --- | --- | --- | --- | +| ① 층 폴더 | `Router_Items._root` + 옵션 `개인만` | `Hopyo_Router._root:42` · `MyMachine_Router._folder:34` 감쌈 · `Router_Layers._layer_dir` 는 프로젝트 · 비동기 때문에 남기되 안쪽이 `access.folder` 를 같이 씀 | −10 | +| ② 층 판정 | `Labor_Ref.where:77` | `MyMachine._user:410` 의 경로 부모 이름 판정 → `where` | −10 | +| ③ 권한 | `Layer_Access` 에 `can_write(session, here)` 하나 | `Library_Delete.can_write:40` · `Library_Same_Router._can_write:108` · TS `accessFor` 는 거울 시험 붙임 | +15 / −15 | +| ④ 판 | `Store.version_of` | `Template_Layers.version_of:139` → 그것을 부름 · `Item_Source.version_of` 는 이름만 「내용 지문」 으로(855 B9-5 때) | −5 | +| ⑤ 여러 파일 쓰기 | `Store` 에 `batch()`(잠금 하나 + 앞판 되돌림 · `Library_Delete.remove:189` 의 되돌림 꼴을 옮김) · `_LOCK` → `RLock` | `Library_Delete` 되돌림 몸 · `Library_Same_Router.merge` · `undo` · `Precombo_Folders.edit` 가 `batch` 안에서 | +40 / −40 | +| ⑥ 번호 장부 | 층 `_번호.json`(854-1 · `Labor_Ref.next_key` 꼴) 을 종류 표 `번호` 칸으로 | `MyMachine._다음.json` · `MyMachine.add` 의 번호 몸 | +10 / −20 | +| ⑦ 쓰는 곳 색인 | `Labor_Ref.use_files · users · _ids_of`(파일 판 기억) 를 새 `M02_Library_Uses.py` 로 떼어 넓힘(참조 + 자원 키 두 찾기) | `Library_Delete.users` 훑기 몸 · `_user_index` · `Layer_Index._uses` · `MyMachine.uses` · `Material_Own.usage` | +120 / −150 | + +### 2-4 새로 만드는 것(가장 적게) + +- 새 파일 2 = `M02_Library_Uses.py`(⑦ · `Labor_Ref` 675 줄이라 더 못 넣음) · 지킴 시험 `test_858_shelf_golden.py`. +- 새 저장 파일 0(층 `_번호.json` 은 이미 있음). +- 새 서버 길 0 — 내 재료 길을 `Labor_Router` 에서 내 기계와 같은 라우터 묶음으로 옮김(길 글자는 그대로). + +## 3. 걸음(두 박자 — 새 틀로 옮김 → 답 전후 같음 → 다음 묶음에서 옛 코드 지움) + +| 걸음 | 무엇 | 파일(어림 줄) | 지킴 | 위험 · 막는 법 | 화면 확인 | +| --- | --- | --- | --- | --- | --- | +| **5-0 지킴 올림** | 임시 storage 견본 층(SK · SC · 항목 · 내 기계 · 내 재료 · 공유 요청)에서 길 답 지문 — 목록 · 나무 · 만들기 · 고치기 · 지우기 · 복사 · 붙여넣기 · 합치기 · 되돌림 · 쓰는 곳 · 권한 403/404 → `858_shelf_golden.json` · 동시 쓰기 시험(854-1 꼴)을 나무 · 지우기 · 합치기로 넓힘 | 새 `resources/tester/test_858_shelf_golden.py`(+ 300) | 지금 수치 그대로 통과 | 견본 짓기가 남의 시험 견본과 겹침 → 기존 `world` 픽스처(`test_m02_labor_ref`) 재사용 | — | +| **5-1 권한 한 벌** | ③ | `M02_Layer_Access.py`(+ 15) · `M02_Library_Delete.py`(− 8) · `M02_Library_Same_Router.py`(− 5) · 거울 시험(TS `accessFor` ↔ 서버) 새 1(+ 60) | 5-0 · `test_m02_layer_access` · `test_735_1` · `test_733_3_*` | 회사 관리자 · 남의 층 경우 — 5-0 의 403 지문 | 개인 · 회사 층 나무 지우기 · 중복 합치기 단추 보임 | +| **5-2 층 폴더 · 층 판정 한 벌** | ① ② | `M02_MasterTemplete_Router_Items.py`(+ 5) · `M02_MyMachine_Router.py`(− 5) · `M02_MyMachine.py`(± 10) · `M02_Material_Own.py`(± 5) | 5-0 · `test_821_*` · `test_840_4` · `test_m02_material_own` | `Hopyo_Router._root` 는 **857 몫 파일** → 여기선 안 고침 · 857 이 같은 옵션을 씀 | 개인관리 › 기계 · 자재 열기 | +| **5-3 판 한 벌 · 프로젝트 저장 잠금** | ④ + `write_template` 을 `Store._LOCK` 안에서 | `M02_Template_Layers.py`(± 10) · `M02_MasterTemplete_Store.py`(± 3) | 5-0 · `test_826_1` · `test_204_2` · `test_572` | 프로젝트 층 저장(B05 · B07 양식) — 판 값은 같은 sha256[:16] 이라 안 바뀜 | 프로젝트 양식 저장 한 번 | +| **5-4 여러 파일 쓰기 한 꼴** | ⑤ | `M02_MasterTemplete_Store.py`(+ 40) · `M02_Library_Delete.py`(− 30) · `M02_Library_Same_Router.py`(± 20) · `M02_Precombo_Folders.py`(± 5) | 5-0 동시 시험(같은 층 지우기 · 합치기 겹침 → 하나만 이김 · 파일 앞판 그대로) · `test_735_1` · `test_733_3_*` · `test_m02_precombo_folders` | `RLock` 으로 바꿈 — `Store.write` 를 잠금 안에서 부르는 길(합치기 `_rewrite:125`)이 생김 · 늦은 쓰기(`_refresh_labor`)는 잠금 밖 그대로 | 나무 지우기 · 되돌림 · 합치기 | +| **5-5 쓰는 곳 색인 한 벌** | ⑦ | 새 `M02_Library_Uses.py`(+ 120) · `M02_Labor_Ref.py`(− 60) · `M02_Library_Delete.py`(− 30) · `M02_Library_Same_Router.py`(− 20) · `M02_Layer_Index.py`(− 15) · `M02_MyMachine.py`(− 25) · `M02_Material_Own.py`(− 20) | 5-0 쓰는 곳 지문 · `test_826_1`(목록 쓰는 곳 수) · `test_840_4` · `test_848_5` | **855 L2 ⓑ 가 `Layer_Index` 를 만짐** → L2 ⓑ 뒤 또는 `Layer_Index` 몫만 L2 ⓑ 창에 | 지우기 미리 보기 쓰는 곳 · 목록 쓰는곳수 · 내 기계 쓰는 단가산출 | +| **5-6 내 기계 · 내 재료를 서고 틀로** | 종류 표(2-2) · 내 기계 번호 = 층 `_번호.json` · 옛 `내기계.json` 옮김(`MyMachine._move:97`) 걷음 · 내 재료 판 대조(+ 판단 1) · 내 재료 길을 내 기계 라우터 묶음으로 | `M02_Template_Layers.py`(+ 40) · `M02_MyMachine.py`(− 60) · `M02_MyMachine_Router.py`(+ 40) · `M02_Material_Own.py`(± 40) · `M02_Labor_Router.py`(− 50) · TS `M02_MyMachine_Api.ts` · 내 재료 화면 Api(판 칸 · ± 20) | 5-0 · `test_854_1` · `test_821_*` · `test_840_4` · `test_m02_material_own` · `test_826_2` | **`San_MyMachine.attach` 가 `MyMachine.create` 를 부름(857 몫)** → `create` 인자 · 답 꼴 그대로 | 내 기계 만들기 · 고침 · 옛 판 막힘 · 내 재료 같은 것 | +| 5-7 공유 범위(판단 2 뒤) | `Share_Request` `Literal` → 종류 표 `공유` 칸 | `M02_Share_Request.py`(± 20) · TS `ShareRequest`(± 20) | `test_706_1` | — | [회사에 올리기] | +| **5-8 옛 코드 지움** | 감쌈 · 중복 몸 · 옛 꼴 옮김 · 잠금 없는 되돌림 몸 · 화면 0 이 된 것 · 그것만 붙드는 시험 | 위 파일들(− 150 안팎) | `/openapi.json` 길 전후(뜻한 길만) · 관련 시험 전부 | — | 한 바퀴 | + +### 3-1 같이 돌릴 수 있는 묶음(파일 안 겹침) + +| 묶음 | 걸음(창) | 겹침 확인 | 앞 조건 | +| --- | --- | --- | --- | +| ㉠ | 5-0(하나) | 새 시험 파일만 | 없음 — **지금** | +| ㉡ | 5-1 · 5-2 · 5-3(셋) | Layer_Access · Library_Delete · Library_Same_Router ↔ Router_Items · MyMachine* · Material_Own ↔ Template_Layers · Store — 다름 | ㉠ | +| ㉢ | 5-4(하나) | Store · Library_* · Precombo_Folders | ㉡(5-1 의 Library_* · 5-3 의 Store) | +| ㉣ | 5-5(하나) | Labor_Ref · Library_* · Layer_Index · MyMachine · Material_Own | ㉢ · 855 L2 ⓑ | +| ㉤ | 5-6 · 5-7(둘) | MyMachine* · Material_Own · Labor_Router · Template_Layers ↔ Share_Request — 다름 | ㉣ · 판단 1 · 2 | +| ㉥ | 5-8(하나) | 전부 | ㉤ | + +꼭 차례인 까닭: +- `Library_Delete` · `Library_Same_Router` 를 5-1 · 5-4 · 5-5 셋이 만짐 → 한 걸음씩. +- `MyMachine` · `Material_Own` 을 5-2 · 5-5 · 5-6 이 만짐 → 5-2 는 판정 몸만 · 5-6 은 마지막. +- 5-4(잠금 하나)가 5-5 앞 — 쓰는 곳 색인을 지우기 · 합치기 잠금 안에서 쓰게 되므로. + +## 4. 「다시 셈 · 새로 고침」 길 열두 가지 + +| 번호 | 길(B 4-1) | 걸음 2 뒤 | 하나로 모을 수 있나 · 정리안 | +| --- | --- | --- | --- | +| ① | 자동 따라옴 `Sk_AutoRenew`(프로젝트 층 밖) | 남음(2-D 가 옛 사본 갈래만 걷음) | ②와 「값을 새로 받기」 한 뜻 — 층 따라 자동 / 손 | +| ② | [단가 갱신] `Sangeun_Copy.PRICE:40` | 남음(프로젝트 층) | 판단 3 — 이름 가름 | +| ③ | [재생성] `REGEN` | 남음 | 그대로(고친 것 버림 · 뜻 다름) | +| ④ | 알림 [확인] `Sk_AutoRenew.CONFIRM:47` | 남음 | ① 의 짝 — ① 과 같이 | +| ⑤ | 저장 때 재계산 `Store._server:566` → … `Doc_Sk.settle` | 남음(서버 정본 원칙) · 2-D 뒤 `사본` 줄임 갈래 빠짐 | 그대로 — 모든 저장이 이미 이 한 길 | +| ⑥ | 펼침 `Library_Flat.flat_doc`(읽기 · 저장 · 복사) · 초기화 `reset_doc` | 남음 · 읽기 길 펼침(`Router_Layers:275-276` `unpromote` · `flat_doc`) = 「열 때 본 문서 ≠ 파일」 | 옛 로직 줄 꼴 올림 몫이 크면 저장본 비운 뒤 읽기 길 펼침 걷음(855 2-D 와 같이 확인) | +| ⑦ | 일위대가 계산값 다시 적기 `Labor_Doc.server` · `Store._refresh_labor:596` | 남음 | ⑦ ⑧ = 「저장 뒤 딸림 갱신」 한 목록으로(`Store.write` 끝 · 5-4 의 `batch` 안) | +| ⑧ | 도면 연결표 글 `Store._refresh_drawing:588` | 남음 | 위와 같음 | +| ⑨ | 저장 전 영향 `MyMachine_Impact` | 남음 | 내 재료에도 같은 꼴(5-6 · 판단 1 과 같이) | +| ⑩ | 파생 색인 `Layer_Index` · `Logic_Standard` · 프로젝트 [재적용] · `Item_Prices.refresh` · B09 | 색인 둘 남음 · 프로젝트 쪽은 B9 걸음 몫 | 색인 무효 규칙 = 「파일 자국」 한 꼴(`Layer_Index._stamps:49` · `Logic_Standard._stamp:227` 이 각자) — 858 범위 밖 · 메모만 | +| ⑪ | `Hopyo_Relink` | 857 몫 | — | +| ⑫ | 한 번용 `*_Migrate*` | **이미 없음**(853-2 · 지금 파일 0) | — | + +같은 단추 이름이 층 따라 다른 뜻인 자리 — **[단가 갱신]**: 프로젝트 층 = 굳힌 사본을 지금 M01 값으로 다시 씀(손) · 층 서고 = 자동 따라옴이라 단추 대신 알림 [확인]. 서버가 `Sk_AutoRenew.on:55` 로 가름 · 화면 글 `formula_doc_text.ts:54` 한 벌. 정리안 = 판단 3. + +## 5. 화면 쪽 + +| 거리 | 지금 | 제안 | +| --- | --- | --- | +| 고치는 중 값 보관 | 단가산출만 sessionStorage(`line_stack_screen.ts:185 · 197` · 열쇠 `m02_sk_doc_drafts` `Sangeun_Tabs.ts:56`) · 나머지는 메모리 + 떠날 때 `confirmLeave`(11 파일) | **858 범위 밖** 권함 — 856 이 일위대가 줄 창을 줄 쌓기로 바꾸면 SC 도 같은 보관을 얻음 · 내 기계 · 내 재료는 짧은 양식이라 메모리 그대로 · 판단 5 | +| 층 전역 `setActiveLayer` | `Api_Fetch.ts:74-92` 모든 M02 부름이 `/layers/${activeLayer}` · `UI_Page.ts:162 · 345` 가 바꿈 · 되돌림 · 섞임은 `turn` 이 막음 | **858 범위 밖** 권함(화면 부름 전부가 걸림 · 효과 작음) · 5-6 에서 내 기계 · 내 재료 Api 만 「종류 + 층」 을 인자로 받는 한 함수로 | +| 권한 짝 | TS `accessFor` ↔ 서버 `Layer_Access` 거울 시험 없음 | 5-1 에서 붙임 | + +## 6. 걸음 2 · 3 · 4 와 겹침 · 차례 조건 + +| 상대 | 겹치는 파일 | 조건 | +| --- | --- | --- | +| 855 2-C1 · 2-C5 · 2-D | `Doc_Sk` · `Sangeun_Calc` · `Labor_Copy` · `Labor_Expand` · `Copy_Slim` · `Library_Flat` · `Sangeun_Copy` · `Sk_AutoRenew` | 858 은 이 파일들을 **안 고침**(⑥ 펼침 정리는 2-D 뒤 메모만) | +| 855 L2 ⓑ | `Layer_Index` · `Labor_Inputs` | 5-5 의 `Layer_Index` 몫은 L2 ⓑ 뒤 | +| 855 B9-5 | `Item_Source.version_of` | 이름 바꿈은 B9-5 몫 · 858 은 안 고침 | +| 856 화면 하나 | `Sangeun_Detail` · `LogicLab_Ho` · `line_stack_*` · 일위대가 줄 창 TS | 겹침 없음 · 고치는 중 값 보관은 856 에 맡김 | +| 857 불러오기 | `Hopyo_Router` · `Hopyo_Store` · `Hopyo_Forget` · `San_MatPick` · `San_MyMachine`(→ `MyMachine.create`) | 실무자료 · 재료 고름의 틀 옮김은 **857 안에서**(종류 표 `숨김` 칸을 씀) · 5-6 은 `create` 꼴 그대로 | +| 854 · 855 이미 끝난 것 | `MyMachine`(854-1 잠금 · 판 · 2-B2) · `Labor_Ref.next_key`(854-1) · `Machine_Hourly` | 바탕으로 씀 | + +지금 바로 시작해도 되는 조각 = **㉠ 5-0 · ㉡ 5-1 · 5-3**(855 남은 걸음 · 856 · 857 과 파일 안 겹침). 5-2 는 `MyMachine` 을 만지는 다른 일감이 없으면 같이. + +## 7. 사용자 판단 거리 · 못 본 것 + +### 7-1 판단 거리(쉬운 말) + +1. **내 재료 저장 꼴** — 지금 한 파일에 모든 줄 · 고칠 때 판 대조 없음. ㉮ 내 기계처럼 한 줄 한 파일 + 판(서고 틀과 같음 · 지금 저장본 1 개라 옛 꼴 호환 없이 바꿈) ㉯ 한 파일 그대로 + 판만 붙임(권함 — 줄이 적고 번호가 전 층에 걸쳐 있어 파일을 나눌 득이 작음). +2. **공유 범위** — 지금 [회사에 올리기] 요청은 구조물 조합 항목 · 일위대가만. 단가산출 · 내 기계 · 내 재료도 요청 길을 둘지(지금 단가산출은 일위대가 승인 때 딸려 갈 때만 올라감). +3. **[단가 갱신] 이름** — 프로젝트 층에선 손으로 새 값 받기, 층 서고에선 저절로 따라오고 알림 [확인]만 있음. ㉮ 이름을 가름(프로젝트 = 「단가 갱신」 · 층 서고 = 「새 값 확인」 · 권함) ㉯ 그대로. +4. **내 기계 · 내 재료 저장본** — 지금 내 기계 0 대(번호 파일만) · 내 재료 1 파일. 비우고 시작해도 되는지(옛 `내기계.json` 옮김 코드도 같이 걷음). +5. **고치는 중 값 보관** — 새로고침 뒤에도 고친 값이 남아야 하는 화면(지금 단가산출만) — 858 에선 안 다루고 856 에 맡겨도 되는지. +6. **실무자료 · 재료 고름** — 857(불러오기 합침) 안에서 같은 틀로 옮김(권함). + +### 7-2 못 본 것 + +- 화면 · 서버를 조작하지 않음(코드 따라가기 · 길 목록만 읽음) — 「공유 요청 승인」 · 「합치기 되돌림」 실제 동작. +- 프로젝트 층 서고(굳힌 사본)의 목록 · 쓰는 곳 — B9 걸음 몫이라 깊게 안 봄. +- M01 `Machine_Uses` · `Doc.users` 속(M01 범위). +- 회사 층 뿌리 `00_template_A1.json`(종류 폴더 밖) 이 어느 코드가 놓은 것인지. +- `Router_Layers._layer_dir` 의 프로젝트 · 직접 SQL(B 1-4) 정리 — 858 에 넣지 않음(마스터 층 ↔ 프로젝트 경계 · B 6(다) 다른 후보). + +## 세기 도구 · 결과(`tmp/s894/m858/`) + +| 파일 | 내용 | +| --- | --- | +| `defs.py` → `defs.tsv` | 서고 관련 36 파일 함수 555 개(이름 · 줄 · 길이 · 서버 길 · 독스트링 첫 줄) | +| `count.py` → `count.tsv` · `count_summary.tsv` | 일 16 갈래 정규식 자리(`파일:줄`) — 표 1-4 는 이것을 손으로 걸러 셈(이름이 같은 다른 일 뺌 — 예 `Hopyo_Excel._columns`) | +| `census_storage.py` → `census_storage.tsv` | 층 폴더 꼴 · 폴더별 json 수 · 뿌리 파일(키 이름은 `<키>` 로 가림 · 값 안 봄) | +| `openapi.json` → `routes.tsv` | 자기 포트 8006 길 목록(읽기만) · M02 108 길 묶음 | From 9954e1c0867390128db2d37362182aeb74d02a2f Mon Sep 17 00:00:00 2001 From: umsangdon Date: Tue, 17 Nov 2026 18:01:19 +0900 Subject: [PATCH 08/30] =?UTF-8?q?test(854-3):=20=EA=B8=B0=EA=B3=84=20?= =?UTF-8?q?=EC=B9=B8=20=EB=8B=A8=EC=9C=84=20=ED=91=9C=20=EC=85=8B=20?= =?UTF-8?q?=EA=B1=B0=EC=9A=B8=20=EC=8B=9C=ED=97=98=20=C2=B7=20=EC=A7=9D=20?= =?UTF-8?q?=EB=A8=B8=EB=A6=AC=20=EA=B8=80=20=EB=A7=9E=EC=B6=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - test_854_3_machine_unit_mirror — 화면 MACHINE_UNIT · 내 기계 UNITS · 빌더 UNIT 의 같은 칸 단위가 같음(㎾h 표시 바꿈 · 「주연료의 %」= % 만 규칙) · 화면 칸은 세 표 어딘가에 짝(시간당 금액 칸만 예외) - 짝 머리 글 — 단위 표(화면 · 빌더) · master_doc_link.py 가 가리키는 TS 파일 바로잡음(calc → table) · M02_Labor_Spec.py 에 화면 짝 · M02_Share_Request.py 에 화면 짝(머리 글만 · 코드 불변) Co-Authored-By: Claude Sonnet 5.5 --- M02_MasterTemplete/M02_Labor_Spec.py | 2 +- M02_MasterTemplete/M02_Share_Request.py | 2 +- common_util/common_util_line_stack_unit.ts | 3 +- .../scripts/build_기계_건설품셈.py | 2 + .../master_data/scripts/master_doc_link.py | 2 +- .../tester/test_854_3_machine_unit_mirror.py | 51 +++++++++++++++++++ 6 files changed, 58 insertions(+), 4 deletions(-) create mode 100644 resources/tester/test_854_3_machine_unit_mirror.py diff --git a/M02_MasterTemplete/M02_Labor_Spec.py b/M02_MasterTemplete/M02_Labor_Spec.py index dcd7a8c0a..c7e800ab8 100644 --- a/M02_MasterTemplete/M02_Labor_Spec.py +++ b/M02_MasterTemplete/M02_Labor_Spec.py @@ -5,7 +5,7 @@ 규격 수량이 있는 줄 = 고른 열 값이 `{손}` 자리 · 없는 줄 · 빈 열 = 문서 `수량` 그대로(공통). 규격 없음 = 옛 문서(열 하나 · 셈 그대로 · 옮김 없음). 짝(CLAUDE.md 5장 ①): `at` ↔ `M02_MasterTemplete_Labor_Calc.ts` `atSpec` — -거울 시험 `resources/tester/test_m02_labor_calc_mirror.py`. +거울 시험 `resources/tester/test_m02_labor_calc_mirror.py`. 화면 짝 = `M02_MasterTemplete_Labor_Spec.ts`(규격 줄 · 열 펼침 · 같은 `규격` 칸 이름). 사본(`M02_Item_Source.build_source`) = 설계가 고른 열(summary_item `spec`)을 `{손}` 으로 굳히고 `규격` 은 그 열 하나만 남김(`freeze`). """ diff --git a/M02_MasterTemplete/M02_Share_Request.py b/M02_MasterTemplete/M02_Share_Request.py index 1d078f0c5..15f985b72 100644 --- a/M02_MasterTemplete/M02_Share_Request.py +++ b/M02_MasterTemplete/M02_Share_Request.py @@ -9,7 +9,7 @@ 그 회사 전부 · 일반은 자기 것 · 승인 · 거절 = 회사 층 쓰기(일반 403) · 다른 회사 장부는 안 봄(시스템 관리자만 `company`). 같은 항목(주인 · 종류 · 키)이 「요청」 상태면 다시 요청 = 409 「요청 중」. -⚠ 등록은 `main.py`(로그인만). +⚠ 등록은 `main.py`(로그인만). 화면 짝 = `M02_MasterTemplete_ShareRequest.ts`(장부 칸 이름). """ from __future__ import annotations diff --git a/common_util/common_util_line_stack_unit.ts b/common_util/common_util_line_stack_unit.ts index e2b070470..f05be2c55 100644 --- a/common_util/common_util_line_stack_unit.ts +++ b/common_util/common_util_line_stack_unit.ts @@ -14,7 +14,8 @@ import type { DocVar, MoneyLine, Node } from "./common_util_formula_doc"; import { evalNode, tryParse, type Values } from "./common_util_formula_doc_view"; -/** 기계 표 칸 단위(`build_기계_건설품셈.py` UNIT · `M02_MyMachine.py` UNITS · 845-1 문서 단위와 같은 글) */ +/** 기계 표 칸 단위(`build_기계_건설품셈.py` UNIT · `M02_MyMachine.py` UNITS · 845-1 문서 단위와 같은 글 · + * 거울 시험 `test_854_3_machine_unit_mirror.py` — 칸을 더하거나 글을 바꾸면 셋 모두 · 화면 표시용 ㎾h 만 다름) */ export const MACHINE_UNIT: Record = { 가격: "천원", 내용시간: "시간", diff --git a/resources/master_data/scripts/build_기계_건설품셈.py b/resources/master_data/scripts/build_기계_건설품셈.py index 94d2a926a..4d0de79b8 100644 --- a/resources/master_data/scripts/build_기계_건설품셈.py +++ b/resources/master_data/scripts/build_기계_건설품셈.py @@ -425,6 +425,8 @@ def load(): return t83, t84, t85 +# 기계 칸 단위 — 짝(표 셋): `common_util_line_stack_unit.ts` MACHINE_UNIT · `M02_MyMachine.py` UNITS · +# 거울 시험 `resources/tester/test_854_3_machine_unit_mirror.py`(칸을 더하거나 글을 바꾸면 셋 모두) UNIT = { "가격": "천원", "내용시간": "시간", diff --git a/resources/master_data/scripts/master_doc_link.py b/resources/master_data/scripts/master_doc_link.py index 72facfb2a..349635ea0 100644 --- a/resources/master_data/scripts/master_doc_link.py +++ b/resources/master_data/scripts/master_doc_link.py @@ -6,7 +6,7 @@ 마스터 색인(`Master`) · 요소 값(준용 · 자재 고르기 · 단위 환산 = `master_material` · `master_pick`)만 씀. 표 찾기(범위 규칙 · 여러 줄 가름)는 여기 -· TS 짝 = `common_util/common_util_formula_doc_calc.ts` `findRow`. +· TS 짝 = `common_util/common_util_formula_doc_table.ts` `findRow` · `cellArith`(거울 시험 test_802_1_formula_doc.py). 수식 문서 저장 자리 = `resources/master_data/수식문서/수식_<옛 로직 파일 꼬리>.json` (로직 파일마다 한 벌). """ diff --git a/resources/tester/test_854_3_machine_unit_mirror.py b/resources/tester/test_854_3_machine_unit_mirror.py new file mode 100644 index 000000000..23a0fd4d1 --- /dev/null +++ b/resources/tester/test_854_3_machine_unit_mirror.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +"""PLAN 854-3 — 기계 칸 단위 표 셋 거울: 화면(`common_util_line_stack_unit.ts` MACHINE_UNIT) · +내 기계(`M02_MyMachine.UNITS`) · 기계 표 빌더(`build_기계_건설품셈.UNIT`). + +같은 칸 이름은 단위가 같음 — 화면 표시용 글자 바꿈(kWh → ㎾h)만 규칙으로 봄 · +빌더의 「주연료의 %」 는 설명 붙은 % 라 % 로 봄. +세 표 어디에도 없는 TS 칸은 시간당 금액 칸(노무비 · 재료비 · 경비)뿐. +""" + +from __future__ import annotations + +import importlib +import re +import sys +from pathlib import Path + +ROOT = Path(__file__).resolve().parents[2] +sys.path.insert(0, str(ROOT / "resources" / "master_data" / "scripts")) + +from M02_MasterTemplete import M02_MyMachine as my # noqa: E402 + +build = importlib.import_module("build_기계_건설품셈") + +MONEY_ONLY_TS = {"노무비", "재료비", "경비"} + + +def _ts_table() -> dict[str, str]: + src = (ROOT / "common_util" / "common_util_line_stack_unit.ts").read_text(encoding="utf-8") + body = re.search(r"MACHINE_UNIT: Record = \{(.*?)\n\};", src, re.S) + assert body, "MACHINE_UNIT 표를 못 찾음" + return dict(re.findall(r'^\s*([^\s:]+): "([^"]*)",?$', body.group(1), re.M)) + + +def _screen(unit: str) -> str: # 화면 표시용 글자 바꿈 — 파이썬 글 → 화면 글 + return unit.replace("kWh", "㎾h").replace("주연료의 %", "%") + + +def test_machine_unit_tables_mirror() -> None: + ts = _ts_table() + assert len(ts) == 16 + py = {"내 기계": my.UNITS, "빌더": build.UNIT} + for name, table in py.items(): + for col, unit in table.items(): + if not unit: # 무차원 = 화면 표 밖 + continue + assert col in ts, f"{name} 칸 「{col}」 이 화면 표에 없음" + assert ts[col] == _screen(unit), f"{name} 「{col}」 단위 {unit!r} ≠ 화면 {ts[col]!r}" + for col in ts: + assert col in MONEY_ONLY_TS or any(col in t for t in py.values()), ( + f"화면 칸 「{col}」 짝 없음" + ) From f5b1ba6ff8a5ae0b63c78ed459e9052ee77bc833 Mon Sep 17 00:00:00 2001 From: umsangdon Date: Tue, 17 Nov 2026 18:10:48 +0900 Subject: [PATCH 09/30] =?UTF-8?q?test(853-4):=20719-2=20SK=20=EC=85=88=20?= =?UTF-8?q?=EC=A4=80=EB=B9=84=20=ED=99=95=EC=9D=B8=20=E2=80=94=20=EA=B1=B4?= =?UTF-8?q?=EB=84=88=EB=9C=80=EC=9D=84=20=EC=8B=A4=ED=8C=A8=EB=A1=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - test_SK_단가_덮개_속_일위대가_펼침: 「715-1b 엔진 덧칸 뒤」 조건 건너뜀 → 단언 — 지금은 늘 셈(기준선에서 통과)이라 건너뜀이 셈 고장을 덮는 꼴만 남음 Co-Authored-By: Claude Opus 5.5 --- resources/tester/test_719_2_sk_project.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/tester/test_719_2_sk_project.py b/resources/tester/test_719_2_sk_project.py index 741cc81ee..5593213fb 100644 --- a/resources/tester/test_719_2_sk_project.py +++ b/resources/tester/test_719_2_sk_project.py @@ -119,8 +119,8 @@ def test_SK_대가_블록_금액_M02_같음_하위_산근(world, tmp_path): def test_SK_단가_덮개_속_일위대가_펼침(world, tmp_path): - if not _engine_ready(world): - pytest.skip("715-1b 엔진 입력 덧칸(단가 · 값묶음) 뒤 — 지금은 M02 SK 셈도 못 함") + # 715-1b 엔진 입력 덧칸(단가 · 값묶음) — 못 세면 건너뛰지 않고 실패 + assert _engine_ready(world), "M02 SK 셈이 단가 덮개를 못 셈(715-1b 엔진 입력 덧칸)" key = _mine(world, full=True) # 740-1 — 속 일위대가 = 넣을 때 펼쳐 담음(SC 로직 줄 = 로직 더한줄 · 본뜬) → 빠진 줄 없음 live = _calc(world["personal"], key) From 3825754a981da23dcf90d58b8b56d661cfb7642c Mon Sep 17 00:00:00 2001 From: umsangdon Date: Tue, 17 Nov 2026 18:13:59 +0900 Subject: [PATCH 10/30] =?UTF-8?q?chore(ledger):=20=EC=84=A4=EA=B3=84=20856?= =?UTF-8?q?=20=E2=80=94=20=EA=B1=B8=EC=9D=8C=203=20=EB=8B=A8=EA=B0=80?= =?UTF-8?q?=EC=82=B0=EC=B6=9C=20=ED=99=94=EB=A9=B4=20=ED=95=98=EB=82=98(?= =?UTF-8?q?=EC=A4=84=20=EC=B0=BD=20=E2=86=92=20=EC=A4=84=20=EC=8C=93?= =?UTF-8?q?=EA=B8=B0=20=C2=B7=20=EC=83=81=EC=84=B8=20=EB=AA=B8=20=EA=B1=B7?= =?UTF-8?q?=EA=B8=B0=20=C2=B7=20=EA=B1=B0=EA=BE=B8=EB=A1=9C=20=EB=B6=80?= =?UTF-8?q?=EB=A6=84=20=C2=B7=20=EB=B3=B4=EC=9D=BC=20=EC=9E=90=EB=A6=AC=20?= =?UTF-8?q?=ED=9B=84=EB=B3=B4)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude --- .../요구_1104/설계_856_단가산출화면하나.md | 236 ++++++++++++++++++ 1 file changed, 236 insertions(+) create mode 100644 docs/raw/요구_1104/설계_856_단가산출화면하나.md diff --git a/docs/raw/요구_1104/설계_856_단가산출화면하나.md b/docs/raw/요구_1104/설계_856_단가산출화면하나.md new file mode 100644 index 000000000..7fb94ed28 --- /dev/null +++ b/docs/raw/요구_1104/설계_856_단가산출화면하나.md @@ -0,0 +1,236 @@ +# 설계 856 — 걸음 3 「단가산출 화면 하나」 (PLAN 856) + +요구 896 · 898 · sub7 · 2026-11-17 · 읽기 · 세기만(코드 · 자료 · 시험 고침 0 · 화면 저장 0). 세는 도구 · 결과 = `tmp/s894/m856/`(4 절 끝 표). +바탕 = 분석 `_분석_894-D_화면.md`(아래 「D」) · 걸음 2 설계 `설계_855_정본하나_계산기하나.md`(「본 설계」) · 보충 `설계_855_보충_B09_로직JSON_호환.md`(「보충」) · `설계_858_서고한벌.md` 5 절 · `tmp/s894/c4/표시_자릿수.md`. + +## 0. 한눈 요약 + +- **옛 상세 몸이 보이는 곳은 이미 거의 없음** — M02 층(마스터 · 회사 · 개인)의 일위대가에서 단가산출 줄을 누르면 **벌써 줄 쌓기**(`Labor_SkEdit` → 그 SK 문서 · `Labor_Table.ts:338`)가 열림. 옛 줄 창(`Labor_RowModal` → `RowSk` → 상세 몸)은 **M01 로직을 바로 담은 줄**과 **프로젝트 사본(셈 주입)** 에서만 열림(`Labor_Table.ts:322-358`). 저장본에 그 줄은 **0**(SC 줄 28 = SK 참조 11 · SC 참조 2 · 고정 15 · M01 로직 줄 0 · 패치 0 / SK 14 의 덮개 · 뺀줄 · 더한줄 · 고름 · 자재표시 · 열린입력 값 0 · 프로젝트 사본 0). +- 그런데도 **상세 몸은 SK 를 열 때마다 숨긴 채 그려지고 서버 셈 두 번**(`Sangeun_Detail.ts:216-217` · `:301-360`) — 걷으면 SK 화면이 가벼워지고 `/sangeun/calc` 의 화면 손님이 **머리 띠 하나**로 줆. +- 사용자가 줄 창에서 하던 일 13 가지 중 **줄 쌓기가 대신하는 것 9 · 대신할 것 없음 2(재료 줄 관급 · 별도계상 표시 · 열린입력 배율) · 이미 죽음 2** (1 절 표). +- 걷는 화면 = M01 이름 2 파일(831 줄) + M02 9 파일(약 1.8 천 줄) — `LogicLab_Ho` · `_Cover`(M02 만 씀) · `Sangeun_Cover_Model` · `Undo` · `BaseHead` · `Sangeun_Cover` · `Sangeun_Unit` · `Labor_RowSk` + `Sangeun_Detail` · `RowModal` 절반. 서버 쪽 화면 0 이 되는 것 = `/sangeun/calc` 길 · 덮개 · 뺀줄 · 더한줄 · 패치 셈(26 파일 269 자리 — 2-E2 로 넘김). +- **자릿수** — 지금 화면엔 「원문 자릿수로 보임」 규칙이 **없음**(셈 값을 소수 여섯 자리까지). 품셈 1 장에 단위 · 소수 자리 규정이 있음(건설 1-2-1 · 1-2-2 · 8-1 주① · 산림 1-2-1 · 1-2-2) → 후보 셋 · 권함 = 「원문 글자 자리 + 갈래 기본 자리」 한 규칙(값은 사용자 확정). +- 차례: **856-1(상세 몸 걷기)은 지금 바로 가능**(자료 0 · 서버 안 건드림) · 856-2(머리 띠를 문서 답으로 · `/sangeun/calc` 화면 0)는 **2-C1 뒤** · 856-3(프로젝트 사본 줄 = 줄 쌓기 보기)은 **B9-5 뒤** · 자릿수(856-5)는 사용자 확정 뒤. + +--- + +## 1. 일위대가 줄 창을 줄 쌓기로 + +### 1-1 지금 줄을 누르면(`Labor_Table.ts:322 openAt`) + +| 줄 갈래 | 지금 열리는 창 | 저장본 수(`census_rows.py`) | +| --- | --- | --- | +| SC 참조(일위대가 속 일위대가) | `Labor_RefEdit`(그 SC 표) | 2 | +| 고정 | 안 열림(숫자 그대로) | 15 | +| **SK 참조 · M02 층** | **`Labor_SkEdit` = 그 SK 문서 줄 쌓기**(`:338` · 806-1) — 이미 「한 화면」 | 11 | +| SK 참조 · 셈 주입(프로젝트 사본 카드 `ItemCards.ts:334`) | `Labor_RowModal` → `RowSk` → 상세 몸 | 0(프로젝트 사본 0) | +| **M01 로직 바로 담은 줄** | `Labor_RowModal` → `RowSk` → 상세 몸(`lineDoc` = 키 `SK-000000` 줄 문서) | 0 — M02 층 [로직 더하기]는 811-1 부터 SK 사본 참조로 담음(`Labor_Table.ts:462-473`) · 프로젝트 층 · 셈 주입만 아직 로직 줄 | +| 사용자 자재 | `openMatModal`(세 칸 · 가격 보기) | 0 | + +→ 856 의 「줄 창을 줄 쌓기로」 = 남은 두 갈래(M01 로직 줄 · 셈 주입 SK 줄)를 없애거나 줄 쌓기로 돌림. + +### 1-2 줄 창에서 하던 일 → 줄 쌓기가 대신하는 것 + +| 줄 창에서 하던 일(근거) | 저장 칸 | 줄 쌓기의 같은 일 | 판정 | +| --- | --- | --- | --- | +| 입력 칩 · 박스 옵션 고르기(`Sangeun_Detail.ts:418 onInput` · `RowSk.ts:83 values`) | 줄 `입력값` | 옵션 가로(`formula_doc_options`) — SK 문서 자기 입력 | **대신함**(줄마다 SK 하나 = 사본이라 줄 입력 = 그 SK 입력) | +| 품 · 비목 단가 덮기(`HoEdit.set` → `Cover_Model.ts:347 setLineCover`) | `덮개` · 줄 `패치.덮개` | 금액 줄 수량 식 · 단가 칸 바로 고침(문서 고침 = `따로`) | **대신함** | +| 줄 빼기(`Sangeun_Detail.ts:368 dropLine`) | `뺀줄` | 금액 줄 지움 | **대신함** | +| 뺀 줄 되살림 띠(`removedStrip` · `restoreLine`) | `뺀줄` · `뺀더한줄` | 줄 쌓기 [되돌림] · 바뀐 자리 표시(`line_stack_diff`) · [초기화] | **대신함**(되살림 목록 대신 되돌림) | +| 기초 · 줄 더하기(`Sangeun_Pick` · 더한줄) | `더한줄` | [+ 줄] 메뉴(단가산출 복사 · 요소 · 기계) | **대신함** | +| 더한 기초 수량 · 되돌림 · 기초 빼기(`BaseHead` `onQty` `onReset` `onDrop`) | `더한줄[k].수량` | 넣은 단가산출 줄 수량 식 · 줄 지움 | **대신함** | +| 재료 고르기(`pickMat` → `고름` cid→MT) | `고름` | 재료 줄 고르기(`line_stack_pick` · `_material`) | **대신함** | +| 이름 · 단위 · 단위 환산(`drawHead` · `Sangeun_Unit` `buildUnitSwap`) | `이름` `단위` `환산` | SK 화면 머리(남김 — 몸이 아니라 머리) | **남김** | +| 머리 띠(까닭 · 빠진 줄 · 짝 잃음 · M01 개정 · 「셈 머리」 배지) | — | 2 절 — 줄 쌓기 답 · 문서 읽기 알림으로 | **옮김**(856-2) | +| 줄 재료 관급 · 별도계상 · 세 칸 표시(`RowModal.ts:96 logicMatRows mark` · `setApart`) | 줄 `자재표시` · SK `자재표시` | **없음** — 줄 쌓기의 「별도계상」 은 불러온 재료 표지뿐(`line_stack_material.ts:71-86`) | **대신할 것 없음** — B09 가 SK `자재표시` 를 대비표 기본 표시로 읽음(841-1) · 저장본 값 0 · 판단 거리 1 | +| 열린입력 배율(`Cover_Model.ts:363` 열린입력 SK = 품 대신 배율) | `열린입력` · `덮개.배율` | 없음 | **대신할 것 없음** · 저장본 값 0 → 걷음(호환 안 만듦) | +| 켜쌓기율 · 메모 보기(`RowModal.ts:79-80`) | 줄 `켜쌓기율` `메모` | 메모 = 일위대가 표 칸 그대로 · 켜쌓기율 = 로직 줄 전용(값 0) | 메모 남김 · 켜쌓기율 **걷음**(로직 줄과 같이) | +| [적용] = 줄에 패치 · 입력값 남김(`RowModal.ts:146-161`) | 줄 `패치` `입력값` | SkEdit [저장] = 그 SK 문서 저장(`Labor_SkEdit.ts` 머리) | **대신함**(저장 길이 SK 문서 하나) | + +### 1-3 `SK-000000` 줄 문서 약속 · 저장 꼴 + +- 지금 — 키 글자로 화면 모드가 갈림: `/^SK-(?!0{6})\d{6}$/`(`Sangeun_Detail.ts:118 · 319`) → 저장한 SK = 줄 쌓기 · `SK-000000`(`lineDoc` · `Cover_Model.ts:584`) = 상세 몸. +- 바꿈 — 줄 문서가 없어지므로 약속을 걷고 **모드를 옵션으로**: `mode: "page"`(단가산출 화면) · `"ref"`(SkEdit — 저장한 SK) · `"memory"`(불러오기 미리 보기 · 프로젝트 사본 SK 보기 — `line_stack_screen.ts:17 · 157` 의 `memory` = 보기만 · 디스크 쓰기 0). 키 정규식 두 곳 지움. +- 저장 꼴 — 일위대가 줄 = **`{참조: {층, 주인, SK}, 별칭, 메모, 수량}` 한 행**(`M02_Labor_SkRow.py` 머리 · 811-1) 그대로. 걷는 칸 = 줄 `패치` · `입력값` · `고름` · `자재표시` · `켜쌓기율` · `로직`(로직 줄 자체) — 저장본 값 0 · 호환 안 만듦(요구 899). +- 남은 로직 줄 길 둘을 닫음: + - **프로젝트 층 [로직 더하기]**(`Labor_Table.ts:462` `own` 이 프로젝트 층을 뺌) → M02 층처럼 그 층 SK 사본 참조로(`skFromLogic` · 프로젝트 층 `templates/sangeun` — 지금 0). + - **셈 주입(프로젝트 사본 카드)의 SK 줄** → 사본 안 SK 수식 문서를 `memory` 줄 쌓기로 **보기만**(프로젝트는 고치지 않음 · 고침 = M02 에서 고쳐 [재생성] · 요구 898 ①). 사본 꼴이 수식 문서 사본이 되는 B9-5 뒤. + +--- + +## 2. 상세 몸 걷기 + +### 2-1 걷는 화면 파일(`census_imports.py` · 결과 `out_imports.tsv`) + +| 파일 | 줄 | 부르는 곳 | 걷은 뒤 | +| --- | --- | --- | --- | +| M01 `UI_LogicLab_Ho` | 689 | M02 `Sangeun_Detail` 하나 | **지움**(M01 이름 · M02 만 씀) | +| M01 `UI_LogicLab_Cover` | 142 | `LogicLab_Ho` 하나 | **지움** | +| M01 `UI_LogicLab_Detail` | 162 | M01 `LogicLab` + M02 `Sangeun_Detail` | **남김**(M01 보기 넷 그대로) · M02 부름만 뺌 | +| M01 `UI_LogicLab_Modal` | 574 | M01 `LogicLab` · `CalcPick` · `LogicLab_Ho` · M02 `Labor_LogicMats` | 남김(`Ho` 부름만 빠짐) | +| M02 `logic/Sangeun_Cover_Model` | 627 | `Labor_Api`(타입 `LinePatch`) · `RowSk` · `BaseHead` · `Sangeun_Cover` · `Sangeun_Detail` · `Undo` | **지움**(`LinePatch` 타입도 · 줄 `패치` 칸 걷음) | +| M02 `logic/Sangeun_Undo` | 93 | `Sangeun_Detail` · `Cover_Model` | **지움** | +| M02 `Sangeun_BaseHead` | 92 | `Sangeun_Detail` | **지움** | +| M02 `Sangeun_Cover` | 72 | `RowModal` · `RowSk` · `Sangeun_Detail`(`calcSangeun` · `removedStrip`) | 856-1 = `removedStrip` 지움 · 856-2 = 파일 지움 | +| M02 `Sangeun_Unit` | 103 | `Sangeun_Detail` 머리 | 남김(머리 단위 환산) — 856-2 에서 바탕 정보를 문서에서 받으면 같이 정리 | +| M02 `Labor_RowSk` | 101 | `RowModal` | **지움** | +| M02 `Labor_RowModal` | 240 | `Labor_Table` | 로직 줄 · 상세 · [적용] 걷음 → 자재 모달(`openMatModal`)만 남음(약 −150) | +| M02 `Sangeun_Detail` | 497 | `Sangeun_View` · `SkEdit` · `RowSk` · `Hopyo_Imported` | 몸 · `bare` 셈 · `hoEdit` · `pickMat` · `buildLabDetail` 부름 · 키 정규식 걷음(약 −250 → 250 안팎) | +| M02 `Sangeun_Tabs` | 85 | `Sangeun_Detail` | `editor` 숨김 · `show` 걷음(약 −15) | +| M02 `Labor_LogicMats` + `_Model` | 160 + 53 | `RowModal` · `Labor_View`(면적 오른쪽 보기) · `Labor_Calc` · `Labor_Table` | 남김 — 로직 줄이 없어지면 856-3 에서 다시 셈 | + +합 = 지움 약 **1.9 천 줄**(M01 0.83 · M02 1.05) + 줄임 약 0.4 천. 글 키(`M02_Sangeun*` · `Sk*` 덮개 · 뺀줄 글)도 같이. + +### 2-2 머리 띠를 문서 셈 답으로(856-2) + +| 머리 띠 | 지금 근거(`/sangeun/calc` 답 · `Sangeun_Detail.ts:248-284`) | 바꿀 근거 | +| --- | --- | --- | +| 까닭(빨강) | `ans.까닭` · 요청 실패 | 줄 쌓기 브라우저 셈 답 `표지`(계산기 한 벌 · 빈 값 까닭) — 이미 화면 안에 있음 | +| 빠진 줄(노랑) | `ans.빠진줄` | 문서 읽기 답의 빈틈(`M02_Doc_Gap` — [저장] · [단가 갱신] 때 채움 · 열 때 표지) | +| 짝 잃음(노랑) | `ans.짝잃음`(덮개 cid 가 줄을 잃음 · `Sangeun_Copy` 재생성 못 얹은 칸) | 덮개가 없어지므로 **재생성 못 얹은 칸만** — [재생성] 답(`formula_doc_copy`)이 이미 보여 줌 | +| M01 개정(빨강 배지) | `doc.바탕판` 대 `ans.바탕판` · `revisedAdds` | M01 자동 따라옴 알림(`formula_doc_renew` · `M02_Sk_AutoRenew` · 848-2)이 대신 — 「바탕판」 칸은 2-D 에서 걷힘(본 설계 5-1) | +| 셈 머리 배지(「계」 · 「합계」) | `ans.머리` | 브라우저 셈 답 `머리` | + +- `recalc` 의 두 번 셈(`:214-218` — 바탕 원값 `bare` = 몸의 「원래 값」 칸용)은 **856-1 에서 한 번으로**(몸이 없으면 `bare` 쓰는 곳 0). +- 856-2 뒤 화면이 `/sangeun/calc` 를 부르는 곳 = 0(`calcSangeun` 부르는 곳 = `Sangeun_Detail:216-217` · `RowSk:53` 셋뿐 · 1 · 2 절에서 모두 걷힘). +- 2-C1 과 맞물림 — 2-C1 은 `/sangeun/calc` 답 꼴을 지키며 속을 문서 셈으로 바꿈. 856-2 가 화면 손님을 0 으로 만들면 **그 길은 일위대가 합산 속 SK 셈(서버 안 `Sangeun_Calc.run`)만 남음** → 2-C1 이 「답 꼴(줄 cid · 덮개 표지 · 빠진줄 · 정체 · 배)」 가운데 화면용 칸을 지킬 필요가 줆. + +### 2-3 걷은 뒤 서버 쪽에서 화면 0 이 되는 것(2-E1 · 2-E2 로 넘길 목록 · `census_server.py` · 결과 `out_server.tsv`) + +| 갈래 | 자리 | 넘김 | +| --- | --- | --- | +| 길 | `POST /layers/{층}/sangeun/calc`(`M02_Sangeun_Router.py:71`) | 2-E2(856-2 뒤 화면 0 · 서버 안 셈만 남음) | +| 덮개 · 뺀줄 · 더한줄 · 열린입력 · 배율 셈 | `Sangeun_Calc`(45 자리) · `Sangeun_Doc`(33) · `Sangeun_Const`(29) · `Library_Flat`(45 — 넣기 펼침) · `Library_Same`(13) · `Library_Delete`(9) · `Doc_Sk`(10) · `Sangeun_Formula`(9) · `Sangeun_Imported`(9) · `Doc_Import_Reset`(6) · `Sangeun_Copy`(6) · `Item_Sangeun`(8) | 2-E2 · 2-D(칸 걷음) — 저장본 값 0 · 호환 안 만듦 | +| 일위대가 줄 패치 | `Labor_Patch`(10) · `Labor_Ref`(7) · `Labor_Copy`(2) · `Doc_Take`(1) · `Labor_SkRow.to_sangeun` | 2-E2 · 856-3(로직 줄 0 뒤) | +| 상세 몸 풀이 글 · 시트 | `Sangeun_Views.text_of` · `Sangeun_Const._mids · sheet` · M01 `/text`(`Store.text` · M02 감쌈 `Logic_Lib_Read.py:67`) | 2-E1 · 2-E2(본 설계 4-1 「856 뒤」) | +| B09 「덮개」(702 · B09 자기 덮개 — 다른 뜻) | `Daega_Personal`(9) · `Labor_Source`(7) · `Past`(2) · `Calc_Labor`(1) | **넘기지 않음**(낱말만 같음 · B9 걸음 몫) | + +### 2-4 그 밖에 같이 정리 + +- `setLogicApiPaths` 전역(`Sangeun_Detail.ts:85` · 되돌림 없음 · D 4-3) — 몸이 걷히면 M02 가 M01 `Logic_Api` 를 쓰는 곳 = 머리 바탕 정보(`fetchLogic`) · 원문 패널(`tabOf`)만 → **M02 길을 인자로 넘기는 작은 읽기 함수**로 바꾸고 전역 걷음. +- 시험(몸만 붙든 것 · 이름 자리) — 지움 후보: `test_717_2b` · `717_3` · `722` · `725_1` · `737` · `740_2` · `750_2` · `796_2d` · helper `728_2` · `748_0`(+ `727_sk_base_add` 의 몸 부분) · 고침 후보(살아 있는 결과도 봄): `723_labor_table` · `806_1_labor_view` · `175_precombo_mats` · `222_1_m02_apart` · `m02_labor_logic_mats` · `m02_labor_mat_marks` · `799_2` · `804_*` · `836_5`(키 정규식 → 모드 옵션) — 걸음마다 그 자리만. + +--- + +## 3. 공용 폴더가 M02 를 거꾸로 부르는 것 + +### 3-1 지금(실측 · `grep import`) + +| A00 파일 | 부르는 M02 · M01 | 쓰는 것 | +| --- | --- | --- | +| `line_stack_screen.ts:73` | M02 `Api_Fetch` | `Layer` 타입만 | +| `line_stack_pick.ts:25-26` | M02 `Api_Fetch` · `Find_Pick` | `Layer` 타입 · `openFindPicker` | +| `line_stack_rows.ts:48` | M02 `Find_Pick` | `openFindPicker` | +| `line_stack_machine_ctl.ts:49` | M02 `Find_Pick` | `openFindPicker` | +| `line_stack_machine.ts:17-27` | M02 `Api_Fetch` · `MyMachine_Api` · `MyMachine_Form` · `MyMachine_Text` | `call` · 내 기계 목록 · `hourlyText` · 글 `mt` | +| `line_stack_material.ts:15-17` | M02 `Api_Fetch` · `Hopyo_Api` · M01 `Api_Fetch` | `call` · `at` · `placeNote` | +| `line_stack_edit.ts:59` | M02 `DataFlow/DF_UnitPick` | `createUnitPick` · `NO_UNIT` | +| `formula_doc_options.ts:14-15` | M02 `DataFlow/DF_Api` · `MyMachine_Text` | 기계 이름 · `mt` | +| `formula_doc_foot.ts:8-9` | M01 `LogicLab_Foot` · `LogicLab_Style.css` | `buildFoot` | +| `ui_template_item_picker_{detail,edit,project}` | M02 `Api_Fetch` · `Labor_Api` · `ItemCards` · `ItemSource` · `Values_Model` · `Drawing` · `Labor_Values` | 대부분 타입 · `readTemplate` · `calcLabor` | +| 순환 | `line_stack_machine_ctl ↔ line_stack_machine_work`(D 1-3) | — | + +### 3-2 끊는 꼴 · 범위 + +| 거리 | 꼴 | 856 에서 | 까닭 | +| --- | --- | --- | --- | +| `Layer` 타입 · `call`(길 부르기) | common_util 로 옮김(타입 · 얇은 부르기 한 함수) | **함** | 작음 · 3 파일 · 동작 불변 | +| `openFindPicker`(3 곳) | `createStackScreen` 옵션 `pick?: (kind, …) => …`(주입 훅) · M01 · M02 가 넘김 | **함** | 줄 쌓기가 M02 없이 돎의 핵심 · 856-1 에서 `Sangeun_Detail` 을 만질 때 같이 | +| `DF_UnitPick`(단위 고르기) · `DataFlow/` 이름 | 부품 상자로 옮김(`ui_template_unit_pick`) — 화면 요소 규칙과 맞음 | **함** | 이름 혼선(D 4-4) 해소 · 이동만 | +| `LogicLab_Foot` · `_Style.css`(M01 → A00) | A00 로 옮김(합계 상자는 공용) | **함** | 2 파일 이동 | +| 기계 창 · 내 기계(`MyMachine_*` 4) · `formula_doc_options` 기계 이름 | 주입 훅 `machine?: {list, hourly, names}` | **미룸 → 858**(서고 한 벌 5-6 이 내 기계 Api 를 「종류 + 층」 함수로 바꿈) | 858 과 같은 파일 | +| 불러온 재료 표지(`Hopyo_Api.at` · M01 `placeNote`) | 주입 훅 `material?` | **미룸 → 857**(불러오기 한 번 읽기) | 857 과 같은 파일 | +| `ui_template_item_picker_*` → M02 | 부품 상자가 M02 를 부르는 것 — 타입은 common_util · 함수는 주입 | **미룸**(구조물 조합 카드 · B08 이 씀 · 화면 하나와 무관) | 범위 밖 | +| `ctl ↔ work` 순환 | 둘이 같이 쓰는 타입 · 상수를 `line_stack_machine_types.ts` 로 | **함**(타입만 · 동작 불변) | 작음 | +| M01 이름 파일을 M02 만 씀(`LogicLab_Ho` · `_Cover`) | 2 절에서 지움 | **함** | — | + +--- + +## 4. 보이는 수의 자릿수 + +### 4-1 지금 규칙과 사용자 뜻의 차이 + +| 보이는 값 | 지금 규칙(코드) | 원문 규정(지식DB) | 차이 | +| --- | --- | --- | --- | +| 표 값(품 · 수량 · 계수) | `eqText` = 셈 값 그대로 · 소수 여섯 자리까지 · **끝 0 뗌**(`ui_template_equation.ts:169-185`) | 원문 표 글자 자리(예 산림 13-4-2 석공 「0.10」) | 끝 0 이 사라짐 — 「0.1 인」(2-C4 계산서 사진) · 표 JSON 자체에 끝 0 이 남은 수 4,775 / 소수 25,726 · 끝 0 없는 표 파일 25 / 83(`census_places.py`) — 예 `소요량_산림품셈_13장_구조물.json:18` 「석공」: 0.1 | +| 식이 낸 중간 값 · 품(시간당 · ÷ 작업량) | `eqText`(여섯 자리) | 건설 1-2-1 2 「지정 소수자리 아래 1 자리까지 산출 · 반올림」 · 1-2-2 1 단위표준(직공인부 인 2 자리 · 토적 ㎥ 2 · 면적 ㎡ 1 …) · 1-2-2 3 시공단위 품 = 일당시공량 1 단위 이하 2 · 10 단위 3 · … 10,000 단위 6 자리 · 8-1 [주]① Q 3 · n 2 · cm 3 자리 사사오입 · 산림 1-2-1 1 「인원 · 재적 셋째 자리 반올림 · 둘째 자리 표시」 | 0.027778(1 ÷ 36 hr)처럼 여섯 자리 — 공식 줄 651 · 금액 줄 수량 1,645(`표시_자릿수.md`) | +| 율 줄 단가(노무비 × 3 % 등) | `eqText` | 규정 없음(금액이 아니라 밑수) | 33,971.813333 — 317 | +| 줄 금액 | 소수 한 자리(`line_stack_out.ts` `one` · 셈 끝수 뒤 값) | 건설 · 산림 1-2-2 2 금액 단위표준 「일위대가표의 금액란 0.1 원 미만 버림」 | **맞음** | +| 비목 · 계 · 합계 | 원(`won` · 셈 끝수 뒤) | 「일위대가표의 계금 1 원 미만 버림」 | **맞음** | +| 기계 시간당 단가 | 기계 문서 셈 끝수 뒤(대개 원) | 8-1 기계경비 산정 | 대개 맞음(2-C4 계산서에서 21,846 원/시간) | + +근거 자리 — 건설 `resources/knowledge/original/원가계산/건설공사_표준품셈/본문/01_공통부문/제01장_적용기준/1-02_설계_및_수량.md:21-22`(1-2-1) · `:40-125`(1-2-2 1 표 · ①②③ 주) · `:127-139`(1-2-2 2 금액) · `:604-616`(1-2-2 3 품 자리) · `…/제08장_건설기계/8-01_적용기준.md:123-126` · 산림 `resources/knowledge/original/원가계산/산림_표준품셈/본문/제01장_적용기준/1-02_설계_및_수량.md:21-22 · 53-59 · 141-149`. + +- 원문 자리를 **알 수 있는 값** = 원문 표 숫자(표 JSON 글자 — 단 끝 0 이 빠진 표가 있음) · 원문 상수(식 안 숫자 글자) · 단위표준 표의 종목(단위로 찾음) · 금액 칸. +- **알 수 없는 값** = 식이 낸 중간 값 · 율 줄 단가 · 입력값(사용자) · 기계 손료 계수 셈. +- 셈은 이미 정밀(Decimal · 끝수는 문서 칸 · 식 안 반올림 함수) — 「보일 자리」 는 **그림만** 바꾸는 일. + +### 4-2 길 후보 + +| 후보 | 하는 일 | 좋은 점 | 나쁜 점 | +| --- | --- | --- | --- | +| ㉮ 갈래별 기본 자리 | 한 규칙 표 — 단위(인 · 시간 · ㎥ · ㎡ · m …) · 갈래(품 · 수량 · 단가 · 금액)마다 보일 자리(1-2-2 표 · 8-1 주①에서 고름) | 문서 · 자료 고침 0 · 짧음 | 원문 표가 3 자리인 품도 갈래 자리로 깎이거나 늘어남 | +| ㉯ 문서 칸 「보일 자리」 | 수식 문서 변수 · 금액 줄 수량 칸에 `자리`(그림 전용) · 빌더 · M01 [저장]이 원문 표 글자 자리 · 단위표준으로 채움 · 화면 · 서버 글이 읽음 | 원문과 줄마다 맞음 · 사용자가 고칠 수 있음 | 문서 1,521 · 표 끝 0 빠진 25 파일 보강 · 거울 시험 · 걸음 큼(로직 JSON 없애기 L1 과 같은 때가 쌈) | +| ㉰ 셈 자체를 원문 규정대로 반올림 | 1-2-1 2 「지정 자리 아래 1 자리 산출 · 반올림」 을 셈에 | 원문 글 그대로 | 「계산은 정밀」 과 어긋남 · 금액이 바뀜(전수 다름) | + +**권함 = ㉮ 를 먼저(기본) + 표 값만 글자 자리 그대로(끝 0 이 남은 표는 그 자리 · 없으면 ㉮)** — 화면 TS(`eqText` 앞 한 규칙) · 서버 풀이 글(`master_doc_text.eq_text` · 2-C4 짝)이 **같은 규칙 파일 한 쌍**(거울 시험)을 씀. ㉯ 는 L1(이름표 칸 싣기)과 같은 때 다시 판단. **자리 값(표)은 정하지 않음 — 사용자 확정**(판단 거리 2). + +--- + +## 5. 고치는 중 값 보관 + +| 화면 | 지금 | 856 뒤 | +| --- | --- | --- | +| 단가산출(SK) 화면 · SkEdit(일위대가 속 SK) | sessionStorage `m02_sk_doc_drafts`(SK 키별 · `line_stack_screen.ts:185 · 197 · 629` · `Sangeun_Tabs.ts:56`) | 그대로 — 줄 창이 줄 쌓기가 되면 **줄 속 SK 고침은 새로고침을 견딤** | +| 일위대가(SC) 표 자체(줄 차례 · 수량 · 별칭 · 메모 · 자재) | 메모리 + 떠날 때 `confirmLeave`(11 파일 · 858 5 절) | 그대로(856 범위 밖) | +| 상세 몸 고침(덮개 · 뺀줄 …) | 메모리(모달 닫으면 [적용] 전 버림) | 없어짐 | +| 프로젝트 사본 SK 보기 | 메모리 | `memory` 보기만 — 보관할 고침 없음 | + +- 858 이 「856 이 줄 창을 줄 쌓기로 바꾸면 SC 도 같은 보관을 얻음」 이라 맡김 → **반만 맞음**: 얻는 것은 SC 안 SK 고침뿐 · SC 표 자체는 메모리. +- **제안** — 856 은 넘기지 않음(SC 표 sessionStorage 는 따로 작은 걸음 · 열쇠 `m02_labor_drafts` · 표 문서 통째 · [저장] 때 비움 · 같은 SC 를 SkEdit 저장이 바꾸면 판 대조로 막음). 원하는지 = 판단 거리 4. + +--- + +## 6. 걸음 + +원칙 = 한 걸음 한 길 · 두 박자(새 길로 바꿈 → 화면 · 시험 같음 → 옛 길 지움) · 걸음마다 커밋. + +| 걸음 | 무엇 | 파일(어림 줄) | 지킴 | 위험 · 막는 법 | 화면 확인 | 앞 조건 | +| --- | --- | --- | --- | --- | --- | --- | +| **856-0 지킴** | 가짜 DOM 시험 — ① SK 화면 열 때 `/sangeun/calc` 부름 수 · 숨은 몸 DOM 0 ② 일위대가 SK 줄 누름 = 줄 쌓기 ③ 머리 띠 넷이 뜨는 경우(견본 답) ④ M01 로직 상세 그대로 | 새 시험 1 + helper(+ 200) | 지금 수치 그대로 | — | — | 지금 | +| **856-1 상세 몸 걷기** | `Sangeun_Detail` 몸 · `bare` 셈 · `hoEdit` · `pickMat` · `buildLabDetail` · 키 정규식 → 모드 옵션 · `RowSk` · `Cover_Model` · `Undo` · `BaseHead` · M01 `LogicLab_Ho` · `_Cover` 지움 · `RowModal` 로직 줄 갈래 · 줄 패치 타입 걷음 | M02 7 · M01 2 · 시험 약 10(− 1.9 천 · 시험 −) | 856-0 · `npm run typecheck` · `test_806_1` · `723` · `804_*` · `836_5` · `854_3`(누수) · 관련 시험 전부 | 로직 줄 · 셈 주입 줄을 누르면 열 창이 없어짐 → 856-3 까지 **안내 띠 한 줄**(「단가산출로 담아 쓰세요」 · 저장본 0 · 프로젝트 사본 0) | M02 단가산출 열기 · 일위대가 SK 줄 누름 · 불러오기 가져온 식 미리 보기 · M01 로직 상세 | 없음(지금 바로 · 2-C1 과 파일 안 겹침 — `Sangeun_Calc` · `Doc_Sk` 안 만짐) | +| 856-2 머리 띠 = 문서 답 | 띠 넷 근거를 줄 쌓기 셈 답 · 문서 읽기 알림으로 · `calcSangeun` · `Sangeun_Cover` 지움 · `setLogicApiPaths` 전역 걷음 | `Sangeun_Detail`(± 80) · `Sangeun_Unit`(± 20) · M01 `Logic_Api`(± 10) | 856-0 ③ · 화면 `/sangeun/calc` 부름 0 · `/openapi.json` 그대로(길 지움은 2-E2) | 「빠진 줄」 이 [저장] 때만 채워짐 — 열 때 표지 문구 확인 | 띠 넷(견본 SK) | 2-C1(`/doc` 답 꼴 · 빈틈 표지) | +| 856-3 남은 로직 줄 길 | 프로젝트 층 [로직 더하기] = SK 사본 참조 · 셈 주입 SK 줄 = `memory` 줄 쌓기 보기 · `RowModal` = 자재 모달만 · `Labor_LogicMats` 정리 | `Labor_Table`(± 30) · `RowModal`(− 150) · `ItemCards`(± 10) · `Labor_SkPick`(+ SK 사본 만드는 서버 길이 프로젝트 층을 받는지 확인 · ± 20) | B9 골든(`test_855_b09_golden`) · 사본 카드 화면 | 프로젝트 층 SK 서고 쓰기 권한 | B08 구조물 카드 일위대가 줄 | B9-5(사본 = 수식 문서 사본) | +| 856-4 거꾸로 부름 · 순환 | 3-2 「함」 줄(타입 · `call` → common_util · `pick` 훅 · 단위 고르기 · 합계 상자 이동 · `ctl ↔ work` 타입) | A00 6 · M01 2 이동 · M02 3(± 150) | typecheck · 줄 쌓기 가짜 DOM · `test_804_*` | import 경로만 — 동작 불변 | M01 · M02 줄 쌓기 [+ 줄] 고르기 · 기계 제어 구역 | 856-1(같은 `Sangeun_Detail`) | +| 856-5 보일 자리 | 4-2 권함 규칙 한 쌍(TS · PY) + 거울 시험 · `eqText` 앞 · `master_doc_text` | common_util 새 1(+ 120) · `master_doc_text`(± 30) · A00 `line_stack_out` · `_rows` · `calc_sheet`(± 30) | 거울 · 금액 불변(그림만) | 자리 표 값 = 사용자 확정 | 단가산출 오른쪽 · 계산서 · 일위대가표 | 사용자 확정 | +| 856-6 옛 길 지움(둘째 박자) | 856-2 뒤 서버 `/sangeun/calc` · 덮개 셈 목록(2-3 절) | → 2-E2 에 넘김(856 은 목록만) | — | — | — | 856-2 · 2-C1 | + +같이 돌릴 수 있는 묶음 — **856-0 → 856-1 은 지금(보충 묶음 ③ 의 2-C1 · 2-C3 · B9-2 와 파일 안 겹침)** · 856-4 는 856-1 뒤 같은 창 · 856-2 는 2-C1 뒤(보충 묶음 ④) · 856-3 은 B9-5 뒤(묶음 ⑤) · 856-5 는 확정 뒤 아무 때(파일 다름). 2-E1 · 2-E2(묶음 ⑥)는 856-2 뒤. + +--- + +## 7. 사용자 판단 거리 · 못 본 것 + +### 7-1 판단 거리(쉬운 말) + +1. **단가산출 속 재료 줄의 「관급 · 별도계상」 표시** — 옛 줄 창에는 있었고 새 단가산출 화면(줄 쌓기)에는 없음. 지금 쓰는 자료는 0 개. ㉠ 줄 쌓기 재료 줄에 표시 칸을 새로 둠(B09 대비표가 읽음) ㉡ 일위대가 표의 재료 칸에서만 표시(단가산출 안에서는 안 함) ㉢ 뺌. +2. **보일 자리** — 화면 숫자를 품셈 원문 자리로 보이려면 「단위 · 갈래마다 몇 자리」 표를 정해야 함(예: 인 = 2 자리 · 시간 = ? · ㎥ = 2 자리 · 율 줄 단가 = ?). 원문 표의 「0.10」 처럼 끝 0 도 살릴지. 셈은 그대로 정밀. +3. **프로젝트 사본의 단가산출 줄** — 프로젝트(구조물 카드)에서 단가산출 줄을 누르면 「보기만」(고침은 M02 에서 고쳐 [재생성]) — 맞는지. +4. **일위대가 표 자체의 고치는 중 값** — 지금은 새로고침하면 사라짐(떠날 때만 물음). 단가산출처럼 새로고침을 견디게 할지(따로 작은 일). + +### 7-2 못 본 것 + +- 화면을 열어 보지 않음 — 줄 창 · 머리 띠 동작은 코드 흐름 · 저장본 세기로 판정. 856-0 의 가짜 DOM 시험이 실제 확인 몫. +- 불러오기 미리 보기 호표(`Hopyo_View` 읽기 전용 표 · `Hopyo_Build.py:155 · 332`)에서 M01 로직 줄이 생기는 갈래가 있는지 — 857 몫으로 남김(있으면 856-1 의 안내 띠가 거기서도 뜸). +- 프로젝트 층(M02 페이지 `layer=project`) 일위대가가 실제로 쓰이는지 · 프로젝트 층 SK 서고 권한 — 856-3 앞에 확인. +- `M02_Sk_AutoRenew` 알림이 머리 띠 「M01 개정」 을 모두 대신하는지(둘째 기초 `revisedAdds` 포함) — 856-2 에서 견본으로. +- 자릿수 규정은 건설 · 산림 1 장 · 건설 8 장만 읽음(장마다 「[주] 소수」 규정이 따로 있을 수 있음 — 1-2-2 ② 「항목에서 제시한 자리 우선」). + +### 7-3 세기 결과(`tmp/s894/m856/`) + +| 도구 | 결과 | 핵심 수 | +| --- | --- | --- | +| `census_rows.py` | `out_rows.json` | SC 6 · 줄 28 = SK 참조 11 · SC 참조 2 · 고정 15 · 로직 0 · 패치 · 입력값 · 고름 · 자재표시 0 / SK 14 몸 칸 값 0 | +| `census_imports.py` | `out_imports.tsv` | 걷을 화면 파일 17 · 부르는 TS · 이름 부르는 시험 | +| `census_server.py` | `out_server.tsv` | 몸 칸을 읽는 서버 py 26 파일 269 자리(B09 「덮개」 다른 뜻 4 파일 포함) | +| `census_places.py` | `out_places.json` | 표 소수 25,726 중 끝 0 남은 것 4,775 · 끝 0 없는 표 파일 25 / 83 | From ff5f1a5e1b9649ec1811f03341e2d2ba2196d18d Mon Sep 17 00:00:00 2001 From: umsangdon Date: Tue, 17 Nov 2026 18:21:12 +0900 Subject: [PATCH 11/30] =?UTF-8?q?chore(ledger):=20=EC=84=A4=EA=B3=84=20857?= =?UTF-8?q?=20=E2=80=94=20=EA=B1=B8=EC=9D=8C=204=20=EB=B6=88=EB=9F=AC?= =?UTF-8?q?=EC=98=A4=EA=B8=B0=20=ED=95=9C=20=EB=B2=88=20=EC=9D=BD=EA=B8=B0?= =?UTF-8?q?(=EB=91=90=20=EA=B3=84=EB=B3=B4=20=EB=8C=80=EC=A1=B0=20=C2=B7?= =?UTF-8?q?=20=EC=9E=AC=EB=A3=8C=20=EA=B7=9C=EC=B9=99=20=EC=B0=A8=EC=9D=B4?= =?UTF-8?q?=20=C2=B7=20=EB=AC=B8=EC=84=9C=20=EB=B0=94=EB=A1=9C=20=C2=B7=20?= =?UTF-8?q?=EA=B1=B8=EC=9D=8C=20857-0=20~=205)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude --- .../요구_1104/설계_857_불러오기한번읽기.md | 277 ++++++++++++++++++ 1 file changed, 277 insertions(+) create mode 100644 docs/raw/요구_1104/설계_857_불러오기한번읽기.md diff --git a/docs/raw/요구_1104/설계_857_불러오기한번읽기.md b/docs/raw/요구_1104/설계_857_불러오기한번읽기.md new file mode 100644 index 000000000..8756a5d7a --- /dev/null +++ b/docs/raw/요구_1104/설계_857_불러오기한번읽기.md @@ -0,0 +1,277 @@ +# 설계 857 — 걸음 4 「불러오기 한 번 읽기」 (요구 896 · PLAN 857) + +sub8 · 2026-11-17 · 읽기 · 세기만(코드 · 자료 · 시험 고침 0). 바탕 = `_분석_894-C_불러오기.md`(「분석 C」) · `설계_855_정본하나_계산기하나.md`(「본 설계」) · `설계_855_보충_B09_로직JSON_호환.md`(「보충」) · `_방향_불러오기.md` 0 절. +세는 도구 · 결과 = `tmp/s894/m857/`(끝 표). 견본 = 저장소의 실무 엑셀 11(`test_797_1a_import_flags.FILES`) · 경쟁사 자료 내용 · 푸는 법은 안 옮김(모듈 구실만). + +## 0. 한눈 요약 + +- **두 계보가 읽은 블록은 이미 같음** — 엑셀 11 에서 단가산출 블록 번 · 단위 · 블록 금액이 두 계보 모두 같음(다름 1 = 빈 블록 「{}」 대 「0」). 이름만 꼴이 다름(EST 호표 쪽 = 「이름(규격)」 한 칸 · 둘 꼴 = 이름 · 규격 두 칸 / STmate 둘 꼴 = 「이름 규격 / 단위」 머리 글). → **호표 계보를 둘 꼴 위에 얹는 것은 가능**. 다만 호표 쪽이 더 읽는 것(항목 · 절 · 출처 · 직종 · 줄합 · 덮음 · **EST 일위대가 시트 전체**)을 둘 꼴에 더 실어야 함(1-3). +- **엑셀 11 중 2 개(516 블록)는 지금 화면에서 못 올림** — 일위대가 시트가 없으면 호표 읽기가 400 을 내고 산근 읽기까지 안 감(`M02_Hopyo_Router.py:83`). 산근 계보는 이 둘을 읽음(374 · 142 블록 · 「3,241 블록 재현」 에 들어 있음). 한 번 읽기(산근 계보 먼저)가 이것도 풂. +- **올림 한 번 = 책 열기 2 회 + 격자 XML 1 회**(`_open` 1 · `San_Book.sheets` 1 · 격자는 `opened` 재사용) — 큰 xlsx(거창)는 두 번째 열기만 9.3 초. 한 번 열기로 그만큼 줄어듦. +- **재료 이음 규칙을 호표 길에 그대로 쓰면 118 줄이 바뀜**(9 파일 · 자재 · 별도계상 393 줄 중) — 생김 106 · 다른 품목으로 바뀜 12 · 풀림 0 · 그중 **109 줄 금액이 엑셀과 달라짐**. 차이의 거의 전부는 「규칙」 이 아니라 **호표 길의 「단가가 엑셀과 같을 때만 이음」 관문**(`M02_Hopyo_Fixed.py:153`)에서 옴(생김 중 정확 일치 66 · 표기 32 · 규칙 F2 8). 고정 줄은 이으면 우리 단가로 셈 → 「엑셀 숫자 그대로」 와 정면으로 부딪힘(2 절 · 판단 거리 1). +- **「고를 재료」 판 첫 셈이 느린 까닭은 변환이 아니라 M01 「바뀌었나」 확인** — 블록마다 줄마다 `m01.loaded()` 가 M01 파일 날짜를 다시 잼(65 블록에 2,069 번 · 시간의 약 80 %) + 기계 파일 목록 glob 2,069 번. 실측 4 ~ 41 초/파일(북부청임도 95 블록 40.9 초). 셈 한 번 동안 M01 한 벌을 쥐면 결과 그대로 몇 초로 줄 것(5 절) — 「재료 줄만 도는 길」 보다 작고 안전. +- **가져온 식은 「옛 로직 줄 꼴 → 옛 엔진 → 빌더 변환기」 를 거쳐 문서가 됨**(`M02_Doc_Import.py:409-422` · `master_doc_convert.convert`). 2-C2 가 옛 엔진만 걷음 · **변환기(`master_doc_convert`)는 그대로 남음** → 본 설계 2-E3(빌더 · 변환기 은퇴) 앞에 857 의 「읽기기가 문서를 바로 냄」 이 끝나야 함(차례 조건 · 3 절). +- **L2 ⓒ(불러오기가 M01 로직 줄을 읽는 곳)는 실제로 9 곳 7 파일**(보충 2-2 의 「관문」 줄 대부분은 M01 요소 색인 `m01.loaded()` 로 로직 줄이 아님 · 4 절) — 857 걸음 안에 합침 권함. +- 걸음 = **여섯**(857-0 지킴 · 857-1 책 한 번 · 857-2 호표를 둘 꼴 위로 · 857-3 문서 바로 · 857-4 재료 한 벌 · 857-5 옛 길 지움) · 병행 묶음 셋 · 앞 조건 = 본 설계 2-C2 · 2-C3 · 2-C5(`Hopyo_Build._inside`) 끝(6 절). + +--- + +## 1. 읽기 한 번 + +### 1-1 지금 올림 한 번(엑셀) + +| 차례 | 자리 | 하는 일 | 책 열기 | +| --- | --- | --- | --- | +| ① | `M02_Hopyo_Router.py:83` → `M02_Hopyo_Excel.read_book:300` → `_open:112` | 일위대가 · 총괄표 · 단가산출 · 목록 시트(STmate = `Hopyo_Stmate.SHEETS`) 줄 · **일위대가 시트 없으면 400** | xlsx `openpyxl` 1 · xls `xlrd`(서식) 1 | +| ② | `Router.py:87` → `Hopyo_Grid.read:325` → `Hopyo_Excel.opened:102` | 격자(보기) — ① 책 재사용(`_OPENED:58` 프로세스 전역 하나) · xlsx 는 ZIP XML 을 따로 읽음(`Grid.py:212`) | 0(+ XML) | +| ③ | `Router.py:91` → `Sangeun_FromHopyo.keep:50` → `San_Book.sheets:40` | 산근 시트(STmate 8 · EST 7) 줄 — **책을 처음부터 다시 엶** | 1 | +| ④ | `FromHopyo._excel:73` → `San_Xlsx.read_sheets` → `Doc_FromNative.pack` | 둘 꼴 → `실무자료/산근/.json` `{파일 시트 엑셀}` | 0 | + +종류 가름 두 곳 · 시트 목록 둘: + +| | 호표 쪽 | 산근 쪽 | 갈림 | +| --- | --- | --- | --- | +| 종류 가름 | `Hopyo_Stmate.is_stmate:67` = 「일위대가표」 **와** 「단가산출근거」 | `San_Book.kind_of:67` = 「단가산출근거」 있으면 STmate · 「단가산출」 있으면 EST | 단가산출근거만 있는 STmate = 호표 쪽 EST 로 보고 「일위대가 시트 없음」 400 · 견본 11 에서는 셋 다 같은 판정 | +| 시트 목록 | `Hopyo_Excel` SHEET · SUMMARY · `ReadEst.SHEET` + LISTS · `Hopyo_Stmate.SHEETS`(7) · `Grid.EXTRA` | `San_Book.STM_SHEETS`(8 · 중기사용료 · 일위대가표 더 있음) · `EST_SHEETS`(7 · 기계경비 · 자재 · 노임 · 견적단가 더 있음) | 두 목록 합집합이 한 번에 읽을 시트 | + +### 1-2 세기 — 두 계보가 읽은 단가산출 블록(`m857_read.py` → `out_read.json`) + +| 파일 | 꼴 | 호표 쪽 단산 | 둘 꼴 산근 | 같은 번 | 단위 다름 | 금액 다름 | 이름 꼴 다름 | 호표 읽기 초 | 산근 책 다시 열기 초 | +| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | +| 북부청임도 | EST xls | 95 | 95 | 95 | 0 | 1(빈 블록) | 87 | 3.7 | 0.08 | +| 북부청사방 | EST xls | 67 | 67 | 67 | 0 | 0 | 47 | 1.9 | 0.10 | +| 거창 | EST xlsx | 61 | 61 | 61 | 0 | 0 | 47 | 10.4 | **9.28** | +| 봉화 · 영월 · 울진대흥 · 영덕 · 울진소광 · 대흥공통 | STmate xlsx | 282 | 282 | 282 | 0 | 0 | 282 | 12.4 | 3.29 | +| 2016사방 · 2026수목 | EST xls | **0(400)** | 516 | — | — | — | — | — | 0.13 | +| 합 | | 505 | 1,021 | 505 | 0 | 1 | 463 | 28.5 | 12.9 | + +- 「이름 꼴 다름」 = 같은 블록 · 쓰는 법만 다름(1 절 요약) — 둘 꼴에 「보일 이름」 하나를 더 실으면 됨. +- 「산근 책 다시 열기」 = 한 번 읽기로 없어지는 시간(거창 꼴 큰 xlsx 에서 큼). + +### 1-3 호표 계보가 둘 꼴 위에서 돌려면 더 실어야 할 것(호표 쪽 단산 칸 전수 · 505 블록) + +| 호표 쪽 칸(`Hopyo_Excel.read_book:369` keep) | 만드는 곳 | 읽는 곳(호표 계보 · 그 밖) | 둘 꼴에 지금 | 더 실을 것 | +| --- | --- | --- | --- | --- | +| 번 · 이름 · 단위 · 행 | ReadEst · Stmate | 목록 · 칠 · 격자 | 번 · 이름(+ 규격) · 단위 · 엑셀행 | 「보일 이름」(호표 쪽 꼴) | +| 금액 {계 노무비 재료비 경비} | 같음 | 검산 · 목록 | 저장 {T L M S} | 없음(이름만 바꿔 읽음) | +| 글 · 글행 | ReadEst(EST) | 근거 보기 · 칠 · `Hopyo_Formula` | EST 줄 `행` · `보임`(같은 시트 줄) / STmate 줄 `글`(숨은 G 열) | STmate = 보이는 글(B 열) 줄 · 아니면 그대로 | +| 출처 [[책, 절]] | `Hopyo_Clause.settle` | 근거 표 · `San_Basis_Index` | 없음 | 글에서 셈(지금 부품 그대로 · 둘 꼴 위로 옮김) | +| 직종 | `ReadEst.trade` | 근거 · `San_Basis_Index:122` | 없음 | 같음 | +| 항목 [{묶음 이름 규격 품 밑품 율 인자 어떻게 단가 금액 절 윗절 절율 행 재현 기준* 계수 손료율 …}] | `ReadEst.items:298` · `Hopyo_Formula` · `Hopyo_Stmate._blocks` | `Hopyo_Marks`(칠 · 줄 표지) · `Hopyo_Units` · `Hopyo_UnitLine`(재현 · 덮음) | EST 구조 줄(자원 · 결과 · 변수 · 연결단가 · 비목 · 품명) · STmate 원문 풀이 | **품 · 율 · 인자 · 절 나무(`Formula`)** — 구조 줄로는 못 냄 · 그 계산은 남기고 입력만 둘 꼴 줄로 | +| 절 [{번 층 제목 갈래 행 글 상수 식}](EST) | `Hopyo_Formula` | 칠 · 근거 | 없음 | 위와 같음 | +| 줄합 · 덮음 | `Hopyo_UnitLine.settle` | 호표 줄 투영 · 칠 | EST 없음 · STmate `줄합`(산근 쪽은 `pack` 이 버림 · 분석 C 2-1) | `줄합` 버리지 않음 | +| 코드 · 규격 · 자원(STmate) | `Hopyo_Stmate` | 목록 · 이음 | 코드 · 규격 · 줄 글 | 자원 줄 메타(M · H · X 열) | +| **EST 일위대가 시트(호표 · 줄 · 참조 · 갈래 · 검산)** | `Hopyo_Excel.read_book:300-360` | 호표 목록 · SC 만들기 · **B09 내역서 불러오기**(`B09_Estimation_Bill_Hopyo.py:41`) | **없음**(`San_Xlsx_Est` 일위 = 빈 목록 · STmate 는 `San_Xlsx_Ilwi` 로 있음) | EST 일위 읽기(지금 함수 그대로)를 둘 꼴 `일위` 로 | +| 일위대가총괄표 · 목록 시트 줄 | `_summary` · 격자 | 검산 · 격자 | 없음 | 시트 줄(한 번 읽은 책에서) | + +못 얹는 것(그대로 둠): +- **격자**(`Hopyo_Grid`) — 서식 · 병합 · 열 폭 = 책 자체(xls 서식 · xlsx XML)가 필요 · 둘 꼴과 무관. 한 번 연 책을 넘겨받는 꼴만. +- **붙여넣기**(`Hopyo_Paste.read_text`) · **B09 내역서**(`Bill_Excel` · `Import_Prices` · `Import_Rates` 가 `hx._text` · `_flat` · `_out` · `DRM` 씀) — 엑셀 책이 아닌 입구 · 작은 도우미만 공유 → 도우미를 공용 자리에 두고 그대로. +- 호표 쪽 **항목 계산 몸**(`ReadEst.items` 116 줄 · `Formula` 352 줄) — 읽는 것은 같은 시트 글이므로 「입력 = 둘 꼴 줄」 로만 바꾸고 몸은 둠(지우면 칠 · 줄 표지 · 고정 줄 회귀가 큼). + +### 1-4 끝 모습 + +- 책 열기 = **한 곳**(새 「책 한 벌」 · 시트 목록 합집합 · 종류 가름 한 말 · xls 서식 책 함께) → ① 둘 꼴(`pack` · 일위 포함) ② 격자 ③ 호표 목록이 그 위. +- 올림 순서 = **산근(둘 꼴) 먼저** → 일위대가 시트 없으면 호표 목록만 빔(400 아님) · 둘 꼴 못 읽으면 지금처럼 「읽기불가」 사유. +- `_OPENED` 전역 걷음(책 한 벌을 인자로 넘김). + +--- + +## 2. 재료 이음 규칙 한 벌 + +### 2-1 두 길 차이 전수 + +| 항목 | 단가산출 길 `San_Link.m01:15` → `San_MatFind.find:125` | 호표 길 `Hopyo_Fixed.Linker.link:107` · `_mats:159` | +| --- | --- | --- | +| 밑 부품 | `Hopyo_Match` · `Hopyo_Material` · `Hopyo_MatSame` · `Elem_Alias` | 같음(`hm._exact` · `hmat.sure`) | +| 코드 길 | EST 원파일 자원 코드 → 우리 자재 출처 코드(`ea.est_code` · 815-1 K1) | 없음 | +| 별칭 | 있음(`ea.keys`) | `hm._exact` 안의 별칭만 | +| 표기 다름(817-1) | 있음(`_how` 「표기」) | 없음 | +| 자동 규칙 A ~ F2 | 있음(`RULES:346`) | 없음 | +| 단서(산근 줄 글 · 머리 · 내역서 · 일위대가표) | 있음(`clues_on:91`) | 없음 | +| 단위 맞춤 | 쌍둥이 › 같은 성격 › 고르기(`_by_unit:176`) | 단위 배 = 1 일 때만 | +| **단가 값** | **안 봄**(판정 = 글만 · 두 판 [엑셀 단가로] · [우리 단가로]) | **엑셀 재료비 단가와 1 원 안으로 같은 품목 하나일 때만**(`_same:152`) | +| 유가 · 환율 | 재료 줄이 MO · 화폐 이름이면 유가 · 환율로 | 없음(자재만) | +| 별도계상 | 품목 찾되 이음 비움(단가 0 그대로) | 재료비 있으면 같은 관문 | +| 못 이은 줄 | 판정 다섯 갈래 + 후보 → 사람 고름(`San_MatPick`) | 후보 수만(`near`) → [수정] 모달 고름 | +| 이은 뒤 셈 | 가져온 식 = 두 판(엑셀 값 기억 · `Doc_Import` `엑셀` 칸) | **고정 줄 = 이은 비목은 우리 단가 책 값**(`M02_Labor_Fixed.py:6-9`) · 엑셀 값 기억 없음 | + +### 2-2 세기 — 호표 길이 단가산출 규칙을 쓰면(`m857_mat.py` → `out_mat.json` · `out_mat.tsv`) + +대상 = 일위대가 시트 호표 줄 중 자재 · 별도계상 갈래(9 파일 · 393 줄 · 단서 = 같은 파일 둘 꼴 단서). + +| 파일 | 같음(이음) | 같음(못 이음) | 생김 | 다른 품목 | 풀림 | 금액 달라짐 | 엑셀 값 그대로 | +| --- | --- | --- | --- | --- | --- | --- | --- | +| 북부청임도 | 1 | 97 | 32 | 12 | 0 | 44 | 0 | +| 북부청사방 | 0 | 48 | 8 | 0 | 0 | 5 | 3 | +| 거창 | 1 | 10 | 5 | 0 | 0 | 5 | 0 | +| 봉화 | 8 | 13 | 19 | 0 | 0 | 17 | 2 | +| 동부청영월 | 0 | 36 | 5 | 0 | 0 | 3 | 2 | +| 울진대흥 · 대흥공통 | 0 | 36 | 26 | 0 | 0 | 24 | 2 | +| 영덕계류 | 4 | 0 | 0 | 0 | 0 | 0 | 0 | +| 울진소광 | 0 | 13 | 11 | 0 | 0 | 11 | 0 | +| **합** | **14** | **253** | **106** | **12** | **0** | **109** | **9** | + +- 생김 106 의 방법 = 정확 일치 66 · 표기 32 · 규칙 F2 8 → **새 규칙보다 「단가 같을 때만」 관문이 차이의 대부분**. +- 다른 품목 12(북부청임도 돌망태 둘 × 6) = 호표 길은 단가가 엑셀과 같은 품목(지역 · 판이 맞는 줄)을 고름 · 단가산출 길은 단가를 안 보고 표기로 다른 품목을 고름 → **규칙 한 벌로 가면 이 12 줄은 품목이 틀어짐**(호표 길 쪽이 맞음). +- 「금액 달라짐」 = 이은 품목의 우리 단가 ≠ 엑셀 재료비 단가(고정 줄은 이으면 우리 단가로 셈). + +### 2-3 「엑셀 숫자 그대로」 와 부딪히는 자리 + +| 자리 | 부딪힘 | 피하는 법(안) | +| --- | --- | --- | +| 고정 줄 이음 = 우리 단가로 셈(`Labor_Fixed.py:6-9`) | 이음이 늘면 SC 금액이 엑셀과 달라짐(109 줄) | ㉠ **규칙 한 벌 = 「찾기」 만**(키 · 후보 · 판정) · 호표 길은 「단가 같음」 관문을 그대로 두고 단가 다른 짝은 「후보 · 판정」 으로만 보임(권함) ㉡ 고정 줄에도 엑셀 값 기억(두 판)을 둠(SC 꼴 바뀜 · 큼) ㉢ 이음 늘림을 받아들이고 금액이 우리 단가로 바뀌는 것을 인정 | +| 다른 품목 12 | 단가산출 길은 단가를 안 봐 지역 · 판이 다른 품목을 고름 | ㉠ 에서는 호표 길이 「단가 같은 후보」 를 먼저 고름 = 지금 결과 그대로 · 단가산출 길에도 같은 「값 같은 쌍둥이 먼저」 를 더할지는 판단 거리 2 | +| 705-3 「빠짐 0」 | 이음 판정이 바뀌어도 줄이 빠지지 않음(고정 줄 그대로) | 지킴 시험 그대로 | + +→ 권함 = **「찾기 한 벌 · 관문은 길마다」**: 호표 길 `_mats` 를 `San_MatFind.find`(단서 포함) 후보로 바꾸되 「엑셀 단가와 같은 후보 하나」 일 때만 이음 · 나머지는 판정 · 후보로 [수정] 모달에 보임. 이러면 금액 달라짐 0 · 생김 = 지금 관문을 통과하는 것만 · 다른 품목 0 · 화면의 「후보 · 판정」 말이 두 길에서 같아짐. + +--- + +## 3. 가져온 식을 문서로 바로 + +### 3-1 지금 길(블록 하나 → 저장 SK) + +| 단 | 꼴 | 자리 | 옛 식 파서 · 엔진 · 변환기 | +| --- | --- | --- | --- | +| ㉠ 둘 꼴 | 블록 구조 줄 | `Doc_FromNative.pack:49` | — | +| ㉡ 옛 로직 줄 `{로직 {이름 결과단위 입력 중간 호표 덧줄 단계 끝전 조정 끝수}, 원본}` | `Doc_NativeEst.block:610`(EST) · `San_Emit.stmate`(STmate) · 이음 · 재료 · 기계 판정 얹음 | `San_Expr` · `San_Stmate.parse_line`(경쟁사 글 풀이 · 남음) | +| ㉢ 가져온 식 SK `가져온 {로직 원본 검산 단가기준}` | `Sangeun_Imported.new_doc:569` · `check:368` → `_run:346`(옛 엔진) | 옛 엔진(2-C3 이 걷음) · `whole.logic`(:179) | +| ㉣ 수식 문서 | `Doc_Import.derive:409` = `_ctx:74`(옛 엔진 · **2-C2 가 걷음**) → `master.logic(key)` → **`master_doc_convert.convert`**(:422) → `_attach` · `_numbers` · `_native` · `Shape` · `Q` · `NativeLayout` | 변환기 · `mf.parse` · `mf._OPS` · `_plain`(`_swap_nth` · `_picks` · `_logic_link`) | + +옛 로직 줄 꼴(㉡ · ㉢)을 읽고 쓰는 자리(불러오기 안 · `out_l2.tsv` 의 「로직」 칸 줄): `Sangeun_Imported`(:7 · 109 · 127 · 281-319 · 334 · 374 · 513-518 · 578) · `Doc_Import`(:142 · 249 · 419) · `Doc_Import_Shape:259` · `Doc_NativeLayout:42 · 68-70` · `San_MatPick:206 · 342` · `San_MyMachine:368-391` · `Sangeun_FromHopyo:133-244` · `Sangeun_QtyLinks:241 · 290 · 330` · `Doc_FromNative:145` · `San_Emit` · `Doc_NativeEst` — **15 파일**. + +### 3-2 바꾸는 길 — 읽기기가 문서를 바로 냄 + +| 박자 | 무엇 | 걷히는 것 | +| --- | --- | --- | +| 첫 박자(857-3a) | ㉡ 꼴은 그대로 두고 **㉡ → 문서 변환을 불러오기 자기 모듈로**(새 `M02_San_ToDoc`) — 지금 `derive` 가 하는 일(변환기 몫 + 붙임 · 다듬기)을 옛 로직 줄 대신 ㉡ 를 직접 읽어 문서 변수 · 식 · 금액 줄로 · 식 글 파서 = 문서 파서(`master_doc.parse`) 또는 `San_Expr` | `Doc_Import` 의 `master_doc_convert` 부름 · `master.logic` · `_Row`(가짜 마스터) · `mf.parse` · `_OPS` · `_plain` | +| 둘째 박자(857-3b) | **SK 정본 = 문서**(`수식`) · `가져온` = `{원본 · 단가기준 · 검산}` 만(호환 안 만듦 · 요구 899) · 이음 고침 · 두 판 · 소요량 고름 · 재료 고름 · 내 기계가 문서 연결을 고침 · 다시 열기 = 저장 문서 그대로(`derive` 없음) | `가져온.로직` · `Sangeun_Imported` 의 옛 줄 꼴 정리(`clean_row` · `row_of` · `_with`) · `San_Basis_Index` · `Sangeun_QtyLinks` 의 옛 식 파서 부름(`mf.parse` · `_OPS` 5 + 3 곳) · `Doc_Import_Reset` 의 옛 줄 되돌림(초기화 = 원본에서 다시 지음) | +| 끝 | 2-E4 「바탕 기반」 새 모듈에서 **옛 식 파서도 뺌**(보충 3-3 의 「857 이 문서를 바로 내면 그때 파서도 걷음」) | `mf.parse` 류(불러오기 몫 0) | + +- 읽기기(㉠ · `San_Xlsx*` · `San_Estx` · `San_Stc`)와 `San_Expr` · `San_Stmate.parse_line`(경쟁사 글 풀이)은 그대로 — 바뀌는 것은 ㉡ 뒤. +- **차례 조건**: 본 설계 2-E3 이 `master_doc_convert` 를 은퇴시키므로 **857-3a 가 2-E3 앞**에 끝나야 함(아니면 2-E3 이 불러오기용으로 변환기를 남겨야 함). + +### 3-3 3,241 블록 금액 재현 지키는 법 + +| 지킴 | 지금 | 857 에서 | +| --- | --- | --- | +| 블록 금액(계 · 비목) | 저장소 시험 = `test_812_1` ③(엑셀 11 = 1,021 블록 · 문서 셈 = 엑셀 금액) · `test_810_2`(원파일) · 전수 3,241 = sub7 `tmp/s894/m855b/m855_import.py`(저장소 밖 · 옛 = 새 대조) | **857-0 에서 저장소 지킴 시험으로 올림** — 3,241 블록 × 두 판(엑셀 · 우리) 계 · 비목 지문(`golden_857_import.json`) + 검산 판정 지문 · 원파일 견본 없으면 건너뜀 | +| 줄 꼴 | 없음 | 블록마다 문서 금액 줄 수 · 이름 · 비목 지문(857-3 전후 같음 · 줄 쌓기 화면이 같은 줄을 봄) | +| 이음률 | `_방향_불러오기.md` 0 절 수(인력 100 · 기계 90.8 · 재료 72.0 %) | 지킴 시험 안에 갈래별 이음 수 · 판정 수 지문(857-4 는 「뜻한 바뀜」 표로 다시 뜸) | + +--- + +## 4. L2 ⓒ — 불러오기가 M01 로직 줄을 읽는 자리(`m857_l2.py` → `out_l2.tsv`) + +보충 2-2 의 「불러오기 이음」 줄(Hopyo_Elem 5 · Match 3 · Clause · Relink · Row · Units · Build · Doc_Import · San_*)을 코드 줄로 펼친 결과 — **대부분은 M01 요소 색인(`m01.loaded()[1]` · LB · MT · EQ · MO · FX)이라 로직 JSON 이 아님**. 로직 줄(로직 JSON)을 실제로 읽는 곳만: + +| 자리 | 읽는 것 | 갈 곳(수식 문서 읽기) | 걸음 | +| --- | --- | --- | --- | +| `M02_San_Basis_Index.py:160` | `로직_*.json` 파일을 **이름으로** glob | 수식 문서 파일(`수식_*.json` · `master_doc_link.load_all`) | 857-3b(옛 식 파서와 같이) | +| `M02_Hopyo_Clause.py:68-71` | M01 파일 중 그룹 「로직」 의 구분 · 원문번호(출처 → 기초 짝) | 문서 머리 원문번호(보충 L1 이 싣는 이름표) | 857-2 | +| `M02_Hopyo_Match.py:211-221` | 로직 줄 키 · 이름 + 알약 단위(`combo_pills`) — 맞춤 대상 | 문서 머리 이름 · 결과단위 | 857-2 | +| `M02_Hopyo_Units.py:72` · `:209` | `whole.logic(code).입력` · 기계 로직 | 문서 변수(입력 갈래) | 857-2 | +| `M02_Doc_Import.py:415` · `:488` | 옛 엔진 색인의 로직 줄 · 하위 로직 | 없앰(857-3a) | 2-C2 가 반 · 857-3a 끝 | +| `M02_Sangeun_Imported.py:179` | 「로직(GC…)」 부름 키 있나 | 문서 있나(`Links.doc`) | 2-C3 | +| `M02_Sangeun_Imported.py:419` | `over.logic(key)` 자동값(`mau`) | 문서 변수 기본값 | 2-C5(`_inner`) | +| `M02_Hopyo_Build.py:332-333` | `run_line` 로 하위 로직 금액 | 문서 셈 | 2-C5(`_inside`) | +| `M02_Hopyo_Relink.py:119` · `Hopyo_Compare.py:55` | `Labor_Ref.Expand`(일위대가 참조 펼침 — 안에서 로직 줄을 읽을 수 있음 · **유력**) | `Labor_Ref` 쪽 걸음을 따라감 | 2-C5 · 855-E | + +- 걷힐 것: `Hopyo_Ledger`(로직 장부 읽기 · 분석 C 「안 씀」) — 857-5 에서 지움. +- **차례**: 보충 L1(이름표 싣기)이 먼저 있어야 Clause · Match · Units 가 문서 머리에서 같은 칸을 읽음 → 857-2 는 L1 뒤 · 857-3b 는 2-C2 · 2-C3 뒤. 보충 4-2 묶음 ⑦(L2 ⓒ)은 **857 에 합침**(따로 걸음 안 둠). + +--- + +## 5. 「고를 재료」 판 첫 셈 · 저장본 무효 + +### 5-1 세기(`m857_census.py` · `m857_census_split.py` · `m857_prof.py` → `out_census*.json`) + +| 파일 | 블록 | 판 첫 셈 초 | 그 안 재료 찾기 초 | 인력 초 | 재료 줄 | +| --- | --- | --- | --- | --- | --- | +| 북부청임도 | 95 | 40.9 | 14.8 | 2.7 | 59 | +| 봉화 | 65 | 28.3 | 8.7 | 1.1 | 36 | +| 2026수목 | 142 | 21.2 | 9.1 | 6.1 | 72 | +| 그 밖 8 | 15 ~ 374 | 4.2 ~ 25.4 | — | — | 0 ~ 64 | + +프로파일(봉화 65 블록): **`m01.loaded()` 2,069 번 → `Store_Cache._stamps`(M01 파일 날짜 다시 잼 · `M01_MasterData_Store_Cache.py:57`) 누적 42.5 초 / 54.5 초**(약 80 %) · 기계 파일 목록 `master_machine_files.names:28` · `stamp:42` 2,069 번 · 별칭 책 `Elem_Alias.book:60` 591 번. + +### 5-2 1 ~ 3 과 같이 풀리나 + +| 문제 | 1 ~ 3 으로 풀림? | 따로 할 것 | +| --- | --- | --- | +| 느림 | **아님** — 한 번 읽기 · 규칙 한 벌 · 문서 바로는 이 확인 횟수를 안 줄임 | **판 셈 · 블록 열기 · 저장 한 번 동안 M01 한 벌을 쥠**(요청 안 「M01 고정」 · 지금 `San_MatFind._CTX` 같은 ContextVar 꼴 · 결과 그대로) — 어림 30 줄 · 기대 = 수 초. 「재료 줄만 도는 길」(분석 C (나) 5)은 그 뒤에도 느릴 때만 | +| 저장본 무효(`산근/.json` `재료판` · 무효 = HP 지움뿐 · `San_MatPick.py:194`) | **일부** — 3-2 둘째 박자 뒤에도 판은 그대로 남음 | 판에 **M01 지문 + 별칭 판 + 그 파일 고름 판**을 같이 적고 다르면 다시 셈(분석 C (나) 4 · 어림 10 줄) · 한 번 읽기(857-1)에서 `산근/.json` 꼴을 바꿀 때 같이 | +| 셈 엔진 셋(읽기 투표 · 검산 · 최종) | 857-3b 로 검산 = 문서 셈 하나 | 읽기 끝전 투표(`San_Eval`)는 경쟁사 끝수 읽기라 남음 | + +--- + +## 6. 걸음 + +원칙: 두 박자(새 길로 바꿈 → 전수 다름 0 → 옛 길 지움) · 한 걸음 = 한 커밋 묶음 · 화면은 걸음마다 그대로 돎. + +| 걸음 | 무엇 | 파일(어림 줄) | 지킴 | 위험 · 막는 법 | 화면 확인 | +| --- | --- | --- | --- | --- | --- | +| **857-0 지킴 올림** | 3,241 블록 × 두 판 계 · 비목 · 검산 판정 · 이음 판정 지문 · 호표 쪽 HP 읽기 지문(엑셀 9 · 호표 · 단산 · 칠 표지 · 고정 줄) · 재료 이음 전후 표(`m857_mat` 꼴) | 새 `resources/tester/test_857_import_golden.py`(+ 250) · `helper_857.py` | 지금 수치 그대로 통과 | 원파일 견본 없는 PC = 건너뜀 · 전수는 환경 변수 | — | +| **857-1 책 한 번 · 종류 한 말** | 새 「책 한 벌」(시트 목록 합집합 · 종류 가름 하나 · xls 서식 책) → `read_book` · `Grid` · `San_Book.sheets` 가 받음 · `_OPENED` 걷음 · 올림 = 산근 먼저(일위대가 없음 = 호표 빈 목록 · 400 아님) · `재료판` 무효 지문 | 새 `M02_San_Workbook.py`(+ 90) · `Hopyo_Excel`(− 60) · `Hopyo_Grid`(± 15) · `San_Book`(− 40) · `Hopyo_Router._upload`(± 20) · `Sangeun_FromHopyo.keep`(± 20) · `Hopyo_Stmate.is_stmate`(− 5) · `San_MatPick`(± 15) | 857-0 전부 같음 · 2016사방 · 2026수목 올림이 됨(HP 생김 · 단가산출 목록 516) · 올림 시간 전후 표 | 시트 선택이 계보마다 달랐던 것(STmate 단가산출근거만 있는 파일) — 견본 11 에서는 같은 판정 | 엑셀 · 원파일 올림 · 엑셀 보기 · 오른쪽 두 목록 | +| **857-2 호표를 둘 꼴 위로 + L2 ⓒ 이름표** | 둘 꼴에 1-3 표 칸(보일 이름 · STmate 보이는 글 · 줄합 · EST 일위)을 더 싣고 `ReadEst` · `Stmate._blocks` · `UnitLine` · `Clause` 의 **입력을 둘 꼴 줄로**(몸은 둠) · `Clause` · `Match` · `Units` 의 로직 줄 읽기 → 문서 머리 | `Doc_FromNative.pack`(± 30) · `San_Xlsx_Est`(+ 60 · EST 일위) · `Hopyo_Excel.read_book`(± 80) · `Hopyo_ReadEst`(± 40) · `Hopyo_Stmate`(± 60) · `Hopyo_Clause` · `Hopyo_Match` · `Hopyo_Units`(± 40) | 호표 쪽 HP 읽기 지문 같음(505 블록 칸 전부) · 칠 · 고정 줄 · `test_621` · `test_m02_hopyo_*` · `test_812_1` · B09 내역서 시험 | B09 `Bill_Hopyo` 가 `read_book` 꼴을 먹음 — 꼴 유지 · `San_Basis_Index` 의 `trade` 를 가벼운 자리로(분석 C (나) 3) | 호표 목록 · 엑셀 칠 · [수정] 모달 · B09 내역서 불러오기 | +| **857-3a 문서 바로(첫 박자)** | ㉡ → 문서를 불러오기 자기 모듈로(변환기 · `master.logic` · `mf.parse` 안 부름) | 새 `M02_San_ToDoc.py`(+ 350) · `Doc_Import.derive`(− 120) | 3,241 × 두 판 지문 같음 · 줄 꼴 지문 같음 · `test_802_4b1` · `test_810_2` · `test_848_*` 불러오기 줄 | 붙임 · 다듬기 다섯 단계(`_attach` · `_numbers` · `Shape` · `Q` · `NativeLayout`)가 변환기 결과 꼴에 기댐 — 한 단계씩 옮기며 지문 확인 | [가져온 식으로 열기] · 줄 쌓기 | +| **857-3b SK 정본 = 문서(둘째 박자)** | `가져온.로직` 없앰 · 이음 고침 · 두 판 · 소요량 · 재료 고름 · 내 기계 · 초기화가 문서 연결을 고침 · 다시 열기 = 저장 문서 · `San_Basis_Index:160` 수식 문서로 · 옛 식 파서 부름 0 | `Sangeun_Imported`(− 250) · `Doc_Import`(− 200) · `Doc_Import_Reset` · `_Shape` · `Doc_NativeLayout` · `San_MatPick` · `San_MyMachine` · `Sangeun_QtyLinks`(± 150) · `San_Basis_Index`(± 40) · `Sangeun_FromHopyo`(± 40) · 화면 `Hopyo_Imported_Model.ts`(± 40) | 위 지문 · 저장 → 다시 열기 왕복 같음 · 이음 고침 · 초기화 시험(`test_793_2` · `797_2` · `827_3` · `848_3`) | 옛 SK 저장본 = 지금 시험 자료(요구 899 · 호환 안 만듦) — 저장본 비움(보충 3-2) 뒤 | 모달 [우리 단가로] · [엑셀 단가로] · [이음 고르기] · 소요량 · 초기화 | +| **857-4 재료 찾기 한 벌** | 호표 길 `_mats` → `San_MatFind.find`(단서 포함) 후보 · 이음 관문 = 판단 거리 1 의 답(권함 = 「엑셀 단가 같은 후보 하나」 만 이음) · [수정] 모달 판정 말 같게 | `Hopyo_Fixed`(± 50) · `Hopyo_View`(± 20) · TS `Hopyo_View` 판정 글(± 20) | 857-0 고정 줄 지문 — 권한 안이면 금액 다름 0 · 이음 · 판정 바뀜 = `out_mat.tsv` 꼴 표로 뜻한 바뀜만 | 다른 품목 12 꼴(단가로 고르던 지역 · 판) — 「값 같은 쌍둥이 먼저」 를 호표 길에 남김 | [수정] 모달 후보 · 안 이은 줄 띠 | +| **857-5 옛 길 지움** | 호표 쪽 시트 직접 읽기 · `_OPENED` · `Hopyo_Ledger` · 분석 C 「안 씀」 약 0.9 천 줄 · 소스 글자 시험 약 10 개 정리 · 옛 로직 줄 꼴 함수 | 위 파일들 · 시험 | 857-0 지문 · 관련 시험 전부 · `/openapi.json` 전후(뜻한 길만 빠짐) | — | 올림 · 두 목록 · 모달 한 바퀴 | + +같이 돌릴 수 있는 묶음(파일 안 겹침): + +| 묶음 | 걸음(창) | 겹침 확인 | +| --- | --- | --- | +| Ⓐ | 857-0(한 창) | 새 시험 파일만 | +| Ⓑ | 857-1 · 857-3a · 857-4(세 창) | 책 · Router · San_Book · Hopyo_Excel 열기 ↔ 새 `San_ToDoc` · `Doc_Import.derive` ↔ `Hopyo_Fixed` · `Hopyo_View` — 다름 | +| Ⓒ | 857-2 · 857-3b(두 창) | Hopyo 읽기 · Clause · Match · Units · pack ↔ Sangeun_Imported · Doc_Import · San_MatPick · QtyLinks · Basis_Index — `pack` 은 857-2 몫 · `San_Basis_Index` 는 857-3b 몫(`trade` 옮김도 그 창) | +| 끝 | 857-5(한 창) | — | + +꼭 차례인 까닭: +- 857-0 먼저 — 「다름 0」 의 자. +- 857-2 는 857-1 뒤(둘 꼴이 한 번 읽은 책에서 와야 호표가 그 위에 얹힘) · **보충 L1 뒤**(이름표가 문서 머리에 있어야 Clause · Match · Units 가 옮겨 감). +- 857-3a 는 **본 설계 2-C2 · 2-C3 뒤**(옛 엔진 없이 열리고 검산되는 길 위에서 변환만 바꿈) · **2-E3 앞**(변환기 은퇴 전에 불러오기가 변환기를 안 부르게). +- 857-3b 는 857-3a 뒤 · **저장본 비움 뒤**(보충 3-2 · 옛 `가져온.로직` 꼴 저장본 0). +- 857-4 는 판단 거리 1 의 답 뒤 · 857-0 의 재료 이음 표가 기준. +- 857-5 는 맨 끝 · 2-E4(엔진 · 옛 파서 지움)는 857-3b 뒤에야 불러오기 몫이 0. + +걸음 2 와 맞물림 — 시작할 수 있는 때: + +| 857 걸음 | 시작 가능 | +| --- | --- | +| 857-0 · 857-1 · 857-4 | **지금 바로**(걸음 2 와 파일 안 겹침 · 857-1 은 `Sangeun_FromHopyo.keep` 만 만짐) — 단 857-4 는 판단 거리 1 답 뒤 | +| 857-3a | 2-C2 · 2-C3 끝 뒤(보충 묶음 ③ 뒤) | +| 857-2 | 857-1 · 보충 L1(묶음 ④) 뒤 | +| 857-3b | 857-3a · 저장본 비움(보충 묶음 ②) · 2-C5(`Hopyo_Build._inside` · `Sangeun_Imported._inner`) 뒤 | +| 857-5 | 857 전부 · 856(화면 하나) 뒤(`Hopyo_*.ts` 화면 겹침) | + +--- + +## 7. 사용자 판단 거리 · 못 본 것 + +### 7-1 판단 거리(쉬운 말) + +1. **일위대가(호표) 불러오기의 재료 이음을 단가산출 불러오기와 맞출 때 「엑셀 숫자 그대로」 를 지킬지** — ㉠ 찾는 법만 맞추고 「엑셀 단가와 같은 품목」 일 때만 이음(금액 그대로 · 나머지는 후보로 보여 사람이 고름 · 권함) ㉡ 다 이음(9 파일에서 118 줄 이음이 바뀌고 109 줄 금액이 우리 단가로 바뀜) ㉢ 일위대가 고정 줄에도 「엑셀 값 · 우리 값」 두 판을 둠(일이 큼). +2. **단가산출 불러오기도 단가를 볼지** — 지금은 이름 · 규격 · 단위로만 골라 지역 · 판이 다른 품목(북부청임도 돌망태 12 줄)을 고를 때가 있음. 「같은 이름 · 규격 쌍둥이 중 엑셀 단가와 같은 품목 먼저」 를 더할지. +3. **일위대가 시트가 없는 엑셀(2016 사방 · 2026 수목 꼴)** — 지금은 화면 올림이 「일위대가 시트 없음」 으로 막힘. 한 번 읽기로 단가산출만 있는 파일도 올라가게 할지(권함 · 단가산출 목록만 보임). +4. 「고를 재료」 판 — M01 · 별칭을 고친 뒤 판이 자동으로 다시 셈되게 할지(권함 · 몇 초 걸림). + +### 7-2 못 본 것 + +- 원파일(EST 6 · STC 7 · 2,220 블록)은 견본 자리만 확인 · 세기는 엑셀 11 만(원파일은 호표 계보가 없어 1 · 2 절 대상 아님 · 3 절 지킴은 857-0 에서 같이 돎). +- 재료 이음 세기는 일위대가 시트 호표 줄만 — 호표가 부르는 단산(SK 참조) 안 줄은 이미 단가산출 길이라 뺌 · 붙여넣기 · B09 내역서(`Linker(by_name=False)`) 길은 안 셈(관문이 더 좁음 · 같은 결론으로 봄). +- 「금액 달라짐」 은 품목 단가 대 엑셀 재료비 단가만 맞댐 · SC 합계 · 내역서 금액 영향은 안 셈(건수만). +- 판 첫 셈 「M01 한 벌 쥐기」 의 기대 시간은 프로파일에서 확인 부분을 뺀 어림(실측 아님) · 서버 · 화면은 안 돌림(파이썬 직접 · 저장 없음). +- 호표 쪽 항목 계산(`ReadEst.items` · `Formula`)을 둘 꼴 줄 입력으로 바꿀 때 같은 결과가 나오는지는 857-2 에서 HP 지문으로 확인할 일(여기서는 칸 전수 · 만드는 곳 · 읽는 곳까지). +- `Labor_Ref.Expand` 안의 로직 줄 읽기는 이름만 확인(유력). + +### 세기 결과(`tmp/s894/m857/`) + +| 도구 | 결과 | 무엇 | +| --- | --- | --- | +| `m857_read.py` | `out_read.json` | 책 열기 횟수 · 시간 · 두 계보 블록 대조 · 호표 쪽 단산 칸 | +| `m857_mat.py` | `out_mat.json` · `out_mat.tsv`(바뀌는 118 줄) | 재료 이음 두 규칙 대조 | +| `m857_l2.py` | `out_l2.tsv`(85 곳 · 19 파일) | 「로직」 낱말 · 로직 줄 읽기 자리 | +| `m857_census.py` · `_split.py` · `m857_prof.py` | `out_census.json` · `out_census_split.json` | 판 첫 셈 시간 · 이음 몫 · 프로파일 | From c79555154dc97ff6a09c2508bbfceb9beacbd694 Mon Sep 17 00:00:00 2001 From: umsangdon Date: Tue, 17 Nov 2026 18:31:31 +0900 Subject: [PATCH 12/30] =?UTF-8?q?chore(854-3):=20=EB=82=B4=20=EA=B8=B0?= =?UTF-8?q?=EA=B3=84=20=EB=8B=A8=EC=9C=84=20=ED=91=9C=20=C2=B7=20=EA=B8=B0?= =?UTF-8?q?=EA=B3=84=20=EC=B0=BD=20=EC=B4=88=EC=95=88=20=EC=A7=9D=20?= =?UTF-8?q?=EB=A8=B8=EB=A6=AC=20=EA=B8=80=20=ED=95=9C=20=EC=A4=84=EC=94=A9?= =?UTF-8?q?=20(=EC=BD=94=EB=93=9C=20=EB=B6=88=EB=B3=80)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - M02_MyMachine.py UNITS 곁에 단위 표 셋 짝 · 거울 시험 이름 - M02_MyMachine_Draft.py 머리에 화면 짝(common_util_line_stack_draft.ts) Co-Authored-By: Claude Sonnet 5.5 --- M02_MasterTemplete/M02_MyMachine.py | 2 ++ M02_MasterTemplete/M02_MyMachine_Draft.py | 1 + 2 files changed, 3 insertions(+) diff --git a/M02_MasterTemplete/M02_MyMachine.py b/M02_MasterTemplete/M02_MyMachine.py index 33859078c..2ceab589c 100644 --- a/M02_MasterTemplete/M02_MyMachine.py +++ b/M02_MasterTemplete/M02_MyMachine.py @@ -43,6 +43,8 @@ COSTS = ("노무비", "재료비", "경비") RATIOS = ("내용시간", "연간표준가동시간", "상각비율", "정비비율", "연간관리비율") COEFS = ("상각비계수", "정비비계수", "관리비계수") NUMS = ("가격", *RATIOS, *COEFS, "손료계수", "주연료", "전력") +# 기계 칸 단위 — 짝(표 셋): `common_util_line_stack_unit.ts` MACHINE_UNIT · `build_기계_건설품셈.py` UNIT · +# 거울 시험 `resources/tester/test_854_3_machine_unit_mirror.py`(칸을 더하거나 글을 바꾸면 셋 모두) UNITS = { "가격": "천원", "내용시간": "시간", "연간표준가동시간": "시간", "상각비율": "", "정비비율": "", "연간관리비율": "", **{k: "10^-7/시간" for k in (*COEFS, "손료계수")}, "주연료": "ℓ/hr", diff --git a/M02_MasterTemplete/M02_MyMachine_Draft.py b/M02_MasterTemplete/M02_MyMachine_Draft.py index f289820e1..319c07d87 100644 --- a/M02_MasterTemplete/M02_MyMachine_Draft.py +++ b/M02_MasterTemplete/M02_MyMachine_Draft.py @@ -8,6 +8,7 @@ `TOUCH` = 사본 단가 줄을 새 값으로(`renew`) · 실패 = 만든 파일 지움 · 고친 줄 되돌림(번호표는 그대로). 사본 줄 보기(`copy_row`) = 그 SK 사본에 박힌 기계 줄 · 지금 줄 · 새 값 여부. 개인 층만(`mym._user` — 그 밖 404). +화면 짝 = `common_util/common_util_line_stack_draft.ts`(칸 이름 · 표지 꼴 「EQP초안-N」). """ from __future__ import annotations From 0123e700ea99c05a4aa2c9db787e84f464323620 Mon Sep 17 00:00:00 2001 From: umsangdon Date: Tue, 17 Nov 2026 18:35:35 +0900 Subject: [PATCH 13/30] =?UTF-8?q?test(857-0):=20=EB=B6=88=EB=9F=AC?= =?UTF-8?q?=EC=98=A4=EA=B8=B0=20=EC=A7=80=EB=AC=B8=20=E2=80=94=20=EB=B8=94?= =?UTF-8?q?=EB=A1=9D=20=EB=91=90=20=ED=8C=90=20=C2=B7=20=EA=B2=80=EC=82=B0?= =?UTF-8?q?=20=C2=B7=20=EC=9D=B4=EC=9D=8C=20=C2=B7=20=EC=97=91=EC=85=80=20?= =?UTF-8?q?=EC=98=AC=EB=A6=BC=20=ED=98=B8=ED=91=9C=20=EB=AA=A9=EB=A1=9D=20?= =?UTF-8?q?=C2=B7=20=EC=B9=A0=20=C2=B7=20=EA=B3=A0=EC=A0=95=20=EC=A4=84=20?= =?UTF-8?q?=C2=B7=20=EC=9E=AC=EB=A3=8C=20=EC=9D=B4=EC=9D=8C=20=ED=91=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 새 test_857_import_golden + helper_857_import + golden_857_import.json(블록 3,241 · 올림 47 · 재료표 11 파일) - 블록 = 원파일 EST · STC · 실무 엑셀 블록마다 엑셀 판 · 우리 판 문서 셈(노 · 재 · 경 · 계) · 검산 판정 · 줄 이음 판정 - 올림 = 실무 엑셀 11 을 임시 개인 층에 올림 → 거절 글 | 호표 목록 · 칠 · 고정 줄 · 재료 이음 표(호표 길 키 대 단가산출 길 키) - 기본 = 빠른 표본(블록 60 · 엑셀 3 · 약 30 초) · 전수 = S857_ALL=1 · 견본 없는 PC = 그 갈래 건너뜀(수를 경고로) - 걸음 4(857) 동안 「다름 0」 자 · 다시 뜨기 = S857_ALL=1 … test_857_import_golden.py --write Co-Authored-By: Claude Opus 5.5 --- resources/tester/golden_857_import.json | 3338 ++++++++++++++++++++ resources/tester/helper_857_import.py | 301 ++ resources/tester/test_857_import_golden.py | 70 + 3 files changed, 3709 insertions(+) create mode 100644 resources/tester/golden_857_import.json create mode 100644 resources/tester/helper_857_import.py create mode 100644 resources/tester/test_857_import_golden.py diff --git a/resources/tester/golden_857_import.json b/resources/tester/golden_857_import.json new file mode 100644 index 000000000..30b817611 --- /dev/null +++ b/resources/tester/golden_857_import.json @@ -0,0 +1,3338 @@ +{ + "블록": { + "블록 EST:main#1": "30ad03b2f07ea87f", + "블록 EST:main#10": "5d755ff7115e4ba4", + "블록 EST:main#100": "a13a4fa6fdde0120", + "블록 EST:main#1000": "c7ad49eab7212bcf", + "블록 EST:main#1001": "25ddaac6d1858242", + "블록 EST:main#1002": "e86dfb9dc4dab3df", + "블록 EST:main#1003": "3bbbc2ef6b2032bc", + "블록 EST:main#1004": "24fb7862829f3374", + "블록 EST:main#1005": "c4fe77269dad0e6e", + "블록 EST:main#1006": "e3acc7be5d4162db", + "블록 EST:main#1007": "6c6bb4f1953ffc7b", + "블록 EST:main#1008": "8f879316865323b7", + "블록 EST:main#1009": "29b91870ac21d30b", + "블록 EST:main#101": "47d34acfa4b40ab3", + "블록 EST:main#1010": "7556ebc78f145168", + "블록 EST:main#1011": "6c6bb4f1953ffc7b", + "블록 EST:main#1012": "3a2c045e4c409880", + "블록 EST:main#1013": "65864734873cd0c3", + "블록 EST:main#1014": "e5d6de46ff08a53d", + "블록 EST:main#1015": "7e401efc7e79342f", + "블록 EST:main#1016": "8d761e03f76be638", + "블록 EST:main#1017": "6d7b4818653aa52b", + "블록 EST:main#1018": "84742103521ec973", + "블록 EST:main#1019": "10e95b62b922b9a2", + "블록 EST:main#102": "ab681183f6b60d2a", + "블록 EST:main#1020": "d6f72857a80eab33", + "블록 EST:main#1021": "22f4aee42764b489", + "블록 EST:main#1022": "06a04426663cea68", + "블록 EST:main#1023": "10e95b62b922b9a2", + "블록 EST:main#1024": "abd0222057a63779", + "블록 EST:main#1025": "9dba5caae03d3035", + "블록 EST:main#1026": "f6ae61a7b2bb62d5", + "블록 EST:main#1027": "b7c67b4a742163e2", + "블록 EST:main#1028": "2338471d03fd3c0d", + "블록 EST:main#1029": "485e30661d75bcf9", + "블록 EST:main#103": "57ee681bf9c21fa5", + "블록 EST:main#1030": "bfac770df754f310", + "블록 EST:main#1031": "9f4656e4d52ed396", + "블록 EST:main#1032": "428625e023f8b256", + "블록 EST:main#1033": "710a3cd915716739", + "블록 EST:main#1034": "af99430b7724a66c", + "블록 EST:main#1035": "253b1abbbf54c9db", + "블록 EST:main#1036": "af99430b7724a66c", + "블록 EST:main#1037": "65c77f87668b100e", + "블록 EST:main#1038": "1b858a068a3e4d73", + "블록 EST:main#1039": "eb689a794943b25f", + "블록 EST:main#104": "a22f79f4b806b6d6", + "블록 EST:main#1040": "000176019aa8e5c5", + "블록 EST:main#1041": "dde603c37cc0c0a2", + "블록 EST:main#1042": "7f5a31f9d09cba58", + "블록 EST:main#1043": "4c8f562d916a91ca", + "블록 EST:main#1044": "b3cce208e923b90b", + "블록 EST:main#1045": "434bfe898d634712", + "블록 EST:main#1046": "be555acead0de517", + "블록 EST:main#1047": "a4bbf16870bec14a", + "블록 EST:main#1048": "90cac5981c8caa4b", + "블록 EST:main#1049": "df03e4e575b30417", + "블록 EST:main#105": "085c66c959148679", + "블록 EST:main#1050": "70830c8f68d1a0b4", + "블록 EST:main#1051": "6d53b0109e34879b", + "블록 EST:main#1052": "681b820cc771d470", + "블록 EST:main#1053": "581596b76169b2cf", + "블록 EST:main#1054": "85b719bd586fd185", + "블록 EST:main#1055": "85783d84ce02fd1e", + "블록 EST:main#1056": "7ca0fe3b4ceb0853", + "블록 EST:main#1057": "906591a905dfca60", + "블록 EST:main#1058": "30c287f0ddcb2c1d", + "블록 EST:main#1059": "93a60f250af52eb5", + "블록 EST:main#106": "516b5c32347d3eb8", + "블록 EST:main#1060": "06662c3145c85580", + "블록 EST:main#1061": "1c517e7833b237de", + "블록 EST:main#1062": "928e0a6e61cd01ae", + "블록 EST:main#1063": "83dbba54e92d0aa8", + "블록 EST:main#1064": "84cdec242d0d9f0a", + "블록 EST:main#1065": "7377034e0dd548a0", + "블록 EST:main#1066": "7e21fc251ee14df2", + "블록 EST:main#1067": "62f57b02cee14316", + "블록 EST:main#1068": "3f3f834ff186f74e", + "블록 EST:main#1069": "6ff8443efc6d4217", + "블록 EST:main#107": "f508f46a4762efcd", + "블록 EST:main#1070": "e29bd8d5d5902c8a", + "블록 EST:main#1071": "bcf8d080130fc2c7", + "블록 EST:main#1072": "e31b51401361b872", + "블록 EST:main#1073": "820e92aa5feb5df8", + "블록 EST:main#1074": "af34e26eeb9a4001", + "블록 EST:main#1075": "3c8484b7a802f4d2", + "블록 EST:main#1076": "6803e8d54a863d8f", + "블록 EST:main#1077": "4fb258e52843c920", + "블록 EST:main#1078": "41a49abb0e003b8f", + "블록 EST:main#1079": "c35e942949f1f254", + "블록 EST:main#108": "d814c98f966e4c0a", + "블록 EST:main#1080": "678933bffe787eff", + "블록 EST:main#1081": "ced55e134c62063a", + "블록 EST:main#1082": "ea1e7fa24eb1eeb4", + "블록 EST:main#1083": "4dcde22cc231b87e", + "블록 EST:main#1084": "cc5652e0efc20ddb", + "블록 EST:main#1085": "afb731264eae95dc", + "블록 EST:main#1086": "6cad32f9cb1e4c31", + "블록 EST:main#1087": "2f0a0c2fa750e085", + "블록 EST:main#1088": "408d13c0f1a9c590", + "블록 EST:main#1089": "8e288ad3baf4404d", + "블록 EST:main#109": "ebed4dfd1163bcec", + "블록 EST:main#1090": "acf45a48488c4b4f", + "블록 EST:main#1091": "3e7c602a26e6d03d", + "블록 EST:main#1092": "9963b174884ffa76", + "블록 EST:main#1093": "331372d9ed2a6f72", + "블록 EST:main#1094": "1b6ca0a1f6034560", + "블록 EST:main#1095": "3e626a49b1915a11", + "블록 EST:main#1096": "eb6edc480c239dd1", + "블록 EST:main#1097": "b381d07df2d30a73", + "블록 EST:main#1098": "e2320e9a299dd39a", + "블록 EST:main#1099": "f21a387b77e5e448", + "블록 EST:main#11": "c31362373dc8e726", + "블록 EST:main#110": "8366f2b19eb5be85", + "블록 EST:main#1100": "0be2afe97e5c93b0", + "블록 EST:main#1101": "70f29cb36ca44ed1", + "블록 EST:main#1102": "cd32c86159bb6816", + "블록 EST:main#1103": "e7b78f56c971af26", + "블록 EST:main#1104": "f411581aef34bd3f", + "블록 EST:main#1105": "ae7bce5795a1cc68", + "블록 EST:main#1106": "90ad4e28e4abca5d", + "블록 EST:main#1107": "184225eeb43084cd", + "블록 EST:main#1108": "34649f334ba31572", + "블록 EST:main#1109": "b29c321d245fdbd8", + "블록 EST:main#111": "be785a60edfed01e", + "블록 EST:main#1110": "377a3e7ae9f5d459", + "블록 EST:main#1111": "d432a3bbca78757a", + "블록 EST:main#1112": "48e8677d63720bbb", + "블록 EST:main#1113": "307f8b87678cbb5c", + "블록 EST:main#1114": "99181c61b3530715", + "블록 EST:main#1115": "f4a6948c00858506", + "블록 EST:main#1116": "057c4b3d9ce87f50", + "블록 EST:main#1117": "4a78decad8afe8eb", + "블록 EST:main#1118": "615bb9cd1c6d83ef", + "블록 EST:main#1119": "6a63c0efe1c00e1f", + "블록 EST:main#112": "4dc03e59892f539e", + "블록 EST:main#1120": "7b2dde1d2d1fe866", + "블록 EST:main#1121": "e37e5d34dcc21be3", + "블록 EST:main#1122": "0e6bb45ac816b20a", + "블록 EST:main#1123": "e7faa1e8dc8e546f", + "블록 EST:main#1124": "45bba4e02729df61", + "블록 EST:main#1125": "e81909fa13e26700", + "블록 EST:main#1126": "6bb8955880a9afe9", + "블록 EST:main#1127": "dd815dfab3240594", + "블록 EST:main#1128": "4cbc307e1b1c747b", + "블록 EST:main#1129": "a9e0797bba17aa02", + "블록 EST:main#113": "5370971b31a09271", + "블록 EST:main#1130": "2dd47d1f1fd69cde", + "블록 EST:main#1131": "d1a3f5d94ed92c03", + "블록 EST:main#1132": "678933bffe787eff", + "블록 EST:main#1133": "201861a0b7af16d3", + "블록 EST:main#1134": "a5f75df9a3905b09", + "블록 EST:main#1135": "e6f5893668d93194", + "블록 EST:main#1136": "6792910db623f892", + "블록 EST:main#1137": "14191e17b9537194", + "블록 EST:main#1138": "917f376cfc6268de", + "블록 EST:main#1139": "066c5a5b8ceb44e0", + "블록 EST:main#114": "12c6290315cc8c7a", + "블록 EST:main#1140": "f85544241e01efb7", + "블록 EST:main#1141": "99f8444d53766353", + "블록 EST:main#1142": "b8d65f4666ae18a5", + "블록 EST:main#1143": "35adadc72d097a86", + "블록 EST:main#1144": "6ba9a1c90cd88df3", + "블록 EST:main#1145": "93c26c77c530974d", + "블록 EST:main#1146": "125df2687fd3fe91", + "블록 EST:main#1147": "e4c81d7121b48236", + "블록 EST:main#1148": "14bc7c783943238c", + "블록 EST:main#1149": "413e303c9cceadd9", + "블록 EST:main#115": "9773e93c5617448b", + "블록 EST:main#1150": "90067dda82db8f8f", + "블록 EST:main#1151": "30dd31f1adf9be57", + "블록 EST:main#1152": "4982b8de6ef426ae", + "블록 EST:main#1153": "9c39e968568d4005", + "블록 EST:main#1154": "084c97c9a4ff66cc", + "블록 EST:main#1155": "fe43fe1528c2502f", + "블록 EST:main#1156": "52590e65dc7bf130", + "블록 EST:main#1157": "55503d394838a308", + "블록 EST:main#1158": "334cb0965e6e5e0a", + "블록 EST:main#1159": "b0207630f9ace7e1", + "블록 EST:main#116": "c5da7956aa19cd3b", + "블록 EST:main#1160": "f40f41e544d92ebc", + "블록 EST:main#1161": "3c4cf22a9d308369", + "블록 EST:main#1162": "1aff6dc3a85b5b85", + "블록 EST:main#1163": "b8dfa190165857b5", + "블록 EST:main#1164": "c016a35c9591b1aa", + "블록 EST:main#1165": "6773be307fda9d77", + "블록 EST:main#1166": "d305b99c971b8a5f", + "블록 EST:main#1167": "2769bedfaff60efc", + "블록 EST:main#1168": "bfea4745852254d4", + "블록 EST:main#1169": "139b289e42c4ba79", + "블록 EST:main#117": "b1ea5d8924f4375f", + "블록 EST:main#1170": "94231f2ba07154b0", + "블록 EST:main#1171": "0eab584b1d8cb6a3", + "블록 EST:main#1172": "16acaf81b6feba87", + "블록 EST:main#1173": "13399c83be7a2e2a", + "블록 EST:main#1174": "a4addf3b87f2959d", + "블록 EST:main#1175": "9a4973b20686a255", + "블록 EST:main#1176": "c6de9f38ec50f5b6", + "블록 EST:main#1177": "f99835fb149ea89b", + "블록 EST:main#1178": "44ddf7339411580f", + "블록 EST:main#1179": "ddfd73c9fa5d47f2", + "블록 EST:main#118": "3ab12787ea4de7ee", + "블록 EST:main#1180": "32ba18d5afd7d1c4", + "블록 EST:main#1181": "b68f0d3f45382eb4", + "블록 EST:main#1182": "38a8af9187ac3dae", + "블록 EST:main#1183": "1b40a8948cca51e5", + "블록 EST:main#1184": "c47a86b94b057901", + "블록 EST:main#1185": "1a067cd1c5775952", + "블록 EST:main#1186": "82ea8eeb1886387e", + "블록 EST:main#1187": "073e1addf3f9d18e", + "블록 EST:main#1188": "af40cf1e6913745a", + "블록 EST:main#1189": "2bf5b724c466d596", + "블록 EST:main#119": "1d70a794be9fc9cd", + "블록 EST:main#1190": "d8e8f0daae0cead5", + "블록 EST:main#1191": "04d307e71db052cd", + "블록 EST:main#1192": "946c2c0d9b7ebf1a", + "블록 EST:main#1193": "958add500e379ac7", + "블록 EST:main#1194": "086a4ca8a50f1f38", + "블록 EST:main#1195": "946c2c0d9b7ebf1a", + "블록 EST:main#1196": "bdf28c3c9894b911", + "블록 EST:main#1197": "f55bab2b3c940140", + "블록 EST:main#1198": "3149b020563b7422", + "블록 EST:main#1199": "d04cd96bd3fc0c83", + "블록 EST:main#12": "779875d638b6f0ef", + "블록 EST:main#120": "9d284bd193f3c7db", + "블록 EST:main#1200": "bafd0682ad970c0b", + "블록 EST:main#1201": "51aacd208ee87486", + "블록 EST:main#1202": "e45387889579d2cc", + "블록 EST:main#1203": "8fa2858958892ea3", + "블록 EST:main#1204": "ba256c92faa8d530", + "블록 EST:main#1205": "269bf6975a7271a6", + "블록 EST:main#1206": "269bf6975a7271a6", + "블록 EST:main#1207": "47997548afd9e799", + "블록 EST:main#1208": "5dfd96d7981b2a4c", + "블록 EST:main#1209": "729e5a3d85c6bc91", + "블록 EST:main#121": "7cab2751db44aeba", + "블록 EST:main#1210": "27823b83e73fcc1f", + "블록 EST:main#1211": "9ba62ce4b22df4f0", + "블록 EST:main#1212": "1eb5f2313af4e377", + "블록 EST:main#1213": "1eb5f2313af4e377", + "블록 EST:main#1214": "0ecdc132852011fb", + "블록 EST:main#1215": "21195920fbe9ff2f", + "블록 EST:main#1216": "d09196e31f1b0bd6", + "블록 EST:main#1217": "a7e9f5f190f69700", + "블록 EST:main#1218": "f7b16583c17715a2", + "블록 EST:main#1219": "93f70a0cdf846b67", + "블록 EST:main#122": "84a3b94635c239f7", + "블록 EST:main#1220": "be071d50f3eee9e3", + "블록 EST:main#1221": "8551f16a2a861b05", + "블록 EST:main#1222": "e2c2244b656f0a83", + "블록 EST:main#1223": "bb70f01d4dc4fe26", + "블록 EST:main#1224": "8403d9bc558cbbb6", + "블록 EST:main#1225": "411a8328d61c0d38", + "블록 EST:main#1226": "577d5c397fbf4b33", + "블록 EST:main#1227": "7ec7eac51190fd9c", + "블록 EST:main#1228": "f25300c05e8a7016", + "블록 EST:main#1229": "be01359ebc1b8871", + "블록 EST:main#123": "59846d6cabd5a19d", + "블록 EST:main#1230": "c9aeafa9302d5b2d", + "블록 EST:main#1231": "7af455d4b5936c24", + "블록 EST:main#1232": "cfa2dda9d0a3bf72", + "블록 EST:main#1233": "19890e6b8370c70e", + "블록 EST:main#1234": "c6f78a62fdcac2ca", + "블록 EST:main#1235": "6d4ee30beb90119f", + "블록 EST:main#1236": "acade614bd80da2b", + "블록 EST:main#1237": "31b5720847b4e66c", + "블록 EST:main#1238": "54906679d02e197e", + "블록 EST:main#1239": "7cced64e7f707215", + "블록 EST:main#124": "004054117bcbfbf2", + "블록 EST:main#1240": "7b5de91e00b6dcb7", + "블록 EST:main#1241": "5456858da67fb6cb", + "블록 EST:main#1242": "b181df777362b4bb", + "블록 EST:main#1243": "0afdeb99f191d9d1", + "블록 EST:main#1244": "c6bfac4ba68aeaeb", + "블록 EST:main#1245": "7cf824ff7a54f9c0", + "블록 EST:main#1246": "18ce9348c601a317", + "블록 EST:main#1247": "d7b143ae4e4eef60", + "블록 EST:main#1248": "33efd262cca45ceb", + "블록 EST:main#1249": "84b3616e582dd66b", + "블록 EST:main#125": "cab209a279baa83d", + "블록 EST:main#1250": "7f873b3f206e143b", + "블록 EST:main#1251": "02b8a42a3eb77e52", + "블록 EST:main#1252": "c0e3968fa8c7a98e", + "블록 EST:main#1253": "6e7de23363857b04", + "블록 EST:main#1254": "22494a75ce719166", + "블록 EST:main#1255": "e2495aa70c3ba811", + "블록 EST:main#1256": "e1c51c44252121db", + "블록 EST:main#1257": "5f43ef185f7de03c", + "블록 EST:main#1258": "b0a7a8fe878ca855", + "블록 EST:main#1259": "a16d7fac093a8650", + "블록 EST:main#126": "ae79f65391cee261", + "블록 EST:main#1260": "de5001ab7699ea85", + "블록 EST:main#1261": "16c90bbe9bc59e5d", + "블록 EST:main#1262": "ad306d7fa4ae814b", + "블록 EST:main#1263": "40eeacecada55874", + "블록 EST:main#1264": "460f282a5ea098a9", + "블록 EST:main#1265": "c7f0425bcc43d50e", + "블록 EST:main#1266": "1a9d94ccb5262ed2", + "블록 EST:main#1267": "293054eb50d4e463", + "블록 EST:main#1268": "cdaf9d2aadfd1628", + "블록 EST:main#1269": "21632fa45018de21", + "블록 EST:main#127": "aa3a6cc52134ce66", + "블록 EST:main#1270": "f4f4dee1cb5bca8f", + "블록 EST:main#1271": "fe5330ea4ae18109", + "블록 EST:main#1272": "5e7e35e59f99f7e4", + "블록 EST:main#1273": "eceffee0bbe56889", + "블록 EST:main#1274": "7211c0f5893395d9", + "블록 EST:main#1275": "e6589c3dd570690d", + "블록 EST:main#1276": "35e4d83429f3ab75", + "블록 EST:main#1277": "10ec14bb0ad722d7", + "블록 EST:main#1278": "a319a612cb930fc2", + "블록 EST:main#1279": "ae41c345a9770669", + "블록 EST:main#128": "43e712b43b092cfb", + "블록 EST:main#1280": "b2d431ae3490cca3", + "블록 EST:main#1281": "5bb5b9427ea3b0d8", + "블록 EST:main#1282": "7a7a2dd3d7ce33a6", + "블록 EST:main#1283": "e36034a2aafb264b", + "블록 EST:main#1284": "304ea9c15e4f04a1", + "블록 EST:main#1285": "20c7cd40525f04ef", + "블록 EST:main#1286": "e59a7e38176934f0", + "블록 EST:main#1287": "1573dd4442659978", + "블록 EST:main#1288": "dac6b9b93f16a695", + "블록 EST:main#1289": "f96bf2dd76b62d8b", + "블록 EST:main#129": "3d022344c97559e7", + "블록 EST:main#1290": "7540892c7dd86363", + "블록 EST:main#1291": "a628f0ce05469ee9", + "블록 EST:main#1292": "09d9de78eb6b3bea", + "블록 EST:main#1293": "1df2225ad7332c3d", + "블록 EST:main#1294": "8c4de1321f00ce5c", + "블록 EST:main#1295": "d70bbf969cb553aa", + "블록 EST:main#1296": "97ee567bc36527a1", + "블록 EST:main#1297": "9031ef79a20fbcf0", + "블록 EST:main#1298": "82af3667cec1742a", + "블록 EST:main#1299": "319438c988a3ec6d", + "블록 EST:main#13": "644e75b248203d92", + "블록 EST:main#130": "1904d3425746968d", + "블록 EST:main#1300": "49a4d6a9fe5fa38e", + "블록 EST:main#1301": "b16f291e202638bd", + "블록 EST:main#1302": "3abd28b5f0428863", + "블록 EST:main#1303": "39d93df3f5f3a933", + "블록 EST:main#1304": "65f48860d194f24e", + "블록 EST:main#1305": "90e316db361b29a9", + "블록 EST:main#1306": "fcd7b0146fe97945", + "블록 EST:main#1307": "96a53152ee1a732d", + "블록 EST:main#1308": "1e060c3094029241", + "블록 EST:main#1309": "de62c1f6d8710a91", + "블록 EST:main#131": "73e537c3187ecbf5", + "블록 EST:main#1310": "1e25dbb54a733e78", + "블록 EST:main#1311": "d14146726551b60e", + "블록 EST:main#1312": "fac9b86f8b18f496", + "블록 EST:main#1313": "a0815d1f650d4fe6", + "블록 EST:main#1314": "58b6358aaef98334", + "블록 EST:main#1315": "3484dd560ce73294", + "블록 EST:main#1316": "5383e6c8277dc3a1", + "블록 EST:main#1317": "0e9a0e2c64f2ed5d", + "블록 EST:main#1318": "0275062e767b0add", + "블록 EST:main#1319": "102157f36209bb93", + "블록 EST:main#132": "b1cb25e11a559df1", + "블록 EST:main#1320": "ab798d07b8260649", + "블록 EST:main#1321": "96fca85deb405dba", + "블록 EST:main#1322": "cfa831f6760e1c23", + "블록 EST:main#1323": "aa9748e88f7019f5", + "블록 EST:main#1324": "94bbf0b3bd9691fb", + "블록 EST:main#1325": "1fe33fb72de25d96", + "블록 EST:main#1326": "4357d2660dcea80f", + "블록 EST:main#1327": "1b3953c26231f93f", + "블록 EST:main#1328": "ca1cd9b529b07884", + "블록 EST:main#1329": "d420c7f389d8affc", + "블록 EST:main#133": "7c2a6604a8ba70ab", + "블록 EST:main#1330": "ad028b9383fa7e93", + "블록 EST:main#1331": "3ae64d831a385dc7", + "블록 EST:main#1332": "808afa4086abf42f", + "블록 EST:main#1333": "e64a8f7b0bfd6dc1", + "블록 EST:main#1334": "0c48a32aa8a32105", + "블록 EST:main#1335": "34048dfa674b6a1a", + "블록 EST:main#1336": "273d960e3ead7a87", + "블록 EST:main#1337": "ff57cadb71b1959a", + "블록 EST:main#1338": "65572e6ebd185fba", + "블록 EST:main#1339": "7a528dff7ea1a337", + "블록 EST:main#134": "35ebce5c3e14d3b0", + "블록 EST:main#1340": "9a6bc8f3d4cde179", + "블록 EST:main#1341": "6dc83d200abee0ea", + "블록 EST:main#1342": "7b66dee20db4d216", + "블록 EST:main#1343": "2d18b6bef20da5c0", + "블록 EST:main#1344": "7a475b49260ded4f", + "블록 EST:main#1345": "a3a998f729ae3fcd", + "블록 EST:main#1346": "28d9be97a29019e7", + "블록 EST:main#1347": "629761822daa8c00", + "블록 EST:main#1348": "5ea5e7d962c58fa5", + "블록 EST:main#1349": "1b1f89036bf767a4", + "블록 EST:main#135": "9eee116beab73050", + "블록 EST:main#1350": "8bea0880192f94d9", + "블록 EST:main#1351": "c6807678bfebe986", + "블록 EST:main#1352": "b0fd7314ee0ab099", + "블록 EST:main#1353": "1d8e6e24e7e74c76", + "블록 EST:main#1354": "09e1df00c43830a4", + "블록 EST:main#1355": "3726e1b61068a21f", + "블록 EST:main#1356": "d2be14c6f39c8ea0", + "블록 EST:main#1357": "9d4e7c6d5ef622db", + "블록 EST:main#1358": "b3af3c4afc7da4d4", + "블록 EST:main#1359": "849dda9c5b63c23b", + "블록 EST:main#136": "8604b593b1e2782f", + "블록 EST:main#1360": "4e86c515c02c86c5", + "블록 EST:main#1361": "7af557442027ac6a", + "블록 EST:main#1362": "b99f0d11abf33424", + "블록 EST:main#1363": "b11125e3a933e7ee", + "블록 EST:main#1364": "f252077945fd9d61", + "블록 EST:main#1365": "f252077945fd9d61", + "블록 EST:main#1366": "065d94a2ab0d01de", + "블록 EST:main#1367": "a80186f054d1857b", + "블록 EST:main#1368": "9c4d02f5a7beac73", + "블록 EST:main#1369": "9c4d02f5a7beac73", + "블록 EST:main#137": "2ebb9c5427e70c35", + "블록 EST:main#1370": "c93ea67c8fc30fcc", + "블록 EST:main#1371": "9c4d02f5a7beac73", + "블록 EST:main#1372": "69dbcd2f3e383ad9", + "블록 EST:main#1373": "1312d38df74ac63b", + "블록 EST:main#1374": "52d49e8fab565aab", + "블록 EST:main#1375": "1f56952a4413b135", + "블록 EST:main#1376": "bd57ce94c4b10035", + "블록 EST:main#1377": "7adef4f84f39153d", + "블록 EST:main#1378": "2a1e4416e65306dd", + "블록 EST:main#1379": "4f76a5d17b7c5376", + "블록 EST:main#138": "0c90edbd0e347636", + "블록 EST:main#1380": "4f76a5d17b7c5376", + "블록 EST:main#1381": "8bdf52320e4168a6", + "블록 EST:main#1382": "4f76a5d17b7c5376", + "블록 EST:main#1383": "b2ad96d50825a3b3", + "블록 EST:main#1384": "4db0b5982baa0b74", + "블록 EST:main#1385": "8541a9e3fcc4e6f5", + "블록 EST:main#1386": "eef46b5cb6ba57e0", + "블록 EST:main#1387": "749314ecfac6fa24", + "블록 EST:main#1388": "dc6a6ade33b7082d", + "블록 EST:main#1389": "cf8601181c9118f9", + "블록 EST:main#139": "36d717e705a868d8", + "블록 EST:main#1390": "d0d46415dd9904b3", + "블록 EST:main#1391": "92de77520764fc45", + "블록 EST:main#1392": "6ff0e1baa1e66c1a", + "블록 EST:main#1393": "f217207c0088fab0", + "블록 EST:main#1394": "0e538ed23cd155cb", + "블록 EST:main#1395": "035a5ff195248d0f", + "블록 EST:main#1396": "28e8be7608c5627c", + "블록 EST:main#1397": "69203472d71c1dc9", + "블록 EST:main#1398": "642504ec5c2fd631", + "블록 EST:main#1399": "bd109b15a2b8ea73", + "블록 EST:main#14": "4959a9557fc8ab08", + "블록 EST:main#140": "e6b464418f472edb", + "블록 EST:main#1400": "69da377fce31ada7", + "블록 EST:main#1401": "d503b40b7d175287", + "블록 EST:main#1402": "0d0965b8663b42f9", + "블록 EST:main#1403": "2b5c0412aa21d79d", + "블록 EST:main#1404": "18a835c259145707", + "블록 EST:main#1405": "4853b4bb269d6bc9", + "블록 EST:main#1406": "2c32389ee7e7f141", + "블록 EST:main#1407": "80862c742921ab11", + "블록 EST:main#1408": "1e3118615f0c757d", + "블록 EST:main#1409": "ef2c00e8d258a515", + "블록 EST:main#141": "5799f8b62bc6d9a5", + "블록 EST:main#1410": "caabac0fe0d78dd2", + "블록 EST:main#1411": "8caa17b312dfc564", + "블록 EST:main#1412": "1938f9208b7b0600", + "블록 EST:main#1413": "6ea5970573c27006", + "블록 EST:main#1414": "94bfdb8b7f73d6fa", + "블록 EST:main#1415": "cef629345a62328f", + "블록 EST:main#1416": "1ce0d0e38ea1ac7d", + "블록 EST:main#1417": "fc7927f7eb4f0a42", + "블록 EST:main#1418": "ed4fd18fd67b475c", + "블록 EST:main#1419": "7c124fbde0241c12", + "블록 EST:main#142": "b2a2da45384659c6", + "블록 EST:main#1420": "4ef459d331662f1d", + "블록 EST:main#1421": "47de169fa919a0c1", + "블록 EST:main#1422": "cf14ef768ce5d8d8", + "블록 EST:main#1423": "266bd0dbe75fe570", + "블록 EST:main#1424": "1ec8e821e94b72d9", + "블록 EST:main#1425": "f981134c9e65b2f2", + "블록 EST:main#1426": "4882ebcba25ce443", + "블록 EST:main#1427": "638ad24d1b3cfd7c", + "블록 EST:main#1428": "465ed5d9e71cbe5c", + "블록 EST:main#1429": "049b187f0b0ea7cb", + "블록 EST:main#143": "013855dcc73241e4", + "블록 EST:main#1430": "61b35a1122aa4bb7", + "블록 EST:main#1431": "14ea0a1cee1fa08f", + "블록 EST:main#1432": "cf4298b1c112b37f", + "블록 EST:main#1433": "a1c8187e63eed080", + "블록 EST:main#1434": "270ae730b44a9338", + "블록 EST:main#1435": "bce14de4a86e68cd", + "블록 EST:main#1436": "3b7ebc667609a2cc", + "블록 EST:main#1437": "fcf9b57737ac6b02", + "블록 EST:main#1438": "21e6cd72eb06a133", + "블록 EST:main#1439": "2c3455059c99471e", + "블록 EST:main#144": "06d12feca5ae2ca8", + "블록 EST:main#1440": "2232d26ad8dd59fc", + "블록 EST:main#1441": "f5211829a61093bb", + "블록 EST:main#1442": "ab5c7820623dc9d5", + "블록 EST:main#1443": "0a09704d2c266d82", + "블록 EST:main#1444": "e936fd13ae8e40d7", + "블록 EST:main#1445": "1fdf08c832bde435", + "블록 EST:main#1446": "c7c26d8357316ccf", + "블록 EST:main#1447": "466c074166dcc454", + "블록 EST:main#1448": "f762405bf87da46a", + "블록 EST:main#1449": "a955758a888789f9", + "블록 EST:main#145": "ee11a2c4d0dee66a", + "블록 EST:main#1450": "907b0dc77e33331c", + "블록 EST:main#1451": "8749da80b6dd97e9", + "블록 EST:main#1452": "d55b496cd63f2368", + "블록 EST:main#1453": "6a536b82f2e560ba", + "블록 EST:main#1454": "969785aa3d19f702", + "블록 EST:main#1455": "a5dbd12cdf44b74d", + "블록 EST:main#1456": "79ab55c77fda5939", + "블록 EST:main#1457": "d222e6ad3cbf668a", + "블록 EST:main#1458": "34129d39deb2a585", + "블록 EST:main#1459": "e4d5d1c2d7739d0c", + "블록 EST:main#146": "03cef711fc11ca2c", + "블록 EST:main#1460": "e942cadc75435d9e", + "블록 EST:main#1461": "13751b6dc142ad12", + "블록 EST:main#1462": "47344628fa48e825", + "블록 EST:main#1463": "a7cad257ba79edb6", + "블록 EST:main#1464": "ae282dd74e404a28", + "블록 EST:main#1465": "ebd7102cfa17c731", + "블록 EST:main#1466": "81178e1084041334", + "블록 EST:main#1467": "2e4958dc34c98233", + "블록 EST:main#1468": "c34b7c9fb0caba28", + "블록 EST:main#1469": "ac38d23ab7dd1f92", + "블록 EST:main#147": "177ca807d2570f3f", + "블록 EST:main#1470": "ecab403bc500b035", + "블록 EST:main#1471": "5bab488b94024f1c", + "블록 EST:main#1472": "487ab17b3557cb0f", + "블록 EST:main#1473": "82e409cb25867a23", + "블록 EST:main#1474": "f993736d808249a3", + "블록 EST:main#1475": "21227988516f24ca", + "블록 EST:main#1476": "d49685653a57441f", + "블록 EST:main#1477": "3eb948993d2ceca4", + "블록 EST:main#1478": "11523674fef65873", + "블록 EST:main#1479": "0fc3bf104f3b718f", + "블록 EST:main#148": "dc5cef5282a68410", + "블록 EST:main#1480": "6ca122a69a683227", + "블록 EST:main#1481": "59e1f9c4a10c91ad", + "블록 EST:main#1482": "aab569277b7d56d3", + "블록 EST:main#1483": "fcafad2dc4a063f9", + "블록 EST:main#1484": "fcafad2dc4a063f9", + "블록 EST:main#1485": "fcafad2dc4a063f9", + "블록 EST:main#1486": "7473896ed99226c5", + "블록 EST:main#1487": "7473896ed99226c5", + "블록 EST:main#1488": "5b0fb710476fa211", + "블록 EST:main#1489": "02675696fe97c4eb", + "블록 EST:main#149": "580992ad859c986b", + "블록 EST:main#1490": "02675696fe97c4eb", + "블록 EST:main#1491": "f203c0e4ba86ebe6", + "블록 EST:main#1492": "97bf92043f71697f", + "블록 EST:main#1493": "916cbfa64f6bce36", + "블록 EST:main#1494": "577d5af1bca3989b", + "블록 EST:main#1495": "d20c89a2e7642a1c", + "블록 EST:main#1496": "1fe2e8e613b4e6fd", + "블록 EST:main#1497": "1fe2e8e613b4e6fd", + "블록 EST:main#1498": "31550b8c6d12e727", + "블록 EST:main#1499": "85d515918a5ecca8", + "블록 EST:main#15": "b1e9aae7137b08e7", + "블록 EST:main#150": "124239e7210f0c00", + "블록 EST:main#1500": "018d67d1570c5aa6", + "블록 EST:main#1501": "a4a1b43dac1273f9", + "블록 EST:main#1502": "4c3112121ff2ed81", + "블록 EST:main#1503": "9899ba0650493c27", + "블록 EST:main#1504": "3b44fbef136e22ed", + "블록 EST:main#1505": "c2c5cc2ee8f790bc", + "블록 EST:main#1506": "eb578864c911412e", + "블록 EST:main#1507": "ae26f818f05dea50", + "블록 EST:main#1508": "426402e69369823d", + "블록 EST:main#1509": "3134369e64783b3f", + "블록 EST:main#151": "fc90323f0530c1a5", + "블록 EST:main#1510": "695f04d6734f1a70", + "블록 EST:main#1511": "b38e87f053942d3f", + "블록 EST:main#1512": "6863e3fd821cc5bd", + "블록 EST:main#1513": "4af8dbbac12d7f99", + "블록 EST:main#1514": "acc2eaaf259b9b8a", + "블록 EST:main#1515": "1b9303c32c12968d", + "블록 EST:main#1516": "286ea387631128d8", + "블록 EST:main#1517": "79bc1188f2dd34e3", + "블록 EST:main#1518": "b999bca5f0dae3d4", + "블록 EST:main#1519": "c5109970a666af55", + "블록 EST:main#152": "ed35d0ed5d15b902", + "블록 EST:main#1520": "87419ebc4097e0b8", + "블록 EST:main#1521": "3e8d1d2d32b89773", + "블록 EST:main#1522": "a177d13f0630a82c", + "블록 EST:main#1523": "cd00b084ce749a82", + "블록 EST:main#1524": "21deab0aaf37d01a", + "블록 EST:main#1525": "d2d7eba7a60d7f24", + "블록 EST:main#1526": "3dd97c554ea1287e", + "블록 EST:main#1527": "72599809ae06c141", + "블록 EST:main#1528": "72599809ae06c141", + "블록 EST:main#1529": "590496a6f543248e", + "블록 EST:main#153": "957dee1e813cc738", + "블록 EST:main#1530": "590496a6f543248e", + "블록 EST:main#1531": "375afa07748abfdf", + "블록 EST:main#1532": "2122f69997587425", + "블록 EST:main#1533": "b7218ae276f2c5e8", + "블록 EST:main#1534": "30e2fe2c35ad247d", + "블록 EST:main#1535": "a1470b3539c84cfa", + "블록 EST:main#1536": "f4860eb70e11211f", + "블록 EST:main#1537": "09dd16d32816ef7d", + "블록 EST:main#1538": "ffcabeed52f7a8aa", + "블록 EST:main#1539": "5eb85a11fd6c25f5", + "블록 EST:main#154": "8291536100cb6090", + "블록 EST:main#1540": "8252a9f8e0011e5c", + "블록 EST:main#1541": "799ff92806b9bbfb", + "블록 EST:main#1542": "6356576e0c08a533", + "블록 EST:main#1543": "2bf626ed0f31b879", + "블록 EST:main#1544": "420ac8d4eb745287", + "블록 EST:main#1545": "1f97e2b5563c5c2f", + "블록 EST:main#1546": "5c89a805a077959e", + "블록 EST:main#1547": "a2ee62a448cdad58", + "블록 EST:main#1548": "7bbaeee6c837e40d", + "블록 EST:main#1549": "b8eefc4f2fcae53d", + "블록 EST:main#155": "57dce87248f93b81", + "블록 EST:main#1550": "18e01ed742914aa6", + "블록 EST:main#1551": "65243bc8047c671c", + "블록 EST:main#1552": "85638c2571d9cf62", + "블록 EST:main#1553": "2840b491a6284273", + "블록 EST:main#1554": "fb4bf838ed7c77e3", + "블록 EST:main#1555": "738ef4f6a5935468", + "블록 EST:main#1556": "f7185a9679c6c053", + "블록 EST:main#1557": "9799b42b19188b8b", + "블록 EST:main#1558": "569b9ff66fed2727", + "블록 EST:main#1559": "9fff1798af41a617", + "블록 EST:main#156": "8d7704766ceee8a0", + "블록 EST:main#1560": "b13dbba8239947b8", + "블록 EST:main#1561": "eaa5e081ad2bf09a", + "블록 EST:main#1562": "9dfcd586b319b1ef", + "블록 EST:main#1563": "cb9fc7f6e6a5051e", + "블록 EST:main#1564": "2403e0c93bb88fc3", + "블록 EST:main#1565": "bb7d7548de27608e", + "블록 EST:main#1566": "1991f60d49b2b60a", + "블록 EST:main#1567": "6295234939fc98fd", + "블록 EST:main#1568": "276749f3832c1d58", + "블록 EST:main#1569": "36601b0c121733c9", + "블록 EST:main#157": "a99b5858ea48334e", + "블록 EST:main#158": "9e3368d173e7f43e", + "블록 EST:main#159": "cb6f52b2b78231d0", + "블록 EST:main#16": "704e1ca7a6674032", + "블록 EST:main#160": "c024a1a683fc03b2", + "블록 EST:main#161": "09852e1e548c985b", + "블록 EST:main#162": "06caf3dd4a428181", + "블록 EST:main#163": "17d89653a81e1336", + "블록 EST:main#164": "938b97d553957d8b", + "블록 EST:main#165": "cb4c1136aa6613ba", + "블록 EST:main#166": "961bb33d9f100724", + "블록 EST:main#167": "f11b38ad5f2798a8", + "블록 EST:main#168": "2da49ca9233aae66", + "블록 EST:main#169": "2952fd8c1fa3ce11", + "블록 EST:main#17": "24fc9be4c68ec2d4", + "블록 EST:main#170": "f1bec0a38c585cdc", + "블록 EST:main#171": "6565abfa5edecd3c", + "블록 EST:main#172": "ea76d406cc211ab4", + "블록 EST:main#173": "2218a37748880123", + "블록 EST:main#174": "d902dc2ecc82e706", + "블록 EST:main#175": "7933b48e3ec96eb1", + "블록 EST:main#176": "d2d0d4e40c15c19a", + "블록 EST:main#177": "f7a00bfe3deca40e", + "블록 EST:main#178": "7a9b95214c4d9c4d", + "블록 EST:main#179": "954a08f96306dcc4", + "블록 EST:main#18": "7dfe27798dd38262", + "블록 EST:main#180": "4d800acdf0ed4f00", + "블록 EST:main#181": "a915bf6ed4de8451", + "블록 EST:main#182": "47566d31f26c986f", + "블록 EST:main#183": "23ac8a6c34103dcb", + "블록 EST:main#184": "e5bb33bc59b0c12f", + "블록 EST:main#185": "735f234da6028ecb", + "블록 EST:main#186": "0912db0d47d10523", + "블록 EST:main#187": "4910b5629c1c5078", + "블록 EST:main#188": "ccaf42ef6bfe041c", + "블록 EST:main#189": "9cf9a3502636c328", + "블록 EST:main#19": "4263e4661fbcca45", + "블록 EST:main#190": "3d94e6206c1ce9d6", + "블록 EST:main#191": "ffe07df7e26fe969", + "블록 EST:main#192": "d7dc8a1244514a89", + "블록 EST:main#193": "35c80f11a9616954", + "블록 EST:main#194": "f776f6ee194ca297", + "블록 EST:main#195": "8d470d4471af4020", + "블록 EST:main#196": "4318fe1b5aa5f390", + "블록 EST:main#197": "cb947ff22cb34cbb", + "블록 EST:main#198": "1364112a61f79441", + "블록 EST:main#199": "2a996779cd2f1531", + "블록 EST:main#2": "940cd03111b954ea", + "블록 EST:main#20": "7b25886ef2f0546b", + "블록 EST:main#200": "a2646d055dc6b628", + "블록 EST:main#201": "03db04baeb6ce49b", + "블록 EST:main#202": "a2646d055dc6b628", + "블록 EST:main#203": "ccd8bd801d03b8e5", + "블록 EST:main#204": "98f9e7fd77c41fd0", + "블록 EST:main#205": "c17ab14f4cf0bd73", + "블록 EST:main#206": "d3c5fce49be3b0b8", + "블록 EST:main#207": "8bb9d0ba8018b7ec", + "블록 EST:main#208": "b4d856cb51da8f39", + "블록 EST:main#209": "2e52754dcd44380b", + "블록 EST:main#21": "01286ea0b5cdfbb4", + "블록 EST:main#210": "a67a2fb4ba7e893e", + "블록 EST:main#211": "6617a9c59c0a69f4", + "블록 EST:main#212": "80cf8e7eb4358d59", + "블록 EST:main#213": "1d8e2833865b137b", + "블록 EST:main#214": "2b844c3b72251d75", + "블록 EST:main#215": "708276e97db0770d", + "블록 EST:main#216": "abde441df0bc7791", + "블록 EST:main#217": "25eb57d9d6418d5a", + "블록 EST:main#218": "9b52440398be4976", + "블록 EST:main#219": "aefc9532389240d5", + "블록 EST:main#22": "0aa8914efe6db331", + "블록 EST:main#220": "94b6d41f2dbe7539", + "블록 EST:main#221": "986ffbaca7e5c776", + "블록 EST:main#222": "9de25324368a5272", + "블록 EST:main#223": "dd8648a0ca6fd96e", + "블록 EST:main#224": "c7dedd079b7bd0f5", + "블록 EST:main#225": "b32ba8c551b6a095", + "블록 EST:main#226": "e8b3d600dc8a2786", + "블록 EST:main#227": "47ab7907da5fb01a", + "블록 EST:main#228": "981588f1facd866e", + "블록 EST:main#229": "d453e8732f36e9e7", + "블록 EST:main#23": "b06b066d33235ee9", + "블록 EST:main#230": "9fcf6642c2ee8865", + "블록 EST:main#231": "5b7c71ebdeac55c7", + "블록 EST:main#232": "476edae2060f3092", + "블록 EST:main#233": "491d03854c7241de", + "블록 EST:main#234": "7657457d5e332e76", + "블록 EST:main#235": "54e501edef2ded7b", + "블록 EST:main#236": "23f65f7b2b246e1c", + "블록 EST:main#237": "bd62d2a6959cd297", + "블록 EST:main#238": "d5b1a8f922897b2b", + "블록 EST:main#239": "34b5c1e6fcb391cd", + "블록 EST:main#24": "7f61a0ccf3922d01", + "블록 EST:main#240": "6a49fb2b50a209e6", + "블록 EST:main#241": "8a74d112db408aba", + "블록 EST:main#242": "9f56da6ead7be3d9", + "블록 EST:main#243": "2043709f1e185f6e", + "블록 EST:main#244": "6c82d2ea7ac0545b", + "블록 EST:main#245": "d248452c50498fc9", + "블록 EST:main#246": "0b69733bab29e42a", + "블록 EST:main#247": "b344a876054cb352", + "블록 EST:main#248": "b88518bdd973261d", + "블록 EST:main#249": "9e898e37b80e5a76", + "블록 EST:main#25": "a43e14a20fb6b2a4", + "블록 EST:main#250": "de5c415f50e5785a", + "블록 EST:main#251": "0eed6e4adc647979", + "블록 EST:main#252": "eda76c3ed64a22b6", + "블록 EST:main#253": "a0680fe5e10ff98f", + "블록 EST:main#254": "48d0f0a979b334c3", + "블록 EST:main#255": "9d94580f4bdc1801", + "블록 EST:main#256": "29e7a16b3edff7d8", + "블록 EST:main#257": "cd5a0109a2c02a2c", + "블록 EST:main#258": "35c141b7a306ed44", + "블록 EST:main#259": "718df77f19ab8ea1", + "블록 EST:main#26": "d983b23ca79d0d3f", + "블록 EST:main#260": "dd1569106eaa04ed", + "블록 EST:main#261": "3691d804637f3d56", + "블록 EST:main#262": "ffa017cfbb36e5f2", + "블록 EST:main#263": "2f602919e8b550ff", + "블록 EST:main#264": "d92568e51e4ef066", + "블록 EST:main#265": "e488ebdd633c2af4", + "블록 EST:main#266": "31fef0f02567d426", + "블록 EST:main#267": "dfb77ea80e0d6f92", + "블록 EST:main#268": "60a1b198d3d791af", + "블록 EST:main#269": "1ba90568ab078a99", + "블록 EST:main#27": "d5868b7a1f0653be", + "블록 EST:main#270": "3e287a741d827d54", + "블록 EST:main#271": "d1b9f2951ec1ccf0", + "블록 EST:main#272": "299ea730c9a28b46", + "블록 EST:main#273": "bf73e40b22da0202", + "블록 EST:main#274": "2c411ce91217d178", + "블록 EST:main#275": "2dc9313eb9a05630", + "블록 EST:main#276": "ce2ad6be357fcffd", + "블록 EST:main#277": "1c4de7cfcd08bcee", + "블록 EST:main#278": "bad591cc216a4cbf", + "블록 EST:main#279": "fb4fa95ed680314b", + "블록 EST:main#28": "aac55d10f5d8903d", + "블록 EST:main#280": "bef3a4c83e3856ee", + "블록 EST:main#281": "a012640b1a41a99e", + "블록 EST:main#282": "902a29cb811cb459", + "블록 EST:main#283": "8fae93efd7300981", + "블록 EST:main#284": "70d43a59ad1e0fb3", + "블록 EST:main#285": "ab68157545068c4f", + "블록 EST:main#286": "a0c8cc43c58865b8", + "블록 EST:main#287": "d398db99823570ce", + "블록 EST:main#288": "1bcfce3390306a74", + "블록 EST:main#289": "fe852d4ca6e88cba", + "블록 EST:main#29": "ddb8f613c20e4056", + "블록 EST:main#290": "a940e5c105dba73e", + "블록 EST:main#291": "ec62b2f28db63cb6", + "블록 EST:main#292": "a0a9cf40b7601955", + "블록 EST:main#293": "8c6e5ef2cc7102c5", + "블록 EST:main#294": "072b39f68cfa8165", + "블록 EST:main#295": "5f4ca12ce0087ca5", + "블록 EST:main#296": "60e75dc5709aa9dc", + "블록 EST:main#297": "c656085ce83a6a68", + "블록 EST:main#298": "4a5ee1c28ea1189f", + "블록 EST:main#299": "4ea624f5229660d2", + "블록 EST:main#3": "aeb9b48f07510807", + "블록 EST:main#30": "a73875e91f00c6b6", + "블록 EST:main#300": "2c127078403b7402", + "블록 EST:main#301": "06f1613a876916e4", + "블록 EST:main#302": "0c6efd71f6af4db4", + "블록 EST:main#303": "a1479943d9f58cad", + "블록 EST:main#304": "6af55b03a93e8b34", + "블록 EST:main#305": "1c63e26415767661", + "블록 EST:main#306": "bcf4b798daf63282", + "블록 EST:main#307": "86d4f2be3609fc9e", + "블록 EST:main#308": "3a2247f51a92ba51", + "블록 EST:main#309": "ffa20df77766d145", + "블록 EST:main#31": "fa4df8766da70b74", + "블록 EST:main#310": "8514525f3eff77c6", + "블록 EST:main#311": "53432e66c6ee6c84", + "블록 EST:main#312": "ab74ab693970843a", + "블록 EST:main#313": "c89f7e9e3d924827", + "블록 EST:main#314": "26f8496ea4490387", + "블록 EST:main#315": "a0bf36a35ca39e15", + "블록 EST:main#316": "ab29cb072a2004a1", + "블록 EST:main#317": "fa216692f553da7b", + "블록 EST:main#318": "5800d29806b45af8", + "블록 EST:main#319": "4c902cc7a908d6b6", + "블록 EST:main#32": "8fe29db9b2e70679", + "블록 EST:main#320": "ab74ab693970843a", + "블록 EST:main#321": "c89f7e9e3d924827", + "블록 EST:main#322": "c38cc2eb6fe2fc0d", + "블록 EST:main#323": "9fbb700c5e4a90a7", + "블록 EST:main#324": "0e5aa0f802329121", + "블록 EST:main#325": "9e57434a5034578f", + "블록 EST:main#326": "f047fa23ed19b2cb", + "블록 EST:main#327": "8f468d227876055e", + "블록 EST:main#328": "4672d60fb56671d4", + "블록 EST:main#329": "ef3ad1b8303eefde", + "블록 EST:main#33": "d1c9a3d90187e08b", + "블록 EST:main#330": "0a9104c4d27b0f72", + "블록 EST:main#331": "ab7c7cf9e78e810f", + "블록 EST:main#332": "2772dcc8bb4330a8", + "블록 EST:main#333": "adc6c3cd678d7f83", + "블록 EST:main#334": "72b08e402f22e6a7", + "블록 EST:main#335": "12cca9b067f6adcb", + "블록 EST:main#336": "380cd5607c75b861", + "블록 EST:main#337": "ad680a1703e7a3bc", + "블록 EST:main#338": "03647eb4cc9c6412", + "블록 EST:main#339": "fd07dc637b7e1fab", + "블록 EST:main#34": "a4e94b322ebf86ed", + "블록 EST:main#340": "eaed25b8abe049f0", + "블록 EST:main#341": "d28159e2b8d99955", + "블록 EST:main#342": "8ae8c9b53c211307", + "블록 EST:main#343": "3b89c001d5bb82f3", + "블록 EST:main#344": "9d4e6e14f9af3b00", + "블록 EST:main#345": "80c456d20c1410c5", + "블록 EST:main#346": "c058102745cf29e8", + "블록 EST:main#347": "b1b5e8f362728139", + "블록 EST:main#348": "b5dc52cf6fa2ebe9", + "블록 EST:main#349": "2c3356092d32ff4b", + "블록 EST:main#35": "0abc1880c513fa1e", + "블록 EST:main#350": "59bdac028387e73d", + "블록 EST:main#351": "a108d0375cd2a0c7", + "블록 EST:main#352": "1ab57e0fe174b94a", + "블록 EST:main#353": "e5c9b0c8bd6060ea", + "블록 EST:main#354": "c6805d8a85f23df6", + "블록 EST:main#355": "34783ce6ab3815f4", + "블록 EST:main#356": "a2a35a1f0868ac4f", + "블록 EST:main#357": "8925addfbe27765d", + "블록 EST:main#358": "9122734d42eb230a", + "블록 EST:main#359": "30912ea6f6b706e2", + "블록 EST:main#36": "b546d2174ca56d91", + "블록 EST:main#360": "0f20f0fdce80efb3", + "블록 EST:main#361": "92e78c9e59980925", + "블록 EST:main#362": "21048445c49f0291", + "블록 EST:main#363": "a578959d088632a8", + "블록 EST:main#364": "5bf6f1c95c504f4d", + "블록 EST:main#365": "c95703caca46352c", + "블록 EST:main#366": "e85bada4069e90a9", + "블록 EST:main#367": "e46bd35cbcabcfff", + "블록 EST:main#368": "c20f2f6cccd21cbf", + "블록 EST:main#369": "b164f886aabe548b", + "블록 EST:main#37": "08c9add6ea95c12e", + "블록 EST:main#370": "e0778e5384d61ea6", + "블록 EST:main#371": "3b4cf8a9c52237a9", + "블록 EST:main#372": "26e57d583199ceda", + "블록 EST:main#373": "648498a2202e82e9", + "블록 EST:main#374": "2d77ced038621026", + "블록 EST:main#375": "56c8d9e0e321c386", + "블록 EST:main#376": "41a98752de5489c6", + "블록 EST:main#377": "8e5fe6f370c65596", + "블록 EST:main#378": "4867dd41d4cb623f", + "블록 EST:main#379": "e094f5f8ffdb29af", + "블록 EST:main#38": "5065dc7bfa825d41", + "블록 EST:main#380": "33dd438c1f9993aa", + "블록 EST:main#381": "9765753a1a0d53d8", + "블록 EST:main#382": "e64a6a33f3d11565", + "블록 EST:main#383": "d4d9375cd3986c97", + "블록 EST:main#384": "9f245b38ac7d95bd", + "블록 EST:main#385": "d86fd306997eea89", + "블록 EST:main#386": "8002ce34c92a7c5d", + "블록 EST:main#387": "16cdd6752774cee5", + "블록 EST:main#388": "309f4b50ee00d6e5", + "블록 EST:main#389": "169c21b7cd055027", + "블록 EST:main#39": "dc10aaf4f30af9f6", + "블록 EST:main#390": "dbde28d7b9beff8a", + "블록 EST:main#391": "2137116ca02afd4d", + "블록 EST:main#392": "6899f989f52d4365", + "블록 EST:main#393": "cbf9e73f5cc2b1b1", + "블록 EST:main#394": "9822d5a1c9bcb2a2", + "블록 EST:main#395": "ac25b1977dcf82a6", + "블록 EST:main#396": "9729a1938a3591cb", + "블록 EST:main#397": "c4e3b2ee0206fbfd", + "블록 EST:main#398": "738e52fb8df70c8f", + "블록 EST:main#399": "fc4694ea4af7fec5", + "블록 EST:main#4": "0aa8914efe6db331", + "블록 EST:main#40": "f30505be22bf79c0", + "블록 EST:main#400": "e51c2caeffb1909e", + "블록 EST:main#401": "53916ff8b41d5dc7", + "블록 EST:main#402": "3ebdd04687fce632", + "블록 EST:main#403": "538fa5c933bace13", + "블록 EST:main#404": "312e273c3f77a4e3", + "블록 EST:main#405": "316d62911dab4dce", + "블록 EST:main#406": "dd79dc6445d9c60c", + "블록 EST:main#407": "2e329b005ea0be4a", + "블록 EST:main#408": "099c88ed0edc6406", + "블록 EST:main#409": "f38749611d0209be", + "블록 EST:main#41": "65782db1861d2900", + "블록 EST:main#410": "4b27a51bab2d34b6", + "블록 EST:main#411": "2628778a118e5ef6", + "블록 EST:main#412": "51c9f2b504cdd2a3", + "블록 EST:main#413": "f7755e7419ad9708", + "블록 EST:main#414": "a95344e8c9b87332", + "블록 EST:main#415": "70037a9142e558ca", + "블록 EST:main#416": "10f6cc4eefb592a1", + "블록 EST:main#417": "7dd96af54c74a858", + "블록 EST:main#418": "5f7a6b709ba27e01", + "블록 EST:main#419": "3b91d0eb37188a0c", + "블록 EST:main#42": "58dc1230f24d17e5", + "블록 EST:main#420": "fe2b10aeb28b5a5c", + "블록 EST:main#421": "04ad70ae86da8544", + "블록 EST:main#422": "c591e0b62a168fbb", + "블록 EST:main#423": "81a1828bf3cb82be", + "블록 EST:main#424": "b0ec3b41bbc61bec", + "블록 EST:main#425": "d0cab051d83a586f", + "블록 EST:main#426": "cd627b63c5540271", + "블록 EST:main#427": "2da49ca9233aae66", + "블록 EST:main#428": "25fdd47a68e2be79", + "블록 EST:main#429": "4f82b2ecbfa6b056", + "블록 EST:main#43": "c91d676abda89b13", + "블록 EST:main#430": "59951d3eb0faaac1", + "블록 EST:main#431": "f2d7af65728180cc", + "블록 EST:main#432": "62c514dacef8ed99", + "블록 EST:main#433": "264d350bfc2dff67", + "블록 EST:main#434": "4f82b2ecbfa6b056", + "블록 EST:main#435": "5e801b7ed088f97b", + "블록 EST:main#436": "efaabec275b14b66", + "블록 EST:main#437": "62c514dacef8ed99", + "블록 EST:main#438": "64f1ff63733435a4", + "블록 EST:main#439": "d9a8dbb173784a59", + "블록 EST:main#44": "9a7b98dcb0f5eb26", + "블록 EST:main#440": "c19b8ad362232d91", + "블록 EST:main#441": "427fc4cef16379c4", + "블록 EST:main#442": "d00d95af56cf4979", + "블록 EST:main#443": "a1eb84a10940b1d9", + "블록 EST:main#444": "8df2a86b22deb2cd", + "블록 EST:main#445": "8f253b05acd7d83a", + "블록 EST:main#446": "d6137dff52c9e0d2", + "블록 EST:main#447": "11272ad1d6b3fc34", + "블록 EST:main#448": "05ab04d0281d63ca", + "블록 EST:main#449": "6d8c139514df09eb", + "블록 EST:main#45": "590aa4168672f082", + "블록 EST:main#450": "6d8c139514df09eb", + "블록 EST:main#451": "6d8c139514df09eb", + "블록 EST:main#452": "9b434418cee10247", + "블록 EST:main#453": "b34b34fa29875c6a", + "블록 EST:main#454": "6544a0a6984122cb", + "블록 EST:main#455": "9cdfcc59e4b83771", + "블록 EST:main#456": "f1d602aac1c49e7b", + "블록 EST:main#457": "beeec30e7ce4d944", + "블록 EST:main#458": "bab82c72fae2efd4", + "블록 EST:main#459": "379c30d016832fbf", + "블록 EST:main#46": "228c8629445415d1", + "블록 EST:main#460": "c5440aa894184db9", + "블록 EST:main#461": "a3ab3cde43fc313f", + "블록 EST:main#462": "fc406d496a39d965", + "블록 EST:main#463": "207f6285d3a5c1f9", + "블록 EST:main#464": "535e6df7bff0396b", + "블록 EST:main#465": "ea2629a87a1b0548", + "블록 EST:main#466": "eb9556e379cc1ae0", + "블록 EST:main#467": "ce7114cba30badb3", + "블록 EST:main#468": "5f1c04af9ac00586", + "블록 EST:main#469": "7e93babf65963aef", + "블록 EST:main#47": "b9784a8c496f06fa", + "블록 EST:main#470": "926e39fc803d1c57", + "블록 EST:main#471": "cc80be4a13e89c44", + "블록 EST:main#472": "fda81a851cafa88f", + "블록 EST:main#473": "f68e1adf4727a9f0", + "블록 EST:main#474": "0eb9bc211c8fcb40", + "블록 EST:main#475": "12a2a339f710064f", + "블록 EST:main#476": "f682df4b49cdd570", + "블록 EST:main#477": "268681171acac145", + "블록 EST:main#478": "531d939c02c8f382", + "블록 EST:main#479": "7c0e60cfa7b28372", + "블록 EST:main#48": "f1287e10f5b46ef7", + "블록 EST:main#480": "de76793fc4613e17", + "블록 EST:main#481": "129b468658b54797", + "블록 EST:main#482": "dd8d4da841b2a5f3", + "블록 EST:main#483": "4429203f5f8fafbf", + "블록 EST:main#484": "3da621335dd4b874", + "블록 EST:main#485": "4494df6fae1db8f1", + "블록 EST:main#486": "022436f52537d20c", + "블록 EST:main#487": "9bcb7209105df3bb", + "블록 EST:main#488": "7eaec2af70287576", + "블록 EST:main#489": "4478327aee16b880", + "블록 EST:main#49": "924de13aea602205", + "블록 EST:main#490": "abae5d78588fbde1", + "블록 EST:main#491": "35fb390787e29fd6", + "블록 EST:main#492": "ceafdd38152169ac", + "블록 EST:main#493": "1da1c911fae96dd2", + "블록 EST:main#494": "eb763cd7bebdfb2a", + "블록 EST:main#495": "ada72ff82916fed4", + "블록 EST:main#496": "6793f27eb00b62c5", + "블록 EST:main#497": "91462af2dd7bafeb", + "블록 EST:main#498": "48ce9e750192a891", + "블록 EST:main#499": "d4c8a0d57a996eea", + "블록 EST:main#5": "4263e4661fbcca45", + "블록 EST:main#50": "79d9b51b63a4fad9", + "블록 EST:main#500": "f479c13035220cba", + "블록 EST:main#501": "8a89ad7b88dc2015", + "블록 EST:main#502": "2c2c559490c09797", + "블록 EST:main#503": "2e11723c0ddcccdf", + "블록 EST:main#504": "d50d127e373c825e", + "블록 EST:main#505": "d55a341f676d8b12", + "블록 EST:main#506": "b684ba2dd255b9c8", + "블록 EST:main#507": "6e6611b3b2264224", + "블록 EST:main#508": "d0084c6f877b44f0", + "블록 EST:main#509": "9fb5202a369f70d1", + "블록 EST:main#51": "bdfdf1daa7520c8e", + "블록 EST:main#510": "8d6906d76ba1caf3", + "블록 EST:main#511": "aa55d47280127f13", + "블록 EST:main#512": "61f17c3bbada39ee", + "블록 EST:main#513": "3c707cb011311bb3", + "블록 EST:main#514": "e4077381990a56cc", + "블록 EST:main#515": "7b15bbbe66db934f", + "블록 EST:main#516": "3447f7ae661a3d3f", + "블록 EST:main#517": "c34aa56077014133", + "블록 EST:main#518": "8313f26e305cfecd", + "블록 EST:main#519": "301fd949fd534d1b", + "블록 EST:main#52": "f86ae563a1783344", + "블록 EST:main#520": "93c127b0fae64135", + "블록 EST:main#521": "59ef2f0b6d66894b", + "블록 EST:main#522": "e31d9a43527cbf48", + "블록 EST:main#523": "1558da404fd664c1", + "블록 EST:main#524": "902c0f85a43de5e0", + "블록 EST:main#525": "24078b50e8d63b6b", + "블록 EST:main#526": "6844c13b090f192c", + "블록 EST:main#527": "d28b1e41c293dfc3", + "블록 EST:main#528": "f0059bb848bc11c4", + "블록 EST:main#529": "7f2d079b38938628", + "블록 EST:main#53": "14ca203edb64c80b", + "블록 EST:main#530": "3bbf6f6ff5cd64d3", + "블록 EST:main#531": "9eac98a10b003675", + "블록 EST:main#532": "023983479a644069", + "블록 EST:main#533": "3d84336fc426f488", + "블록 EST:main#534": "2655220db991db2d", + "블록 EST:main#535": "5946bf02872846f8", + "블록 EST:main#536": "034c5f7cb5e676e2", + "블록 EST:main#537": "7de1fb4438f398c5", + "블록 EST:main#538": "f0e20424fede9ae3", + "블록 EST:main#539": "12cf59712d14d5d5", + "블록 EST:main#54": "0f68b68a2ea28362", + "블록 EST:main#540": "effae653d78f6809", + "블록 EST:main#541": "777e6bcb82baf863", + "블록 EST:main#542": "4b35c5d1af62827b", + "블록 EST:main#543": "7343ca6c23993768", + "블록 EST:main#544": "4902e92cb9cac50e", + "블록 EST:main#545": "6948ef21211b0f13", + "블록 EST:main#546": "e323975d89f59245", + "블록 EST:main#547": "bd4bd83c5b07a83b", + "블록 EST:main#548": "9b4f7033a404353d", + "블록 EST:main#549": "5af2f42daf0f3211", + "블록 EST:main#55": "c61b10918ce5df2d", + "블록 EST:main#550": "09df7379a961cab8", + "블록 EST:main#551": "518bd46d88d7a9e1", + "블록 EST:main#552": "7943612582dbd15f", + "블록 EST:main#553": "04fd7406d3afa2df", + "블록 EST:main#554": "294d8cb37dd39549", + "블록 EST:main#555": "5d74dd07e3188ba5", + "블록 EST:main#556": "66624e3a5c0dbfb0", + "블록 EST:main#557": "b237733e76beaa1f", + "블록 EST:main#558": "179077696a5496d6", + "블록 EST:main#559": "88345c7df412ae69", + "블록 EST:main#56": "78d809c8f75ba681", + "블록 EST:main#560": "6ea752a78be2d1e9", + "블록 EST:main#561": "eaf446c891f93654", + "블록 EST:main#562": "b8e5437b4a4ad894", + "블록 EST:main#563": "ad6c2ee49038a1b9", + "블록 EST:main#564": "cdc38a2a6f8a5934", + "블록 EST:main#565": "7087beab4399aa35", + "블록 EST:main#566": "830f2082133bd2fd", + "블록 EST:main#567": "0f608691d65ac612", + "블록 EST:main#568": "b2eaf140ca0ab0db", + "블록 EST:main#569": "0251a0d82053e891", + "블록 EST:main#57": "25a06ef983d6e68a", + "블록 EST:main#570": "dc5f53df3e5baa6b", + "블록 EST:main#571": "c48a1d7bf14afd2d", + "블록 EST:main#572": "1bf3c1a085a36a5d", + "블록 EST:main#573": "cb5a949da5d3ae32", + "블록 EST:main#574": "0c7812c453e0eb63", + "블록 EST:main#575": "63bd8251163769ab", + "블록 EST:main#576": "b313d9e3ca873eff", + "블록 EST:main#577": "f5ff7d9f0f7e5fae", + "블록 EST:main#578": "46904612727f6fad", + "블록 EST:main#579": "0e3fc9e8e4abfd46", + "블록 EST:main#58": "97cba0f555443e3a", + "블록 EST:main#580": "5885e807b06814a7", + "블록 EST:main#581": "9f262917e38c75d4", + "블록 EST:main#582": "1cc132c021ac05cf", + "블록 EST:main#583": "b789492f9c8a4e93", + "블록 EST:main#584": "161daac9a0f24be6", + "블록 EST:main#585": "20eebec689481bf3", + "블록 EST:main#586": "68a1f9249bc54148", + "블록 EST:main#587": "73f6932b64b15d29", + "블록 EST:main#588": "93b928b8b095aefd", + "블록 EST:main#589": "72870f927a19f5f8", + "블록 EST:main#59": "0cd5a0b5ec3afcb8", + "블록 EST:main#590": "aa859488a644e028", + "블록 EST:main#591": "9d674586da00cd1f", + "블록 EST:main#592": "442fac853b8f0a93", + "블록 EST:main#593": "5815573c662e8937", + "블록 EST:main#594": "ce31166fe2eafa8d", + "블록 EST:main#595": "20b6b56e27719c14", + "블록 EST:main#596": "b49096f0b7ac31d0", + "블록 EST:main#597": "82cfbcadb54e789a", + "블록 EST:main#598": "79db4eea91c5ce80", + "블록 EST:main#599": "24ba6f63f152bb0a", + "블록 EST:main#6": "7b25886ef2f0546b", + "블록 EST:main#60": "807097739fb824b8", + "블록 EST:main#600": "73e3dca2354f34e0", + "블록 EST:main#601": "71bd530ea32d6bda", + "블록 EST:main#602": "3b440c978f34bcf2", + "블록 EST:main#603": "b8a3b60ad2d7349a", + "블록 EST:main#604": "8e276a815ea5f585", + "블록 EST:main#605": "56a62709dfe59f6c", + "블록 EST:main#606": "6ec641c70a77fafe", + "블록 EST:main#607": "81f78f3613a39f91", + "블록 EST:main#608": "9bd25cd8141b6d1e", + "블록 EST:main#609": "5783f0d3b35e2015", + "블록 EST:main#61": "d696efc9a9d6afb3", + "블록 EST:main#610": "7c706e2eda353291", + "블록 EST:main#611": "24d8d7625013c418", + "블록 EST:main#612": "f7e4d717f7f8ece5", + "블록 EST:main#613": "70153fe5873b893c", + "블록 EST:main#614": "b6af5f3a056f85fd", + "블록 EST:main#615": "eb752f4cc6d89fa0", + "블록 EST:main#616": "95a1565bad50eb8c", + "블록 EST:main#617": "272eaa6adc9f2e17", + "블록 EST:main#618": "5861934bd770d653", + "블록 EST:main#619": "1e71b5bf2bbdbe6c", + "블록 EST:main#62": "c55b303d51ae80eb", + "블록 EST:main#620": "89ae5285b62880e9", + "블록 EST:main#621": "5496a2cc4b07a7a6", + "블록 EST:main#622": "d481d9bbcc6dd31c", + "블록 EST:main#623": "b36657187cfac8a6", + "블록 EST:main#624": "d3525cb4b6abf7cf", + "블록 EST:main#625": "66f7d45db31d36f8", + "블록 EST:main#626": "73b84fe2edfea7ff", + "블록 EST:main#627": "6d5605b603168c65", + "블록 EST:main#628": "6bb016ed52ddc9cd", + "블록 EST:main#629": "d5411293b7141153", + "블록 EST:main#63": "beffdbfa2657b602", + "블록 EST:main#630": "b6abd2f0edcd0115", + "블록 EST:main#631": "16b9ff772d8101f2", + "블록 EST:main#632": "3cf326effa068491", + "블록 EST:main#633": "c0aa2c44f2fad3d5", + "블록 EST:main#634": "753b9b0222dec21f", + "블록 EST:main#635": "5438376ca7d4a08a", + "블록 EST:main#636": "3b5ccd921c142fa1", + "블록 EST:main#637": "d70253e9de4a7953", + "블록 EST:main#638": "62bdc330223b9938", + "블록 EST:main#639": "1c1f7771f635d3ed", + "블록 EST:main#64": "4b51488fd54ed23f", + "블록 EST:main#640": "647900edd850ebfa", + "블록 EST:main#641": "3dd67dd1fc7b0635", + "블록 EST:main#642": "84baa3bf2bc6e4cd", + "블록 EST:main#643": "26c9c7a2d2f2dcc8", + "블록 EST:main#644": "fd3da7b463576431", + "블록 EST:main#645": "0b3f63223e5441a4", + "블록 EST:main#646": "e2f5d9137b659fb7", + "블록 EST:main#647": "59b17d2c2d8a1f8c", + "블록 EST:main#648": "7c1f3339b899a856", + "블록 EST:main#649": "17e2acac06f815f4", + "블록 EST:main#65": "c36c6c95f88f7ae0", + "블록 EST:main#650": "a9330ffcb68e4932", + "블록 EST:main#651": "79e928eb870ccd18", + "블록 EST:main#652": "0f4307128cca4ad5", + "블록 EST:main#653": "a29703b727c086f0", + "블록 EST:main#654": "3fa6d4d83e234775", + "블록 EST:main#655": "e35bef822a3d8b9f", + "블록 EST:main#656": "94e24b7b4b17074d", + "블록 EST:main#657": "a3d1b2352017e3a5", + "블록 EST:main#658": "39df4fe3737b6a04", + "블록 EST:main#659": "3596587fbb995a01", + "블록 EST:main#66": "deef554f2900315f", + "블록 EST:main#660": "738c08f81f33dfe1", + "블록 EST:main#661": "41dbd5530f9d47b7", + "블록 EST:main#662": "205c9a48a8a2a92e", + "블록 EST:main#663": "fd15a30ebbce0b08", + "블록 EST:main#664": "8aa57dbd4197a12f", + "블록 EST:main#665": "d0d85687528fa5b4", + "블록 EST:main#666": "8fd2a7913362f608", + "블록 EST:main#667": "7f19cfc9d37963ca", + "블록 EST:main#668": "7f19cfc9d37963ca", + "블록 EST:main#669": "41770544819e4f3c", + "블록 EST:main#67": "e2b68c25b1e31e3b", + "블록 EST:main#670": "334c57a006afdb67", + "블록 EST:main#671": "334c57a006afdb67", + "블록 EST:main#672": "0633f23789d73933", + "블록 EST:main#673": "e894ae51d012da13", + "블록 EST:main#674": "3a0af153ccf0438e", + "블록 EST:main#675": "a3d1b2352017e3a5", + "블록 EST:main#676": "39df4fe3737b6a04", + "블록 EST:main#677": "a541279a1ce71409", + "블록 EST:main#678": "3596587fbb995a01", + "블록 EST:main#679": "eadb4bcd28564e89", + "블록 EST:main#68": "2c411ce91217d178", + "블록 EST:main#680": "179d683239b92591", + "블록 EST:main#681": "fd15a30ebbce0b08", + "블록 EST:main#682": "8aa57dbd4197a12f", + "블록 EST:main#683": "8aa57dbd4197a12f", + "블록 EST:main#684": "8fd2a7913362f608", + "블록 EST:main#685": "8fd2a7913362f608", + "블록 EST:main#686": "7f19cfc9d37963ca", + "블록 EST:main#687": "41770544819e4f3c", + "블록 EST:main#688": "334c57a006afdb67", + "블록 EST:main#689": "334c57a006afdb67", + "블록 EST:main#69": "6b89c8cca2f4894f", + "블록 EST:main#690": "0633f23789d73933", + "블록 EST:main#691": "44a8cc0ffeedd2fa", + "블록 EST:main#692": "973e63982d1953cf", + "블록 EST:main#693": "973e63982d1953cf", + "블록 EST:main#694": "4071ba7ca2eeabd9", + "블록 EST:main#695": "4071ba7ca2eeabd9", + "블록 EST:main#696": "150e3cae7914b719", + "블록 EST:main#697": "459c4151351751f9", + "블록 EST:main#698": "15515ecd3e013f85", + "블록 EST:main#699": "a0f565c2a6eb3077", + "블록 EST:main#7": "01286ea0b5cdfbb4", + "블록 EST:main#70": "099ff1bf79284261", + "블록 EST:main#700": "4c3f16433d89de8d", + "블록 EST:main#701": "efc27dad7bb10bb3", + "블록 EST:main#702": "bba6b0f035cb0b8d", + "블록 EST:main#703": "072795dab7aa9c66", + "블록 EST:main#704": "80089384830bb86f", + "블록 EST:main#705": "34ac67e026d8031a", + "블록 EST:main#706": "ff64f9f8bf90604f", + "블록 EST:main#707": "4ff4ec02520690c8", + "블록 EST:main#708": "11910148292f0c75", + "블록 EST:main#709": "d85da25a98115eb2", + "블록 EST:main#71": "ec5c95a7cd890536", + "블록 EST:main#710": "79b05fdf79a3d0b5", + "블록 EST:main#711": "4f2b6b949e12546f", + "블록 EST:main#712": "63f6df056341059d", + "블록 EST:main#713": "1c929ead6e8d4102", + "블록 EST:main#714": "0420ea6ca41c656f", + "블록 EST:main#715": "53da0ff880560325", + "블록 EST:main#716": "eb6400ca67c7b625", + "블록 EST:main#717": "c2abd78f1b828220", + "블록 EST:main#718": "be49c2c1783d1c39", + "블록 EST:main#719": "fc59e8754974e406", + "블록 EST:main#72": "3b562e326d1dc6db", + "블록 EST:main#720": "709c7fbb7ced4057", + "블록 EST:main#721": "09d12e9d647c544f", + "블록 EST:main#722": "0f6bfda0fd2c252a", + "블록 EST:main#723": "6dbae8dac8a5028e", + "블록 EST:main#724": "58b780082f85bff9", + "블록 EST:main#725": "8a15cdcc873db389", + "블록 EST:main#726": "2c2e84021ed6f0eb", + "블록 EST:main#727": "ea92677bfd701531", + "블록 EST:main#728": "674d0d501f4e1d51", + "블록 EST:main#729": "cd11fe4d335ca352", + "블록 EST:main#73": "33de2757a49cb209", + "블록 EST:main#730": "bcc8b11b9c8a84d3", + "블록 EST:main#731": "0caf825f0936d89f", + "블록 EST:main#732": "e4d01c59e6bd7c89", + "블록 EST:main#733": "a20b6126c422ec0f", + "블록 EST:main#734": "55d2684216833692", + "블록 EST:main#735": "479d41b09dc40529", + "블록 EST:main#736": "2dc77758cc3dc9b2", + "블록 EST:main#737": "b0dbb9b312826ba7", + "블록 EST:main#738": "3df31ad5d7d8d8a8", + "블록 EST:main#739": "445a556d01b5d69f", + "블록 EST:main#74": "5c2bef11d10e7007", + "블록 EST:main#740": "ad5d097cd18e898b", + "블록 EST:main#741": "c31dcfc9c5f7510b", + "블록 EST:main#742": "ac2c78d25b5d3426", + "블록 EST:main#743": "5a915ca51e127adf", + "블록 EST:main#744": "01ba5814b37b4951", + "블록 EST:main#745": "dad119f5b97ae14a", + "블록 EST:main#746": "fcd7e6766129d417", + "블록 EST:main#747": "24eb285239deca55", + "블록 EST:main#748": "15db7ab2ecdb2a65", + "블록 EST:main#749": "7562c4df1735d2a8", + "블록 EST:main#75": "9c02fba45ecf8642", + "블록 EST:main#750": "905a00f379d82adb", + "블록 EST:main#751": "497db7cbaa248bd9", + "블록 EST:main#752": "51661f8a087a325d", + "블록 EST:main#753": "044906d68555e3b6", + "블록 EST:main#754": "829323a78a386f77", + "블록 EST:main#755": "b33fdf3692a84262", + "블록 EST:main#756": "828c949705b9be45", + "블록 EST:main#757": "65ce5ce5565a132a", + "블록 EST:main#758": "cb8ac806e9a6a5f6", + "블록 EST:main#759": "7cbdb2e84bc56b48", + "블록 EST:main#76": "52d79db2019018e4", + "블록 EST:main#760": "c49ac9eea5ea0792", + "블록 EST:main#761": "7f7637ac7f4193b8", + "블록 EST:main#762": "49c1920ffad19086", + "블록 EST:main#763": "4ab274920732d18b", + "블록 EST:main#764": "2647c2d2d412a3ea", + "블록 EST:main#765": "283a1ce14a2c96ca", + "블록 EST:main#766": "c21e32469d5e255b", + "블록 EST:main#767": "bc40a2fb2346fce8", + "블록 EST:main#768": "475c3132f3bfb4b7", + "블록 EST:main#769": "8e8e6f5609f25355", + "블록 EST:main#77": "ecba1afde226b63d", + "블록 EST:main#770": "4096c7567486a95c", + "블록 EST:main#771": "89d0dc4fd33034aa", + "블록 EST:main#772": "59b212d11b08e23d", + "블록 EST:main#773": "bbac1f4f1f3e9b2c", + "블록 EST:main#774": "bbac1f4f1f3e9b2c", + "블록 EST:main#775": "bbac1f4f1f3e9b2c", + "블록 EST:main#776": "3042478877b35409", + "블록 EST:main#777": "3042478877b35409", + "블록 EST:main#778": "e46667f5d53a8323", + "블록 EST:main#779": "d56e59be71e2e1e9", + "블록 EST:main#78": "ad36febc6bfe29bd", + "블록 EST:main#780": "e263d3510de5ec1d", + "블록 EST:main#781": "e263d3510de5ec1d", + "블록 EST:main#782": "e263d3510de5ec1d", + "블록 EST:main#783": "59b212d11b08e23d", + "블록 EST:main#784": "59b212d11b08e23d", + "블록 EST:main#785": "59b212d11b08e23d", + "블록 EST:main#786": "bbac1f4f1f3e9b2c", + "블록 EST:main#787": "bbac1f4f1f3e9b2c", + "블록 EST:main#788": "bbac1f4f1f3e9b2c", + "블록 EST:main#789": "3042478877b35409", + "블록 EST:main#79": "f1d31c956b325554", + "블록 EST:main#790": "e46667f5d53a8323", + "블록 EST:main#791": "59b212d11b08e23d", + "블록 EST:main#792": "59b212d11b08e23d", + "블록 EST:main#793": "bbac1f4f1f3e9b2c", + "블록 EST:main#794": "3042478877b35409", + "블록 EST:main#795": "3042478877b35409", + "블록 EST:main#796": "3042478877b35409", + "블록 EST:main#797": "e46667f5d53a8323", + "블록 EST:main#798": "e46667f5d53a8323", + "블록 EST:main#799": "d56e59be71e2e1e9", + "블록 EST:main#8": "0aa8914efe6db331", + "블록 EST:main#80": "b6977e32b52c84ca", + "블록 EST:main#800": "0a6fd40eccecccc7", + "블록 EST:main#801": "0a6fd40eccecccc7", + "블록 EST:main#802": "60457ddf3fa96809", + "블록 EST:main#803": "98f9d0e2756297fb", + "블록 EST:main#804": "76e6d77673d753bc", + "블록 EST:main#805": "3a47077a90fefde0", + "블록 EST:main#806": "5a5f4391efcfa3c2", + "블록 EST:main#807": "b0b1de399beaa634", + "블록 EST:main#808": "1d4086637e5563b6", + "블록 EST:main#809": "3cc1a07a67594818", + "블록 EST:main#81": "e6be7f46c92d1dca", + "블록 EST:main#810": "f52e431d690642d6", + "블록 EST:main#811": "3b9918ec446b6b7d", + "블록 EST:main#812": "d256b7a461b01845", + "블록 EST:main#813": "625ce12955851743", + "블록 EST:main#814": "8b011715653bcce2", + "블록 EST:main#815": "862046b6e359c1fe", + "블록 EST:main#816": "9377377d6951df01", + "블록 EST:main#817": "5e65ff7347b9a789", + "블록 EST:main#818": "627fa4a03212d0ab", + "블록 EST:main#819": "25fb56ab99374d3d", + "블록 EST:main#82": "e03b17a2633c749b", + "블록 EST:main#820": "4b573e858bc19ac2", + "블록 EST:main#821": "a70500eb7132ea04", + "블록 EST:main#822": "bd01430da3f28e84", + "블록 EST:main#823": "27c9857b06561c71", + "블록 EST:main#824": "1933fd20c8bf9e44", + "블록 EST:main#825": "980330c507d0233c", + "블록 EST:main#826": "57be1ab9f128b46a", + "블록 EST:main#827": "3dcefe5614e74e94", + "블록 EST:main#828": "8f42fc71fae99de7", + "블록 EST:main#829": "ab5a630405957832", + "블록 EST:main#83": "acc6a572439874db", + "블록 EST:main#830": "8d3c83e7338d3cd5", + "블록 EST:main#831": "faaedab8524298bb", + "블록 EST:main#832": "3510136bb8541230", + "블록 EST:main#833": "f540b1e6955209e2", + "블록 EST:main#834": "231c8646a6e9ed40", + "블록 EST:main#835": "2d9d4afc61a4db03", + "블록 EST:main#836": "05174451a2c3162e", + "블록 EST:main#837": "0980660b4a748c69", + "블록 EST:main#838": "3f6506be53110f99", + "블록 EST:main#839": "5692e6fe0587d747", + "블록 EST:main#84": "729fae5d31bac6f7", + "블록 EST:main#840": "b03cc2966933080a", + "블록 EST:main#841": "be075d0f9a470b31", + "블록 EST:main#842": "0c300f4e23271a91", + "블록 EST:main#843": "47d16535e0ed4f1a", + "블록 EST:main#844": "72595de4cc778255", + "블록 EST:main#845": "551f364a03c071f6", + "블록 EST:main#846": "3c0757666768f203", + "블록 EST:main#847": "7f0e7110feff0e3f", + "블록 EST:main#848": "b580181f75cc9b2f", + "블록 EST:main#849": "373d5466152d9d75", + "블록 EST:main#85": "136cb4291df545a3", + "블록 EST:main#850": "d41dddfaa238aa0b", + "블록 EST:main#851": "2240e2cb8137d6e8", + "블록 EST:main#852": "06d124a5815f8268", + "블록 EST:main#853": "bd99de01989108bc", + "블록 EST:main#854": "f300efe2497ad72a", + "블록 EST:main#855": "98559c5555df4a63", + "블록 EST:main#856": "734cb1a1cb3067be", + "블록 EST:main#857": "3e3d9c3717a3cb32", + "블록 EST:main#858": "9c3f6084b0e54d7e", + "블록 EST:main#859": "379b5bd7be5558cd", + "블록 EST:main#86": "b95d5a49f4f417b3", + "블록 EST:main#860": "e9b7d8c5d9809308", + "블록 EST:main#861": "e8b81cd943f02db4", + "블록 EST:main#862": "9fd8cb54613b689d", + "블록 EST:main#863": "9b1c57f8ae5fe13f", + "블록 EST:main#864": "75ac5e1ffc622c93", + "블록 EST:main#865": "355daa02568a32a3", + "블록 EST:main#866": "46c70909c13696f8", + "블록 EST:main#867": "c8dd82e9c26b3de7", + "블록 EST:main#868": "a7dc36f3fdb9f04b", + "블록 EST:main#869": "78627edfa08ba4d9", + "블록 EST:main#87": "89735b375f6f1b5c", + "블록 EST:main#870": "fe318096a0060407", + "블록 EST:main#871": "dc7cc84918a9853c", + "블록 EST:main#872": "92b261f1d16052bc", + "블록 EST:main#873": "3e1ff0374afee14d", + "블록 EST:main#874": "db9118107b82f66d", + "블록 EST:main#875": "2a7e4afda036845a", + "블록 EST:main#876": "8842e349431e7e2a", + "블록 EST:main#877": "7594568167f73a25", + "블록 EST:main#878": "cdf42de591871625", + "블록 EST:main#879": "6b3968a7b30ab136", + "블록 EST:main#88": "dd698d88afc63338", + "블록 EST:main#880": "3d3a205bfa083eb5", + "블록 EST:main#881": "8d595a392df0a0d7", + "블록 EST:main#882": "3d3a205bfa083eb5", + "블록 EST:main#883": "8d595a392df0a0d7", + "블록 EST:main#884": "010b1ab3f24502c2", + "블록 EST:main#885": "aea639e5b466ab9f", + "블록 EST:main#886": "00785b981e150db1", + "블록 EST:main#887": "7e416e904c5c4021", + "블록 EST:main#888": "939126a21f5a183a", + "블록 EST:main#889": "3c2b858d589e0f2e", + "블록 EST:main#89": "d11b2021018502f8", + "블록 EST:main#890": "63ee50dbd4bb92d1", + "블록 EST:main#891": "d5cd0e22c1d6e74d", + "블록 EST:main#892": "00785b981e150db1", + "블록 EST:main#893": "3777c304de15f8ee", + "블록 EST:main#894": "4c2bb9f257a7b22d", + "블록 EST:main#895": "00785b981e150db1", + "블록 EST:main#896": "dee9b7f0add90717", + "블록 EST:main#897": "786c6025fe981682", + "블록 EST:main#898": "00785b981e150db1", + "블록 EST:main#899": "0a09744341099fe2", + "블록 EST:main#9": "86b7e84333b9c6d0", + "블록 EST:main#90": "855c46155d9a1168", + "블록 EST:main#900": "4bfca18e24ed0106", + "블록 EST:main#901": "cc5cee6f440db0a8", + "블록 EST:main#902": "b8362f4c46220bc0", + "블록 EST:main#903": "fa876ecc2d6496f3", + "블록 EST:main#904": "95797d265f422fc3", + "블록 EST:main#905": "02bdcb1dffbc4432", + "블록 EST:main#906": "b468a87a33f517b9", + "블록 EST:main#907": "0d05139011c23427", + "블록 EST:main#908": "7c3dabebac2b6d9b", + "블록 EST:main#909": "cb09601a6ea93870", + "블록 EST:main#91": "a727e954ff10baa2", + "블록 EST:main#910": "124d7c0e715f2855", + "블록 EST:main#911": "776495bfb7571f36", + "블록 EST:main#912": "b287f102341fe5f1", + "블록 EST:main#913": "103346946983839b", + "블록 EST:main#914": "61b2d819f160e87c", + "블록 EST:main#915": "ab262d6f00babe2b", + "블록 EST:main#916": "316092d71185f37b", + "블록 EST:main#917": "fa5bdaea215dd3f2", + "블록 EST:main#918": "a91f36d0e5c474f8", + "블록 EST:main#919": "68179fb449d649db", + "블록 EST:main#92": "d5d3ed1c43039e61", + "블록 EST:main#920": "97d40405553b2662", + "블록 EST:main#921": "313ae1c368c2ecb5", + "블록 EST:main#922": "1c132fb8598fd5b9", + "블록 EST:main#923": "60fecbbf45f19713", + "블록 EST:main#924": "48206184056b84df", + "블록 EST:main#925": "1a73115312624870", + "블록 EST:main#926": "cbc9693eb946b01b", + "블록 EST:main#927": "07456f3b9b48ecac", + "블록 EST:main#928": "93e4bb658f83d10e", + "블록 EST:main#929": "f014fb94b08383f1", + "블록 EST:main#93": "994a38fbf09163d7", + "블록 EST:main#930": "4deb20157596a041", + "블록 EST:main#931": "e72231822bd4e6ba", + "블록 EST:main#932": "88f764c65838fccc", + "블록 EST:main#933": "14411b1aa2d9e0f8", + "블록 EST:main#934": "fe37cecc8b3736d2", + "블록 EST:main#935": "6519258afacceef2", + "블록 EST:main#936": "2f62eaab24b5622c", + "블록 EST:main#937": "14a9030ac8f79383", + "블록 EST:main#938": "9339c6c8ac8bd79d", + "블록 EST:main#939": "882c78831a7fb207", + "블록 EST:main#94": "13f7a8a78cf9aa8d", + "블록 EST:main#940": "80e3632994a3c69c", + "블록 EST:main#941": "90d1ab5f515c39a4", + "블록 EST:main#942": "002dd0cc211ba3be", + "블록 EST:main#943": "002c17a13e4f05c4", + "블록 EST:main#944": "eea38e6d5d7bb1da", + "블록 EST:main#945": "c3155e838f52b945", + "블록 EST:main#946": "d3d136d3d1964f5d", + "블록 EST:main#947": "86ad76d9a6ba0695", + "블록 EST:main#948": "4be5133650591b03", + "블록 EST:main#949": "c82626e9a6d355e2", + "블록 EST:main#95": "4e28d1307c413038", + "블록 EST:main#950": "b4baefc3806e013e", + "블록 EST:main#951": "69d47f78b88b1673", + "블록 EST:main#952": "6980d60a06bf4e22", + "블록 EST:main#953": "1e2ffbdfbd58a0ec", + "블록 EST:main#954": "7d8d5870d98f4a6b", + "블록 EST:main#955": "a16c3e809d89a974", + "블록 EST:main#956": "6086800bcdf7ef97", + "블록 EST:main#957": "728cb50c49901b1b", + "블록 EST:main#958": "f7483b0b7b0d70f2", + "블록 EST:main#959": "6deea482aa9d159b", + "블록 EST:main#96": "dbcba3d6e06778e8", + "블록 EST:main#960": "b039f76cbd2eaa42", + "블록 EST:main#961": "2692ff1e2d9e6eae", + "블록 EST:main#962": "d15f2db95d30af41", + "블록 EST:main#963": "74fec45e6dbcb65e", + "블록 EST:main#964": "fc580b0b11ff9341", + "블록 EST:main#965": "cca23ba01660f925", + "블록 EST:main#966": "e0129b0c8d2f2126", + "블록 EST:main#967": "933b0e4cb346185d", + "블록 EST:main#968": "f16d9b4f6f142291", + "블록 EST:main#969": "e3ef40b27adb3ab3", + "블록 EST:main#97": "564e7235f04c8535", + "블록 EST:main#970": "65139b6f4e6066b1", + "블록 EST:main#971": "99d1bcd59a09e088", + "블록 EST:main#972": "de0872bae465f611", + "블록 EST:main#973": "99408db8f8dc41e4", + "블록 EST:main#974": "7d4befc14773b0cd", + "블록 EST:main#975": "367c7874c6b8d38d", + "블록 EST:main#976": "56747123966f67fe", + "블록 EST:main#977": "2b8f9cd9d0d3dac8", + "블록 EST:main#978": "cb523cac94fc3bc2", + "블록 EST:main#979": "6e86a0c6f6de3b7f", + "블록 EST:main#98": "9da04493f6d18dd8", + "블록 EST:main#980": "3a9f7ac3da6343ae", + "블록 EST:main#981": "8fddc2242a4e1c8d", + "블록 EST:main#982": "0c5a238729b4a007", + "블록 EST:main#983": "33409b5023b804ec", + "블록 EST:main#984": "46b84db4af653685", + "블록 EST:main#985": "b2a4ccef10901628", + "블록 EST:main#986": "2033141422371230", + "블록 EST:main#987": "ecc01e7c4fcfbaa8", + "블록 EST:main#988": "68a17f1d24687ee4", + "블록 EST:main#989": "d01b94b059e70666", + "블록 EST:main#99": "564e7235f04c8535", + "블록 EST:main#990": "63871bf341e7b461", + "블록 EST:main#991": "4dc50dbccf6d2853", + "블록 EST:main#992": "81fff32979bedd62", + "블록 EST:main#993": "5d036c74bfb07881", + "블록 EST:main#994": "0669ad46677a65a9", + "블록 EST:main#995": "78954a02e35b084a", + "블록 EST:main#996": "d97cc3310a1bd2bc", + "블록 EST:main#997": "48c0231171b06a9c", + "블록 EST:main#998": "b1a5a2ffae462e59", + "블록 EST:main#999": "ddecc061fbff72be", + "블록 EST:거창#1": "3eda4903bf6d3e4b", + "블록 EST:거창#10": "b8fd3cb7c2ca69b3", + "블록 EST:거창#11": "570a3c875f083063", + "블록 EST:거창#12": "923ddea179943454", + "블록 EST:거창#13": "6b0170026d9ce1af", + "블록 EST:거창#14": "c9c86412896be67f", + "블록 EST:거창#15": "7d4a24880b730654", + "블록 EST:거창#16": "7b3492e5b2ca16db", + "블록 EST:거창#17": "fcdaf7717e71b535", + "블록 EST:거창#18": "fee26b58850f3223", + "블록 EST:거창#19": "f851a8359936a3af", + "블록 EST:거창#2": "f7cfcb85328daf52", + "블록 EST:거창#20": "2405fdfceaf61b4c", + "블록 EST:거창#21": "05a31f99ba45f77b", + "블록 EST:거창#22": "684935a35519eb47", + "블록 EST:거창#23": "e55af78b4477abe9", + "블록 EST:거창#24": "cb8926b27ae4eb3d", + "블록 EST:거창#25": "836321393dfba459", + "블록 EST:거창#26": "91debfe05a48d4f7", + "블록 EST:거창#27": "5969a5418e545afa", + "블록 EST:거창#28": "3d71f2651e2db2f6", + "블록 EST:거창#29": "651772ace62a7be7", + "블록 EST:거창#3": "a2ca7eb293cf466f", + "블록 EST:거창#30": "ce72ee25edf21163", + "블록 EST:거창#31": "86db9ea8247842d1", + "블록 EST:거창#32": "5e60c236932bbf8c", + "블록 EST:거창#33": "f7df285a1f4d6d49", + "블록 EST:거창#34": "7738bc9a45970993", + "블록 EST:거창#35": "1aa60d1c665a6773", + "블록 EST:거창#36": "b7523769346fa225", + "블록 EST:거창#37": "0c814b3589591c8f", + "블록 EST:거창#38": "edea9aa9bcff0ad9", + "블록 EST:거창#39": "fc0d8904c332a0f5", + "블록 EST:거창#4": "b5d530e0d426dd7d", + "블록 EST:거창#40": "43f0e46e2cd50197", + "블록 EST:거창#41": "e4b51800631785af", + "블록 EST:거창#42": "1df3859c838fe918", + "블록 EST:거창#43": "0251a0d82053e891", + "블록 EST:거창#44": "b5566779bbdb30d5", + "블록 EST:거창#45": "1fb207dbabcf87db", + "블록 EST:거창#46": "c081e49789bc0bf6", + "블록 EST:거창#47": "27cd823262a59f6f", + "블록 EST:거창#48": "a4e4087d6a9ca6ea", + "블록 EST:거창#49": "2c5bd574a86dac6f", + "블록 EST:거창#5": "5dc364979971e626", + "블록 EST:거창#50": "eee05c86a1b6ea6d", + "블록 EST:거창#51": "d6cad1535c252581", + "블록 EST:거창#52": "a1254670b687d777", + "블록 EST:거창#53": "a1f3a200c0d7c9e8", + "블록 EST:거창#54": "398de09ca5105568", + "블록 EST:거창#55": "35625f0321a0c69f", + "블록 EST:거창#56": "cb59d76986646868", + "블록 EST:거창#57": "cc816bf7e674a262", + "블록 EST:거창#58": "0c495eacbbc2b5ca", + "블록 EST:거창#59": "a17400c96526db3c", + "블록 EST:거창#6": "e5759df55e8b92cf", + "블록 EST:거창#60": "f6f9ffcd229f6522", + "블록 EST:거창#61": "21c3ad5ccd2ff0a2", + "블록 EST:거창#7": "a30c86227d717bc9", + "블록 EST:거창#8": "8570ba622e8b862a", + "블록 EST:거창#9": "30bc6ad11ab669cf", + "블록 EST:임도용역#1": "f751ee4f91af5ff4", + "블록 EST:임도용역#10": "31bfa81ad07ebe6b", + "블록 EST:임도용역#11": "2bd7e3f76304d2b7", + "블록 EST:임도용역#12": "e0e79e333eb21acf", + "블록 EST:임도용역#13": "5aec4f00c62f4baa", + "블록 EST:임도용역#14": "ec51fc6032910f72", + "블록 EST:임도용역#15": "861707bb684993c2", + "블록 EST:임도용역#16": "5a587b6d38326461", + "블록 EST:임도용역#17": "6d5dca8851fb4392", + "블록 EST:임도용역#18": "0f0428802ec5dcdf", + "블록 EST:임도용역#19": "02b15d6c3cb2088b", + "블록 EST:임도용역#2": "5b1d733a290d6978", + "블록 EST:임도용역#20": "71608915a962581f", + "블록 EST:임도용역#21": "be3817bb5238b9c4", + "블록 EST:임도용역#22": "c7e1c9ea6bc1bc3c", + "블록 EST:임도용역#23": "c22604d54e5a6edb", + "블록 EST:임도용역#24": "2c433f211cdefad0", + "블록 EST:임도용역#25": "3ec1949a2f6fdb0d", + "블록 EST:임도용역#26": "53e6d9c4530d9186", + "블록 EST:임도용역#27": "2120da35805f1664", + "블록 EST:임도용역#28": "1284f1556920e6ca", + "블록 EST:임도용역#29": "1b3daf20eb8034fb", + "블록 EST:임도용역#3": "33cdde9108c74e17", + "블록 EST:임도용역#30": "7f693110aa9d11f9", + "블록 EST:임도용역#31": "6f1b1807df2305b8", + "블록 EST:임도용역#32": "82fa4992aba84ad5", + "블록 EST:임도용역#33": "869aab55a9438002", + "블록 EST:임도용역#34": "fd7e966e1a94e497", + "블록 EST:임도용역#35": "0a8f98d31463fceb", + "블록 EST:임도용역#36": "d59d71bb455e5b3e", + "블록 EST:임도용역#37": "535c7677376da927", + "블록 EST:임도용역#38": "5174ac3e09d2fec0", + "블록 EST:임도용역#39": "107ec786c54b9678", + "블록 EST:임도용역#4": "8d68904ace32ed5c", + "블록 EST:임도용역#40": "ce78629b43ed1507", + "블록 EST:임도용역#41": "1b399aac74974e03", + "블록 EST:임도용역#42": "b2051f7b3f58e87d", + "블록 EST:임도용역#43": "e3bec2cc394e22f0", + "블록 EST:임도용역#44": "7727a8fd0b58eda2", + "블록 EST:임도용역#45": "34da28a05b731ca9", + "블록 EST:임도용역#46": "53f9294d961d54c0", + "블록 EST:임도용역#47": "ee1b60dab59400ce", + "블록 EST:임도용역#48": "840e1fa8fbc40724", + "블록 EST:임도용역#49": "adeeef0c43be8af8", + "블록 EST:임도용역#5": "9595bb08b71cff09", + "블록 EST:임도용역#50": "d47f149755f5272c", + "블록 EST:임도용역#51": "05bad31a079d2fc0", + "블록 EST:임도용역#52": "b40938ad380a9dd9", + "블록 EST:임도용역#53": "9bd3d3eb95973867", + "블록 EST:임도용역#54": "e9cfce9652109001", + "블록 EST:임도용역#55": "abec5ea374f2988d", + "블록 EST:임도용역#56": "611c6127f4ea8503", + "블록 EST:임도용역#57": "ef80fa7e454aced6", + "블록 EST:임도용역#58": "e5f4bc721adede56", + "블록 EST:임도용역#59": "d2f9a06ed9d7a22b", + "블록 EST:임도용역#6": "e6130b923e2f115e", + "블록 EST:임도용역#60": "7f93bef5e454f8b8", + "블록 EST:임도용역#61": "8293f5dbbac85f71", + "블록 EST:임도용역#62": "00218c916e1c3ee1", + "블록 EST:임도용역#63": "959f97391294f17c", + "블록 EST:임도용역#64": "1588639889dfa176", + "블록 EST:임도용역#65": "dad908643744087b", + "블록 EST:임도용역#66": "81e11559b41b2154", + "블록 EST:임도용역#67": "4bd1356e20e0d02d", + "블록 EST:임도용역#68": "d161561c807c88e1", + "블록 EST:임도용역#69": "ff87f499c5daa920", + "블록 EST:임도용역#7": "b7f71f2e8bd6e288", + "블록 EST:임도용역#70": "84ebec6ffa09df04", + "블록 EST:임도용역#71": "3e08e97322e8754b", + "블록 EST:임도용역#72": "13bfb403bb9bbd1d", + "블록 EST:임도용역#73": "6b7e1d368a2dec0a", + "블록 EST:임도용역#8": "84873c7f4f0f48bd", + "블록 EST:임도용역#9": "66f4f355858bb538", + "블록 EST:장수#1": "862fedc715df1518", + "블록 EST:장수#10": "58c9c520b46841a9", + "블록 EST:장수#11": "e4f3d959db549895", + "블록 EST:장수#12": "50901e3bd75d86bd", + "블록 EST:장수#13": "1335685507e39def", + "블록 EST:장수#14": "4808800ebfe4829c", + "블록 EST:장수#15": "c3975bbf90028f73", + "블록 EST:장수#16": "6945878da91d7673", + "블록 EST:장수#17": "a64a761fce7ed3ca", + "블록 EST:장수#18": "366fd88de64ed12b", + "블록 EST:장수#19": "bacc3bb0a2b37e5f", + "블록 EST:장수#2": "7936802a0d6c9197", + "블록 EST:장수#20": "6df86408d68009fb", + "블록 EST:장수#21": "6a66dae179dcd494", + "블록 EST:장수#22": "7c8837ace362d808", + "블록 EST:장수#23": "9043fbd212a7a91d", + "블록 EST:장수#24": "f0f1395cf992cc5a", + "블록 EST:장수#25": "5df24088613f2c97", + "블록 EST:장수#26": "54e46fd3e82dcc9a", + "블록 EST:장수#27": "7df2cfe788083c01", + "블록 EST:장수#28": "741276bf9d5a1ee2", + "블록 EST:장수#29": "ce72ee25edf21163", + "블록 EST:장수#3": "3c949e7dfa3844b0", + "블록 EST:장수#30": "86db9ea8247842d1", + "블록 EST:장수#31": "e3eb2514f1d2d3d9", + "블록 EST:장수#32": "f7df285a1f4d6d49", + "블록 EST:장수#33": "ec95cb2ea7c63658", + "블록 EST:장수#34": "1366a5bf1ad8cd7f", + "블록 EST:장수#35": "d42c09c7f75e0239", + "블록 EST:장수#36": "0c814b3589591c8f", + "블록 EST:장수#37": "40418fc16106e02c", + "블록 EST:장수#38": "e4b51800631785af", + "블록 EST:장수#39": "bfe92ff86753b848", + "블록 EST:장수#4": "1ae235f39ab69c95", + "블록 EST:장수#40": "0251a0d82053e891", + "블록 EST:장수#41": "411250f918c5e08b", + "블록 EST:장수#42": "1fb207dbabcf87db", + "블록 EST:장수#43": "a002604d0ffb3097", + "블록 EST:장수#44": "bf17812c20f15b6a", + "블록 EST:장수#45": "4e94fb0d00a77579", + "블록 EST:장수#46": "2c5bd574a86dac6f", + "블록 EST:장수#47": "eee05c86a1b6ea6d", + "블록 EST:장수#48": "257c217657545a0b", + "블록 EST:장수#49": "e36dbac796755b9f", + "블록 EST:장수#5": "daab296de62f788c", + "블록 EST:장수#50": "2256f53dffa57ed8", + "블록 EST:장수#51": "f4813f71086c89ce", + "블록 EST:장수#52": "1b57a7eb8ddfcb97", + "블록 EST:장수#53": "42886c858860a365", + "블록 EST:장수#54": "bcb014f5f0056a31", + "블록 EST:장수#55": "fcf9cf551454430c", + "블록 EST:장수#56": "419a1be3ae371bab", + "블록 EST:장수#57": "5009bcfe55ddc708", + "블록 EST:장수#58": "00e4e5db0af7a869", + "블록 EST:장수#59": "d42da0213a065539", + "블록 EST:장수#6": "0821600436fedf9a", + "블록 EST:장수#60": "77811bc1b265ce5b", + "블록 EST:장수#61": "89649835419827a0", + "블록 EST:장수#62": "5c2afb9d5c7654bc", + "블록 EST:장수#63": "848dd9491f56e7d8", + "블록 EST:장수#64": "7de9f89ec3096f4d", + "블록 EST:장수#65": "6b8b33dff943ec26", + "블록 EST:장수#7": "057fa9c2cc493dba", + "블록 EST:장수#8": "aa7cdfee16511204", + "블록 EST:장수#9": "351134c1fb49665b", + "블록 EST:진안#1": "862fedc715df1518", + "블록 EST:진안#10": "58c9c520b46841a9", + "블록 EST:진안#11": "e4f3d959db549895", + "블록 EST:진안#12": "50901e3bd75d86bd", + "블록 EST:진안#13": "1335685507e39def", + "블록 EST:진안#14": "4808800ebfe4829c", + "블록 EST:진안#15": "26109c47237533b9", + "블록 EST:진안#16": "a64a761fce7ed3ca", + "블록 EST:진안#17": "366fd88de64ed12b", + "블록 EST:진안#18": "bacc3bb0a2b37e5f", + "블록 EST:진안#19": "6df86408d68009fb", + "블록 EST:진안#2": "7936802a0d6c9197", + "블록 EST:진안#20": "6a66dae179dcd494", + "블록 EST:진안#21": "7c8837ace362d808", + "블록 EST:진안#22": "9043fbd212a7a91d", + "블록 EST:진안#23": "f0f1395cf992cc5a", + "블록 EST:진안#24": "5df24088613f2c97", + "블록 EST:진안#25": "9370cd93584b28b0", + "블록 EST:진안#26": "cb56d670c2ec7cb5", + "블록 EST:진안#27": "7df2cfe788083c01", + "블록 EST:진안#28": "741276bf9d5a1ee2", + "블록 EST:진안#29": "ce72ee25edf21163", + "블록 EST:진안#3": "3c949e7dfa3844b0", + "블록 EST:진안#30": "86db9ea8247842d1", + "블록 EST:진안#31": "752d92f15c0db1f8", + "블록 EST:진안#32": "f7df285a1f4d6d49", + "블록 EST:진안#33": "ec95cb2ea7c63658", + "블록 EST:진안#34": "1366a5bf1ad8cd7f", + "블록 EST:진안#35": "d42c09c7f75e0239", + "블록 EST:진안#36": "0c814b3589591c8f", + "블록 EST:진안#37": "edea9aa9bcff0ad9", + "블록 EST:진안#38": "fc0d8904c332a0f5", + "블록 EST:진안#39": "40418fc16106e02c", + "블록 EST:진안#4": "1ae235f39ab69c95", + "블록 EST:진안#40": "e4b51800631785af", + "블록 EST:진안#41": "1df3859c838fe918", + "블록 EST:진안#42": "0251a0d82053e891", + "블록 EST:진안#43": "411250f918c5e08b", + "블록 EST:진안#44": "1fb207dbabcf87db", + "블록 EST:진안#45": "a002604d0ffb3097", + "블록 EST:진안#46": "bf17812c20f15b6a", + "블록 EST:진안#47": "4e94fb0d00a77579", + "블록 EST:진안#48": "2c5bd574a86dac6f", + "블록 EST:진안#49": "eee05c86a1b6ea6d", + "블록 EST:진안#5": "daab296de62f788c", + "블록 EST:진안#50": "257c217657545a0b", + "블록 EST:진안#51": "e36dbac796755b9f", + "블록 EST:진안#52": "2256f53dffa57ed8", + "블록 EST:진안#53": "f4813f71086c89ce", + "블록 EST:진안#54": "54f5875a0f82601c", + "블록 EST:진안#55": "42886c858860a365", + "블록 EST:진안#56": "bcb014f5f0056a31", + "블록 EST:진안#57": "fcf9cf551454430c", + "블록 EST:진안#58": "419a1be3ae371bab", + "블록 EST:진안#59": "5009bcfe55ddc708", + "블록 EST:진안#6": "bb51efec22877663", + "블록 EST:진안#60": "6b8b33dff943ec26", + "블록 EST:진안#61": "00e4e5db0af7a869", + "블록 EST:진안#62": "d42da0213a065539", + "블록 EST:진안#63": "89649835419827a0", + "블록 EST:진안#64": "9046e4676405c387", + "블록 EST:진안#65": "c1e0387ad94b5652", + "블록 EST:진안#66": "7de9f89ec3096f4d", + "블록 EST:진안#67": "3067a6108442d113", + "블록 EST:진안#68": "4bcd124d9d9682e5", + "블록 EST:진안#69": "77957dce3770db20", + "블록 EST:진안#7": "057fa9c2cc493dba", + "블록 EST:진안#70": "379ec90fcbb47539", + "블록 EST:진안#71": "b88d8600a71258fb", + "블록 EST:진안#72": "b0ffc1fb975497c0", + "블록 EST:진안#73": "e040b41a4ead78b2", + "블록 EST:진안#74": "6945878da91d7673", + "블록 EST:진안#8": "aa7cdfee16511204", + "블록 EST:진안#9": "351134c1fb49665b", + "블록 EST:통영#1": "b919fb3805743a2c", + "블록 EST:통영#2": "f72d945ce47d9b7f", + "블록 EST:통영#3": "a091a116ae4187d5", + "블록 EST:통영#4": "7afeba704dbd6aef", + "블록 EST:통영#5": "f72d945ce47d9b7f", + "블록 EST:통영#6": "871b274ece63dd65", + "블록 EST:통영#7": "41eaca9846d267f9", + "블록 STC:동부청영월#10": "9da1441c0cc3d7a5", + "블록 STC:동부청영월#111": "b70695880a18f37b", + "블록 STC:동부청영월#13": "9da1441c0cc3d7a5", + "블록 STC:동부청영월#1361": "3ad695d39e013438", + "블록 STC:동부청영월#1466": "fce1934a5a42270b", + "블록 STC:동부청영월#1519": "5ce18f1010d621e0", + "블록 STC:동부청영월#1611": "60791d8aaa9ac96d", + "블록 STC:동부청영월#17": "2d02dc3519303061", + "블록 STC:동부청영월#1748": "b57cd2c5a17fccc9", + "블록 STC:동부청영월#1752": "f1bc120cce75b847", + "블록 STC:동부청영월#1755": "0164dfce197fee34", + "블록 STC:동부청영월#1759": "dfea518273d83501", + "블록 STC:동부청영월#18": "47d41404d502ce31", + "블록 STC:동부청영월#1810": "85d228f81fc53317", + "블록 STC:동부청영월#1841": "c9c769c01059a110", + "블록 STC:동부청영월#1843": "51f8103b40a9d641", + "블록 STC:동부청영월#1844": "5b9418cc612f3e6b", + "블록 STC:동부청영월#1854": "fe3853a30c20aa5c", + "블록 STC:동부청영월#1855": "21c69a1cee1c0366", + "블록 STC:동부청영월#19": "252763cd7fc1c3f2", + "블록 STC:동부청영월#1926": "cc2caf8e4da67129", + "블록 STC:동부청영월#1927": "9809f9615114ddb5", + "블록 STC:동부청영월#1928": "76c1526be0ccde71", + "블록 STC:동부청영월#1932": "6c4b769c6b3a9f97", + "블록 STC:동부청영월#1942": "b85cefd6da3538df", + "블록 STC:동부청영월#1999": "4ececca80e5f3960", + "블록 STC:동부청영월#2": "b85cefd6da3538df", + "블록 STC:동부청영월#20": "f9999d933e3ab97b", + "블록 STC:동부청영월#2001": "7293f384675d90b5", + "블록 STC:동부청영월#2002": "dbe2401a28a1dd31", + "블록 STC:동부청영월#2003": "216c227f847812e7", + "블록 STC:동부청영월#2004": "b38b42b44b8b0699", + "블록 STC:동부청영월#2005": "aa8cf5eea8e40895", + "블록 STC:동부청영월#2008": "340819463a01e388", + "블록 STC:동부청영월#2030": "d395e5aa54a20014", + "블록 STC:동부청영월#2031": "b7932b2860a92f1c", + "블록 STC:동부청영월#2032": "862bc5b1f1661946", + "블록 STC:동부청영월#2033": "5db01550490642f0", + "블록 STC:동부청영월#2034": "c8d26f4e4979cabf", + "블록 STC:동부청영월#2036": "dfb1b3417330445d", + "블록 STC:동부청영월#2058": "0bce1777294a162b", + "블록 STC:동부청영월#2071": "845b72cd5b30b08b", + "블록 STC:동부청영월#2074": "8dd522d0f0bf5bdd", + "블록 STC:동부청영월#21": "fc71629593103518", + "블록 STC:동부청영월#23": "874d6d0780c8df34", + "블록 STC:동부청영월#25": "adf78f4400109687", + "블록 STC:동부청영월#258": "135f21f1c36bc161", + "블록 STC:동부청영월#26": "f6d98fd91908d0e7", + "블록 STC:동부청영월#27": "26babdbaa8e067f2", + "블록 STC:동부청영월#29": "58c3d48e9b3f1841", + "블록 STC:동부청영월#3": "efc1d0fbd05f2768", + "블록 STC:동부청영월#31": "bc2d4cd4e21c6746", + "블록 STC:동부청영월#33": "420541de4786bfc8", + "블록 STC:동부청영월#35": "029aaf5712b7d60b", + "블록 STC:동부청영월#37": "5daa516be0b12898", + "블록 STC:동부청영월#411": "184dc4f049dc8021", + "블록 STC:동부청영월#450": "4224cbb622cbca03", + "블록 STC:동부청영월#56": "5f87543039b29913", + "블록 STC:동부청영월#58": "81257f1cf5cc1921", + "블록 STC:동부청영월#59": "67350559b5a39f17", + "블록 STC:동부청영월#60": "1cb27cd193a25c4f", + "블록 STC:동부청영월#600": "5ce18f1010d621e0", + "블록 STC:동부청영월#644": "7d54ed17c9b7d4cf", + "블록 STC:동부청영월#7": "2a70328a83e6700e", + "블록 STC:동부청영월#71": "df8013ef4d14a1f0", + "블록 STC:동부청영월#72": "0e479bdc777bb31d", + "블록 STC:동부청영월#8": "b6cebab496a9cb64", + "블록 STC:동부청영월#81": "d51a4b38d312972a", + "블록 STC:동부청영월#9": "d563f42c15d0ab74", + "블록 STC:봉화#1": "6a3a4cf5413ad60c", + "블록 STC:봉화#10": "6a3e504d29821efe", + "블록 STC:봉화#102": "ed5ad3d31bd356b9", + "블록 STC:봉화#103": "8d0b37a9ffa59bd7", + "블록 STC:봉화#105": "5d75fc8605e75fb2", + "블록 STC:봉화#107": "2db0d8f63cbcf24a", + "블록 STC:봉화#108": "f3ced38b539bce62", + "블록 STC:봉화#109": "79c23cc9464fff35", + "블록 STC:봉화#110": "d4f03dae61a05eac", + "블록 STC:봉화#111": "6a3a4cf5413ad60c", + "블록 STC:봉화#112": "1a0adb0616c89a1b", + "블록 STC:봉화#113": "b26a17356b1b7e01", + "블록 STC:봉화#115": "b7a0079a51e026bb", + "블록 STC:봉화#116": "7c65d8e81f16000d", + "블록 STC:봉화#117": "31dad24a201b9dfa", + "블록 STC:봉화#118": "790e7a29b8256514", + "블록 STC:봉화#119": "fa322523dbdbfbb6", + "블록 STC:봉화#12": "529c0fad8fc39243", + "블록 STC:봉화#120": "53adcb53f0fd79d6", + "블록 STC:봉화#121": "d336b5e37f240dbe", + "블록 STC:봉화#13": "448eabd64c7b30d5", + "블록 STC:봉화#14": "93ec5c0aa7430448", + "블록 STC:봉화#15": "a5f85991dac23ab9", + "블록 STC:봉화#16": "90fd01b26e06ceb6", + "블록 STC:봉화#17": "7e6046aa55598d9f", + "블록 STC:봉화#18": "ba28bc24ba3cb5e0", + "블록 STC:봉화#19": "d8a22e6d882f1838", + "블록 STC:봉화#2": "26fda3cd956f5643", + "블록 STC:봉화#20": "693a88aa6c2d9c97", + "블록 STC:봉화#21": "71a463290869e2c7", + "블록 STC:봉화#22": "40c0de0c8965033c", + "블록 STC:봉화#23": "5bd6a3cb6b42c921", + "블록 STC:봉화#24": "a4788c0555b74535", + "블록 STC:봉화#25": "19ebf2aea160edc4", + "블록 STC:봉화#26": "448afc644c612d70", + "블록 STC:봉화#27": "a576f8fe6912ab44", + "블록 STC:봉화#29": "cdcf1e0a9a7c592f", + "블록 STC:봉화#3": "82e8b50fd8c5198a", + "블록 STC:봉화#37": "83fb026dccaf5c6c", + "블록 STC:봉화#38": "6ea7eac8fdca3ca4", + "블록 STC:봉화#39": "2d62a96520fcebca", + "블록 STC:봉화#4": "d8c3e68d1d006410", + "블록 STC:봉화#43": "fb31b13b0ba8cb8a", + "블록 STC:봉화#44": "6a3a4cf5413ad60c", + "블록 STC:봉화#49": "f6b96008e5bd0d89", + "블록 STC:봉화#5": "de043379f21970d2", + "블록 STC:봉화#51": "933e1350c7f48693", + "블록 STC:봉화#52": "833a138058980bc2", + "블록 STC:봉화#54": "8ab57925b999ab13", + "블록 STC:봉화#55": "20b39443409ca8ce", + "블록 STC:봉화#6": "de043379f21970d2", + "블록 STC:봉화#7": "725c92ac485242ac", + "블록 STC:봉화#77": "9c6aae9a8f1d4608", + "블록 STC:봉화#8": "6b8d5d0a0efcd64d", + "블록 STC:봉화#81": "73cd52ec88407cfd", + "블록 STC:봉화#89": "7848bdf06714786e", + "블록 STC:봉화#90": "a90b61899d1bafd1", + "블록 STC:봉화#91": "d84dc6fa2c5e431c", + "블록 STC:봉화#93": "a4e376d71b72facb", + "블록 STC:봉화#94": "7165f7083d103fc1", + "블록 STC:봉화#95": "8d0b37a9ffa59bd7", + "블록 STC:봉화#96": "4438e72e8830a9e0", + "블록 STC:봉화#97": "39b90f7d8b0c459a", + "블록 STC:봉화#98": "e2b606091c5a19e4", + "블록 STC:봉화#99": "6ee83a29315c5613", + "블록 STC:소광22#1010": "07e021a850ddcbe4", + "블록 STC:소광22#1030": "e51a9c3d00c8dd9a", + "블록 STC:소광22#1075": "4a23945503a6cf59", + "블록 STC:소광22#1129": "55f3a69760327245", + "블록 STC:소광22#1132": "9c735131426f8657", + "블록 STC:소광22#1140": "23b36533f85f7c14", + "블록 STC:소광22#1154": "2fde65716ec593a0", + "블록 STC:소광22#1155": "89fb644c81c0d753", + "블록 STC:소광22#1248": "ed39d22c6047f6bb", + "블록 STC:소광22#1249": "e73f5f68c2e07c24", + "블록 STC:소광22#1254": "d9de4ccf675fec48", + "블록 STC:소광22#1256": "d04ff336d4f9903a", + "블록 STC:소광22#1259": "0a30f333d1eeeba9", + "블록 STC:소광22#1329": "50acfe9f8a70a2d0", + "블록 STC:소광22#1336": "54d62606d31b09e7", + "블록 STC:소광22#1351": "6e4bbe91a587b6c2", + "블록 STC:소광22#1352": "2bad632ea73040fe", + "블록 STC:소광22#1354": "f3699f4eb6a4a9aa", + "블록 STC:소광22#1398": "bb6c55b5230297b1", + "블록 STC:소광22#1417": "6b36c5a38d342033", + "블록 STC:소광22#1448": "dd92e0de5c6c26c3", + "블록 STC:소광22#1456": "2d93013a513aa360", + "블록 STC:소광22#1474": "bd3948ba7d36fc94", + "블록 STC:소광22#1475": "0503119b96dcd9b7", + "블록 STC:소광22#208": "a9043dd47c68c627", + "블록 STC:소광22#3": "4c6f9d7ce52f5ce5", + "블록 STC:소광22#408": "7ba8ed4a06e57ebe", + "블록 STC:소광22#492": "d3637b2731538ee5", + "블록 STC:소광22#649": "e18965deb615fb68", + "블록 STC:소광22#720": "5b0bf07fad84c349", + "블록 STC:소광22#79": "3dc8f95cbc9fab08", + "블록 STC:소광22#794": "80a597faff611a6d", + "블록 STC:소광22#808": "cec6651cf47822d7", + "블록 STC:소광22#83": "1dff25d8121ae42b", + "블록 STC:소광22#867": "92bd326a31d6c069", + "블록 STC:소광22#9": "4fbfbeff724fa3a5", + "블록 STC:소광22#91": "6a0131356bcf8fd8", + "블록 STC:소광22#918": "1347240aaa3fc811", + "블록 STC:소광22#96": "ce04b8e3caae63d5", + "블록 STC:소광22#963": "0d423ded4366ccc8", + "블록 STC:소광변경1#12": "80a597faff611a6d", + "블록 STC:소광변경1#14": "92bd326a31d6c069", + "블록 STC:소광변경1#15": "1347240aaa3fc811", + "블록 STC:소광변경1#18": "e51a9c3d00c8dd9a", + "블록 STC:소광변경1#20": "55f3a69760327245", + "블록 STC:소광변경1#30": "50acfe9f8a70a2d0", + "블록 STC:소광변경1#31": "54d62606d31b09e7", + "블록 STC:소광변경1#32": "6e4bbe91a587b6c2", + "블록 STC:소광변경1#33": "2bad632ea73040fe", + "블록 STC:소광변경1#34": "f3699f4eb6a4a9aa", + "블록 STC:소광변경1#37": "dd92e0de5c6c26c3", + "블록 STC:소광변경1#38": "2d93013a513aa360", + "블록 STC:소광변경1#39": "bd3948ba7d36fc94", + "블록 STC:소광변경1#4": "1dff25d8121ae42b", + "블록 STC:소광변경1#40": "0503119b96dcd9b7", + "블록 STC:소광변경1#41": "0d423ded4366ccc8", + "블록 STC:소광변경1#42": "4c6f9d7ce52f5ce5", + "블록 STC:소광변경1#43": "07e021a850ddcbe4", + "블록 STC:소광변경1#44": "4fbfbeff724fa3a5", + "블록 STC:소광변경1#45": "d9de4ccf675fec48", + "블록 STC:소광변경1#46": "0a30f333d1eeeba9", + "블록 STC:소광변경1#47": "ed39d22c6047f6bb", + "블록 STC:소광변경1#48": "a9043dd47c68c627", + "블록 STC:소광변경1#49": "e73f5f68c2e07c24", + "블록 STC:소광변경1#5": "6a0131356bcf8fd8", + "블록 STC:소광변경1#50": "3dc8f95cbc9fab08", + "블록 STC:소광변경1#51": "cec6651cf47822d7", + "블록 STC:소광변경1#52": "e18965deb615fb68", + "블록 STC:소광변경1#53": "4a23945503a6cf59", + "블록 STC:소광변경1#54": "2fde65716ec593a0", + "블록 STC:소광변경1#55": "89fb644c81c0d753", + "블록 STC:소광변경1#56": "ce04b8e3caae63d5", + "블록 STC:소광변경1#57": "bb6c55b5230297b1", + "블록 STC:소광변경1#58": "5b0bf07fad84c349", + "블록 STC:소광변경1#59": "6b36c5a38d342033", + "블록 STC:소광변경1#60": "9c735131426f8657", + "블록 STC:소광변경1#61": "23b36533f85f7c14", + "블록 STC:소광변경1#62": "d04ff336d4f9903a", + "블록 STC:소광변경1#63": "0ba04d0122ec87dc", + "블록 STC:소광변경1#64": "8ff462d18eb16a18", + "블록 STC:소광변경1#65": "761fcb154f601713", + "블록 STC:소광변경1#66": "62f37f9a6a9e317c", + "블록 STC:소광변경1#67": "9e3d72e9ceaedd38", + "블록 STC:소광변경1#68": "0af825d10d8ba0e5", + "블록 STC:소광변경1#69": "1181baa5f8f13c6b", + "블록 STC:소광변경1#70": "1347240aaa3fc811", + "블록 STC:소광변경1#71": "19124f19d0d98599", + "블록 STC:소광변경1#72": "1dff25d8121ae42b", + "블록 STC:소광변경1#73": "cdbcab98d110a988", + "블록 STC:소광변경1#74": "b8a6fc5afe221811", + "블록 STC:소광변경1#75": "7919130c8ca80a09", + "블록 STC:소광변경1#76": "847d7300c9bc65db", + "블록 STC:소광변경1#8": "7ba8ed4a06e57ebe", + "블록 STC:소광변경1#9": "d3637b2731538ee5", + "블록 STC:영덕계류#1396": "1a0684b41e84b27c", + "블록 STC:영덕계류#1416": "7c1ca36af7d7b508", + "블록 STC:영덕계류#1417": "97b5c1744cbfdb3e", + "블록 STC:영덕계류#1418": "fc5625be1410ebda", + "블록 STC:영덕계류#1419": "3ab0d5c128bf0677", + "블록 STC:영덕계류#1420": "86abf9b31134ae8d", + "블록 STC:영덕계류#1421": "bda262f01eb660bc", + "블록 STC:영덕계류#1422": "f53a7694fcc45465", + "블록 STC:영덕계류#1423": "9811154b2449e5bb", + "블록 STC:영덕계류#1424": "0cbafaf8626739a3", + "블록 STC:영덕계류#1425": "3296d09ce4b88261", + "블록 STC:영덕계류#1426": "7cd8d15a8e83ae06", + "블록 STC:영덕계류#1427": "52547320b344bcd3", + "블록 STC:영덕계류#1428": "1a0684b41e84b27c", + "블록 STC:영덕계류#1429": "bb6c55b5230297b1", + "블록 STC:영덕계류#1430": "75cd054dfc0508cc", + "블록 STC:영덕계류#1431": "ac06c9a5e30c4aab", + "블록 STC:영덕계류#1432": "a91e262fc8cc151d", + "블록 STC:영덕계류#1433": "0c52ee6a3b8ab3f2", + "블록 STC:영덕계류#1434": "d4aacb6b021ed950", + "블록 STC:영덕계류#1435": "0d73033e97ce964d", + "블록 STC:영덕계류#1436": "965398ee1ef76595", + "블록 STC:영덕계류#1438": "8842bdd15130a836", + "블록 STC:영덕계류#1439": "9a63cde067d39ddf", + "블록 STC:영덕계류#1441": "d1589bb19d40faa0", + "블록 STC:영덕계류#1442": "58b2d82a57104793", + "블록 STC:영덕계류#1443": "725a070c451c4254", + "블록 STC:영덕계류#1445": "aabed9c79e97db60", + "블록 STC:영덕계류#1446": "02d6ec3f72c936fa", + "블록 STC:영덕계류#1447": "31198d48a7c2b2e4", + "블록 STC:영덕계류#1448": "788f039a0d8ace29", + "블록 STC:영덕계류#1453": "62421203afd55041", + "블록 STC:영덕계류#1455": "02d6ec3f72c936fa", + "블록 STC:영덕계류#150": "3296d09ce4b88261", + "블록 STC:영덕계류#75": "7f96a67ac95051c9", + "블록 STC:울진대흥#1036": "6a3a4cf5413ad60c", + "블록 STC:울진대흥#1038": "18c437aa6589934a", + "블록 STC:울진대흥#1124": "ffbdbe49ad9697d7", + "블록 STC:울진대흥#1129": "354e91c5b3015f11", + "블록 STC:울진대흥#1251": "54298f63d4ab9223", + "블록 STC:울진대흥#1341": "6164d5b1b061b8c2", + "블록 STC:울진대흥#1343": "9fd7b5cb9c521d64", + "블록 STC:울진대흥#1344": "945e55ef00eba0d3", + "블록 STC:울진대흥#154": "cb6316c5709af100", + "블록 STC:울진대흥#159": "b437989df163e847", + "블록 STC:울진대흥#1874": "de97d6c100b12bb3", + "블록 STC:울진대흥#1989": "f64c44a72e48a95c", + "블록 STC:울진대흥#2119": "2c4199d27e5acf05", + "블록 STC:울진대흥#2139": "e37049823aa0cdb8", + "블록 STC:울진대흥#2145": "9581200505b7dba7", + "블록 STC:울진대흥#2153": "ac1a4ef7ab029adc", + "블록 STC:울진대흥#2154": "3e7606a25b102fd7", + "블록 STC:울진대흥#2155": "24bb9ccc091ed213", + "블록 STC:울진대흥#2157": "c996b3d6fb526869", + "블록 STC:울진대흥#2172": "0b34e05c7bbdc22e", + "블록 STC:울진대흥#2173": "510e493d44c7a411", + "블록 STC:울진대흥#2174": "885e56ddee37844c", + "블록 STC:울진대흥#2175": "d27a25a4f0d95a78", + "블록 STC:울진대흥#2195": "a4e376d71b72facb", + "블록 STC:울진대흥#2200": "d0909b8b9bb060bb", + "블록 STC:울진대흥#2242": "471f25abd2f9f6c0", + "블록 STC:울진대흥#2246": "7165f7083d103fc1", + "블록 STC:울진대흥#2248": "596725eae65fe458", + "블록 STC:울진대흥#2251": "73cb7593746f0f96", + "블록 STC:울진대흥#2252": "fb2f186b8625d0fd", + "블록 STC:울진대흥#2253": "c04c0e40ec0f48f0", + "블록 STC:울진대흥#2254": "755dc98f6a2c34d7", + "블록 STC:울진대흥#2255": "9abfa363dc7c900d", + "블록 STC:울진대흥#2256": "0c1f4c96bcd27e5f", + "블록 STC:울진대흥#2257": "18fd0fb5ff866988", + "블록 STC:울진대흥#2258": "48171d4ca2f2a007", + "블록 STC:울진대흥#2259": "ed6d4ae9df72f6c3", + "블록 STC:울진대흥#2260": "e561e316b54682a1", + "블록 STC:울진대흥#2261": "54988e48935ca8c1", + "블록 STC:울진대흥#2262": "03007ac31b503236", + "블록 STC:울진대흥#2263": "9373bc6464f31529", + "블록 STC:울진대흥#42": "54298f63d4ab9223", + "블록 STC:울진대흥#6": "fc7648ea55b297e1", + "블록 STC:울진대흥#75": "41d21174111f0295", + "블록 STC:울진대흥#9": "0e786fa12d9b4ede", + "블록 STC:울진대흥#959": "b0886bb0943458c6", + "블록 STC:울진소광#1010": "07e021a850ddcbe4", + "블록 STC:울진소광#1030": "e51a9c3d00c8dd9a", + "블록 STC:울진소광#1075": "4a23945503a6cf59", + "블록 STC:울진소광#1129": "55f3a69760327245", + "블록 STC:울진소광#1132": "9c735131426f8657", + "블록 STC:울진소광#1140": "23b36533f85f7c14", + "블록 STC:울진소광#1154": "2fde65716ec593a0", + "블록 STC:울진소광#1155": "89fb644c81c0d753", + "블록 STC:울진소광#1248": "ed39d22c6047f6bb", + "블록 STC:울진소광#1249": "e73f5f68c2e07c24", + "블록 STC:울진소광#1254": "d9de4ccf675fec48", + "블록 STC:울진소광#1256": "d04ff336d4f9903a", + "블록 STC:울진소광#1259": "0a30f333d1eeeba9", + "블록 STC:울진소광#1329": "50acfe9f8a70a2d0", + "블록 STC:울진소광#1336": "54d62606d31b09e7", + "블록 STC:울진소광#1351": "6e4bbe91a587b6c2", + "블록 STC:울진소광#1352": "2bad632ea73040fe", + "블록 STC:울진소광#1354": "f3699f4eb6a4a9aa", + "블록 STC:울진소광#1398": "bb6c55b5230297b1", + "블록 STC:울진소광#1417": "6b36c5a38d342033", + "블록 STC:울진소광#1448": "dd92e0de5c6c26c3", + "블록 STC:울진소광#1456": "2d93013a513aa360", + "블록 STC:울진소광#1474": "bd3948ba7d36fc94", + "블록 STC:울진소광#1475": "0503119b96dcd9b7", + "블록 STC:울진소광#1476": "0d423ded4366ccc8", + "블록 STC:울진소광#1477": "4c6f9d7ce52f5ce5", + "블록 STC:울진소광#1478": "07e021a850ddcbe4", + "블록 STC:울진소광#1479": "4fbfbeff724fa3a5", + "블록 STC:울진소광#1480": "d9de4ccf675fec48", + "블록 STC:울진소광#1481": "0a30f333d1eeeba9", + "블록 STC:울진소광#1482": "ed39d22c6047f6bb", + "블록 STC:울진소광#1483": "a9043dd47c68c627", + "블록 STC:울진소광#1484": "e73f5f68c2e07c24", + "블록 STC:울진소광#1485": "3dc8f95cbc9fab08", + "블록 STC:울진소광#1486": "cec6651cf47822d7", + "블록 STC:울진소광#1487": "e18965deb615fb68", + "블록 STC:울진소광#1488": "4a23945503a6cf59", + "블록 STC:울진소광#1489": "2fde65716ec593a0", + "블록 STC:울진소광#1490": "89fb644c81c0d753", + "블록 STC:울진소광#1491": "ce04b8e3caae63d5", + "블록 STC:울진소광#1492": "bb6c55b5230297b1", + "블록 STC:울진소광#1493": "5b0bf07fad84c349", + "블록 STC:울진소광#1494": "6b36c5a38d342033", + "블록 STC:울진소광#1495": "9c735131426f8657", + "블록 STC:울진소광#1496": "23b36533f85f7c14", + "블록 STC:울진소광#1497": "d04ff336d4f9903a", + "블록 STC:울진소광#208": "a9043dd47c68c627", + "블록 STC:울진소광#3": "4c6f9d7ce52f5ce5", + "블록 STC:울진소광#408": "7ba8ed4a06e57ebe", + "블록 STC:울진소광#492": "d3637b2731538ee5", + "블록 STC:울진소광#649": "e18965deb615fb68", + "블록 STC:울진소광#720": "5b0bf07fad84c349", + "블록 STC:울진소광#79": "3dc8f95cbc9fab08", + "블록 STC:울진소광#794": "80a597faff611a6d", + "블록 STC:울진소광#808": "cec6651cf47822d7", + "블록 STC:울진소광#83": "1dff25d8121ae42b", + "블록 STC:울진소광#867": "92bd326a31d6c069", + "블록 STC:울진소광#9": "4fbfbeff724fa3a5", + "블록 STC:울진소광#91": "6a0131356bcf8fd8", + "블록 STC:울진소광#918": "1347240aaa3fc811", + "블록 STC:울진소광#96": "ce04b8e3caae63d5", + "블록 STC:울진소광#963": "0d423ded4366ccc8", + "블록 엑셀:2016사방#1": "2e987a6fb5afbc8b", + "블록 엑셀:2016사방#10": "b35e845ba42796a2", + "블록 엑셀:2016사방#100": "94d9fcc8b5f4a371", + "블록 엑셀:2016사방#101": "ba59ce077e93b8df", + "블록 엑셀:2016사방#102": "bb95b415220936a5", + "블록 엑셀:2016사방#103": "cddc97c98f03cded", + "블록 엑셀:2016사방#104": "3b4eab855cbd2abc", + "블록 엑셀:2016사방#105": "f0a7ec1bbe958537", + "블록 엑셀:2016사방#106": "82452e50481de90a", + "블록 엑셀:2016사방#107": "6d9f1be09a874555", + "블록 엑셀:2016사방#108": "bddba92e6e39e63e", + "블록 엑셀:2016사방#109": "f9a52f692e80d4f7", + "블록 엑셀:2016사방#11": "ebcd1844ae48d13a", + "블록 엑셀:2016사방#110": "cddc97c98f03cded", + "블록 엑셀:2016사방#111": "8507082097e652a6", + "블록 엑셀:2016사방#112": "82452e50481de90a", + "블록 엑셀:2016사방#113": "e72de966d47222d8", + "블록 엑셀:2016사방#114": "0c1617b19b51a490", + "블록 엑셀:2016사방#115": "f4bf69261bc47315", + "블록 엑셀:2016사방#116": "69632f4075b05d30", + "블록 엑셀:2016사방#117": "18e881a3f821564f", + "블록 엑셀:2016사방#118": "28565396deab0e69", + "블록 엑셀:2016사방#119": "99346b107e860af3", + "블록 엑셀:2016사방#12": "573108cfc7f26399", + "블록 엑셀:2016사방#120": "8e627d89f7ed7245", + "블록 엑셀:2016사방#121": "ac965a060794bc71", + "블록 엑셀:2016사방#122": "fdab8795be306e86", + "블록 엑셀:2016사방#123": "c3a58cd01509f1da", + "블록 엑셀:2016사방#124": "cd5dd129bf65006a", + "블록 엑셀:2016사방#125": "56a460686ee9a78c", + "블록 엑셀:2016사방#126": "36baf012479b5e67", + "블록 엑셀:2016사방#127": "4c4be36489d73073", + "블록 엑셀:2016사방#128": "5bac5afc26b4c280", + "블록 엑셀:2016사방#129": "39b759b3bb442174", + "블록 엑셀:2016사방#13": "27721b6bdb00845a", + "블록 엑셀:2016사방#130": "56a460686ee9a78c", + "블록 엑셀:2016사방#131": "e1e71e2469828081", + "블록 엑셀:2016사방#132": "94d9fcc8b5f4a371", + "블록 엑셀:2016사방#133": "ba59ce077e93b8df", + "블록 엑셀:2016사방#134": "a224ef8126264950", + "블록 엑셀:2016사방#135": "7ec5373b33eb14d1", + "블록 엑셀:2016사방#136": "d0b8fec906b9b24b", + "블록 엑셀:2016사방#137": "a8fc2e1944627089", + "블록 엑셀:2016사방#138": "f0a7ec1bbe958537", + "블록 엑셀:2016사방#139": "e1ee6a2fb870f473", + "블록 엑셀:2016사방#14": "91c8609cde9159b5", + "블록 엑셀:2016사방#140": "28ab32ece19c6739", + "블록 엑셀:2016사방#141": "fdab8795be306e86", + "블록 엑셀:2016사방#142": "4a5e89f4d3417ef9", + "블록 엑셀:2016사방#143": "4c4be36489d73073", + "블록 엑셀:2016사방#144": "94d9fcc8b5f4a371", + "블록 엑셀:2016사방#145": "ba59ce077e93b8df", + "블록 엑셀:2016사방#146": "bb95b415220936a5", + "블록 엑셀:2016사방#147": "6eaeb105c471d7d6", + "블록 엑셀:2016사방#148": "56971302752d917a", + "블록 엑셀:2016사방#149": "5e1c242f511162fc", + "블록 엑셀:2016사방#15": "c4adef2355d72931", + "블록 엑셀:2016사방#150": "a5a1525195d936c2", + "블록 엑셀:2016사방#151": "167248697805dd3c", + "블록 엑셀:2016사방#152": "3c01e3db105b779d", + "블록 엑셀:2016사방#153": "67a71af78510869b", + "블록 엑셀:2016사방#154": "b3a79ebabee95997", + "블록 엑셀:2016사방#155": "d17569f2333f8dee", + "블록 엑셀:2016사방#156": "3f45f34e5355ec9e", + "블록 엑셀:2016사방#157": "6760d8fe80833c9d", + "블록 엑셀:2016사방#158": "7b47b5ac7bb390cc", + "블록 엑셀:2016사방#159": "c20bee30f566e8c4", + "블록 엑셀:2016사방#16": "8f0449ac5c87973c", + "블록 엑셀:2016사방#160": "63487a4c31de8255", + "블록 엑셀:2016사방#161": "86bd4ef268357205", + "블록 엑셀:2016사방#162": "b2a1040427dd3b7a", + "블록 엑셀:2016사방#163": "27209f1b897e7524", + "블록 엑셀:2016사방#164": "73971f4557584409", + "블록 엑셀:2016사방#165": "b5588920573ee0cd", + "블록 엑셀:2016사방#166": "51924db45bb24402", + "블록 엑셀:2016사방#167": "8dc320175cd9b9e7", + "블록 엑셀:2016사방#168": "d7537b66e0b013f6", + "블록 엑셀:2016사방#169": "b78a596dda99f43a", + "블록 엑셀:2016사방#17": "67c79d41abc01ea1", + "블록 엑셀:2016사방#170": "4eed0809023124b0", + "블록 엑셀:2016사방#171": "f78c3134ef30421c", + "블록 엑셀:2016사방#172": "1ee2caf55adeb252", + "블록 엑셀:2016사방#173": "25c0f57255e364c3", + "블록 엑셀:2016사방#174": "c35f705d355fdf02", + "블록 엑셀:2016사방#175": "6c113d84324e3277", + "블록 엑셀:2016사방#176": "f22b230e0ab579b0", + "블록 엑셀:2016사방#177": "ed6c357367a97d60", + "블록 엑셀:2016사방#178": "124610d2daf03a32", + "블록 엑셀:2016사방#179": "c6a1012fb0b3db4b", + "블록 엑셀:2016사방#18": "99cac897032cde5f", + "블록 엑셀:2016사방#180": "c6a1012fb0b3db4b", + "블록 엑셀:2016사방#181": "12bd1f14d68c889e", + "블록 엑셀:2016사방#182": "f9a520de4a649d69", + "블록 엑셀:2016사방#183": "f4f3d62d1c032f22", + "블록 엑셀:2016사방#184": "d03cabe4e5690ebf", + "블록 엑셀:2016사방#185": "99fc08575b5b137d", + "블록 엑셀:2016사방#186": "94c1544f860dc7fc", + "블록 엑셀:2016사방#187": "611ae0daf478b8dd", + "블록 엑셀:2016사방#188": "0fb26533afb2552d", + "블록 엑셀:2016사방#189": "222bb6880b3f6644", + "블록 엑셀:2016사방#19": "f40dbcc48a007a9a", + "블록 엑셀:2016사방#190": "d7f5b9f0683cd278", + "블록 엑셀:2016사방#191": "8efd611839a622fe", + "블록 엑셀:2016사방#192": "a8423802e5ae9a2c", + "블록 엑셀:2016사방#193": "037e5f83fce1db8b", + "블록 엑셀:2016사방#194": "c9bc3818f4349db7", + "블록 엑셀:2016사방#195": "b3885a4db1cc3376", + "블록 엑셀:2016사방#196": "f40506257e4bc7d3", + "블록 엑셀:2016사방#197": "0cb6363e05460ebe", + "블록 엑셀:2016사방#198": "3efca2ef86e72c5d", + "블록 엑셀:2016사방#199": "62db5daa7df7cc4a", + "블록 엑셀:2016사방#2": "f522318076304fba", + "블록 엑셀:2016사방#20": "d22feb686667fb41", + "블록 엑셀:2016사방#200": "27b0aa6a2c6747c9", + "블록 엑셀:2016사방#201": "611ae0daf478b8dd", + "블록 엑셀:2016사방#202": "ca190ab363848701", + "블록 엑셀:2016사방#203": "e9ef177a32f9a314", + "블록 엑셀:2016사방#204": "76ddd81106b06486", + "블록 엑셀:2016사방#205": "dcc009257cf1aa45", + "블록 엑셀:2016사방#206": "89be4d713f3754b6", + "블록 엑셀:2016사방#207": "8c9b93335261d8b4", + "블록 엑셀:2016사방#208": "da1df2284700d4b6", + "블록 엑셀:2016사방#209": "d3766d777c35567f", + "블록 엑셀:2016사방#21": "6cf57f301f27a017", + "블록 엑셀:2016사방#210": "e26e39699203154c", + "블록 엑셀:2016사방#211": "c20bee30f566e8c4", + "블록 엑셀:2016사방#212": "63487a4c31de8255", + "블록 엑셀:2016사방#213": "01062ce068bd01e9", + "블록 엑셀:2016사방#214": "f698a7109e31ee03", + "블록 엑셀:2016사방#215": "89be4d713f3754b6", + "블록 엑셀:2016사방#216": "05840d83ea5915da", + "블록 엑셀:2016사방#217": "406787b7d240b03d", + "블록 엑셀:2016사방#218": "86bd4ef268357205", + "블록 엑셀:2016사방#219": "1d8c7233536dd24e", + "블록 엑셀:2016사방#22": "7bfb03de17654437", + "블록 엑셀:2016사방#220": "b5588920573ee0cd", + "블록 엑셀:2016사방#221": "71ca296fe3fc85f7", + "블록 엑셀:2016사방#222": "d3828b59f3f44b5a", + "블록 엑셀:2016사방#223": "dcc009257cf1aa45", + "블록 엑셀:2016사방#224": "e26e39699203154c", + "블록 엑셀:2016사방#225": "b6833cdb959b1232", + "블록 엑셀:2016사방#226": "0b4fccb6d6e783e0", + "블록 엑셀:2016사방#227": "9cd52b78ddd454e0", + "블록 엑셀:2016사방#228": "4fc318f90a07572a", + "블록 엑셀:2016사방#229": "3b9ab225fa8f3e5d", + "블록 엑셀:2016사방#23": "64f585bde780b357", + "블록 엑셀:2016사방#230": "092cd7e5a26700ea", + "블록 엑셀:2016사방#231": "740bb9cd8a81c955", + "블록 엑셀:2016사방#232": "7f311229101e453f", + "블록 엑셀:2016사방#233": "87fd5a1c3c5aaa41", + "블록 엑셀:2016사방#234": "b2a1040427dd3b7a", + "블록 엑셀:2016사방#235": "27209f1b897e7524", + "블록 엑셀:2016사방#236": "b5588920573ee0cd", + "블록 엑셀:2016사방#237": "ee35959fe43b7eb2", + "블록 엑셀:2016사방#238": "3671215a89c4e519", + "블록 엑셀:2016사방#239": "fdbf57480505090d", + "블록 엑셀:2016사방#24": "8e45b80754872305", + "블록 엑셀:2016사방#240": "70f4613abaf903b8", + "블록 엑셀:2016사방#241": "948314239cb21364", + "블록 엑셀:2016사방#242": "57924652d1d21160", + "블록 엑셀:2016사방#243": "9cd52b78ddd454e0", + "블록 엑셀:2016사방#244": "73971f4557584409", + "블록 엑셀:2016사방#245": "bdd8a58ad35d94f7", + "블록 엑셀:2016사방#246": "d7537b66e0b013f6", + "블록 엑셀:2016사방#247": "3671215a89c4e519", + "블록 엑셀:2016사방#248": "7213040938658683", + "블록 엑셀:2016사방#249": "6a9eef801e998996", + "블록 엑셀:2016사방#25": "b7e84ee692636330", + "블록 엑셀:2016사방#250": "f8be39702eb507df", + "블록 엑셀:2016사방#251": "0d469a8ca6604117", + "블록 엑셀:2016사방#252": "081a6b5ea50abb5d", + "블록 엑셀:2016사방#253": "a08c7393c6fdb6cc", + "블록 엑셀:2016사방#254": "091a3a5ec5826d93", + "블록 엑셀:2016사방#255": "c48bf897e68a2830", + "블록 엑셀:2016사방#256": "9793c64ceaf8c15c", + "블록 엑셀:2016사방#257": "e2b5e4017af81522", + "블록 엑셀:2016사방#258": "d7537b66e0b013f6", + "블록 엑셀:2016사방#259": "3671215a89c4e519", + "블록 엑셀:2016사방#26": "d01419fc08784997", + "블록 엑셀:2016사방#260": "d1536edb3354d32f", + "블록 엑셀:2016사방#261": "c86c7486437196a6", + "블록 엑셀:2016사방#262": "27aa8f58ff4dfe3f", + "블록 엑셀:2016사방#263": "5fd943c25e1d1bb4", + "블록 엑셀:2016사방#264": "7f913d569693cea5", + "블록 엑셀:2016사방#265": "d14a42ac6c24a81e", + "블록 엑셀:2016사방#266": "46c734d673d37947", + "블록 엑셀:2016사방#267": "b1f318b21459c7ca", + "블록 엑셀:2016사방#268": "c3862be0a51e185f", + "블록 엑셀:2016사방#269": "776f9c7bc028ad36", + "블록 엑셀:2016사방#27": "a0d36005c3f43ba4", + "블록 엑셀:2016사방#270": "3dfda1cc837f49e0", + "블록 엑셀:2016사방#271": "ca99092f31754cc6", + "블록 엑셀:2016사방#272": "461e268f0bb2b84d", + "블록 엑셀:2016사방#273": "5051485173f5768c", + "블록 엑셀:2016사방#274": "eecf5671926da53a", + "블록 엑셀:2016사방#275": "07cd877b2e484750", + "블록 엑셀:2016사방#276": "e1d06dbb06f2996d", + "블록 엑셀:2016사방#277": "9e6223263b6a214a", + "블록 엑셀:2016사방#278": "fb89af16367e4800", + "블록 엑셀:2016사방#279": "46c734d673d37947", + "블록 엑셀:2016사방#28": "6b233e8623975c2a", + "블록 엑셀:2016사방#280": "6537b6496e74c016", + "블록 엑셀:2016사방#281": "c4adef2355d72931", + "블록 엑셀:2016사방#282": "776f9c7bc028ad36", + "블록 엑셀:2016사방#283": "9e0a030968f308a7", + "블록 엑셀:2016사방#284": "c34281fa3190c84f", + "블록 엑셀:2016사방#285": "f429111a08651cce", + "블록 엑셀:2016사방#286": "0f621bd8f1674556", + "블록 엑셀:2016사방#287": "e625a984643a5bc8", + "블록 엑셀:2016사방#288": "db1bd47415b4a7f9", + "블록 엑셀:2016사방#289": "74acb0526b4e3e4e", + "블록 엑셀:2016사방#29": "737ef50e86a63d6e", + "블록 엑셀:2016사방#290": "3dba5a1962d472a3", + "블록 엑셀:2016사방#291": "4e8e1527a14b413d", + "블록 엑셀:2016사방#292": "f38a957187ded982", + "블록 엑셀:2016사방#293": "c4adef2355d72931", + "블록 엑셀:2016사방#294": "776f9c7bc028ad36", + "블록 엑셀:2016사방#295": "913a6e078c96f631", + "블록 엑셀:2016사방#296": "bdc547c90342b3ef", + "블록 엑셀:2016사방#297": "8e78e4bc85b44fcb", + "블록 엑셀:2016사방#298": "3bd89324c0366d29", + "블록 엑셀:2016사방#299": "ffc8bbd6c6e56917", + "블록 엑셀:2016사방#3": "97832a104c1acef8", + "블록 엑셀:2016사방#30": "7579351fff39815e", + "블록 엑셀:2016사방#300": "0a817c45c9ce0a17", + "블록 엑셀:2016사방#301": "94646cf4227bd201", + "블록 엑셀:2016사방#302": "a9f6bf89ce119ded", + "블록 엑셀:2016사방#303": "57d76c9a34b1c961", + "블록 엑셀:2016사방#304": "a981464372986ce9", + "블록 엑셀:2016사방#305": "f61604ede5e2a7ef", + "블록 엑셀:2016사방#306": "d009eafe564cdcb2", + "블록 엑셀:2016사방#307": "31ec16606264138a", + "블록 엑셀:2016사방#308": "a34290acaebe0a61", + "블록 엑셀:2016사방#309": "4382cc8067205fa5", + "블록 엑셀:2016사방#31": "b9f29d56f274b65c", + "블록 엑셀:2016사방#310": "ec56035b560082c0", + "블록 엑셀:2016사방#311": "7bdd7691912712aa", + "블록 엑셀:2016사방#312": "15cacecbf2e98be0", + "블록 엑셀:2016사방#313": "49fa6f88fb69b044", + "블록 엑셀:2016사방#314": "b135d30bf596a1ce", + "블록 엑셀:2016사방#315": "494c1e483a1c6193", + "블록 엑셀:2016사방#316": "0a393dc0a95dc17f", + "블록 엑셀:2016사방#317": "9a0f6ef8c8dbcba8", + "블록 엑셀:2016사방#318": "ec2bd4c3ca67dd21", + "블록 엑셀:2016사방#319": "e98550343de6a3cb", + "블록 엑셀:2016사방#32": "75810c8cb16cea5a", + "블록 엑셀:2016사방#320": "24de57b99cbe72b3", + "블록 엑셀:2016사방#321": "b77f14b8c0e7fadf", + "블록 엑셀:2016사방#322": "03e52fcd6427545a", + "블록 엑셀:2016사방#323": "cc7cf24e4f224207", + "블록 엑셀:2016사방#324": "6b94dd3c43f8524b", + "블록 엑셀:2016사방#325": "19f5a4baa15cac14", + "블록 엑셀:2016사방#326": "3852d65cd0ecb236", + "블록 엑셀:2016사방#327": "7fd33d919caaf75b", + "블록 엑셀:2016사방#328": "4158a119bc1daee1", + "블록 엑셀:2016사방#329": "272fd0e960932b32", + "블록 엑셀:2016사방#33": "a20a6f7c44846987", + "블록 엑셀:2016사방#330": "803d81283a0beb14", + "블록 엑셀:2016사방#331": "12d9e842912da149", + "블록 엑셀:2016사방#332": "90b06d5eac3d8ccb", + "블록 엑셀:2016사방#333": "0f0c355fe3061483", + "블록 엑셀:2016사방#334": "90b06d5eac3d8ccb", + "블록 엑셀:2016사방#335": "324a2ec4121e95c1", + "블록 엑셀:2016사방#336": "bda2c69e15ca99d3", + "블록 엑셀:2016사방#337": "5c86aa7b0af0c377", + "블록 엑셀:2016사방#338": "38754a0c6d3113c6", + "블록 엑셀:2016사방#339": "eaeac47ca46b82ae", + "블록 엑셀:2016사방#34": "c77ed6cd2042cf1e", + "블록 엑셀:2016사방#340": "f45d233cc6b60417", + "블록 엑셀:2016사방#341": "dec74771200c26dd", + "블록 엑셀:2016사방#342": "13dbe9f469599e44", + "블록 엑셀:2016사방#343": "62a1fff80ccc532a", + "블록 엑셀:2016사방#344": "08d8be8ea5e8c7c8", + "블록 엑셀:2016사방#345": "6452cadc75dccac3", + "블록 엑셀:2016사방#346": "a4aedff324ae713d", + "블록 엑셀:2016사방#347": "fd7e2e5362c8778f", + "블록 엑셀:2016사방#348": "a43431c2ecb51311", + "블록 엑셀:2016사방#349": "9520b4f4ec0b6b22", + "블록 엑셀:2016사방#35": "e51b5877b0febe7b", + "블록 엑셀:2016사방#350": "2980d0876983c7a0", + "블록 엑셀:2016사방#351": "306bbf1ea91b5596", + "블록 엑셀:2016사방#352": "96b57716ec30bb4a", + "블록 엑셀:2016사방#353": "fac0a2d7924e861b", + "블록 엑셀:2016사방#354": "2980d0876983c7a0", + "블록 엑셀:2016사방#355": "306bbf1ea91b5596", + "블록 엑셀:2016사방#356": "01062ce068bd01e9", + "블록 엑셀:2016사방#357": "d3766d777c35567f", + "블록 엑셀:2016사방#358": "af40f7b0267e81fa", + "블록 엑셀:2016사방#359": "cdaa6ddebd5f2ed6", + "블록 엑셀:2016사방#36": "2e6d4540acd7045d", + "블록 엑셀:2016사방#360": "41666ef7574c3fc3", + "블록 엑셀:2016사방#361": "5a729ec1020a39a8", + "블록 엑셀:2016사방#362": "6291cba6c7de7177", + "블록 엑셀:2016사방#363": "e9388f2606cd3c78", + "블록 엑셀:2016사방#364": "a3151af3b449af2f", + "블록 엑셀:2016사방#365": "2c0777cb4201ef35", + "블록 엑셀:2016사방#366": "931d551e546dd83d", + "블록 엑셀:2016사방#367": "f4afa952218b0d7d", + "블록 엑셀:2016사방#368": "93f1a0fbea332750", + "블록 엑셀:2016사방#369": "1f61e6ccf407df53", + "블록 엑셀:2016사방#37": "326b7852f6ff0df7", + "블록 엑셀:2016사방#370": "51187c387045a40f", + "블록 엑셀:2016사방#371": "0fc102b643a1c931", + "블록 엑셀:2016사방#372": "e02e66ef75ab646f", + "블록 엑셀:2016사방#373": "1c0418be48086b58", + "블록 엑셀:2016사방#374": "6a31642760afe671", + "블록 엑셀:2016사방#38": "5559e223faa08a51", + "블록 엑셀:2016사방#39": "a94b76dd66ff67e9", + "블록 엑셀:2016사방#4": "bc43fc7ae6fff4c9", + "블록 엑셀:2016사방#40": "ec1466db75a25e88", + "블록 엑셀:2016사방#41": "6d4fe27ca3ce49fc", + "블록 엑셀:2016사방#42": "2f3c9acd46de7259", + "블록 엑셀:2016사방#43": "27209f1b897e7524", + "블록 엑셀:2016사방#44": "73971f4557584409", + "블록 엑셀:2016사방#45": "b5588920573ee0cd", + "블록 엑셀:2016사방#46": "e2b5e4017af81522", + "블록 엑셀:2016사방#47": "ee35959fe43b7eb2", + "블록 엑셀:2016사방#48": "41f38445e9ec6a61", + "블록 엑셀:2016사방#49": "2d1ab966c077bf09", + "블록 엑셀:2016사방#5": "fbff46f8beadff15", + "블록 엑셀:2016사방#50": "27209f1b897e7524", + "블록 엑셀:2016사방#51": "4fc318f90a07572a", + "블록 엑셀:2016사방#52": "b5588920573ee0cd", + "블록 엑셀:2016사방#53": "e2b5e4017af81522", + "블록 엑셀:2016사방#54": "ee35959fe43b7eb2", + "블록 엑셀:2016사방#55": "41f38445e9ec6a61", + "블록 엑셀:2016사방#56": "3b70cd5632ad0bce", + "블록 엑셀:2016사방#57": "3671215a89c4e519", + "블록 엑셀:2016사방#58": "f4f3d62d1c032f22", + "블록 엑셀:2016사방#59": "94c1544f860dc7fc", + "블록 엑셀:2016사방#6": "b9f73ddd0935d48d", + "블록 엑셀:2016사방#60": "eecf5671926da53a", + "블록 엑셀:2016사방#61": "99fc08575b5b137d", + "블록 엑셀:2016사방#62": "ba879124f2028318", + "블록 엑셀:2016사방#63": "27aa8f58ff4dfe3f", + "블록 엑셀:2016사방#64": "f8be39702eb507df", + "블록 엑셀:2016사방#65": "e1d06dbb06f2996d", + "블록 엑셀:2016사방#66": "52acd22cc98fc93c", + "블록 엑셀:2016사방#67": "4091d5acef1b8eaa", + "블록 엑셀:2016사방#68": "a452e71b51834f01", + "블록 엑셀:2016사방#69": "dcc009257cf1aa45", + "블록 엑셀:2016사방#7": "ff2434f6b06c5bed", + "블록 엑셀:2016사방#70": "c4d9b5256f64a4ad", + "블록 엑셀:2016사방#71": "b6833cdb959b1232", + "블록 엑셀:2016사방#72": "8628421be2d4216e", + "블록 엑셀:2016사방#73": "d2c99f843c434a57", + "블록 엑셀:2016사방#74": "9cd52b78ddd454e0", + "블록 엑셀:2016사방#75": "9b369e966f67fdcf", + "블록 엑셀:2016사방#76": "a0089633a285c0ce", + "블록 엑셀:2016사방#77": "40b5ea836488d074", + "블록 엑셀:2016사방#78": "a1e6c9417932fd26", + "블록 엑셀:2016사방#79": "da1df2284700d4b6", + "블록 엑셀:2016사방#8": "407f7f099087d7f2", + "블록 엑셀:2016사방#80": "89be4d713f3754b6", + "블록 엑셀:2016사방#81": "05840d83ea5915da", + "블록 엑셀:2016사방#82": "406787b7d240b03d", + "블록 엑셀:2016사방#83": "86bd4ef268357205", + "블록 엑셀:2016사방#84": "2f3c9acd46de7259", + "블록 엑셀:2016사방#85": "1d8c7233536dd24e", + "블록 엑셀:2016사방#86": "9b369e966f67fdcf", + "블록 엑셀:2016사방#87": "a0089633a285c0ce", + "블록 엑셀:2016사방#88": "bdd8a58ad35d94f7", + "블록 엑셀:2016사방#89": "f9a52f692e80d4f7", + "블록 엑셀:2016사방#9": "6882f1e6a78f40fd", + "블록 엑셀:2016사방#90": "cddc97c98f03cded", + "블록 엑셀:2016사방#91": "8507082097e652a6", + "블록 엑셀:2016사방#92": "82452e50481de90a", + "블록 엑셀:2016사방#93": "e72de966d47222d8", + "블록 엑셀:2016사방#94": "0c1617b19b51a490", + "블록 엑셀:2016사방#95": "f4bf69261bc47315", + "블록 엑셀:2016사방#96": "69632f4075b05d30", + "블록 엑셀:2016사방#97": "18e881a3f821564f", + "블록 엑셀:2016사방#98": "28565396deab0e69", + "블록 엑셀:2016사방#99": "4c4be36489d73073", + "블록 엑셀:2026수목#1": "c0bb35ac3a49096e", + "블록 엑셀:2026수목#10": "93cf2204ef6d07a1", + "블록 엑셀:2026수목#100": "811776cea5f745b9", + "블록 엑셀:2026수목#101": "6e8886d4c9db74be", + "블록 엑셀:2026수목#102": "d21ca23f04d3b88e", + "블록 엑셀:2026수목#103": "aa0d0ab803593d75", + "블록 엑셀:2026수목#104": "38a956501d5c41da", + "블록 엑셀:2026수목#105": "e0b6843d37a1303f", + "블록 엑셀:2026수목#106": "ea170c75d40019e8", + "블록 엑셀:2026수목#107": "dd424e18c0e21326", + "블록 엑셀:2026수목#108": "ae55e4b441d00386", + "블록 엑셀:2026수목#109": "e937284c8f561ac3", + "블록 엑셀:2026수목#11": "32aafbee93a3f254", + "블록 엑셀:2026수목#110": "0358f9c598609aac", + "블록 엑셀:2026수목#111": "d47ae8e8d4c8d19b", + "블록 엑셀:2026수목#112": "873b8d9944296357", + "블록 엑셀:2026수목#113": "a7486eb41cbc7530", + "블록 엑셀:2026수목#114": "6cd1ae185e479ae9", + "블록 엑셀:2026수목#115": "18ea6e75bcfe7cdf", + "블록 엑셀:2026수목#116": "5f618f52cf7ff998", + "블록 엑셀:2026수목#117": "4e41eb066c05d0d8", + "블록 엑셀:2026수목#118": "3b258f6306aae400", + "블록 엑셀:2026수목#119": "dfa9411492b55dd1", + "블록 엑셀:2026수목#12": "630425b22146a30b", + "블록 엑셀:2026수목#120": "a33d0c5e2902cdbc", + "블록 엑셀:2026수목#121": "ada90714a1c836ba", + "블록 엑셀:2026수목#122": "8c1d2edf27d9bdaf", + "블록 엑셀:2026수목#123": "71ebe187e402e2d5", + "블록 엑셀:2026수목#124": "9da45a251df12462", + "블록 엑셀:2026수목#125": "94e81bc544b378b1", + "블록 엑셀:2026수목#126": "58510f356838775e", + "블록 엑셀:2026수목#127": "e5f0f0c638fa7105", + "블록 엑셀:2026수목#128": "49e05c900ab0d758", + "블록 엑셀:2026수목#129": "4f6f0c9fb6e75289", + "블록 엑셀:2026수목#13": "85d35b572fff37a4", + "블록 엑셀:2026수목#130": "483de44141f7a367", + "블록 엑셀:2026수목#131": "37512d15ceff5996", + "블록 엑셀:2026수목#132": "032b84ed5dcac8e2", + "블록 엑셀:2026수목#133": "6237692e57b68603", + "블록 엑셀:2026수목#134": "bc1ed55d8c15f371", + "블록 엑셀:2026수목#135": "f2ffa6d59b553c5d", + "블록 엑셀:2026수목#136": "f38a5d9f77725b8d", + "블록 엑셀:2026수목#137": "55b011b1bca5e2fa", + "블록 엑셀:2026수목#138": "0947843f645e7034", + "블록 엑셀:2026수목#139": "01a34db6f6e6f6a7", + "블록 엑셀:2026수목#14": "bc5b7ee2e7b9bf0c", + "블록 엑셀:2026수목#140": "cc78f50610f34733", + "블록 엑셀:2026수목#141": "4e872d7429a932ee", + "블록 엑셀:2026수목#142": "b2758169b869bf6a", + "블록 엑셀:2026수목#15": "3c8ec9b5ce8f0734", + "블록 엑셀:2026수목#16": "8b64dec2e27be240", + "블록 엑셀:2026수목#17": "09b916615a974a94", + "블록 엑셀:2026수목#18": "b544e7db9e01e5ae", + "블록 엑셀:2026수목#19": "ab8d5b107e8fcd40", + "블록 엑셀:2026수목#2": "1f4fe870ecce656d", + "블록 엑셀:2026수목#20": "2e0c5b56344cf2f2", + "블록 엑셀:2026수목#21": "a547e85e6a5ac5a2", + "블록 엑셀:2026수목#22": "7a27ebf61eea0f2d", + "블록 엑셀:2026수목#23": "bfda214503819295", + "블록 엑셀:2026수목#24": "d2128ee3185532bd", + "블록 엑셀:2026수목#25": "220a312d6a925238", + "블록 엑셀:2026수목#26": "750aee7c195be4e4", + "블록 엑셀:2026수목#27": "6aff4fde78d464e0", + "블록 엑셀:2026수목#28": "d09a5fa68bd7e0c1", + "블록 엑셀:2026수목#29": "e83c3153fb3cb144", + "블록 엑셀:2026수목#3": "cbfd64736e82ab87", + "블록 엑셀:2026수목#30": "f5fcd3ce91d4e8a4", + "블록 엑셀:2026수목#31": "365796892b31a145", + "블록 엑셀:2026수목#32": "29fffd3c48f0db98", + "블록 엑셀:2026수목#33": "d722af66cc7928d4", + "블록 엑셀:2026수목#34": "8a58c0eb8cbf364c", + "블록 엑셀:2026수목#35": "aa2ed6fe2bce2b17", + "블록 엑셀:2026수목#36": "e36f920a081ff527", + "블록 엑셀:2026수목#37": "f28ab73f6f2a1cab", + "블록 엑셀:2026수목#38": "7455ca61e66b9974", + "블록 엑셀:2026수목#39": "c88bb606b81c17a9", + "블록 엑셀:2026수목#4": "3b84fb3ff64f0760", + "블록 엑셀:2026수목#40": "3105ff41a48e50bd", + "블록 엑셀:2026수목#41": "ff38b199a381bfa7", + "블록 엑셀:2026수목#42": "c333beb994180863", + "블록 엑셀:2026수목#43": "899e45ee85a66367", + "블록 엑셀:2026수목#44": "7018781aa8fab6c8", + "블록 엑셀:2026수목#45": "d4236ab72a3c8541", + "블록 엑셀:2026수목#46": "a6659a5770ba9b28", + "블록 엑셀:2026수목#47": "b8ecce7f5674fb1f", + "블록 엑셀:2026수목#48": "e6ec8899a756cacc", + "블록 엑셀:2026수목#49": "ffd2611ecf2d28d6", + "블록 엑셀:2026수목#5": "37841faa96a4e01b", + "블록 엑셀:2026수목#50": "40c831a71fe49c7a", + "블록 엑셀:2026수목#51": "53bab20dffdaedd8", + "블록 엑셀:2026수목#52": "22309bc68324cda1", + "블록 엑셀:2026수목#53": "5a3790109fcf7fec", + "블록 엑셀:2026수목#54": "71e06e23e10fa5f2", + "블록 엑셀:2026수목#55": "b0c1b94fa328d39d", + "블록 엑셀:2026수목#56": "b87817b3e521a25a", + "블록 엑셀:2026수목#57": "aeb73bdf6362d402", + "블록 엑셀:2026수목#58": "2717eecc60049dfb", + "블록 엑셀:2026수목#59": "3ad3c3878b093906", + "블록 엑셀:2026수목#6": "adbf1b6895598a06", + "블록 엑셀:2026수목#60": "c4ec0012ffdf5605", + "블록 엑셀:2026수목#61": "92499925f22040d4", + "블록 엑셀:2026수목#62": "0768b4c6d46aea01", + "블록 엑셀:2026수목#63": "b866f3fc077e8372", + "블록 엑셀:2026수목#64": "8290109c6138d920", + "블록 엑셀:2026수목#65": "d18a1c69ea649c88", + "블록 엑셀:2026수목#66": "39b45ca0296d403c", + "블록 엑셀:2026수목#67": "24b1c318ba9b508c", + "블록 엑셀:2026수목#68": "c5a4b1623b48aa5a", + "블록 엑셀:2026수목#69": "0920ed1a6b923609", + "블록 엑셀:2026수목#7": "010a8dc60296ca81", + "블록 엑셀:2026수목#70": "f13b26646d2e354a", + "블록 엑셀:2026수목#71": "454aaf63d9a5df5b", + "블록 엑셀:2026수목#72": "600b7a024fa354f2", + "블록 엑셀:2026수목#73": "f88ba0cf9d9d4745", + "블록 엑셀:2026수목#74": "9026477303cb8755", + "블록 엑셀:2026수목#75": "1f278ee22681a830", + "블록 엑셀:2026수목#76": "4bb032da94966a7f", + "블록 엑셀:2026수목#77": "61ec25ca5aa36229", + "블록 엑셀:2026수목#78": "96716f53a115ad46", + "블록 엑셀:2026수목#79": "817004db4bdd8077", + "블록 엑셀:2026수목#8": "f1f47791cfcb4aa7", + "블록 엑셀:2026수목#80": "58f8d4c7ac378607", + "블록 엑셀:2026수목#81": "5d09e5c60e6cd9e9", + "블록 엑셀:2026수목#82": "8975e4cf1227cb04", + "블록 엑셀:2026수목#83": "19b284c4b3a12d1b", + "블록 엑셀:2026수목#84": "ae435ef6842e82b1", + "블록 엑셀:2026수목#85": "71cfa8c4aafc91e5", + "블록 엑셀:2026수목#86": "6a1343e86e124328", + "블록 엑셀:2026수목#87": "8c47f5e6e8e4adff", + "블록 엑셀:2026수목#88": "c7e2f70281db288b", + "블록 엑셀:2026수목#89": "7ec982464d926eb0", + "블록 엑셀:2026수목#9": "a734d2c6e210865f", + "블록 엑셀:2026수목#90": "cf06ddf970706f8b", + "블록 엑셀:2026수목#91": "8e2465cbf8de8baa", + "블록 엑셀:2026수목#92": "96e0b42e46e70ab7", + "블록 엑셀:2026수목#93": "391495cd4aed8b8e", + "블록 엑셀:2026수목#94": "a77692b4b06fd40f", + "블록 엑셀:2026수목#95": "da14e121fa3d6e47", + "블록 엑셀:2026수목#96": "86bed3b257888ec8", + "블록 엑셀:2026수목#97": "abdf1abeb94faeed", + "블록 엑셀:2026수목#98": "e9317855a4a4d25c", + "블록 엑셀:2026수목#99": "0e60336363929cb7", + "블록 엑셀:거창#1": "3eda4903bf6d3e4b", + "블록 엑셀:거창#10": "b8fd3cb7c2ca69b3", + "블록 엑셀:거창#11": "570a3c875f083063", + "블록 엑셀:거창#12": "923ddea179943454", + "블록 엑셀:거창#13": "6b0170026d9ce1af", + "블록 엑셀:거창#14": "c9c86412896be67f", + "블록 엑셀:거창#15": "7d4a24880b730654", + "블록 엑셀:거창#16": "7b3492e5b2ca16db", + "블록 엑셀:거창#17": "fcdaf7717e71b535", + "블록 엑셀:거창#18": "fee26b58850f3223", + "블록 엑셀:거창#19": "f851a8359936a3af", + "블록 엑셀:거창#2": "f7cfcb85328daf52", + "블록 엑셀:거창#20": "2405fdfceaf61b4c", + "블록 엑셀:거창#21": "05a31f99ba45f77b", + "블록 엑셀:거창#22": "684935a35519eb47", + "블록 엑셀:거창#23": "e55af78b4477abe9", + "블록 엑셀:거창#24": "cb8926b27ae4eb3d", + "블록 엑셀:거창#25": "836321393dfba459", + "블록 엑셀:거창#26": "91debfe05a48d4f7", + "블록 엑셀:거창#27": "5969a5418e545afa", + "블록 엑셀:거창#28": "3d71f2651e2db2f6", + "블록 엑셀:거창#29": "651772ace62a7be7", + "블록 엑셀:거창#3": "a2ca7eb293cf466f", + "블록 엑셀:거창#30": "ce72ee25edf21163", + "블록 엑셀:거창#31": "86db9ea8247842d1", + "블록 엑셀:거창#32": "5e60c236932bbf8c", + "블록 엑셀:거창#33": "f7df285a1f4d6d49", + "블록 엑셀:거창#34": "7738bc9a45970993", + "블록 엑셀:거창#35": "1aa60d1c665a6773", + "블록 엑셀:거창#36": "b7523769346fa225", + "블록 엑셀:거창#37": "0c814b3589591c8f", + "블록 엑셀:거창#38": "edea9aa9bcff0ad9", + "블록 엑셀:거창#39": "fc0d8904c332a0f5", + "블록 엑셀:거창#4": "b5d530e0d426dd7d", + "블록 엑셀:거창#40": "43f0e46e2cd50197", + "블록 엑셀:거창#41": "e4b51800631785af", + "블록 엑셀:거창#42": "1df3859c838fe918", + "블록 엑셀:거창#43": "0251a0d82053e891", + "블록 엑셀:거창#44": "b5566779bbdb30d5", + "블록 엑셀:거창#45": "1fb207dbabcf87db", + "블록 엑셀:거창#46": "c081e49789bc0bf6", + "블록 엑셀:거창#47": "27cd823262a59f6f", + "블록 엑셀:거창#48": "a4e4087d6a9ca6ea", + "블록 엑셀:거창#49": "2c5bd574a86dac6f", + "블록 엑셀:거창#5": "5dc364979971e626", + "블록 엑셀:거창#50": "eee05c86a1b6ea6d", + "블록 엑셀:거창#51": "d6cad1535c252581", + "블록 엑셀:거창#52": "a1254670b687d777", + "블록 엑셀:거창#53": "a1f3a200c0d7c9e8", + "블록 엑셀:거창#54": "398de09ca5105568", + "블록 엑셀:거창#55": "35625f0321a0c69f", + "블록 엑셀:거창#56": "cb59d76986646868", + "블록 엑셀:거창#57": "cc816bf7e674a262", + "블록 엑셀:거창#58": "0c495eacbbc2b5ca", + "블록 엑셀:거창#59": "a17400c96526db3c", + "블록 엑셀:거창#6": "e5759df55e8b92cf", + "블록 엑셀:거창#60": "f6f9ffcd229f6522", + "블록 엑셀:거창#61": "21c3ad5ccd2ff0a2", + "블록 엑셀:거창#7": "a30c86227d717bc9", + "블록 엑셀:거창#8": "8570ba622e8b862a", + "블록 엑셀:거창#9": "30bc6ad11ab669cf", + "블록 엑셀:대흥공통#1036": "6a3a4cf5413ad60c", + "블록 엑셀:대흥공통#1038": "4bc31c589ac83e64", + "블록 엑셀:대흥공통#1124": "2d007228ef127841", + "블록 엑셀:대흥공통#1129": "31cfde9a7d4b9a84", + "블록 엑셀:대흥공통#1251": "0f076526cc1c6812", + "블록 엑셀:대흥공통#1341": "c9a2b331d0ba9fb2", + "블록 엑셀:대흥공통#1343": "b4776b1799b86686", + "블록 엑셀:대흥공통#1344": "9626f06b9e2a59df", + "블록 엑셀:대흥공통#154": "a0dffbaa1ccbe412", + "블록 엑셀:대흥공통#159": "9e4cc4d765b35336", + "블록 엑셀:대흥공통#1874": "c5a229fe3420c4f6", + "블록 엑셀:대흥공통#1989": "f9077d55b862b650", + "블록 엑셀:대흥공통#2119": "ef4847e91e3e6443", + "블록 엑셀:대흥공통#2139": "9d2002623e48222c", + "블록 엑셀:대흥공통#2145": "515d5c699b34556e", + "블록 엑셀:대흥공통#2153": "af4a9f535b2eb9b7", + "블록 엑셀:대흥공통#2154": "a8e4f4bc33fa34d3", + "블록 엑셀:대흥공통#2155": "1bfea193cd342ac4", + "블록 엑셀:대흥공통#2157": "81e63355271d7c4f", + "블록 엑셀:대흥공통#2172": "0fcd5b59fc040999", + "블록 엑셀:대흥공통#2173": "d270bca4032dd2eb", + "블록 엑셀:대흥공통#2174": "e395cef106868c38", + "블록 엑셀:대흥공통#2175": "a80861be438003f2", + "블록 엑셀:대흥공통#2195": "ff7412b3f5d4c8c9", + "블록 엑셀:대흥공통#2200": "04ba3155cd5c4c75", + "블록 엑셀:대흥공통#2242": "e585e91f8b693d2a", + "블록 엑셀:대흥공통#2246": "7793dcbdd60e6075", + "블록 엑셀:대흥공통#2248": "fc765fc4b81106a4", + "블록 엑셀:대흥공통#2251": "ad44b8cc46438883", + "블록 엑셀:대흥공통#2252": "41fbcef04412225c", + "블록 엑셀:대흥공통#2253": "540fe0ded9779eee", + "블록 엑셀:대흥공통#2254": "c002c91b998459d6", + "블록 엑셀:대흥공통#2255": "22b0b2d797b53a18", + "블록 엑셀:대흥공통#2256": "0b3cebdcd7336b9d", + "블록 엑셀:대흥공통#2257": "acd1edbf6f3c21e3", + "블록 엑셀:대흥공통#2258": "f57346156d7fe508", + "블록 엑셀:대흥공통#2259": "78358864c7332672", + "블록 엑셀:대흥공통#2260": "ddfadc78887615d5", + "블록 엑셀:대흥공통#2261": "e09abdd3f2c1ef67", + "블록 엑셀:대흥공통#2262": "3e58df3d6f15335a", + "블록 엑셀:대흥공통#2263": "3eff1e286c422a44", + "블록 엑셀:대흥공통#42": "0f076526cc1c6812", + "블록 엑셀:대흥공통#6": "eefcb07bc6cbc73c", + "블록 엑셀:대흥공통#75": "0df3bb8185e95be9", + "블록 엑셀:대흥공통#9": "0ce2ac2eb17475f8", + "블록 엑셀:대흥공통#959": "b7f96cc256162bd8", + "블록 엑셀:동부청영월#10": "66c315d03acec26e", + "블록 엑셀:동부청영월#111": "7ae508efc4b3f86f", + "블록 엑셀:동부청영월#13": "14a186601430b918", + "블록 엑셀:동부청영월#1361": "c9e0858709174c02", + "블록 엑셀:동부청영월#1466": "5303739033b4ed50", + "블록 엑셀:동부청영월#1519": "899a253ed8ec857f", + "블록 엑셀:동부청영월#1611": "05c801013be5bdc5", + "블록 엑셀:동부청영월#17": "96c6a79fd64e1b1f", + "블록 엑셀:동부청영월#1748": "d5b47a92f7945b89", + "블록 엑셀:동부청영월#1752": "254dfcd52fb2a1fb", + "블록 엑셀:동부청영월#1755": "07ae44393783cafa", + "블록 엑셀:동부청영월#1759": "08280fc9ee8870a2", + "블록 엑셀:동부청영월#18": "00763aba4098e4f9", + "블록 엑셀:동부청영월#1810": "a6443d53770819f0", + "블록 엑셀:동부청영월#1841": "d1c80b980ec262cc", + "블록 엑셀:동부청영월#1843": "ac5c680ea44671d8", + "블록 엑셀:동부청영월#1844": "66f677e7ddb7f26b", + "블록 엑셀:동부청영월#1854": "e160fe67ef436b05", + "블록 엑셀:동부청영월#1855": "4f0d38a372236d8f", + "블록 엑셀:동부청영월#19": "9071d25df0239e18", + "블록 엑셀:동부청영월#1926": "73615595d7bab033", + "블록 엑셀:동부청영월#1927": "ff5058b6a8f188c1", + "블록 엑셀:동부청영월#1928": "487208766d8fd1f8", + "블록 엑셀:동부청영월#1932": "c3e17639182a5efb", + "블록 엑셀:동부청영월#1942": "c6aa719c8f390ee5", + "블록 엑셀:동부청영월#1999": "abf16f931b763f85", + "블록 엑셀:동부청영월#2": "8399463af0ccd5c5", + "블록 엑셀:동부청영월#20": "92c1755deb5676a5", + "블록 엑셀:동부청영월#2001": "1bf579cb640828a2", + "블록 엑셀:동부청영월#2002": "e47494b1edd0282b", + "블록 엑셀:동부청영월#2003": "015a1099d33be4f8", + "블록 엑셀:동부청영월#2004": "e9b7cf6f1e8d29b1", + "블록 엑셀:동부청영월#2005": "e1e56ebf0342af9e", + "블록 엑셀:동부청영월#2008": "05e8e041416041b5", + "블록 엑셀:동부청영월#2030": "363feef3455ccee2", + "블록 엑셀:동부청영월#2031": "ea25d1a052e8ba7e", + "블록 엑셀:동부청영월#2032": "dee8f909d4eaa906", + "블록 엑셀:동부청영월#2033": "6d92d97628d2514d", + "블록 엑셀:동부청영월#2034": "4f0691714be87c41", + "블록 엑셀:동부청영월#2036": "e0619857be47b6d2", + "블록 엑셀:동부청영월#2058": "808fd9c398e63efd", + "블록 엑셀:동부청영월#2071": "b9b488dbe7dbc0b7", + "블록 엑셀:동부청영월#2074": "aa65c3f053400801", + "블록 엑셀:동부청영월#21": "ac8eb84573536882", + "블록 엑셀:동부청영월#23": "b9d54cdfde134d58", + "블록 엑셀:동부청영월#25": "4b2ba641b20107c3", + "블록 엑셀:동부청영월#258": "9ceeb312757479d9", + "블록 엑셀:동부청영월#26": "d91c76e7821d205e", + "블록 엑셀:동부청영월#27": "2b895e36c8985fec", + "블록 엑셀:동부청영월#29": "ef4e3f51cee4c887", + "블록 엑셀:동부청영월#3": "2147055f076d3746", + "블록 엑셀:동부청영월#31": "191b276d2d530ca5", + "블록 엑셀:동부청영월#33": "e1a958b1eb80798d", + "블록 엑셀:동부청영월#35": "a7083ecd67527feb", + "블록 엑셀:동부청영월#37": "6a5e34c59deb5c52", + "블록 엑셀:동부청영월#411": "052b53397b4455db", + "블록 엑셀:동부청영월#450": "82142689c2152de2", + "블록 엑셀:동부청영월#56": "cd5316ad576da0f5", + "블록 엑셀:동부청영월#58": "b5f864001925b735", + "블록 엑셀:동부청영월#59": "bbb270854bd6e81a", + "블록 엑셀:동부청영월#60": "83a27bbf02995081", + "블록 엑셀:동부청영월#600": "6f93c2eae8bc82d0", + "블록 엑셀:동부청영월#644": "4b6e3d9fa1534d7d", + "블록 엑셀:동부청영월#7": "d09521c74c0699a8", + "블록 엑셀:동부청영월#71": "c6db36aae0e2e7f0", + "블록 엑셀:동부청영월#72": "dab0d380af45421c", + "블록 엑셀:동부청영월#8": "23ba3f5177519390", + "블록 엑셀:동부청영월#81": "64792e90dd869e6e", + "블록 엑셀:동부청영월#9": "e45f6af198d024cf", + "블록 엑셀:봉화#1": "6a3a4cf5413ad60c", + "블록 엑셀:봉화#10": "31461fe8eea3d3e7", + "블록 엑셀:봉화#102": "799b403942729c33", + "블록 엑셀:봉화#103": "b70acf460861a632", + "블록 엑셀:봉화#105": "365719504a1cfddb", + "블록 엑셀:봉화#107": "4ab5752b11af883d", + "블록 엑셀:봉화#108": "83ea9f3ddf848801", + "블록 엑셀:봉화#109": "83fe1b0159e23015", + "블록 엑셀:봉화#110": "ab44f6828485b12d", + "블록 엑셀:봉화#111": "6a3a4cf5413ad60c", + "블록 엑셀:봉화#112": "5a4d59a133604dde", + "블록 엑셀:봉화#113": "9a04866923bc5941", + "블록 엑셀:봉화#115": "3241be344f6632a0", + "블록 엑셀:봉화#116": "aad7cd487d567533", + "블록 엑셀:봉화#117": "89972db7576cdf60", + "블록 엑셀:봉화#118": "fe634dc444868142", + "블록 엑셀:봉화#119": "e18d77ad5ee30d97", + "블록 엑셀:봉화#12": "a7779bc40ccb1cb3", + "블록 엑셀:봉화#120": "0948dd4ea7f649cb", + "블록 엑셀:봉화#121": "9da269061aa09e18", + "블록 엑셀:봉화#13": "669e64dd5dd4af2c", + "블록 엑셀:봉화#14": "5ad7aeb6ce2ddc5b", + "블록 엑셀:봉화#15": "3438713632c502be", + "블록 엑셀:봉화#16": "ac92e14e8c8d6b7d", + "블록 엑셀:봉화#17": "ec823fb4ee8c5cde", + "블록 엑셀:봉화#18": "da0592e571c63504", + "블록 엑셀:봉화#19": "eed99273db0b8a37", + "블록 엑셀:봉화#2": "871956abe9379944", + "블록 엑셀:봉화#20": "42beb254ad690662", + "블록 엑셀:봉화#21": "6a867e2a302afb92", + "블록 엑셀:봉화#22": "a88626bec41d261a", + "블록 엑셀:봉화#23": "3426ed264c2a50c5", + "블록 엑셀:봉화#24": "f72170f40e84d736", + "블록 엑셀:봉화#25": "3fdae37803643511", + "블록 엑셀:봉화#26": "2edb4c9ef9c3a14f", + "블록 엑셀:봉화#27": "6087129c9abc4d6e", + "블록 엑셀:봉화#29": "f4ebabdf039b074a", + "블록 엑셀:봉화#3": "3f7ebc5c546d8306", + "블록 엑셀:봉화#37": "e68469c18f3c88af", + "블록 엑셀:봉화#38": "72cc0d6900a0d237", + "블록 엑셀:봉화#39": "29de4781669a8413", + "블록 엑셀:봉화#4": "38fe38fcccb92d7c", + "블록 엑셀:봉화#43": "1bdeb00c2eb0be50", + "블록 엑셀:봉화#44": "6a3a4cf5413ad60c", + "블록 엑셀:봉화#49": "d006bdbd0b6eaa0f", + "블록 엑셀:봉화#5": "4cf6b06f20a0a53e", + "블록 엑셀:봉화#51": "4933c819dde10df6", + "블록 엑셀:봉화#52": "32d04ec6c2e6bead", + "블록 엑셀:봉화#54": "54482c44534eaab9", + "블록 엑셀:봉화#55": "b378bc17ebbec746", + "블록 엑셀:봉화#6": "4cf6b06f20a0a53e", + "블록 엑셀:봉화#7": "287acee995642061", + "블록 엑셀:봉화#77": "89c39b8b2ec67595", + "블록 엑셀:봉화#8": "9a79e8e260d43c8d", + "블록 엑셀:봉화#81": "b6b3daa9e0b54987", + "블록 엑셀:봉화#89": "d9cc4ba3d00949b4", + "블록 엑셀:봉화#90": "798ab0ec133074c9", + "블록 엑셀:봉화#91": "c0936abfb607c53f", + "블록 엑셀:봉화#93": "ff7412b3f5d4c8c9", + "블록 엑셀:봉화#94": "7793dcbdd60e6075", + "블록 엑셀:봉화#95": "b70acf460861a632", + "블록 엑셀:봉화#96": "63daa43b0397cb31", + "블록 엑셀:봉화#97": "045d25f59b17d600", + "블록 엑셀:봉화#98": "2c465a6e1217bfeb", + "블록 엑셀:봉화#99": "9f14cd929ce1cac7", + "블록 엑셀:북부청사방#1": "dbfc508ab3cbebf3", + "블록 엑셀:북부청사방#10": "8643aa11c68658f1", + "블록 엑셀:북부청사방#11": "879a2998036d3363", + "블록 엑셀:북부청사방#12": "427556a2c3ff4326", + "블록 엑셀:북부청사방#13": "028f364b6a997aa7", + "블록 엑셀:북부청사방#14": "302fc36fbb41a66e", + "블록 엑셀:북부청사방#15": "de8f0537b1944187", + "블록 엑셀:북부청사방#16": "c70bbbf05e0b12b8", + "블록 엑셀:북부청사방#17": "3109db676bc72b7d", + "블록 엑셀:북부청사방#18": "b8207b0e2ee9f5f1", + "블록 엑셀:북부청사방#19": "beeec30e7ce4d944", + "블록 엑셀:북부청사방#2": "5539b72413442738", + "블록 엑셀:북부청사방#20": "7876be251f739b04", + "블록 엑셀:북부청사방#21": "d09efe35330be220", + "블록 엑셀:북부청사방#22": "a3955a23664665c5", + "블록 엑셀:북부청사방#23": "d755ea725a037699", + "블록 엑셀:북부청사방#24": "81bd8ab1cc8be20b", + "블록 엑셀:북부청사방#25": "3bb70a53503672ac", + "블록 엑셀:북부청사방#26": "7c5fb86f6cf68bf0", + "블록 엑셀:북부청사방#27": "62792ccf27f4cc4d", + "블록 엑셀:북부청사방#28": "b41ae7ffb7b59999", + "블록 엑셀:북부청사방#29": "677be01fbaf29f8f", + "블록 엑셀:북부청사방#3": "12d4f9f8b69bf5fb", + "블록 엑셀:북부청사방#30": "32bf0a3538538c69", + "블록 엑셀:북부청사방#31": "3e80751405884ab4", + "블록 엑셀:북부청사방#32": "02f9652cddd6407c", + "블록 엑셀:북부청사방#33": "f7ca1b22bb4c1337", + "블록 엑셀:북부청사방#34": "2fff95d1492b24f8", + "블록 엑셀:북부청사방#35": "11db89247f136c17", + "블록 엑셀:북부청사방#36": "c1a2c40720dc7c61", + "블록 엑셀:북부청사방#37": "78d31ff8a3850b8e", + "블록 엑셀:북부청사방#38": "8d5a8aa166c8b132", + "블록 엑셀:북부청사방#39": "4d858e60b965ba62", + "블록 엑셀:북부청사방#4": "d9828e3034cbad23", + "블록 엑셀:북부청사방#40": "2da49ca9233aae66", + "블록 엑셀:북부청사방#41": "ed376b4c04318149", + "블록 엑셀:북부청사방#42": "5a7494c46d88dcff", + "블록 엑셀:북부청사방#43": "0104e2cf4200b23d", + "블록 엑셀:북부청사방#44": "d32f9d4026d43a49", + "블록 엑셀:북부청사방#45": "96e622616a435b29", + "블록 엑셀:북부청사방#46": "e34f4005654aa7b8", + "블록 엑셀:북부청사방#47": "41c22bb2cbf1fe82", + "블록 엑셀:북부청사방#48": "e6227a96e69fe4c9", + "블록 엑셀:북부청사방#49": "8090e5151657ab97", + "블록 엑셀:북부청사방#5": "cbed993e986760a8", + "블록 엑셀:북부청사방#50": "af3ea46977e954a1", + "블록 엑셀:북부청사방#51": "741835e3864044ca", + "블록 엑셀:북부청사방#52": "b61761555fbdcc29", + "블록 엑셀:북부청사방#53": "d2ff6e023d7d1e5e", + "블록 엑셀:북부청사방#54": "dc079af948e9e01a", + "블록 엑셀:북부청사방#55": "037e2f52ee484102", + "블록 엑셀:북부청사방#56": "3b8a375d41cee054", + "블록 엑셀:북부청사방#57": "e8797f6f3f87920e", + "블록 엑셀:북부청사방#58": "2deeb95e878c608a", + "블록 엑셀:북부청사방#59": "4cafa3fcae36cf5c", + "블록 엑셀:북부청사방#6": "431538234c128bfa", + "블록 엑셀:북부청사방#60": "49f39e5196bf2a76", + "블록 엑셀:북부청사방#61": "26481175b2677fa1", + "블록 엑셀:북부청사방#62": "65c973721967b2e8", + "블록 엑셀:북부청사방#63": "6ebb5bc35f37e012", + "블록 엑셀:북부청사방#64": "4a40b3243021c6f7", + "블록 엑셀:북부청사방#65": "5140860fd118511b", + "블록 엑셀:북부청사방#66": "9301bdc6486cdcd5", + "블록 엑셀:북부청사방#67": "a59285eb60ec9bd4", + "블록 엑셀:북부청사방#7": "1d8e2833865b137b", + "블록 엑셀:북부청사방#8": "38c982a376bab262", + "블록 엑셀:북부청사방#9": "6ff604de595f3e73", + "블록 엑셀:북부청임도#1": "6a3a4cf5413ad60c", + "블록 엑셀:북부청임도#10": "bf6e7c4cb09bf6c6", + "블록 엑셀:북부청임도#11": "26c8c066aa06222b", + "블록 엑셀:북부청임도#12": "1d8e2833865b137b", + "블록 엑셀:북부청임도#13": "2da49ca9233aae66", + "블록 엑셀:북부청임도#14": "ae58112d9d53a607", + "블록 엑셀:북부청임도#15": "3d595c9777d592a1", + "블록 엑셀:북부청임도#16": "165340ad59e8b005", + "블록 엑셀:북부청임도#17": "4245b7a393d03585", + "블록 엑셀:북부청임도#18": "8fa29b07cfa26b42", + "블록 엑셀:북부청임도#19": "eb466c45c972bd2c", + "블록 엑셀:북부청임도#2": "3447359991c44220", + "블록 엑셀:북부청임도#20": "538b2685f580e0e8", + "블록 엑셀:북부청임도#21": "beeec30e7ce4d944", + "블록 엑셀:북부청임도#22": "7876be251f739b04", + "블록 엑셀:북부청임도#23": "fc24d8fb70cb51fd", + "블록 엑셀:북부청임도#24": "183b33c0a0e88eea", + "블록 엑셀:북부청임도#25": "4eecba98f20cae45", + "블록 엑셀:북부청임도#26": "8d5a8aa166c8b132", + "블록 엑셀:북부청임도#27": "83d5540ce9b38d20", + "블록 엑셀:북부청임도#28": "21c3ad5ccd2ff0a2", + "블록 엑셀:북부청임도#29": "4be7b716f16fa109", + "블록 엑셀:북부청임도#3": "a25b825f34675b42", + "블록 엑셀:북부청임도#30": "b97f8e432363ca23", + "블록 엑셀:북부청임도#31": "0bb0600e59b85b0d", + "블록 엑셀:북부청임도#32": "49f39e5196bf2a76", + "블록 엑셀:북부청임도#33": "167cb8e69c740364", + "블록 엑셀:북부청임도#34": "acea03da02f61758", + "블록 엑셀:북부청임도#35": "ae6f8dac52926c90", + "블록 엑셀:북부청임도#36": "a2a4de5e093652dd", + "블록 엑셀:북부청임도#37": "dbfc508ab3cbebf3", + "블록 엑셀:북부청임도#38": "33d94a0dbd01c17f", + "블록 엑셀:북부청임도#39": "693ee4f9400ecda2", + "블록 엑셀:북부청임도#4": "c70758aa14c1e1c8", + "블록 엑셀:북부청임도#40": "05ab559e05760741", + "블록 엑셀:북부청임도#41": "43bde3b2243cdb35", + "블록 엑셀:북부청임도#42": "a54b1c57fbd24e2a", + "블록 엑셀:북부청임도#43": "dc916c9c4f19b30c", + "블록 엑셀:북부청임도#44": "7eb39f507b3a4646", + "블록 엑셀:북부청임도#45": "0ca5821288e38b76", + "블록 엑셀:북부청임도#46": "d929035a75d19451", + "블록 엑셀:북부청임도#47": "b61761555fbdcc29", + "블록 엑셀:북부청임도#48": "5581038fb0919b90", + "블록 엑셀:북부청임도#49": "16cbd3f591c37055", + "블록 엑셀:북부청임도#5": "2652d8a041bf232f", + "블록 엑셀:북부청임도#50": "207d76a6e324f690", + "블록 엑셀:북부청임도#51": "af4cd80302ebc845", + "블록 엑셀:북부청임도#52": "1f6309e2927c016c", + "블록 엑셀:북부청임도#53": "54d5e95a2685b27f", + "블록 엑셀:북부청임도#54": "77e7bbbb0bdd68ca", + "블록 엑셀:북부청임도#55": "3d8f0d3b2decf218", + "블록 엑셀:북부청임도#56": "41ddbdd4eaa38579", + "블록 엑셀:북부청임도#57": "d09efe35330be220", + "블록 엑셀:북부청임도#58": "752c206f261d841b", + "블록 엑셀:북부청임도#59": "f64f8b599ac68be4", + "블록 엑셀:북부청임도#6": "a367aeb31cdc0f84", + "블록 엑셀:북부청임도#60": "371b83aa4706026c", + "블록 엑셀:북부청임도#61": "9d4326ad5c4ab79a", + "블록 엑셀:북부청임도#62": "ddd94e5a7871263e", + "블록 엑셀:북부청임도#63": "cd57f71497ed6490", + "블록 엑셀:북부청임도#64": "530746780f58b3a5", + "블록 엑셀:북부청임도#65": "fc27ccee204a16b8", + "블록 엑셀:북부청임도#66": "da627a22f6dc4325", + "블록 엑셀:북부청임도#67": "33aab59db1af7596", + "블록 엑셀:북부청임도#68": "2c05b2c1e777af71", + "블록 엑셀:북부청임도#69": "cca43ed4a4c160d6", + "블록 엑셀:북부청임도#7": "bacd47351a598265", + "블록 엑셀:북부청임도#70": "5ee64378f7bf1507", + "블록 엑셀:북부청임도#71": "546e537032d1fa62", + "블록 엑셀:북부청임도#72": "d2ff6e023d7d1e5e", + "블록 엑셀:북부청임도#73": "12d4f9f8b69bf5fb", + "블록 엑셀:북부청임도#74": "60ef7852d88c3adc", + "블록 엑셀:북부청임도#75": "840dcbb052f27109", + "블록 엑셀:북부청임도#76": "73be84d374c28630", + "블록 엑셀:북부청임도#77": "4800c2d5d6aa0b53", + "블록 엑셀:북부청임도#78": "db50a172f27c4027", + "블록 엑셀:북부청임도#79": "73be84d374c28630", + "블록 엑셀:북부청임도#8": "bd92a7265a346824", + "블록 엑셀:북부청임도#80": "c388228c48c4f995", + "블록 엑셀:북부청임도#81": "86f46eeb51ca89b9", + "블록 엑셀:북부청임도#82": "f5ff7d9f0f7e5fae", + "블록 엑셀:북부청임도#83": "efde091ee6cd2567", + "블록 엑셀:북부청임도#84": "6e96235099a88420", + "블록 엑셀:북부청임도#85": "1248e36ac8359fc2", + "블록 엑셀:북부청임도#86": "5539b72413442738", + "블록 엑셀:북부청임도#87": "10c3362cd23cb25f", + "블록 엑셀:북부청임도#88": "a7defd23022b01c6", + "블록 엑셀:북부청임도#89": "2673add9bbd9c5c0", + "블록 엑셀:북부청임도#9": "7c5fb86f6cf68bf0", + "블록 엑셀:북부청임도#90": "abfa81c1ba5d846d", + "블록 엑셀:북부청임도#91": "482f49325ee51927", + "블록 엑셀:북부청임도#92": "96968c20f8d70d22", + "블록 엑셀:북부청임도#93": "0b22e87898b4dd21", + "블록 엑셀:북부청임도#94": "44841da8b8d14d9c", + "블록 엑셀:북부청임도#95": "683dc630bcfb5083", + "블록 엑셀:영덕계류#1425": "23864272bce68d5d", + "블록 엑셀:영덕계류#1426": "813a6addbcc94dca", + "블록 엑셀:영덕계류#1427": "8f1ac52d2f6db8c8", + "블록 엑셀:영덕계류#1438": "29101b2555bcbe8d", + "블록 엑셀:영덕계류#1439": "7fc5592564518f50", + "블록 엑셀:영덕계류#1441": "7f26bfb35ba4d332", + "블록 엑셀:영덕계류#1442": "69d522e944315198", + "블록 엑셀:영덕계류#1443": "73b1136194edc95f", + "블록 엑셀:영덕계류#1445": "4003c47bc8654e36", + "블록 엑셀:영덕계류#1446": "43cef26f79c0c441", + "블록 엑셀:영덕계류#1447": "3df5ee3c03db8a49", + "블록 엑셀:영덕계류#1448": "c86b93aa9570e3ce", + "블록 엑셀:영덕계류#1453": "7a266f17a09604b0", + "블록 엑셀:영덕계류#1455": "43cef26f79c0c441", + "블록 엑셀:영덕계류#150": "23864272bce68d5d", + "블록 엑셀:울진대흥#1124": "2d007228ef127841", + "블록 엑셀:울진대흥#1129": "31cfde9a7d4b9a84", + "블록 엑셀:울진대흥#1343": "b4776b1799b86686", + "블록 엑셀:울진대흥#159": "9e4cc4d765b35336", + "블록 엑셀:울진대흥#2119": "ef4847e91e3e6443", + "블록 엑셀:울진대흥#2139": "9d2002623e48222c", + "블록 엑셀:울진대흥#2195": "ff7412b3f5d4c8c9", + "블록 엑셀:울진대흥#2200": "04ba3155cd5c4c75", + "블록 엑셀:울진대흥#2246": "7793dcbdd60e6075", + "블록 엑셀:울진대흥#2248": "fc765fc4b81106a4", + "블록 엑셀:울진대흥#2251": "ad44b8cc46438883", + "블록 엑셀:울진대흥#2262": "3e58df3d6f15335a", + "블록 엑셀:울진대흥#2264": "c9a2b331d0ba9fb2", + "블록 엑셀:울진대흥#2265": "c5a229fe3420c4f6", + "블록 엑셀:울진대흥#2266": "eefcb07bc6cbc73c", + "블록 엑셀:울진대흥#2267": "b4776b1799b86686", + "블록 엑셀:울진대흥#2268": "0f076526cc1c6812", + "블록 엑셀:울진대흥#2269": "9626f06b9e2a59df", + "블록 엑셀:울진대흥#2270": "0ce2ac2eb17475f8", + "블록 엑셀:울진대흥#2271": "0f076526cc1c6812", + "블록 엑셀:울진대흥#2272": "6a3a4cf5413ad60c", + "블록 엑셀:울진대흥#2273": "c002c91b998459d6", + "블록 엑셀:울진대흥#2274": "22b0b2d797b53a18", + "블록 엑셀:울진대흥#2275": "0b3cebdcd7336b9d", + "블록 엑셀:울진대흥#2276": "acd1edbf6f3c21e3", + "블록 엑셀:울진대흥#2277": "540fe0ded9779eee", + "블록 엑셀:울진대흥#2278": "4bc31c589ac83e64", + "블록 엑셀:울진대흥#2279": "a0dffbaa1ccbe412", + "블록 엑셀:울진대흥#2280": "af4a9f535b2eb9b7", + "블록 엑셀:울진대흥#2281": "e585e91f8b693d2a", + "블록 엑셀:울진대흥#2282": "a8e4f4bc33fa34d3", + "블록 엑셀:울진대흥#2283": "1bfea193cd342ac4", + "블록 엑셀:울진대흥#2284": "f9077d55b862b650", + "블록 엑셀:울진대흥#2285": "81e63355271d7c4f", + "블록 엑셀:울진대흥#2286": "f57346156d7fe508", + "블록 엑셀:울진대흥#2287": "78358864c7332672", + "블록 엑셀:울진대흥#2288": "ddfadc78887615d5", + "블록 엑셀:울진대흥#2289": "e09abdd3f2c1ef67", + "블록 엑셀:울진대흥#2290": "3eff1e286c422a44", + "블록 엑셀:울진대흥#2291": "0fcd5b59fc040999", + "블록 엑셀:울진대흥#2292": "d270bca4032dd2eb", + "블록 엑셀:울진대흥#2293": "e395cef106868c38", + "블록 엑셀:울진대흥#2294": "a80861be438003f2", + "블록 엑셀:울진대흥#2295": "515d5c699b34556e", + "블록 엑셀:울진대흥#2296": "41fbcef04412225c", + "블록 엑셀:울진대흥#75": "0df3bb8185e95be9", + "블록 엑셀:울진대흥#959": "b7f96cc256162bd8", + "블록 엑셀:울진소광#1030": "5342ace3ab37cc42", + "블록 엑셀:울진소광#1129": "81924e3ee58506f5", + "블록 엑셀:울진소광#1329": "133a98c4249b84d1", + "블록 엑셀:울진소광#1336": "4ba58e414659ccb2", + "블록 엑셀:울진소광#1351": "ba62173e333fd26c", + "블록 엑셀:울진소광#1352": "911201a04d979a6d", + "블록 엑셀:울진소광#1354": "7208989323941692", + "블록 엑셀:울진소광#1448": "ff0a96ad97381880", + "블록 엑셀:울진소광#1456": "91c852bf3baae606", + "블록 엑셀:울진소광#1474": "1cadd9cebbad0901", + "블록 엑셀:울진소광#1475": "e1ac1be902c24d20", + "블록 엑셀:울진소광#1476": "94a3daf2fe03f24e", + "블록 엑셀:울진소광#1477": "4b7746431e855e73", + "블록 엑셀:울진소광#1478": "f57db383b9499638", + "블록 엑셀:울진소광#1479": "3ec65fffd685046d", + "블록 엑셀:울진소광#1480": "31f85c5bab310935", + "블록 엑셀:울진소광#1481": "a03c5d5a31860bcb", + "블록 엑셀:울진소광#1482": "91db3c8108ae35f6", + "블록 엑셀:울진소광#1483": "3999910dc2da5a21", + "블록 엑셀:울진소광#1484": "c680803ec6e2b621", + "블록 엑셀:울진소광#1485": "41e71f8583c7bade", + "블록 엑셀:울진소광#1486": "980c82520d182dfd", + "블록 엑셀:울진소광#1487": "e5a194f8f97d7dc2", + "블록 엑셀:울진소광#1488": "85927d429a083e29", + "블록 엑셀:울진소광#1489": "06e6f9ab5d105fd1", + "블록 엑셀:울진소광#1490": "1f967c874fe85bae", + "블록 엑셀:울진소광#1491": "f0ec30af72713d9a", + "블록 엑셀:울진소광#1492": "24f0eae53f3bc9cd", + "블록 엑셀:울진소광#1493": "3b5d5b712e71884a", + "블록 엑셀:울진소광#1494": "16d3e3f8b3338f01", + "블록 엑셀:울진소광#1495": "fa37438ba2b5acc2", + "블록 엑셀:울진소광#1496": "21c4c3bebb06a740", + "블록 엑셀:울진소광#1497": "f9fb455fda6dc0ca", + "블록 엑셀:울진소광#408": "a3e02fa715166b93", + "블록 엑셀:울진소광#492": "c8377091574890d3", + "블록 엑셀:울진소광#794": "7b66d1241c5f1ba5", + "블록 엑셀:울진소광#83": "4252edfdac45b394", + "블록 엑셀:울진소광#867": "f182c15ec31bea07", + "블록 엑셀:울진소광#91": "ca1e5f63ad25dfd5", + "블록 엑셀:울진소광#918": "494eacf70e3fb96f" + }, + "올림": { + "올림 2016사방 올림": "591a8b4dfbe67819", + "올림 2026수목 올림": "591a8b4dfbe67819", + "올림 거창 고정": "301f9d50d2aa6e01", + "올림 거창 목록": "1b2914680b1c29fc", + "올림 거창 올림": "5f32212ea5f045b1", + "올림 거창 재료": "1ec877cf7e9e02ad", + "올림 거창 칠": "bc0678f986a965b4", + "올림 대흥공통 고정": "b46a695b4c7ad3b0", + "올림 대흥공통 목록": "c09a7c665eefc36b", + "올림 대흥공통 올림": "157bff3f6900ea13", + "올림 대흥공통 재료": "3f3d3149d18e1c2a", + "올림 대흥공통 칠": "bf96a80f4e8a7732", + "올림 동부청영월 고정": "1792d43222245005", + "올림 동부청영월 목록": "fa74122eab6b6e33", + "올림 동부청영월 올림": "be95d8872c70e009", + "올림 동부청영월 재료": "7a4b8bfc9d058a79", + "올림 동부청영월 칠": "94961d7090fe0f0f", + "올림 봉화 고정": "fe99665cfa67664e", + "올림 봉화 목록": "ff7a9a7a8f7fb0d3", + "올림 봉화 올림": "9b6994bd6b730cb9", + "올림 봉화 재료": "deb7009db2a1545e", + "올림 봉화 칠": "6e1bdc18a313f431", + "올림 북부청사방 고정": "3681cbce171e2eb9", + "올림 북부청사방 목록": "1ba106b360303538", + "올림 북부청사방 올림": "24295521752b8045", + "올림 북부청사방 재료": "924f4798b4c177a0", + "올림 북부청사방 칠": "8edfe7ec0fc65fbb", + "올림 북부청임도 고정": "200093e072f526af", + "올림 북부청임도 목록": "3a170d96d3912635", + "올림 북부청임도 올림": "d3f2435548533cde", + "올림 북부청임도 재료": "389bf49a4a1117d1", + "올림 북부청임도 칠": "e4d629901960f7d5", + "올림 영덕계류 고정": "deb8b2df599c7397", + "올림 영덕계류 목록": "76f84e208058206f", + "올림 영덕계류 올림": "64bf734b8ba86121", + "올림 영덕계류 재료": "3a5f797626302cb6", + "올림 영덕계류 칠": "1a81d5151b25755c", + "올림 울진대흥 고정": "f79e991f8fce7dc7", + "올림 울진대흥 목록": "b6e84aa2aaa36ede", + "올림 울진대흥 올림": "157bff3f6900ea13", + "올림 울진대흥 재료": "961279430c2bc784", + "올림 울진대흥 칠": "e062abee88d50692", + "올림 울진소광 고정": "1ea94553de8845f1", + "올림 울진소광 목록": "5a92223af94df28b", + "올림 울진소광 올림": "71174eecbf7abe3b", + "올림 울진소광 재료": "c00afaaa8533fa04", + "올림 울진소광 칠": "41241ae33b2b5174" + }, + "재료표": { + "2016사방": {}, + "2026수목": {}, + "거창": { + "같음(못 이음)": 10, + "같음(이음)": 1, + "생김": 5 + }, + "대흥공통": { + "같음(못 이음)": 18, + "생김": 13 + }, + "동부청영월": { + "같음(못 이음)": 36, + "생김": 5 + }, + "봉화": { + "같음(못 이음)": 13, + "같음(이음)": 8, + "생김": 19 + }, + "북부청사방": { + "같음(못 이음)": 48, + "생김": 8 + }, + "북부청임도": { + "같음(못 이음)": 97, + "같음(이음)": 1, + "다른 품목": 12, + "생김": 32 + }, + "영덕계류": { + "같음(이음)": 4 + }, + "울진대흥": { + "같음(못 이음)": 18, + "생김": 13 + }, + "울진소광": { + "같음(못 이음)": 13, + "생김": 11 + } + }, + "판": 1 +} diff --git a/resources/tester/helper_857_import.py b/resources/tester/helper_857_import.py new file mode 100644 index 000000000..ffbb4f759 --- /dev/null +++ b/resources/tester/helper_857_import.py @@ -0,0 +1,301 @@ +"""857-0 지킴 도우미 — 불러오기 지문(블록 × 두 판 · 검산 · 이음 / 엑셀 올림 · 호표 목록 · 칠 · +고정 줄 / 재료 이음 표). + +- 블록 = 견본(원파일 EST · STC · 실무 엑셀)마다 `Doc_FromNative.emit` → 가져온 식 SK(저장 없음) → + 엑셀 판 · 우리 판 문서 셈(`Doc_Import.derive` + `run`) 노 · 재 · 경 · 계 + + 검산(`Sangeun_Imported.check` 같음 · 줄 같음 수) + 줄마다 이음(종류 · 이음 · 기계 찾기 · + 재료 찾기 판정 · 키). +- 올림 = 엑셀을 임시 개인 층에 올림(`Hopyo_Router._upload`) → 거절 글 | 목록(`Hopyo_View.listing`) · + 칠(`Hopyo_Marks.blocks`) · 고정 줄(`Hopyo_Fixed.line_of` 이름 · 규격 · 단위 · 단가 · 이음 · 비율). +- 재료 이음 표 = 일위대가 호표 자재 · 별도계상 줄 — 호표 길 키(`line_of`) · + 단가산출 길 키(`San_Link.m01`). +- 지문 = 갈래 열쇠(「블록 EST:거창#3」 등)마다 sha256 앞 16 자 · 견본 내용은 안 남김. +- M01 한 벌 쥠(셈 동안 M01 파일이 안 바뀜 — 빠르게만 · 답 같음). +""" + +from __future__ import annotations + +import contextlib +import hashlib +import json +import sys +import tempfile +import warnings +from pathlib import Path +from typing import Any + +HERE = Path(__file__).resolve().parent +ROOT = HERE.parents[1] +for p in (str(ROOT), str(HERE)): + if p not in sys.path: + sys.path.insert(0, p) +warnings.filterwarnings("ignore", category=UserWarning, module="openpyxl") + +KEYS = ("노무비", "재료비", "경비", "계") +#: 기본(빠른) 표본 — 견본마다 블록 몇 개 · 올림 파일 몇 개(전수 = `S857_ALL=1`) +QUICK_BLOCKS = { + "EST:거창": 8, + "STC:봉화": 8, + "엑셀:북부청임도": 8, + "엑셀:봉화": 8, + "엑셀:2026수목": 8, +} +QUICK_UPLOAD = ("북부청임도", "봉화", "2026수목") + + +def sources() -> dict[str, Path]: + """「갈래:이름」 → 견본 경로(없는 PC = 경로가 없음).""" + import test_797_1a_import_flags as practice + from test_810_1_estx import FILES as EST + from test_810_1_stc import FILES as STC + + out = {f"EST:{k}": v for k, v in EST.items()} + out |= {f"STC:{k}": v for k, v in STC.items()} + return out | {f"엑셀:{k}": v for k, v in practice.FILES.items()} + + +def digest(value: Any) -> str: + raw = json.dumps(value, ensure_ascii=False, sort_keys=True, default=str) + return hashlib.sha256(raw.encode("utf-8")).hexdigest()[:16] + + +@contextlib.contextmanager +def hold_m01(): + """M01 한 벌을 셈 동안 쥠(줄마다 파일 날짜 다시 재기 뺌).""" + from M01_MasterData import M01_MasterData_Store as m01 + + real, memo = m01.loaded, [] + + def once(): + if not memo: + memo.append(real()) + return memo[0] + + m01.loaded = once + try: + yield + finally: + m01.loaded = real + + +@contextlib.contextmanager +def personal(): + """임시 storage 개인 층(원본 storage · 마스터 안 씀).""" + from config import config_system + + old = config_system.STORAGE_BASE_DIR + tmp = Path(tempfile.mkdtemp(prefix="t857_")) + config_system.STORAGE_BASE_DIR = str(tmp / "storage") + (tmp / "storage").mkdir() + from M02_MasterTemplete import M02_MasterTemplete_Store as store + from M02_MasterTemplete import M02_Template_Layers as layers + + folder = layers.personal_dir(7, 42) + folder.mkdir(parents=True, exist_ok=True) + try: + with store.at(folder): + yield folder + finally: + config_system.STORAGE_BASE_DIR = old + + +# ── 블록 ────────────────────────────────────────────────────────────── +def saved_of(tag: str, path: Path) -> dict: + from M02_MasterTemplete import M02_Doc_FromNative as fn + from M02_MasterTemplete import M02_San_Xlsx as sx + + raw = path.read_bytes() + if tag.startswith("엑셀:"): + return fn.pack(sx.read(path.name, raw), path.name) + return fn.read(path.name, raw) + + +def _money(got: dict) -> Any: + return {k: str(got.get(k)) for k in KEYS} if got.get("셈됨") else "못 셈" + + +def _links(row: dict) -> list: + out = [] + for it in row.get("호표") or []: + res = it.get("자원") or {} + find, mat = res.get("찾기") or {}, res.get("재료찾기") or {} + out.append( + [ + it.get("종류"), + it.get("이음"), + find.get("판정"), + find.get("키"), + mat.get("판정"), + mat.get("키"), + ] + ) + return out + + +def block(saved: dict, no: int) -> dict: + """블록 하나 → 지문 몸 {엑셀, 우리, 검산, 이음}.""" + from M02_MasterTemplete import M02_Doc_FromNative as fn + from M02_MasterTemplete import M02_Doc_Import as dim + from M02_MasterTemplete import M02_Sangeun_Doc as sd + from M02_MasterTemplete import M02_Sangeun_Imported as imp + + whole = imp._whole() + out = fn.emit(saved, no) + row = out["로직"] + sk = { + "키": "SK-999999", + "이름": row["이름"], + "단위": str(row.get("결과단위", "/")).split("/", 1)[-1], + } + sk |= {"바탕": None, "입력값": {}, "덮개": {}, "뺀줄": [], "더한줄": []} + sk[imp.KEY] = {"로직": row, "원본": out["원본"], "단가기준": "엑셀"} + sk = sd.clean(sk, None, whole) + got: dict[str, Any] = {"이음": _links(row)} + for basis in ("엑셀", "우리"): + one = {**sk, imp.KEY: {**sk[imp.KEY], "단가기준": basis}} + try: + got[basis] = _money(dim.run(dim.derive(one, None, whole), one, whole)) + except Exception as e: # noqa: BLE001 — 예외도 지문 + got[basis] = f"예외 {type(e).__name__}" + try: + c = imp.check(sk, whole) + got["검산"] = [c["같음"], sum(1 for x in c["줄"] if x.get("같음")), len(c["줄"])] + except Exception as e: # noqa: BLE001 + got["검산"] = f"예외 {type(e).__name__}" + return got + + +def blocks(full: bool) -> tuple[dict[str, str], int]: + """{「블록 갈래:이름#번」: 지문} · 건너뛴 견본 수.""" + from M02_MasterTemplete import M02_Doc_FromNative as fn + + out, skipped = {}, 0 + with hold_m01(), personal(): + for tag, path in sources().items(): + if not full and tag not in QUICK_BLOCKS: + continue + if not path or not path.exists(): + skipped += 1 + continue + saved = saved_of(tag, path) + nos = sorted(fn.numbers(saved)) + if not full: + step = max(1, len(nos) // QUICK_BLOCKS[tag]) + nos = nos[::step][: QUICK_BLOCKS[tag]] + for no in nos: + out[f"블록 {tag}#{no}"] = digest(block(saved, no)) + return out, skipped + + +# ── 엑셀 올림 · 호표 쪽 ───────────────────────────────────────────────── +def _fixed(book: dict) -> list: + from M02_MasterTemplete import M02_Hopyo_Fixed as hf + + linker, out = hf.Linker(True), [] + for h in book.get("호표") or []: + for ln in h.get("줄") or []: + fx = hf.line_of(ln, h["줄"], {}, set(), linker)["고정"] + out.append( + [ + h["번"], + ln.get("차례"), + {k: fx.get(k) for k in ("이름", "규격", "단위", "단가", "이음", "비율")}, + ] + ) + return out + + +def mats(book: dict, clues: list) -> list: + """재료 이음 표 [호표, 차례, 갈래, 호표 길 키, 단가산출 길 키, 산근 판정 · 방법].""" + from M02_MasterTemplete import M02_Hopyo_Fixed as hf + from M02_MasterTemplete import M02_Hopyo_Match as hm + from M02_MasterTemplete import M02_San_Link as sl + from M02_MasterTemplete import M02_San_MatFind as smf + + linker, out = hf.Linker(True), [] + for h in book.get("호표") or []: + for ln in h.get("줄") or []: + if hf.kind_of(ln) not in hm.MATERIAL_KINDS: + continue + a = (hf.line_of(ln, h["줄"], {}, set(), linker)["고정"]["이음"] or {}).get("자재") + src = {k: ln.get(k) or "" for k in ("이름", "규격", "단위")} + src |= {"종류": "자재", "코드": ln.get("코드") or ""} + with smf.clues_on(clues): + b, _ = sl.m01("재료", src, "") + found = src.get("재료찾기") or {} + out.append( + [ + h["번"], + ln.get("차례"), + ln.get("갈래"), + a, + b, + found.get("판정"), + found.get("방법"), + ] + ) + return out + + +def upload(tag: str, path: Path) -> dict[str, Any]: + """엑셀 하나 올림(임시 층) → {올림, 목록, 칠, 고정, 재료} 지문 몸.""" + from M02_MasterTemplete import M02_Doc_FromNative as fn + from M02_MasterTemplete import M02_Hopyo_Marks as marks + from M02_MasterTemplete import M02_Hopyo_Router as router + from M02_MasterTemplete import M02_Hopyo_Store as hstore + from M02_MasterTemplete import M02_Hopyo_View as view + from M02_MasterTemplete import M02_MasterTemplete_Store as store + from M02_MasterTemplete import M02_San_Book as sb + from M02_MasterTemplete import M02_San_Xlsx as sx + + data = path.read_bytes() + try: + row = router._upload(path.name, data, {"id": 42, "이름": "시험"}) + except store.StoreError as e: + return {"올림": f"거절 {e.status} {e}"} + folder, key = store.root(), row["키"] + book = hstore.read(folder, key) + listing = view.listing(folder, key, folder) + sheets = sb.sheets(path.name, data) + clues = (fn.pack(sx.read_sheets(sheets), path.name) if sb.kind_of(sheets) else {}).get("단서") + return { + "올림": {k: row.get(k) for k in ("시트", "호표수", "읽기불가")}, + "목록": {k: listing.get(k) for k in ("호표", "단산", "검산")}, + "칠": marks.blocks(folder, key), + "고정": _fixed(book), + "재료": mats(book, clues or []), + } + + +def uploads(full: bool) -> tuple[dict[str, str], dict[str, list], int]: + """({「올림 이름 갈래」: 지문}, {이름: 재료 이음 표}, 건너뛴 수).""" + out, table, skipped = {}, {}, 0 + with hold_m01(), personal(): + for tag, path in sources().items(): + name = tag.split(":", 1)[1] + if not tag.startswith("엑셀:") or (not full and name not in QUICK_UPLOAD): + continue + if not path or not path.exists(): + skipped += 1 + continue + got = upload(tag, path) + for part, body in got.items(): + out[f"올림 {name} {part}"] = digest(body) + table[name] = got.get("재료") or [] + return out, table, skipped + + +def mat_counts(table: dict[str, list]) -> dict[str, dict[str, int]]: + """재료 이음 전후 표(`m857_mat` 꼴) — 같음(이음) · 같음(못 이음) · 생김 · 풂 · 다른 품목.""" + out = {} + for name, rows in table.items(): + c: dict[str, int] = {} + for r in rows: + a, b = r[3], r[4] + if a == b: + k = "같음(이음)" if a else "같음(못 이음)" + else: + k = "풀림" if a and not b else "생김" if b and not a else "다른 품목" + c[k] = c.get(k, 0) + 1 + out[name] = c + return out diff --git a/resources/tester/test_857_import_golden.py b/resources/tester/test_857_import_golden.py new file mode 100644 index 000000000..64031cef3 --- /dev/null +++ b/resources/tester/test_857_import_golden.py @@ -0,0 +1,70 @@ +"""857-0 지킴 — 불러오기 지문(걸음 4 동안 「다름 0」 자 · 도우미 `helper_857_import`). + +- 블록 = 원파일 EST · STC · 실무 엑셀 블록마다 엑셀 판 · 우리 판 문서 셈(노 · 재 · 경 · 계) · + 검산 판정 · 줄 이음 판정. +- 올림 = 실무 엑셀을 임시 개인 층에 올림 → 거절 | 호표 목록 · 칠 · 고정 줄 · 재료 이음 표. +- 재료 이음 전후 표 = 호표 길 키 대 단가산출 길 키 갈래 수(857-4 의 기준). +- 기본 = 빠른 표본(`QUICK_*`) · 전수 = 환경 `S857_ALL=1` · 견본 없는 PC = 그 갈래 건너뜀(수를 글로). +- 다르면 실패 + 갈래 이름 — 뜻대로 바꾼 걸음만 다시 뜸(바뀐 갈래를 커밋 글에): + `S857_ALL=1 ./venv/Scripts/python.exe resources/tester/test_857_import_golden.py --write` +""" + +from __future__ import annotations + +import json +import os +import sys +import warnings +from pathlib import Path + +import pytest + +HERE = Path(__file__).resolve().parent +sys.path.insert(0, str(HERE)) +import helper_857_import as h # noqa: E402 + +FILE = HERE / "golden_857_import.json" +REDO = "S857_ALL=1 ./venv/Scripts/python.exe resources/tester/test_857_import_golden.py --write" +ALL = os.environ.get("S857_ALL") == "1" + + +def _want() -> dict: + return json.loads(FILE.read_text("utf-8")) + + +def _compare(got: dict[str, str], want: dict[str, str], skipped: int) -> None: + if not got: + pytest.skip(f"견본 없음 — 건너뜀 {skipped}") + missing = sorted(k for k in got if k not in want) + changed = sorted(k for k in got if k in want and want[k] != got[k]) + gone = sorted(k for k in want if k not in got) if ALL and not skipped else [] + assert not (missing or changed or gone), ( + f"지문 다름 — 바뀜 {len(changed)} {changed[:15]} · 새 {missing[:10]} · 빠짐 {gone[:10]}" + f" · 건너뜀 {skipped}\n뜻대로 바꾼 걸음이면 다시 뜸: {REDO}" + ) + if skipped: + warnings.warn(f"견본 없어 건너뜀 {skipped}", stacklevel=2) + + +def test_블록_두_판_검산_이음_지문_같음(): + got, skipped = h.blocks(ALL) + _compare(got, _want()["블록"], skipped) + + +def test_엑셀_올림_호표_목록_칠_고정_재료_지문_같음(): + got, table, skipped = h.uploads(ALL) + _compare(got, _want()["올림"], skipped) + want = _want()["재료표"] + assert {k: v for k, v in h.mat_counts(table).items()} == {k: want[k] for k in table} + + +if __name__ == "__main__": + if "--write" not in sys.argv or not ALL: + sys.exit(f"다시 뜨기 = {REDO}") + blocks, skip_b = h.blocks(True) + ups, table, skip_u = h.uploads(True) + body = {"판": 1, "블록": blocks, "올림": ups, "재료표": h.mat_counts(table)} + FILE.write_text( + json.dumps(body, ensure_ascii=False, indent=1, sort_keys=True) + "\n", "utf-8", newline="\n" + ) + print(f"블록 {len(blocks)} · 올림 {len(ups)} · 건너뜀 {skip_b + skip_u} → {FILE.name}") From 97b1278a936ccd4abd9f3866cd20cb4f59df943d Mon Sep 17 00:00:00 2001 From: umsangdon Date: Tue, 17 Nov 2026 18:41:24 +0900 Subject: [PATCH 14/30] =?UTF-8?q?test(858-5-0):=20=EC=B8=B5=20=EC=84=9C?= =?UTF-8?q?=EA=B3=A0=20=EC=A7=80=ED=82=B4=20=E2=80=94=20=EC=84=9C=EB=B2=84?= =?UTF-8?q?=20=EA=B8=B8=20=EB=8B=B5=20=EC=A7=80=EB=AC=B8=20=C2=B7=20?= =?UTF-8?q?=EB=8F=99=EC=8B=9C=20=EC=93=B0=EA=B8=B0=20=EC=8B=9C=ED=97=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 새 test_858_shelf_golden.py — 임시 storage 견본 층(단가산출 · 일위대가 · 구조물 조합 항목 · 내 기계 · 내 재료 · 공유 요청)에서 목록 · 나무 · 만들기 · 고치기 · 지우기 · 복사 · 붙여넣기 · 합치기 · 되돌림 · 쓰는 곳 · 권한(다섯 사람 · 남의 층 403 · 404) 길 답을 갈래마다 지문 - 지문 = fixtures/m02_858_shelf_golden.json · 다르면 갈래 이름 + 지금 답 + 다시 뜨는 법(SHELF_858_WRITE=1)으로 실패 · 시각 · uuid 가림 · 판 = 갈래 안 차례 번호 - 동시 쓰기 셋 — 나무 고침 둘 · 지우기 + 고침 · 지우기 + 합치기 같은 판 · 지금 사실 단언(뒤 것이 이김 · 뒤 합치기 터짐) · 「5-4 에서 뒤집을 단언」 표시 - 제품 코드 고침 0 · 견본 = test_m02_labor_ref 의 world 재사용 Co-Authored-By: Claude Opus 5.5 --- .../tester/fixtures/m02_858_shelf_golden.json | 54 ++ resources/tester/test_858_shelf_golden.py | 469 ++++++++++++++++++ 2 files changed, 523 insertions(+) create mode 100644 resources/tester/fixtures/m02_858_shelf_golden.json create mode 100644 resources/tester/test_858_shelf_golden.py diff --git a/resources/tester/fixtures/m02_858_shelf_golden.json b/resources/tester/fixtures/m02_858_shelf_golden.json new file mode 100644 index 000000000..811c7eaee --- /dev/null +++ b/resources/tester/fixtures/m02_858_shelf_golden.json @@ -0,0 +1,54 @@ +{ + "갈래": { + "precombo.고치기": "600ec92b1b7fabe4", + "precombo.나무": "d08cff9db9575c99", + "precombo.되돌림": "ce11ade1bd96129c", + "precombo.만들기": "e53ad45acbf386bc", + "precombo.목록": "20bd9f3f0803cb91", + "precombo.복사": "ea957146cf361b70", + "precombo.붙여넣기": "236bf55301ef9045", + "precombo.쓰는곳": "8f68c3d2501f7a53", + "precombo.읽기": "c822ceb7cedfc59d", + "precombo.중복": "6f783eab99eb8095", + "precombo.지우기": "a356d2496ae34f51", + "precombo.합치기": "2010fbd1ab774d86", + "sangeun.고치기": "e47e5593c71f5a56", + "sangeun.나무": "991823a8c1fe1913", + "sangeun.되돌림": "6ca25af01d1d38ab", + "sangeun.만들기": "2155d280fd6d97ae", + "sangeun.목록": "a75cf0387e16ed84", + "sangeun.복사": "40edbd4d0644186f", + "sangeun.붙여넣기": "57cfb7bb522a80d3", + "sangeun.쓰는곳": "2c9ec1824709481f", + "sangeun.읽기": "6f5b02af37f2b55b", + "sangeun.중복": "e4d3ff3235a8d0b9", + "sangeun.지우기": "db8b1e8ad9bef9eb", + "sangeun.합치기": "5a6d9e24d05ae1af", + "공유.거절": "9a38b16329ed7c68", + "공유.목록": "eccff54e8114d69c", + "공유.봄": "a3bdb64cc1be2935", + "공유.승인": "ec5183ff8c81f5c8", + "공유.요청": "762ba10d5af57643", + "권한.같은회사남": "2d3d50a90583497d", + "권한.남의회사관리": "a1213c908c70528f", + "권한.시스템": "ee1c88a183b2740f", + "권한.일반": "9a05899de41301f2", + "권한.회사관리": "d6da88af7fe80323", + "내기계.고치기": "3f00365dbfb77cee", + "내기계.만들기": "20f5562f02c276f8", + "내기계.목록": "064102da4c9740d6", + "내기계.쓰는곳": "7bd823f7780c6f86", + "내기계.읽기": "0e5467fc806d83ff", + "내기계.지우기": "6db3b2b387f87ce7", + "내기계.찾기": "feca2de012a206ee", + "내재료.고치기": "60c0d3337d7dde06", + "내재료.만들기": "9fec4ce2a9bbfb82", + "내재료.목록": "9c5929426719e9ae", + "내재료.지우기": "9c194d1b5367920e", + "항목.나무": "abb5815352e81102", + "항목.목록": "f7ff1a6372bf308f", + "항목.복사": "b37ed4bfc45e5032", + "항목.붙여넣기": "2324914f36f4b24e", + "항목.지우기": "1fd673b8f7e3bab1" + } +} diff --git a/resources/tester/test_858_shelf_golden.py b/resources/tester/test_858_shelf_golden.py new file mode 100644 index 000000000..64f489d2c --- /dev/null +++ b/resources/tester/test_858_shelf_golden.py @@ -0,0 +1,469 @@ +# ruff: noqa: F811 — 임시 층 fixture(world)를 test_m02_labor_ref 에서 받아 씀 +"""858 5-0 층 서고 지킴 — 서버 길 답 지문 · 동시 쓰기(임시 storage · 제품 코드 안 고침). + +① 지문 — 견본 층(단가산출 · 일위대가 · 구조물 조합 항목 · 내 기계 · 내 재료 · 공유 요청)에서 + 목록 · 나무 · 만들기 · 고치기 · 지우기 · 복사 · 붙여넣기 · 합치기 · 되돌림 · 쓰는 곳 · 권한 길을 + 차례로 불러 답(상태 + 몸)을 갈래마다 지문으로 → `fixtures/m02_858_shelf_golden.json` 과 같음. + 다르면 갈래 이름 + 지금 답 + 다시 뜨는 법으로 실패(건너뛰지 않음). 다시 뜸 = + `SHELF_858_WRITE=1 ./venv/Scripts/python.exe -m pytest resources/tester/test_858_shelf_golden.py` + (뜻한 바뀜일 때만 · 커밋 글에 까닭). 답 통째 전후 대조 = `SHELF_858_DUMP=tmp/<파일>.json`. +② 동시 쓰기 — 잠금 없는 나무 고침 · 나무 지우기 · 합치기를 같은 판으로 겹쳐 부름. 지금 사실을 + 그대로 단언(나무 = 둘 다 됨 · 뒤 것이 이김 · 지우기 + 합치기 = 앞 것이 이기고 뒤 것은 터짐) — + 「5-4 에서 뒤집을 단언」 표시 줄은 5-4 가 바꿈. +""" + +from __future__ import annotations + +import hashlib +import json +import os +import threading +from concurrent.futures import ThreadPoolExecutor +from pathlib import Path +from typing import Any + +import pytest +from fastapi import FastAPI +from fastapi.testclient import TestClient + +from common_util.common_util_auth import verify_session +from M02_MasterTemplete import M02_Labor_Router as labor_router +from M02_MasterTemplete import M02_Library_Same_Router as same_router +from M02_MasterTemplete import M02_MasterTemplete_Router_Items as items_router +from M02_MasterTemplete import M02_MasterTemplete_Router_Layers as layers_router +from M02_MasterTemplete import M02_MasterTemplete_Store as store +from M02_MasterTemplete import M02_MyMachine_Look as look_router +from M02_MasterTemplete import M02_MyMachine_Router as machine_router +from M02_MasterTemplete import M02_Precombo_Folders as pre_folders +from M02_MasterTemplete import M02_Share_Request as share +from resources.tester.test_m02_labor_ref import world # noqa: F401 — 같은 임시 층 + +GOLD = Path(__file__).resolve().parent / "fixtures" / "m02_858_shelf_golden.json" +WRITE = "SHELF_858_WRITE" +USER = {"user_id": 42, "company_id": 7, "role": "USER", "is_master": False, "name": "갑"} +NEIGHBOR = {**USER, "user_id": 43, "name": "을"} # 같은 회사 남 +ADMIN = {**USER, "user_id": 50, "role": "ADMIN", "name": "관리"} # 회사 7 관리자 +SYSADMIN = {**USER, "user_id": 1, "role": "SYSTEM_ADMIN", "name": "시스템"} +STRANGER = {"user_id": 90, "company_id": 9, "role": "ADMIN", "is_master": False, "name": "남"} +MEMBERS = {42: 7, 43: 7, 44: 7, 50: 7, 1: 7, 90: 9} +P = "/api/m02/layers/personal" +MASK = {"날짜", "때", "처리날짜", "수정일", "넣은날", "고친날"} # 실행마다 다른 시각 +PREFIX = {"sangeun": "SK", "precombo": "SC"} + + +@pytest.fixture() +def shelf(world, monkeypatch, tmp_path): + async def member(owner: str) -> bool: + company, _, user = owner.partition("/") + return MEMBERS.get(int(user)) == int(company) if user else int(company) in (7, 9) + + async def note(session: dict[str, Any], got: Any) -> None: + return None + + monkeypatch.setattr(items_router, "_member", member) + monkeypatch.setattr(items_router, "_note", note) + app = FastAPI() + for one in ( + layers_router, + items_router, + labor_router, + same_router, + machine_router, + look_router, + share, + ): + app.include_router(one.router) + session = dict(USER) + app.dependency_overrides[verify_session] = lambda: session + return Shelf(TestClient(app), session, str(tmp_path)) + + +class Shelf: + """길을 부르고 답을 갈래마다 모음 — 갈래 = 「종류.일」.""" + + def __init__(self, client: TestClient, session: dict[str, Any], tmp: str): + self.client, self.session, self.tmp = client, session, tmp + self.got: dict[str, list[Any]] = {} + self.seq: dict[str, dict[str, str]] = {} # 갈래마다 값 → 차례 표 + self.home: dict[str, str] = {} # 값 → 처음 본 갈래 표(길 글자용) + + def who(self, person: dict[str, Any]) -> None: + self.session.clear() + self.session.update(person) + + def go(self, branch: str, method: str, url: str, body: Any = None) -> Any: + res = self.client.request(method, url, json=body) + try: + out = res.json() + except ValueError: + out = res.text + who = self.session.get("user_id") + local = self.seq.setdefault(branch, {}) + for raw, mark in self.home.items(): # 길 글자 속 uuid · 판도 같은 표로 + url = url.replace(raw, local.get(raw) or mark) + row = [who, method, url, res.status_code, self.clean(out, branch)] + self.got.setdefault(branch, []).append(row) + return out + + def clean(self, value: Any, branch: str) -> Any: + """실행마다 다른 것만 가림 — 임시 폴더 · 시각 · uuid 와 판(갈래 안 처음 본 차례 번호 — 같은 + 값은 같은 번호라 「409 판 = 앞서 받은 판」 같은 이음은 그대로 잼 · 한 갈래가 바뀌어도 다른 + 갈래 번호는 안 밀림).""" + local = self.seq.setdefault(branch, {}) + if isinstance(value, dict): + out = {} + for k, v in value.items(): + if (k == "id" or k.endswith("판")) and isinstance(v, str) and v: + out[k] = local.setdefault(v, f"<{k}{len(local) + 1}>") + self.home.setdefault(v, f"<{branch}{out[k][1:]}") + elif k in MASK and v is not None: + out[k] = "<가림>" + else: + out[k] = self.clean(v, branch) + return out + if isinstance(value, list): + return [self.clean(v, branch) for v in value] + if isinstance(value, str): + return value.replace(self.tmp, "").replace(self.tmp.replace("\\", "/"), "") + return value + + +def _finger(answers: list[Any]) -> str: + text = json.dumps(answers, ensure_ascii=False, sort_keys=True, default=str) + return hashlib.sha256(text.encode()).hexdigest()[:16] + + +# ── 견본 ────────────────────────────────────────────────────────────── +def _fixed(price: int, kind: str) -> dict[str, Any]: + line = {"고정": {"이름": "운반", "단위": "식", "단가": {"경비": price}}} + return {**line, "수량": 1 if kind == "sangeun" else {"손": 1}} + + +def _doc(kind: str, name: str, price: int) -> dict[str, Any]: + field = "더한줄" if kind == "sangeun" else "담은로직" + return {"이름": f"sub4임시{name}", "단위": "m", field: [_fixed(price, kind)]} + + +def _library(s: Shelf, world: dict[str, Any], kind: str) -> None: + b = f"{kind}." + lib, tree = f"{P}/library/{kind}", f"{P}/{kind}-tree" + one = s.go(b + "만들기", "POST", lib, {"문서": _doc(kind, "가", 1000)})["이름"] + two = s.go(b + "만들기", "POST", lib, {"문서": _doc(kind, "나", 2000)})["이름"] + s.go(b + "만들기", "POST", lib, {"문서": _doc(kind, "가", 1000)}) # 같은 내용 + twin = s.go(b + "만들기", "POST", lib, {"문서": _doc(kind, "가", 1000), "새로": True})["이름"] + s.go(b + "복사", "POST", lib, {"본뜬": {"층": "personal", "주인": "7/42", "키": two}}) + s.go( + b + "복사", + "POST", + lib, + {"본뜬": {"층": "personal", "주인": "7/42", "키": f"{PREFIX[kind]}-999999"}}, + ) + spare = s.go(b + "만들기", "POST", lib, {"문서": _doc(kind, "다", 3000), "새로": True})["이름"] + s.go(b + "목록", "GET", f"{P}/templates") + + read = s.go(b + "읽기", "GET", f"{P}/templates/{kind}/{one}") + s.go(b + "읽기", "GET", f"{P}/templates/{kind}/{PREFIX[kind]}-999999") + edited = {**read["문서"], "이름": "sub4임시가고침"} + s.go(b + "고치기", "PUT", f"{P}/templates/{kind}/{one}", {"문서": edited, "판": read["판"]}) + s.go(b + "고치기", "PUT", f"{P}/templates/{kind}/{one}", {"문서": edited, "판": read["판"]}) + + 판 = s.go(b + "나무", "GET", tree)["판"] + for body in ( + {"op": "add-folder", "경로": [], "이름": "옹벽"}, + {"op": "add-folder", "경로": [], "이름": "옹벽"}, # 이미 있음 + {"op": "move", "키": one, "새경로": ["옹벽"]}, + {"op": "rename", "경로": ["옹벽"], "이름": "석축"}, + ): + got = s.go(b + "나무", "POST", tree, {**body, "판": 판}) + 판 = got.get("판", 판) + s.go(b + "나무", "POST", tree, {"op": "add-folder", "경로": [], "이름": "x", "판": "옛판"}) + + paste = {"from_layer": "personal", "대상": [{"경로": ["석축"]}], "경로": []} + s.go(b + "붙여넣기", "POST", f"{tree}/paste", paste) + s.go(b + "붙여넣기", "POST", f"{tree}/paste", {**paste, "대상": [{"경로": ["없음"]}]}) + + with store.at(world["personal"]): # 쓰는 곳 = 구조물 조합 열(740-1) + ref = {"참조": {"층": "personal", "주인": "7/42", "키": two}, "수량": {"손": 2}} + store.write("labor", f"u{kind}", "", {"열": f"u{kind}", "담은로직": [ref], "자재": []}) + s.go(b + "쓰는곳", "POST", f"{tree}/delete-check", {"대상": [{"키": two}]}) + s.go(b + "쓰는곳", "POST", f"{tree}/delete-check", {"대상": [{"경로": ["석축"]}]}) + + 판 = s.go(b + "나무", "GET", tree)["판"] + s.go(b + "지우기", "POST", tree, {"op": "delete", "대상": [{"키": two}], "판": 판}) + gone = s.go( + b + "지우기", "POST", tree, {"op": "delete", "대상": [{"키": two}], "판": 판, "확인": True} + ) + s.go(b + "지우기", "GET", f"{P}/templates/{kind}/{two}") + s.go(b + "지우기", "GET", f"{P}/templates/labor/u{kind}") + spare_판 = s.go(b + "읽기", "GET", f"{P}/templates/{kind}/{spare}")["판"] + s.go(b + "지우기", "DELETE", f"{P}/templates/{kind}/{spare}") # 판 없음 + s.go(b + "지우기", "DELETE", f"{P}/templates/{kind}/{spare}?판={spare_판}") + s.go(b + "지우기", "DELETE", f"{P}/templates/{kind}/{spare}?판={spare_판}") + + record = (gone.get("알림") or {}).get("기록") + s.go(b + "되돌림", "POST", f"{P}/{kind}-same/undo", {"키": record or "없음"}) + s.go(b + "되돌림", "GET", f"{P}/templates/labor/u{kind}") + s.go(b + "되돌림", "POST", f"{P}/{kind}-same/undo", {"키": "없음"}) + + found = s.go(b + "중복", "GET", f"{P}/{kind}-same") + keep = {"층": "personal", "주인": "7/42", "키": twin} + merge = {"남김": keep, "지움": [one], "판": found["판"]} + s.go(b + "합치기", "POST", f"{P}/{kind}-same/merge", {**merge, "판": "옛판"}) + s.go(b + "합치기", "POST", f"{P}/{kind}-same/merge", merge) + s.go(b + "되돌림", "POST", f"{P}/{kind}-same/undo", {"키": one}) + s.go(b + "목록", "GET", f"{P}/templates") + s.go(b + "나무", "GET", tree) + + +def _items(s: Shelf) -> None: + tree = f"{P}/tree" + 판 = s.go("항목.나무", "GET", tree)["판"] + for body in ( + {"op": "add-folder", "경로": [], "이름": "배수"}, + {"op": "add-item", "경로": ["배수"], "이름": "sub4임시측구", "단위": "m"}, + {"op": "add-item", "경로": [], "이름": "sub4임시옹벽", "단위": "m"}, + {"op": "rename", "경로": ["배수"], "이름": "수로"}, + {"op": "move", "경로": ["sub4임시옹벽"], "새경로": ["수로"]}, + {"op": "add-folder", "경로": [], "이름": "수로"}, # 이미 있음 + ): + got = s.go("항목.나무", "POST", tree, {**body, "판": 판}) + 판 = got.get("판", 판) + s.go("항목.나무", "POST", tree, {"op": "add-folder", "경로": [], "이름": "x", "판": "옛판"}) + s.go("항목.목록", "GET", "/api/m02/items?layer=personal") + s.go("항목.목록", "GET", "/api/m02/items") + paste = {"from_layer": "personal", "대상": [{"경로": ["수로"]}], "경로": []} + s.go("항목.붙여넣기", "POST", f"{P}/items/paste", paste) + system = s.go("항목.목록", "GET", "/api/m02/items") + key = system[0]["key"] if system else "없음" + s.go("항목.복사", "POST", f"{P}/items/copy", {"from_layer": "system", "key": key}) + s.go("항목.복사", "POST", f"{P}/items/copy", {"from_layer": "system", "key": "SS-999999"}) + 판 = s.go("항목.나무", "GET", tree)["판"] + s.go("항목.지우기", "POST", tree, {"op": "delete", "경로": ["수로(1)"], "판": 판}) + s.go("항목.나무", "GET", tree) + + +def _machines(s: Shelf) -> None: + m = f"{P}/my-machines" + easy = {"이름": "sub4임시기계", "규격": "1㎾", "방식": "바로"} + easy["값"] = {"가격": 1000, "손료계수": 2000, "주연료": 0, "주연료종류": "경유"} + made = s.go("내기계.만들기", "POST", m, {"줄": easy}) + key = made.get("줄", {}).get("키", "없음") + s.go("내기계.목록", "GET", m) + one = s.go("내기계.읽기", "GET", f"{m}/{key}") + fixed = {**easy, "값": {**easy["값"], "가격": 3000}} + s.go("내기계.고치기", "PUT", f"{m}/{key}", {"줄": fixed, "판": one.get("판")}) + s.go("내기계.고치기", "PUT", f"{m}/{key}", {"줄": fixed, "판": one.get("판")}) # 옛 판 + s.go("내기계.쓰는곳", "POST", f"{m}/{key}/impact", {"줄": fixed}) + s.go("내기계.찾기", "GET", f"{P}/my-machine-find?q=sub4") + s.go("내기계.목록", "GET", "/api/m02/layers/company/my-machines") + s.go("내기계.지우기", "DELETE", f"{m}/{key}") + s.go("내기계.지우기", "GET", f"{m}/{key}") + + +def _materials(s: Shelf) -> None: + m = f"{P}/materials" + bolt = {"이름": "sub4임시볼트", "규격": "M16", "단위": "EA", "값": 1200} + key = s.go("내재료.만들기", "POST", m, bolt).get("키", "없음") + s.go("내재료.만들기", "POST", m, {**bolt, "규격": "M20"}) + s.go("내재료.만들기", "POST", "/api/m02/layers/company/materials", bolt) + s.go("내재료.목록", "GET", m) + s.go("내재료.목록", "GET", "/api/m02/layers/company/materials") + s.go("내재료.고치기", "PUT", f"{m}/{key}", {**bolt, "값": 1500}) + s.go("내재료.지우기", "DELETE", f"{m}/{key}") + s.go("내재료.지우기", "DELETE", f"{m}/{key}") + s.go("내재료.목록", "GET", m) + + +def _share(s: Shelf) -> None: + url = "/api/m02/share-requests" + item = s.go("공유.요청", "GET", "/api/m02/items?layer=personal")[0]["key"] + pre = s.go("공유.요청", "POST", f"{P}/library/precombo", {"문서": _doc("precombo", "공유", 7)}) + one = s.go("공유.요청", "POST", url, {"종류": "item", "키": item, "글": " 회사 공용 "}) + s.go("공유.요청", "POST", url, {"종류": "item", "키": item}) # 요청 중 + two = s.go("공유.요청", "POST", url, {"종류": "precombo", "키": pre["이름"]}) + s.go("공유.요청", "POST", url, {"종류": "precombo", "키": "SC-999999"}) + s.go("공유.목록", "GET", url) + s.go("공유.승인", "POST", f"{url}/{one['id']}/approve", {"경로": []}) # 일반 = 403 + s.who(STRANGER) + s.go("공유.목록", "GET", url) + s.go("공유.승인", "POST", f"{url}/{one['id']}/approve", {"경로": []}) + s.who(ADMIN) + s.go("공유.목록", "GET", url) + s.go("공유.승인", "POST", f"{url}/{one['id']}/approve", {"경로": []}) + s.go("공유.승인", "POST", f"{url}/{one['id']}/approve", {"경로": []}) # 이미 끝남 + s.go("공유.거절", "POST", f"{url}/{two['id']}/reject", {"사유": " 겹침 "}) + s.go("공유.목록", "GET", "/api/m02/items?layer=company") + s.who(USER) + s.go("공유.목록", "GET", url) + s.go("공유.봄", "POST", f"{url}/seen") + s.go("공유.봄", "POST", f"{url}/seen") + + +READS = { # 남의 층 읽기 길(주인 붙임) + "목록": "/api/m02/layers/personal/templates", + "단가산출나무": "/api/m02/layers/personal/sangeun-tree", + "일위대가나무": "/api/m02/layers/personal/precombo-tree", + "항목나무": "/api/m02/layers/personal/tree", + "내기계": "/api/m02/layers/personal/my-machines", + "내재료": "/api/m02/layers/personal/materials", +} + + +def _access(s: Shelf) -> None: + people = {"일반": USER, "같은회사남": NEIGHBOR, "회사관리": ADMIN, "시스템": SYSADMIN} + people["남의회사관리"] = STRANGER + for n, (name, person) in enumerate(people.items()): + s.who(person) + for owner in ("7/42", "7/44"): # 44 = 아직 층 없음 + for what, url in READS.items(): + s.go(f"권한.{name}", "GET", f"{url}?owner={owner}") + s.go(f"권한.{name}", "GET", "/api/m02/layers/company/sangeun-tree") + s.go(f"권한.{name}", "GET", "/api/m02/layers/system/sangeun-tree") + new = {"문서": _doc("sangeun", f"권한{name}", 90 + n)} # 사람마다 다른 내용 + s.go(f"권한.{name}", "POST", "/api/m02/layers/company/library/sangeun", new) + s.go(f"권한.{name}", "POST", "/api/m02/layers/system/library/sangeun", new) + s.go(f"권한.{name}", "POST", f"{P}/library/sangeun?owner=7/42", new) + s.go(f"권한.{name}", "GET", f"{P}/sangeun-same?owner=7/42") + s.who(USER) + + +def test_서고_길_답_지문(shelf, world): + for kind in ("sangeun", "precombo"): + _library(shelf, world, kind) + _items(shelf) + _machines(shelf) + _materials(shelf) + _share(shelf) + _access(shelf) + now = {k: _finger(v) for k, v in sorted(shelf.got.items())} + if dump := os.environ.get("SHELF_858_DUMP"): # 전후 답 통째 대조용(자기 tmp/ 에) + Path(dump).write_text( + json.dumps(shelf.got, ensure_ascii=False, indent=1, default=str), "utf-8" + ) + if os.environ.get(WRITE): + text = json.dumps({"갈래": now}, ensure_ascii=False, indent=1) + "\n" + GOLD.write_bytes(text.encode()) # 줄 끝 LF + was = json.loads(GOLD.read_bytes())["갈래"] + bad = sorted(k for k in now.keys() | was.keys() if now.get(k) != was.get(k)) + if bad: + shown = {k: shelf.got.get(k) for k in bad} + text = json.dumps(shown, ensure_ascii=False, default=str)[:4000] + pytest.fail( + f"서고 길 답 지문이 다름 — 갈래 {bad}\n지금 답: {text}\n" + f"뜻한 바뀜이면 다시 뜸: {WRITE}=1 ./venv/Scripts/python.exe -m pytest {__file__}" + ) + + +# ── ② 동시 쓰기 — 잠금 없는 여러 파일 쓰기(설계 858 1-4 「잠금 없는 쓰기」 · 5-4 몫) ───────── +def _two(first, second, meet: list[tuple[Any, str]], late: tuple[Any, str]): + """둘을 같이 돌림 — 둘 다 판 대조를 지난 뒤 `meet` 함수 앞에서 만나고, 그 뒤 `second` 쪽 + `late` 함수를 늦춤 → (먼저 답 · 나중 답 — 예외면 예외).""" + gate = threading.Barrier(2, timeout=10) + slow = threading.local() + saved = [(late[0], late[1], getattr(*late))] + [(o, n, None) for o, n in meet] + + def later(*a, _real=saved[0][2], **k): + if getattr(slow, "on", False): + threading.Event().wait(0.3) + return _real(*a, **k) + + setattr(*late, later) # 안쪽 = 늦춤 · 바깥 = 만남(같은 함수면 만난 뒤 늦춤) + for i, (owner, name, _) in enumerate(saved[1:], 1): + inner = getattr(owner, name) + saved[i] = (owner, name, inner) + + def wait(*a, _inner=inner, **k): + gate.wait() + return _inner(*a, **k) + + setattr(owner, name, wait) + + def run(fn, is_late): + slow.on = is_late + try: + return fn() + except Exception as error: # 지금 사실(터짐)도 답으로 + return error + + try: + with ThreadPoolExecutor(2) as pool: + a = pool.submit(run, first, False) + b = pool.submit(run, second, True) + return a.result(), b.result() + finally: + for owner, name, real in reversed(saved): + setattr(owner, name, real) + + +def _sk(me: Path, name: str, price: int, again: bool = False) -> str: + from M02_MasterTemplete import M02_Library_Ask as ask + + with store.at(me): + return ask.create("sangeun", _doc("sangeun", name, price), again, None)["이름"] + + +def _edit(me: Path, body: dict[str, Any]): + def go(): + with store.at(me): + return pre_folders.edit(body, "sangeun", dict(USER)) + + return go + + +def _folders(me: Path) -> list[list[str]]: + with store.at(me): + return pre_folders.view("sangeun")["폴더"] + + +def test_동시_나무_고침_둘_다_됨_뒤_것이_이김(world): + me = world["personal"] + with store.at(me): + 판 = pre_folders.view("sangeun")["판"] + first, second = _two( + _edit(me, {"op": "add-folder", "경로": [], "이름": "가", "판": 판}), + _edit(me, {"op": "add-folder", "경로": [], "이름": "나", "판": 판}), + [(pre_folders, "apply_many")], + (pre_folders, "atomic_write_json"), + ) + assert first["알림"]["경로"] == ["가"] and second["알림"]["경로"] == ["나"] # 둘 다 됨 + assert _folders(me) == [["나"]] # 5-4 에서 뒤집을 단언 — 지금은 뒤 것이 이김(앞 「가」 사라짐) + + +def test_동시_나무_지우기와_고침_둘_다_됨_뒤_것이_이김(world): + me = world["personal"] + gone = _sk(me, "지울것", 1000) + with store.at(me): + 판 = pre_folders.view("sangeun")["판"] + first, second = _two( + _edit(me, {"op": "add-folder", "경로": [], "이름": "가", "판": 판}), + _edit(me, {"op": "delete", "대상": [{"키": gone}], "판": 판}), + [(pre_folders, "apply_many")], + (pre_folders, "atomic_write_json"), + ) + assert first["알림"]["경로"] == ["가"] and second["알림"]["기록"] # 둘 다 됨 + assert not (me / "sangeun" / f"{gone}.json").exists() + assert _folders(me) == [] # 5-4 에서 뒤집을 단언 — 지금은 뒤 것(지우기)이 이김(「가」 사라짐) + + +def test_동시_지우기와_합치기_앞_것이_이기고_뒤_것은_터짐(world): + me = world["personal"] + gone = _sk(me, "겹침", 1000) + keep = _sk(me, "겹침", 1000, again=True) + with store.at(me): + 판 = pre_folders.view("sangeun")["판"] + body = same_router.MergeBody( + 남김={"층": "personal", "주인": "7/42", "키": keep}, 지움=[gone], 판=판 + ) + first, second = _two( + _edit(me, {"op": "delete", "대상": [{"키": gone}], "판": 판}), + lambda: same_router.merge(dict(USER), me, "sangeun", body), + [(pre_folders, "apply_many"), (same_router, "_user_index")], + (same_router, "_user_index"), + ) + assert first["알림"]["기록"] == gone # 지우기 = 됨(기록 키 = 그 문서) + # 5-4 에서 뒤집을 단언 — 지금은 뒤 합치기가 판 · 지문 대조를 지난 뒤 사라진 파일에서 터짐 + # (화면 = 500) · 5-4 뒤 = 409 · 파일 앞판 그대로 + assert isinstance(second, FileNotFoundError) + assert not (me / "sangeun" / f"{gone}.json").exists() + assert (me / "sangeun" / f"{keep}.json").is_file() + assert [p.stem for p in (me / same_router.GONE).glob("*.json")] == [gone] # 지우기 기록만 From 06524d6182989b885de23e2d33478f4d7bff23a3 Mon Sep 17 00:00:00 2001 From: umsangdon Date: Tue, 17 Nov 2026 18:44:42 +0900 Subject: [PATCH 15/30] =?UTF-8?q?test(856-0):=20=EB=8B=A8=EA=B0=80?= =?UTF-8?q?=EC=82=B0=EC=B6=9C=20=ED=99=94=EB=A9=B4=20=EC=A7=80=ED=82=B4=20?= =?UTF-8?q?=E2=80=94=20=EA=B0=80=EC=A7=9C=20DOM=20=EC=8B=9C=ED=97=98(?= =?UTF-8?q?=EB=B6=80=EB=A6=84=20=EC=88=98=20=C2=B7=20=EC=88=A8=EC=9D=80=20?= =?UTF-8?q?=EB=AA=B8=20=C2=B7=20=EC=A4=84=20=EB=88=84=EB=A6=84=20=C2=B7=20?= =?UTF-8?q?=EB=A8=B8=EB=A6=AC=20=EB=9D=A0=20=C2=B7=20M01=20=EC=83=81?= =?UTF-8?q?=EC=84=B8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 단가산출 화면 열 때 /sangeun/calc 부름 수(바탕 있음 2 · 없음 1) · 숨은 상세 몸 DOM 2 - 일위대가 줄 누름 — SK 참조 줄 = 그 SK 줄 쌓기 · M01 로직 줄 = 옛 줄 모달(상세 몸) · 셈 주입 줄 - 머리 띠 넷(까닭 · M01 개정 · 빠진 줄 · 짝 잃음) 견본 답 · M01 로직 상세 그릇 꼴 - 지금 수치 그대로 단언 — 856-1 에서 뒤집음 Co-Authored-By: Claude Opus 5.5 --- resources/tester/helper_856_0_sk_screen.cjs | 415 ++++++++++++++++++++ resources/tester/test_856_0_sk_screen.py | 77 ++++ 2 files changed, 492 insertions(+) create mode 100644 resources/tester/helper_856_0_sk_screen.cjs create mode 100644 resources/tester/test_856_0_sk_screen.py diff --git a/resources/tester/helper_856_0_sk_screen.cjs b/resources/tester/helper_856_0_sk_screen.cjs new file mode 100644 index 000000000..497c2b03b --- /dev/null +++ b/resources/tester/helper_856_0_sk_screen.cjs @@ -0,0 +1,415 @@ +/* 856-0 헬퍼 — 단가산출 화면 · 일위대가 줄 누름 · 머리 띠 · M01 로직 상세(가짜 DOM · 진짜 코드) + * 진짜 = M02 단가산출 화면(`Sangeun_Detail` 과 그 이웃) · 일위대가 표(`Labor_Table`) · 줄 모달 · M01 상세 그릇 + * 가짜 = 부품 상자(표지 붙은 빈 상자) · 줄 쌓기 화면(그린 키만 적음) · 서버 부름(길 · 몸을 적고 견본 답) */ +const fs = require("fs"); +const path = require("path"); +const ROOT = path.resolve(__dirname, "..", ".."); +const ts = require(path.join(ROOT, "config", "node_modules", "typescript")); + +const camel = (s) => s.replace(/-([a-z])/g, (_, c) => c.toUpperCase()); +class Fake { + constructor(tag) { + this.tagName = String(tag).toUpperCase(); + this.children = []; + this.parentElement = null; + this.dataset = {}; + this.attrs = {}; + this.style = { setProperty() {} }; + this.hidden = false; + this.className = ""; + this.textContent = ""; + this.value = ""; + this.disabled = false; + this.classList = { add() {}, remove() {}, toggle() {}, contains: () => false }; + } + append(...xs) { + for (const x of xs) + if (x instanceof Fake) { + x.parentElement = this; + this.children.push(x); + } + } + prepend(...xs) { + this.append(...xs); + } + replaceChildren(...xs) { + this.children = []; + this.append(...xs); + } + remove() {} + get firstChild() { + return this.children[0] ?? null; + } + addEventListener() {} + removeEventListener() {} + setAttribute(k, v) { + this.attrs[k] = v; + if (k.startsWith("data-")) this.dataset[camel(k.slice(5))] = v; + } + removeAttribute() {} + contains() { + return false; + } + querySelector() { + return null; + } + focus() {} +} +globalThis.window = globalThis; +globalThis.addEventListener = () => {}; +globalThis.removeEventListener = () => {}; +globalThis.getComputedStyle = () => ({ overflowY: "visible" }); +globalThis.requestAnimationFrame = (f) => setTimeout(f, 0); +globalThis.HTMLElement = Fake; +globalThis.HTMLInputElement = class extends Fake {}; +globalThis.HTMLTextAreaElement = class extends Fake {}; +globalThis.document = { + createElement: (t) => new Fake(t), + body: new Fake("body"), + activeElement: null, +}; +globalThis.sessionStorage = { getItem: () => null, setItem() {}, removeItem() {} }; + +/** 표지 붙은 빈 상자 */ +const box = (tag, mark = {}, text = "") => { + const n = new Fake(tag); + for (const [k, v] of Object.entries(mark)) n.setAttribute(k, v); + n.textContent = text; + return n; +}; +const el = (tag, o = {}) => { + const n = box(tag, o.attrs ?? {}, o.text ?? ""); + n.className = o.className ?? ""; + n.append(...(o.children ?? [])); + return n; +}; +const button = (o = {}) => box("button", { "data-button": o.label ?? "" }); +const input = (o = {}) => { + const i = box("input"); + i.value = o.value ?? ""; + return { root: box("label", { "data-input": o.label ?? "" }, ""), input: i, setError() {} }; +}; +const modals = []; // 열린 모달 — 제목 · 몸 +const ui = { + ui_template_elements: { + el, + createButton: button, + createInputField: input, + showToast() {}, + showConfirmDialog: async () => true, + }, + ui_template_button: { createButton: button }, + ui_template_input: { createInputField: input }, + ui_template_banner: { createBanner: (o) => box("div", { "data-banner": o.tone }, o.text) }, + ui_template_badge: { createBadge: (text, tone) => box("span", { "data-badge": tone }, text) }, + ui_template_text: { createText: (text) => box("span", {}, text) }, + ui_template_checkbox: { createCheckbox: () => ({ root: box("label") }) }, + ui_template_card: { createCard: () => box("div") }, + ui_template_locale: { t: (k) => k, currentLanguageIndex: 0 }, + ui_template_modal: { + openModal: (o) => { + const body = box("div", { "data-modal": o.title }); + const head = box("div"); + const close = () => {}; + o.mount?.(body, close, head); + modals.push({ title: o.title, body, head, actions: o.actions ?? [] }); + return { close }; + }, + askConfirm: async () => true, + askText: async () => null, + showConfirmDialog: async () => true, + }, + ui_template_side_panels: { + createSidePanels: () => ({ current: () => null, root: box("div"), wrap: (m) => m }), + }, + ui_template_hopyo_grid: { + hopyoGrid: (blocks) => ({ + at: new Map(blocks[0].lines.map((_, i) => [i, [0, i]])), + columns: [], + rows: [], + }), + createHopyoGrid: (_blocks, o) => ((grid.onRowClick = o.onRowClick), { root: box("table") }), + hopyoCellClass: () => "", + }, +}; +const grid = { onRowClick: null }; + +// 줄 쌓기 화면 = 그린 키 · 저장 전 문서만 적음 +const stacks = []; +const screen = { + createStackScreen: (opt) => { + const s = { root: box("div", { "data-stack": "" }), draws: [], opt }; + stacks.push(s); + return { + root: s.root, + draw: (k) => s.draws.push({ key: k, memory: !k && !!opt.memory?.() }), + dirty: () => false, + save: async () => true, + discard: async () => {}, + canLeave: async () => true, + destroy() {}, + }; + }, +}; + +// 서버 부름 — 길 · 몸을 적고 견본 답 +const calls = []; +let skAnswer = () => ({}); +const api = { + call: async (p, init) => { + calls.push({ path: p, body: init?.body ? JSON.parse(init.body) : null }); + if (p.includes("/sangeun/calc")) return skAnswer(); + if (p.includes("/labor/")) return { 줄: [], 자재: [], 알약: [] }; + return {}; + }, + readTemplate: async (_l, _k, key) => ({ 문서: { 키: key, 이름: "견본", 단위: "㎡" }, 판: "1" }), + saveTemplate: async () => ({}), + getActiveLayer: () => "system", + getActiveOwner: () => null, +}; +const logicApi = { + fetchLogic: async (k) => ({ + logic: { 키: k, 이름: "기초", 결과단위: "원/㎡", 입력: [] }, + prices: {}, + file: "", + reasons: [], + }), + fetchAuto: async () => ({}), + setLogicApiPaths() {}, + ApiError: class extends Error {}, +}; + +const stubs = { + ...ui, + line_stack_screen: screen, + M02_MasterTemplete_Api_Fetch: api, + M01_MasterData_UI_Logic_Api: logicApi, + M02_MasterTemplete_Sangeun_Side: { + createSangeunSide: () => ({ wrap: (m) => m, set() {} }), + tabOf: () => ({}), + }, + M01_MasterData_UI_LogicLab_Ho: { buildHo: () => [box("div", { "data-ho": "" })] }, + M02_MasterTemplete_Sangeun_Unit: { buildUnitSwap: () => null, baseUnitOf: () => "" }, + M02_MasterTemplete_Labor_LogicMats: { logicMatRows: () => [] }, + M02_Labor_Values_Model: { + valueLine: () => ({ text: "", empty: 0 }), + keepKnown: (_a, b) => ({ kept: b }), + }, + M02_MasterTemplete_Labor_Grid: { + laborBlock: (cur) => ({ lines: cur.담은로직.map(() => ({ note: "", amounts: { sum: 1 } })) }), + }, + M02_DF_UnitPick: { createUnitPick: () => box("div"), NO_UNIT: "-" }, + M02_MasterTemplete_Labor_Unlinked: { unlinkedBar: () => null }, + M02_MasterTemplete_Labor_Text: { tc: (k) => k }, + M02_MasterTemplete_Labor_LibMeta: { libMeta: () => [] }, + M02_MasterTemplete_Labor_National: { nationalRows: () => [] }, +}; +const real = new Set([ + "M02_MasterTemplete_Sangeun_Detail", + "M02_MasterTemplete_Sangeun_Tabs", + "M02_MasterTemplete_Sangeun_Cover", + "M02_MasterTemplete_Sangeun_BaseHead", + "M02_Sangeun_Cover_Model", + "M02_Sangeun_Undo", + "M02_Born_Tag", + "M01_MasterData_UI_LogicLab_Detail", + "M02_MasterTemplete_Labor_Table", + "M02_MasterTemplete_Labor_SkEdit", + "M02_MasterTemplete_Labor_RowModal", + "M02_MasterTemplete_Labor_RowSk", + "M02_MasterTemplete_Labor_Api", + "M02_MasterTemplete_Labor_Calc", +]); + +const empty = () => + new Proxy(function () {}, { + get: (_, k) => (k === "then" ? undefined : empty()), + apply: () => undefined, + }); +const cache = new Map(); +function load(at) { + if (cache.has(at)) return cache.get(at); + const js = ts.transpileModule(fs.readFileSync(at, "utf8"), { + compilerOptions: { module: ts.ModuleKind.CommonJS, target: ts.ScriptTarget.ES2020 }, + }).outputText; + const mod = { exports: {} }; + cache.set(at, mod.exports); + const need = (p) => { + if (p.endsWith(".css")) return {}; + const name = path.basename(p); + if (stubs[name]) return stubs[name]; + if (p.startsWith("@config/")) return { API_BASE_URL: "" }; + if (!p.startsWith(".")) return empty(); + const r = `${path.resolve(path.dirname(at), p)}.ts`; + return real.has(path.basename(r, ".ts")) && fs.existsSync(r) ? load(r) : empty(); + }; + new Function("exports", "module", "require", js)(mod.exports, mod, need); + return mod.exports; +} +const M = (rel) => load(path.join(ROOT, rel)); +const tick = () => new Promise((r) => setTimeout(r, 0)); +const settle = async () => { + for (let i = 0; i < 20; i++) await tick(); +}; +const walk = (n, fn) => { + fn(n); + for (const c of n.children) walk(c, fn); +}; +const all = (root, pred) => { + const out = []; + walk(root, (n) => pred(n) && out.push(n)); + return out; +}; +/** 숨은 조상까지 보고 보이는가 */ +const shown = (n) => { + for (let x = n; x; x = x.parentElement) if (x.hidden) return false; + return true; +}; +const skCalls = () => calls.filter((c) => c.path.includes("/sangeun/calc")); +const plainAns = (o = {}) => ({ + 기준: null, + 줄: [ + { 이름: "보통인부", cid: "labor:LB1#0", 수량: 1, 단가: 100, 금액: 100, 비목: { 노무비: 100 } }, + ], + 정체: ["labor:LB1#0"], + 짝잃음: [], + 빠진줄: [], + 바탕판: "v1", + ...o, +}); + +/** 단가산출 화면 한 벌 열기 — 부름 수 · 숨은 몸 · 줄 쌓기 그림 · 띠 */ +async function openSk(doc, opt = {}) { + calls.length = 0; + stacks.length = 0; + const { mountSangeunDetail } = M("M02_MasterTemplete/M02_MasterTemplete_Sangeun_Detail.ts"); + const host = box("div"); + const h = mountSangeunDetail(host, doc, { + layer: "system", + owner: null, + readOnly: false, + onChanged() {}, + ...opt, + }); + await settle(); + const s = stacks[stacks.length - 1]; + const r = { + calc: skCalls().length, + body: all(host, (n) => "skCover" in n.dataset || "ho" in n.dataset).length, // 몸 DOM(덮개 그릇 · 호표) + bodyShown: all(host, (n) => "skCover" in n.dataset && shown(n)).length, + stack: s ? { shown: shown(s.root), draws: s.draws } : null, + banners: all(host, (n) => "banner" in n.dataset).map((n) => n.dataset.banner), + badges: all(host, (n) => "badge" in n.dataset).map((n) => [n.dataset.badge, n.textContent]), + }; + h.destroy(); + return r; +} + +(async () => { + const out = {}; + skAnswer = () => plainAns(); + // ① 단가산출 화면(페이지) — 바탕 있음 · 없음 + out.page_base = await openSk( + { 키: "SK-000001", 이름: "견본", 단위: "㎡", 바탕: { 로직: "GC001109" } }, + { source: true }, + ); + out.page_nobase = await openSk({ 키: "SK-000002", 이름: "견본", 단위: "㎡" }, { source: true }); + // 불러오기 미리 보기(저장 전 가져온 식) + out.memory = await openSk({ 이름: "가져온", 단위: "식", 가져온: { 파일: "x" } }); + + // ③ 머리 띠 넷(견본 답) — 까닭 · M01 개정 · 빠진 줄 · 짝 잃음 + 머리 배지 + skAnswer = () => + plainAns({ + 까닭: "못 셈", + 빠진줄: [{ cid: "labor:LB2#1", 이름: "특별인부", 까닭: "입력 없음" }], + 짝잃음: [{ cid: "labor:LB9#0", 까닭: "줄 없음" }], + 바탕판: "v2", + 머리: "계", + }); + out.bands = await openSk( + { 키: "SK-000003", 이름: "띠", 단위: "㎡", 바탕: { 로직: "GC001109" }, 바탕판: "v1" }, + { source: true }, + ); + skAnswer = () => { + throw new Error("서버 못 닿음"); + }; + out.bands_fail = await openSk({ 키: "SK-000004", 이름: "띠", 단위: "㎡" }, { source: true }); + skAnswer = () => plainAns(); + + // ② 일위대가 표 줄 누름 — SK 참조 줄 · M01 로직 줄 · 셈 주입(프로젝트 사본) SK 줄 + const { mountLaborTable } = M("M02_MasterTemplete/M02_MasterTemplete_Labor_Table.ts"); + const rows = [ + { + 참조: { 층: "system", 주인: null, 키: "SK-000010" }, + 별칭: null, + 메모: null, + 수량: { 손: 1 }, + }, + { 로직: "GC001109", 별칭: null, 메모: null, 입력값: {}, 수량: { 손: 1 } }, + ]; + const click = async (calc) => { + const res = []; + for (let i = 0; i < rows.length; i++) { + const t = mountLaborTable( + box("div"), + { 담은로직: JSON.parse(JSON.stringify(rows)), 자재: [], 단위: "㎡" }, + { + mode: "precombo", + layer: "system", + column: "공통", + readOnly: false, + owner: null, + onChanged() {}, + ...(calc ? { calc: async () => ({ 줄: [], 자재: [] }) } : {}), + }, + ); + await settle(); + modals.length = 0; + stacks.length = 0; + calls.length = 0; + grid.onRowClick(i); + await settle(); + const m = modals[0]; + const s = stacks[0]; + res.push({ + modal: m ? m.title : null, + skModal: m ? all(m.body, (n) => "laborSk" in n.dataset).length : 0, // 그 SK 문서 모달(806-1) + stack: s ? { shown: shown(s.root), draws: s.draws.map((d) => d.key) } : null, + body: m ? all(m.body, (n) => "skCover" in n.dataset && shown(n)).length : 0, + banners: m ? all(m.body, (n) => "banner" in n.dataset).map((n) => n.dataset.banner) : [], + calc: skCalls().length, + }); + t.destroy?.(); + } + return res; + }; + out.labor = await click(false); + out.labor_inject = await click(true); + + // ④ M01 로직 상세 그릇 — 기본정보 접힘 + 줄 쌓기 + const { buildLabDetail } = M("M01_MasterData/M01_MasterData_UI_LogicLab_Detail.ts"); + const host = box("div"); + const stack = box("div", { "data-stack": "" }); + buildLabDetail(host, { + row: { + 키: "GC001109", + 원문번호: "1-1", + 이름: "기초", + 결과단위: "원/㎡", + 입력: [], + 중간: [], + 호표: [], + 덧줄: [], + }, + file: "f.json", + reasons: ["막힘"], + ownHost: box("div"), + onChange() {}, + stack, + }); + out.m01 = host.children.map((n) => n.tagName + (n.dataset.stack !== undefined ? ":stack" : "")); + console.log(JSON.stringify(out)); +})().catch((e) => { + console.error(e.stack || String(e)); + process.exit(1); +}); diff --git a/resources/tester/test_856_0_sk_screen.py b/resources/tester/test_856_0_sk_screen.py new file mode 100644 index 000000000..cd171acee --- /dev/null +++ b/resources/tester/test_856_0_sk_screen.py @@ -0,0 +1,77 @@ +# -*- coding: utf-8 -*- +"""PLAN 856-0 — 단가산출 화면 지킴(가짜 DOM · 진짜 코드 · `helper_856_0_sk_screen.cjs`). + +① 단가산출 화면을 열 때 서버 `/sangeun/calc` 부름 수 · 숨은 상세 몸 DOM · 줄 쌓기 그림 +② 일위대가 표 줄 누름 — 단가산출(SK) 참조 줄 = 그 SK 줄 쌓기 · M01 로직 줄 · 셈 주입(프로젝트 사본) 줄 +③ 머리 띠 넷(까닭 · M01 개정 · 빠진 줄 · 짝 잃음)이 뜨는 경우 — 견본 답 +④ M01 로직 상세 그릇 = 기본정보 접힘 + 줄 쌓기 +""" + +from __future__ import annotations + +import json +import os +import subprocess +from functools import lru_cache + +HERE = os.path.dirname(os.path.abspath(__file__)) + + +@lru_cache(maxsize=1) +def _run() -> dict: + proc = subprocess.run( + ["node", os.path.join(HERE, "helper_856_0_sk_screen.cjs")], + capture_output=True, + text=True, + encoding="utf-8", + ) + assert proc.returncode == 0, proc.stderr[-3000:] + return json.loads(proc.stdout) + + +def test_sk_page_open_calls_and_hidden_body() -> None: + got = _run() + # 바탕 있는 SK = 셈 두 번(바탕 원값 bare) · 바탕 없음 = 한 번 · 상세 몸 DOM 둘(덮개 그릇 · 호표) 숨김 + assert got["page_base"]["calc"] == 2 + assert got["page_nobase"]["calc"] == 1 + for k in ("page_base", "page_nobase", "memory"): + assert got[k]["body"] == 2, k + assert got[k]["bodyShown"] == 0, k + assert got[k]["stack"]["shown"] is True, k + assert {d["key"] for d in got["page_base"]["stack"]["draws"]} == {"SK-000001"} + # 불러오기 미리 보기(저장 전 가져온 식) = 빈 키 + 문서째 + assert all(d == {"key": "", "memory": True} for d in got["memory"]["stack"]["draws"]) + assert got["memory"]["calc"] == 1 + + +def test_labor_row_click() -> None: + sk, logic = _run()["labor"] + # 단가산출 참조 줄 = 그 SK 문서 모달 · 줄 쌓기가 그 키로 보임 · 몸 안 보임 + assert sk["skModal"] == 1 and sk["stack"]["shown"] is True + assert set(sk["stack"]["draws"]) == {"SK-000010"} and sk["body"] == 0 + # M01 로직 줄 = 옛 줄 모달 — 줄 쌓기 숨김 · 상세 몸 보임 · 안내 띠 하나 · 셈 둘(정체 + 상세) + assert logic["skModal"] == 0 and logic["stack"]["shown"] is False + assert logic["body"] == 1 and logic["banners"] == ["info"] and logic["calc"] == 2 + + +def test_labor_row_click_inject() -> None: + sk, logic = _run()["labor_inject"] + # 셈 주입(프로젝트 사본) = 옛 줄 모달 · 상세 없음 · 안내 띠 없음 · 셈 없음 + for row in (sk, logic): + assert row["modal"] and row["stack"] is None + assert row["body"] == 0 and row["banners"] == [] and row["calc"] == 0 + + +def test_head_bands_four() -> None: + got = _run() + # 까닭(빨강) · M01 개정 · 빠진 줄 · 짝 잃음(노랑) + 머리 배지 · 개정 배지 + assert got["bands"]["banners"] == ["danger", "warning", "warning", "warning"] + assert got["bands"]["badges"] == [["info", "계"], ["danger", "M02_SangeunRevisedBase"]] + # 서버 못 닿음 = 빨강 하나 + assert got["bands_fail"]["banners"] == ["danger"] + assert got["page_base"]["banners"] == [] and got["page_base"]["badges"] == [] + + +def test_m01_logic_detail_shape() -> None: + # 기본정보 접힘 · 막힘 까닭 · 줄 쌓기 — 단가산출 상세 몸 칸 없음 + assert _run()["m01"] == ["DETAILS", "DIV", "DIV:stack"] From ab217b8e8c1d38dcbd6d978402e06b4270c89ee0 Mon Sep 17 00:00:00 2001 From: umsangdon Date: Tue, 17 Nov 2026 19:03:02 +0900 Subject: [PATCH 16/30] =?UTF-8?q?refactor(858-5-2):=20=EC=B8=B5=20?= =?UTF-8?q?=ED=8F=B4=EB=8D=94=20=C2=B7=20=EC=B8=B5=20=ED=8C=90=EC=A0=95=20?= =?UTF-8?q?=ED=95=9C=20=EB=B2=8C=20=E2=80=94=20=EA=B0=9C=EC=9D=B8=20?= =?UTF-8?q?=EC=B8=B5=EB=A7=8C=20=EC=98=B5=EC=85=98=EC=9D=84=20`=5Froot`=20?= =?UTF-8?q?=EB=A1=9C=20=C2=B7=20=EB=82=B4=20=EA=B8=B0=EA=B3=84=20=EC=B8=B5?= =?UTF-8?q?=20=ED=8C=90=EC=A0=95=20=3D=20`Labor=5FRef.where`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - `Router_Items._root` 에 `personal`(개인 층만 받는 종류의 그 밖 층 404 글) — 층 폴더 찾기 한 길 - `MyMachine_Router._folder` = `_root(..., personal=…)` 한 줄(감쌈 껍데기는 5-8 에서 걷음 · 부르는 곳 그대로) - `MyMachine._user` 경로 부모 이름 판정 → `Labor_Ref.where`(같은 답 · 잠금 · 판 · 번호 장부 · `create` 꼴 그대로) - `Material_Own._personal` 은 이미 `where` — 고침 없음 · `Hopyo_Router._root` 는 857 몫이라 안 고침 - 지킴: test_858_shelf_golden 지문 50 갈래 같음(다시 뜨지 않음) · 관련 시험 252 통과 · test_855_golden · typecheck 0 · openapi 길 480 그대로 Co-Authored-By: Claude Opus 5.5 --- .../M02_MasterTemplete_Router_Items.py | 13 +++++++++++-- M02_MasterTemplete/M02_MyMachine.py | 12 ++++++------ M02_MasterTemplete/M02_MyMachine_Router.py | 6 ++---- 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/M02_MasterTemplete/M02_MasterTemplete_Router_Items.py b/M02_MasterTemplete/M02_MasterTemplete_Router_Items.py index 4afb42205..2580f8717 100644 --- a/M02_MasterTemplete/M02_MasterTemplete_Router_Items.py +++ b/M02_MasterTemplete/M02_MasterTemplete_Router_Items.py @@ -142,9 +142,18 @@ async def others_write(session: Session, got: access.Grant, folder: Path) -> Non pending.append((session, got)) -def _root(session: Session, layer: str, owner: str | None = None, write: bool = False) -> Path: +def _root( + session: Session, + layer: str, + owner: str | None = None, + write: bool = False, + personal: str | None = None, +) -> Path: """층 폴더(권한까지 · `M02_Layer_Access`) — 자기 회사 · 개인 층은 없으면 빈 뼈대를 만듦 · - 남의 층 쓰기(맡은 회사 · 39-6)는 `others_write`.""" + 남의 층 쓰기(맡은 회사 · 39-6)는 `others_write` · `personal` = 개인 층만 받는 종류(내 기계 + 등)의 그 밖 층 404 글(858 5-2 — 층 폴더 찾기 한 벌).""" + if personal and layer != "personal": + raise HTTPException(status_code=404, detail=personal) got = access.require(session, layer, owner, write=write) if layer == "system": return store.FOLDER diff --git a/M02_MasterTemplete/M02_MyMachine.py b/M02_MasterTemplete/M02_MyMachine.py index 2ceab589c..9a5f2b25f 100644 --- a/M02_MasterTemplete/M02_MyMachine.py +++ b/M02_MasterTemplete/M02_MyMachine.py @@ -410,14 +410,14 @@ def _seed(key: str) -> dict: def _user() -> str: - """개인 층(`storage/{회사}/{사용자}/templates`) 사용자 번호 — 그 밖 층 = 404.""" - from M02_MasterTemplete import M02_Template_Layers as layers + """개인 층(`storage/{회사}/{사용자}/templates`) 사용자 번호 — 그 밖 층 = 404 · 층 판정 = + `Labor_Ref.where` 한 벌(858 5-2).""" + from M02_MasterTemplete import M02_Labor_Ref as refs - here = store.root().resolve() - user, company = here.parent.name, here.parent.parent.name - if not (user.isdigit() and company.isdigit()) or here != layers.personal_dir(company, user): + layer, owner = refs.where(store.root()) + if layer != "personal" or not owner: raise _bad("내 기계는 개인 층만", 404) - return user + return owner.split("/")[1] def not_m01(raw: Any, skip: str = "") -> None: diff --git a/M02_MasterTemplete/M02_MyMachine_Router.py b/M02_MasterTemplete/M02_MyMachine_Router.py index 2637bf04b..725d07f61 100644 --- a/M02_MasterTemplete/M02_MyMachine_Router.py +++ b/M02_MasterTemplete/M02_MyMachine_Router.py @@ -13,7 +13,7 @@ from __future__ import annotations from typing import Any -from fastapi import APIRouter, Depends, HTTPException +from fastapi import APIRouter, Depends from pydantic import BaseModel from common_util.common_util_auth import verify_session @@ -32,9 +32,7 @@ class MachineBody(BaseModel): def _folder(session: Session, layer: str, owner: str | None, write: bool = False): - if layer != "personal": - raise HTTPException(status_code=404, detail="내 기계는 개인 층만") - return _root(session, layer, owner, write=write) + return _root(session, layer, owner, write=write, personal="내 기계는 개인 층만") @router.get(PATH) From e13c23c4e369d7ccff6cf1ee7a225817dddf4358 Mon Sep 17 00:00:00 2001 From: umsangdon Date: Tue, 17 Nov 2026 19:04:01 +0900 Subject: [PATCH 17/30] =?UTF-8?q?refactor(5-1):=20=EC=B8=B5=20=EC=93=B0?= =?UTF-8?q?=EA=B8=B0=20=EA=B6=8C=ED=95=9C=20=ED=8C=90=EB=8B=A8=20=ED=95=9C?= =?UTF-8?q?=20=EB=B2=8C=20=E2=80=94=20M02=5FLayer=5FAccess.can=5Fwrite=20?= =?UTF-8?q?=C2=B7=20=EA=B1=B0=EC=9A=B8=20=EC=8B=9C=ED=97=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - M02_Layer_Access 에 can_write(session, here) 더함(옛 Library_Delete.can_write 몸 옮김) - Library_Delete.can_write = access.can_write 별칭 · Library_Same_Router._can_write 는 access.can_write 부름(옛 이름 걷음은 5-8) - 새 거울 시험 test_858_1_access_mirror — 화면 accessFor ↔ 서버 can_write · grant 409 · 88 갈래 같음 - M02_MasterTemplete_Layer.ts 머리 글 한 줄(짝 시험 자리 · 코드 불변) Co-Authored-By: Claude Opus 5.5 --- M02_MasterTemplete/M02_Layer_Access.py | 13 ++- M02_MasterTemplete/M02_Library_Delete.py | 10 +-- M02_MasterTemplete/M02_Library_Same_Router.py | 3 +- .../M02_MasterTemplete_Layer.ts | 1 + resources/tester/test_858_1_access_mirror.py | 88 +++++++++++++++++++ 5 files changed, 104 insertions(+), 11 deletions(-) create mode 100644 resources/tester/test_858_1_access_mirror.py diff --git a/M02_MasterTemplete/M02_Layer_Access.py b/M02_MasterTemplete/M02_Layer_Access.py index 2a0cc5dc8..7c5238800 100644 --- a/M02_MasterTemplete/M02_Layer_Access.py +++ b/M02_MasterTemplete/M02_Layer_Access.py @@ -1,5 +1,6 @@ """M02 층 권한 한 벌 — 나무 · 항목(`Router_Items`) · 양식 · 남의 층 목록(`Router_Layers`)이 함께 씀 -(PLAN 27-1c). 화면 쪽 짝 = `M02_MasterTemplete_Layer.ts` 의 `accessFor`. +(PLAN 27-1c). 화면 쪽 짝 = `M02_MasterTemplete_Layer.ts` 의 `accessFor` · 거울 시험 +`test_858_1_access_mirror.py`. 서고 지우기 · 합치기 쓰기 판단도 `can_write` 한 벌(858-B). 「회사 C 를 맡음」(`manages` · 39-6) = SYSTEM_ADMIN · 또는 C 의 회사 관리자(ADMIN · 마스터). system 읽기 = 로그인 누구나 · 수정 = SYSTEM_ADMIN @@ -94,6 +95,16 @@ def require( return got +def can_write(session: dict[str, Any] | None, here: tuple[str, str | None]) -> bool: + """층 `here` = (층, 주인) 에 쓸 수 있나 — 읽기 못 함 · 회사 없음 · 모양 틀림도 False.""" + if session is None: + return False + try: + return grant(session, here[0], here[1]).write + except HTTPException: + return False + + def folder(got: Grant, create: bool = False) -> Path: """회사 · 개인 층 폴더 — 남의 층은 그 층 폴더가 있어야 함 · `create` = 쓰기(부르는 쪽이 소속을 본 뒤 뼈대를 만듦).""" diff --git a/M02_MasterTemplete/M02_Library_Delete.py b/M02_MasterTemplete/M02_Library_Delete.py index 9ecc46e87..4e8a678b3 100644 --- a/M02_MasterTemplete/M02_Library_Delete.py +++ b/M02_MasterTemplete/M02_Library_Delete.py @@ -22,8 +22,6 @@ from datetime import datetime from pathlib import Path from typing import Any -from fastapi import HTTPException - from common_util.common_util_json import atomic_write_json from M02_MasterTemplete import M02_Labor_Ref as refs from M02_MasterTemplete import M02_Layer_Access as access @@ -37,13 +35,7 @@ _ADD = re.compile(r"^add:#(\d+)(.*)$") _PATCH = ("덮개", "고름", "자재표시") -def can_write(session: dict[str, Any] | None, at: refs.Here) -> bool: - if session is None: - return False - try: - return access.grant(session, at[0], at[1]).write - except HTTPException: - return False +can_write = access.can_write # 쓰기 판단 한 벌(858-B) — 이름은 5-8 에서 걷음 def _hits(doc: dict[str, Any], rids: dict[str, str]) -> list[tuple[str, str]]: diff --git a/M02_MasterTemplete/M02_Library_Same_Router.py b/M02_MasterTemplete/M02_Library_Same_Router.py index 390350545..362261e12 100644 --- a/M02_MasterTemplete/M02_Library_Same_Router.py +++ b/M02_MasterTemplete/M02_Library_Same_Router.py @@ -34,6 +34,7 @@ from pydantic import BaseModel from common_util.common_util_auth import verify_session from common_util.common_util_json import atomic_write_json from M02_MasterTemplete import M02_Labor_Ref as refs +from M02_MasterTemplete import M02_Layer_Access as access from M02_MasterTemplete import M02_Library_Delete as deleting from M02_MasterTemplete import M02_Library_Flat as flat from M02_MasterTemplete import M02_Library_Same as same @@ -106,7 +107,7 @@ def _user_index() -> dict[str, list[tuple[Path, str, str]]]: def _can_write(session: Session, at: refs.Here) -> bool: - return deleting.can_write(session, at) + return access.can_write(session, at) def _retarget(doc: dict[str, Any], olds: set[str], new: refs.Ref) -> dict[str, Any]: diff --git a/M02_MasterTemplete/M02_MasterTemplete_Layer.ts b/M02_MasterTemplete/M02_MasterTemplete_Layer.ts index cee791ad5..77f586f5a 100644 --- a/M02_MasterTemplete/M02_MasterTemplete_Layer.ts +++ b/M02_MasterTemplete/M02_MasterTemplete_Layer.ts @@ -4,6 +4,7 @@ * `#/m02-master-template?open=구조물조합|옵션|도면|일위대가조합|단가산출&root=master|company|personal&owner=…&company=…&pre=…` * (옛 `?layer=` 도 root 로 읽음 · `pre` = 일위대가 사전조합 층 · 134-3) · 고칠 권한(`accessFor` — 서버 `M02_Layer_Access` 와 짝 · 27-1c) · * 회사 없음 안내 · 회사용 읽기만일 때 [개인용 복사] 막대. + * 짝 거울 시험 = `resources/tester/test_858_1_access_mirror.py`(`accessFor` ↔ 서버 `can_write` · `grant` 409). * ========================================================================== */ import { ROUTES } from "@config/config_frontend"; diff --git a/resources/tester/test_858_1_access_mirror.py b/resources/tester/test_858_1_access_mirror.py new file mode 100644 index 000000000..eae0e96a8 --- /dev/null +++ b/resources/tester/test_858_1_access_mirror.py @@ -0,0 +1,88 @@ +"""858-B 권한 짝 거울 시험 — 화면 `M02_MasterTemplete_Layer.ts` 의 `accessFor` 와 서버 +`M02_Layer_Access`(`can_write` · `grant` 409 = 회사 없음)가 같은 답을 내는지. + +사람 여덟 × 층 · 주인 열하나를 통째로 맞춤 — 고침(canWrite) · 회사부터 등록(needCompany). +""" + +from __future__ import annotations + +import itertools +import json +import re +import shutil +import subprocess +from pathlib import Path + +import pytest +from fastapi import HTTPException + +from M02_MasterTemplete import M02_Layer_Access as access + +LAYER = Path(__file__).resolve().parents[2] / "M02_MasterTemplete" / "M02_MasterTemplete_Layer.ts" + +PEOPLE = { + "시스템": {"id": "1", "role": "SYSTEM_ADMIN", "company_id": None}, + "시스템3": {"id": "1", "role": "SYSTEM_ADMIN", "company_id": 3}, + "관리자3": {"id": "5", "role": "ADMIN", "company_id": 3}, + "마스터3": {"id": "6", "role": "USER", "company_id": 3, "is_master": True}, + "일반3": {"id": "7", "role": "USER", "company_id": 3}, + "관리자9": {"id": "90", "role": "ADMIN", "company_id": 9}, + "회사없음": {"id": "8", "role": "USER", "company_id": None}, + "없음": None, +} +PLACES = [ + ("system", None), + ("company", None), ("company", "3"), ("company", "9"), + ("personal", None), ("personal", "3/7"), ("personal", "3/5"), ("personal", "3/1"), + ("personal", "9/90"), ("personal", "9/91"), ("personal", "3/8"), +] # fmt: skip + + +def _server(user: dict | None, layer: str, owner: str | None) -> dict[str, bool]: + session = None if user is None else {**user, "user_id": user["id"]} + try: + access.grant(session or {}, layer, owner) + need = False + except HTTPException as error: + need = error.status_code == 409 + return {"canWrite": access.can_write(session, (layer, owner)), "needCompany": need} + + +def _screen(cases: list) -> list[dict[str, bool]]: + text = LAYER.read_text(encoding="utf-8") + parts = [ + re.search(r"^export const ownOwner[\s\S]*?;\n", text, re.M), + re.search(r"^export function accessFor[\s\S]*?^}", text, re.M), + re.search(r"^export function manages[\s\S]*?^}", text, re.M), + ] + assert all(parts), "ownOwner · accessFor · manages 를 못 찾음" + script = ( + 'type ManageLayer = "system" | "company" | "personal";\n' + "interface SessionUser { id: string; role?: string; company_id?: number | null;" + " is_master?: boolean }\n" + "interface LayerAccess { canWrite: boolean; needCompany: boolean }\n" + + "\n".join(p.group(0).replace("export ", "") for p in parts) + + "\nconst cases = JSON.parse(process.argv[1]);" + + "\nconsole.log(JSON.stringify(cases.map((c) => accessFor(c[0], c[1], c[2]))));" + ) + result = subprocess.run( + ["node", "--experimental-strip-types", "--no-warnings", + "--input-type=module-typescript", "-e", script, json.dumps(cases)], + capture_output=True, text=True, encoding="utf-8", timeout=60, + ) # fmt: skip + assert result.returncode == 0, result.stderr + return json.loads(result.stdout) + + +@pytest.mark.skipif(shutil.which("node") is None, reason="node 가 없음") +def test_화면_서버_권한_같음(): + combos = list(itertools.product(PEOPLE.items(), PLACES)) + screen = _screen([[layer, owner, user] for (_n, user), (layer, owner) in combos]) + differ = [ + (name, layer, owner, got, _server(user, layer, owner)) + for ((name, user), (layer, owner)), got in zip(combos, screen, strict=True) + if got != _server(user, layer, owner) + ] + assert differ == [] + writes = sum(s["canWrite"] for s in screen) + assert 0 < writes < len(screen) # 고침 · 못 고침이 둘 다 나옴(빈 비교가 아님) From f8e317356a80c8ce8a84950adf12bcb6ae0b6e12 Mon Sep 17 00:00:00 2001 From: umsangdon Date: Tue, 17 Nov 2026 19:24:58 +0900 Subject: [PATCH 18/30] =?UTF-8?q?refactor(858-5-3):=20=ED=8C=90=20?= =?UTF-8?q?=ED=95=9C=20=EB=B2=8C=20=C2=B7=20=ED=94=84=EB=A1=9C=EC=A0=9D?= =?UTF-8?q?=ED=8A=B8=20=EC=B8=B5=20=EC=A0=80=EC=9E=A5=20=EC=9E=A0=EA=B8=88?= =?UTF-8?q?=20=E2=80=94=20`Template=5FLayers`=20=ED=8C=90=20=3D=20`Store.v?= =?UTF-8?q?ersion=5Fof`=20=C2=B7=20`write=5Ftemplate`=20=EC=9D=84=20`Store?= =?UTF-8?q?.=5FLOCK`=20=EC=95=88=EC=97=90=EC=84=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - `Template_Layers.version_of` · `read_template` 판 = `Store.version_of` 한 몸(같은 sha256 앞 16 자 · 판 값 안 바뀜) · hashlib 직접 셈 걷음 - `write_template` 판 대조 · 원자 쓰기를 `Store._LOCK` 안으로(대조와 쓰기 사이가 열려 있던 것) · 부르는 곳(층 길 프로젝트 저장 · B07 도각 · B08 옵션)이 잠금 안에서 부르지 않음 확인 - `Store` 는 고침 없음 · `Item_Source.version_of` 는 855 B9-5 몫이라 안 고침 - 지킴: test_858_shelf_golden 지문 같음 · 관련 시험 + 826_1 · 204_2 · 572 · 855_golden 485 통과 · typecheck 0 · openapi 길 480 그대로 · 검증_sub4 프로젝트 집계표 저장 = 판 같음 · 옛 판 409 · 파일 그대로 Co-Authored-By: Claude Opus 5.5 --- M02_MasterTemplete/M02_Template_Layers.py | 28 +++++++++++++++-------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/M02_MasterTemplete/M02_Template_Layers.py b/M02_MasterTemplete/M02_Template_Layers.py index 31f69c704..9513f016f 100644 --- a/M02_MasterTemplete/M02_Template_Layers.py +++ b/M02_MasterTemplete/M02_Template_Layers.py @@ -15,7 +15,6 @@ from __future__ import annotations -import hashlib import json import os import shutil @@ -137,10 +136,13 @@ def template_path(layer_dir: str | Path, kind: str, name: str) -> Path: def version_of(path: str | Path) -> str | None: + """파일 판 — 몸은 `Store.version_of` 한 벌(858 5-3 · Store 가 이 파일을 불러 안에서 부름).""" + from M02_MasterTemplete import M02_MasterTemplete_Store as store + path = Path(path) if not path.is_file(): return None - return hashlib.sha256(path.read_bytes()).hexdigest()[:16] + return store.version_of(path.read_bytes()) def _modified(path: Path) -> str: @@ -176,11 +178,13 @@ def read_template(layer_dir: str | Path, kind: str, name: str) -> dict[str, Any] path = template_path(layer_dir, kind, name) if not path.is_file(): return None + from M02_MasterTemplete import M02_MasterTemplete_Store as store + raw = path.read_bytes() return { "종류": kind, "이름": name, - "판": hashlib.sha256(raw).hexdigest()[:16], + "판": store.version_of(raw), "문서": json.loads(raw.decode("utf-8")), } @@ -257,16 +261,20 @@ def write_template( version: str | None = None, check_version: bool = False, ) -> str: - """원자 쓰기 → 새 판. `check_version` 이면 `version` 이 지금 판과 같아야 함(새 파일은 None).""" + """원자 쓰기 → 새 판. `check_version` 이면 `version` 이 지금 판과 같아야 함(새 파일은 None) · + 판 대조 · 쓰기 = `Store._LOCK` 안(858 5-3 — 대조와 쓰기 사이가 열려 있던 것).""" + from M02_MasterTemplete import M02_MasterTemplete_Store as store + if not isinstance(document, dict): raise ValueError("양식 문서는 JSON 객체여야 합니다.") path = template_path(layer_dir, kind, name) - if check_version: - current = version_of(path) - if current != (version or None): - raise StaleTemplate(current) - atomic_write_json(path, document) - return version_of(path) or "" + with store._LOCK: + if check_version: + current = version_of(path) + if current != (version or None): + raise StaleTemplate(current) + atomic_write_json(path, document) + return version_of(path) or "" def delete_template( From d6715dcec57eec6115494d2b04845a422dc3bc11 Mon Sep 17 00:00:00 2001 From: umsangdon Date: Tue, 17 Nov 2026 19:36:59 +0900 Subject: [PATCH 19/30] =?UTF-8?q?refactor(856-1):=20=EB=8B=A8=EA=B0=80?= =?UTF-8?q?=EC=82=B0=EC=B6=9C=20=EC=83=81=EC=84=B8=20=EB=AA=B8=20=EA=B1=B7?= =?UTF-8?q?=EA=B8=B0=20=E2=80=94=20=EC=A4=84=20=EC=8C=93=EA=B8=B0=20?= =?UTF-8?q?=ED=95=9C=20=EB=B2=8C=20=C2=B7=20=EC=97=B4=20=EB=95=8C=20?= =?UTF-8?q?=EC=84=9C=EB=B2=84=20=EC=85=88=20=ED=95=9C=20=EB=B2=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 지움: M01 LogicLab_Ho · LogicLab_Cover · M02 Sangeun_Cover_Model · Sangeun_Undo · Sangeun_BaseHead · Labor_RowSk - Sangeun_Detail: 숨긴 몸 · 바탕 원값(bare) 셈 · 덮개 고침 · 재료 고름 · 키 글자 약속(SK-000000) 걷음 → 모드 옵션(page · ref · memory) - Sangeun_Tabs: 몸 그릇 · 숨김 걷음 · Sangeun_Cover: 뺀 줄 띠 걷음 · 셈 보기 덧칸 끔(머리 띠는 안 씀) · 머리 띠 타입만 둠(856-2 에서 파일째) - 일위대가 줄 모달: 로직 줄 · 셈 주입 줄 = 안내 한 줄(856-3 까지) · 상세 · [적용] 걷음 · 줄 패치 칸 · 타입 걷음(저장본 0) - M01 LogicLab_Detail: M02 몸 칸 걷음(M01 보기 그대로) · 지운 파일만 쓰던 글 키 16 · CSS 규칙 걷음 - 시험: 지운 몸만 붙든 시험 지움(717_3 · 722 · 748_0 · helper 728_2 · 748_0) · 섞인 파일은 몸 꼴 · 글 대조 함수 · 줄만 지움(서버 셈 시험 남김) · 856-0 단언 뒤집음 - 수치: 열 때 /sangeun/calc 2 → 1 · 숨은 몸 DOM 2 → 0 · 화면 파일 줄 −1.9 천 안팎 Co-Authored-By: Claude Opus 5.5 --- .../M01_MasterData_UI_LogicLab_Cover.ts | 142 ---- .../M01_MasterData_UI_LogicLab_Detail.ts | 28 +- .../M01_MasterData_UI_LogicLab_Ho.ts | 689 ------------------ .../M01_MasterData_UI_LogicLab_Style.css | 88 --- .../M01_MasterData_UI_LogicLab_Text.ts | 6 - .../M02_MasterTemplete_Hopyo_Imported.ts | 1 + .../M02_MasterTemplete_Labor_Api.ts | 4 - .../M02_MasterTemplete_Labor_RowModal.ts | 116 +-- .../M02_MasterTemplete_Labor_RowSk.ts | 101 --- .../M02_MasterTemplete_Labor_SkEdit.ts | 2 +- .../M02_MasterTemplete_Labor_Table.ts | 6 +- .../M02_MasterTemplete_Sangeun.css | 50 +- .../M02_MasterTemplete_Sangeun_BaseHead.ts | 92 --- .../M02_MasterTemplete_Sangeun_Cover.ts | 78 +- .../M02_MasterTemplete_Sangeun_Detail.ts | 311 +------- .../M02_MasterTemplete_Sangeun_Tabs.ts | 27 +- .../M02_MasterTemplete_Sangeun_View.ts | 2 +- M02_MasterTemplete/logic/M02_Born_Tag.ts | 11 +- .../logic/M02_Sangeun_Cover_Model.ts | 627 ---------------- M02_MasterTemplete/logic/M02_Sangeun_Undo.ts | 93 --- resources/tester/helper_728_2_cover_unit.cjs | 44 -- resources/tester/helper_748_0_sk_undo.cjs | 102 --- resources/tester/helper_854_3_screen_leak.cjs | 2 +- resources/tester/helper_856_0_sk_screen.cjs | 10 +- .../tester/test_717_2b_sangeun_detail.py | 174 ----- resources/tester/test_717_3_sangeun_modal.py | 151 ---- resources/tester/test_722_ho_detail.py | 98 --- resources/tester/test_723_labor_table.py | 12 - .../tester/test_725_1_sangeun_add_inputs.py | 8 - resources/tester/test_727_sk_base_add.py | 51 -- resources/tester/test_728_2_sk_unit.py | 21 +- resources/tester/test_737_option_grid_foot.py | 9 +- .../tester/test_740_2_reset_delete_born.py | 20 +- resources/tester/test_748_0_sk_undo.py | 40 - .../tester/test_750_2_views_one_answer.py | 76 -- resources/tester/test_778_4_rate_line.py | 21 - resources/tester/test_796_2b_m02_equation.py | 1 - .../tester/test_796_2d_detail_subtotal.py | 33 - resources/tester/test_799_2_old_tabs_gone.py | 2 +- resources/tester/test_804_7_line_stack_fix.py | 3 - resources/tester/test_806_1_labor_view.py | 10 +- resources/tester/test_836_5_memory_doc.py | 9 +- resources/tester/test_856_0_sk_screen.py | 27 +- ui_template/ui_template_locale_m2.ts | 10 - 44 files changed, 129 insertions(+), 3279 deletions(-) delete mode 100644 M01_MasterData/M01_MasterData_UI_LogicLab_Cover.ts delete mode 100644 M01_MasterData/M01_MasterData_UI_LogicLab_Ho.ts delete mode 100644 M02_MasterTemplete/M02_MasterTemplete_Labor_RowSk.ts delete mode 100644 M02_MasterTemplete/M02_MasterTemplete_Sangeun_BaseHead.ts delete mode 100644 M02_MasterTemplete/logic/M02_Sangeun_Cover_Model.ts delete mode 100644 M02_MasterTemplete/logic/M02_Sangeun_Undo.ts delete mode 100644 resources/tester/helper_728_2_cover_unit.cjs delete mode 100644 resources/tester/helper_748_0_sk_undo.cjs delete mode 100644 resources/tester/test_717_3_sangeun_modal.py delete mode 100644 resources/tester/test_722_ho_detail.py delete mode 100644 resources/tester/test_748_0_sk_undo.py diff --git a/M01_MasterData/M01_MasterData_UI_LogicLab_Cover.ts b/M01_MasterData/M01_MasterData_UI_LogicLab_Cover.ts deleted file mode 100644 index 5c0b98b30..000000000 --- a/M01_MasterData/M01_MasterData_UI_LogicLab_Cover.ts +++ /dev/null @@ -1,142 +0,0 @@ -/* ============================================================================= - * M01_MasterData_UI_LogicLab_Cover.ts - * 단가산출 상세 줄 「그 자리 고침」(PLAN 722-2 · 내역 16 · 17-2) — 줄 모달 안 수량 · 단가 칸. - * 고침 꼴 = M02 단가산출 덮개 칸과 같음(`qty` · `labor` · `material` · `expense` — `M02_Sangeun_Doc._covered` 규칙 중 품 · 단가) - * M02(724) = 고침 칸의 값을 고침 고리(`HoEdit.set`)로 받아 덮개로 보관 — M01 시험 고침은 840-1 에 걷음 - * 서버 셈 = 줄 `단가`(손 단가) · 로직 줄 `값묶음`(노 · 재 · 경) · `수량` 글 — `master_pick._priced` · `bundled` 가 읽음 - * ========================================================================== */ - -import { createButton, createInputField, el } from "@ui/ui_template_elements"; -import { currentLanguageIndex } from "@ui/ui_template_locale"; -import { createText } from "@ui/ui_template_text"; - -/* ── 순수 셈 ── */ -/** 줄 하나 고침 — 품(수량) · 비목 단가(로직 줄은 셋 · 그 밖은 그 줄 비목 하나) */ -export interface LineCover { - qty?: number; - labor?: number; - material?: number; - expense?: number; -} -export const COVER_PARTS = { labor: "노무비", material: "재료비", expense: "경비" } as const; -export type CoverPart = keyof typeof COVER_PARTS; - -/* ── 순수 셈 끝 ── */ - -const TEXT = { - Head: ["그 자리 고침 (시험 값)", "Edit here (trial value)"], - Note: [ - "정본 · 마스터 값(노임 · 자재)은 안 바뀜 · 로직을 다시 열면 사라짐", - "Source and master prices stay unchanged · cleared when reopened", - ], - NoteM02: [ - "고친 값은 이 단가산출의 변경 항목으로 저장 — M01 은 안 바뀜", - "Saved as this item's override — M01 stays unchanged", - ], - Qty: ["수량(품)", "Quantity"], - Price: ["단가", "Unit price"], - Apply: ["적용", "Apply"], - Undo: ["되돌림", "Undo"], - Bad: ["0 이상 수만", "Numbers ≥ 0 only"], -} as const satisfies Record; -export const tc = (k: keyof typeof TEXT): string => - TEXT[k][currentLanguageIndex as 0 | 1] ?? TEXT[k][0]; - -export interface CoverFormOptions { - /** 지금 값(덮기 전 셈 값) — 칸 처음 값 */ - qty: number | null; - /** 단가 칸 — 로직 줄 = 셋(1 단위 비목 값) · 그 밖 = 그 줄 비목 하나 */ - prices: Partial>; - /** 지금 든 고침(있으면 칸 처음 값 · [되돌림]) */ - cover?: LineCover; - /** 「m02」 = 덮개 보관 안내 */ - scope?: "m01" | "m02"; - onApply: (cover: LineCover | null) => void; - /** 모달 머리 단추 자리(닫기 왼쪽 · 748-1) — 주면 [적용] 이 거기로 */ - head?: HTMLElement; -} - -const num = (raw: string): number | null => { - const v = Number(raw.replaceAll(",", "").trim()); - return raw.trim() !== "" && Number.isFinite(v) && v >= 0 ? v : null; -}; - -/** 고침 칸 — 수량 · 단가(들) · [적용] [되돌림] · 바뀐 칸만 고침으로 넘김 */ -export function coverForm(o: CoverFormOptions): HTMLElement { - const parts = Object.keys(o.prices) as CoverPart[]; - const field = (label: string, raw: number | null, mine?: number) => { - const now = raw === null ? null : Number(raw.toPrecision(10)); // 칸 글 = 유효 10 자리 · 손대지 않으면 고침 아님 - const box = createInputField({ - label, - value: String(mine ?? now ?? ""), - compact: true, - type: "text", - }); - box.input.inputMode = "decimal"; - return { box, now }; - }; - const qty = field(tc("Qty"), o.qty, o.cover?.qty); - const prices = parts.map((k) => ({ - k, - ...field(parts.length > 1 ? COVER_PARTS[k] : tc("Price"), o.prices[k] ?? null, o.cover?.[k]), - })); - const error = createText("", "error"); - error.hidden = true; - const apply = (): void => { - const next: LineCover = {}; - let bad = false; - const take = (f: { box: { input: HTMLInputElement }; now: number | null }, was?: number) => { - const v = num(f.box.input.value); - if (v === null) - return f.box.input.value.trim() === "" ? undefined : ((bad = true), undefined); - return v !== f.now || was !== undefined ? v : undefined; // 셈 값 그대로면 고침 아님 - }; - const q = take(qty, o.cover?.qty); - if (q !== undefined) next.qty = q; - for (const p of prices) { - const v = take(p, o.cover?.[p.k]); - if (v !== undefined) next[p.k] = v; - } - error.textContent = tc("Bad"); - error.hidden = !bad; - if (!bad) o.onApply(Object.keys(next).length ? next : null); - }; - const applyButton = createButton({ - label: tc("Apply"), - variant: "filled", - size: 32, - onClick: apply, - }); - o.head?.append(applyButton); - const actions = el("div", { - className: "m01lab-cover__actions", - children: [ - ...(o.head ? [] : [applyButton]), - ...(o.cover - ? [ - createButton({ - label: tc("Undo"), - variant: "ghost", - size: 32, - onClick: () => o.onApply(null), - }), - ] - : []), - ], - }); - actions.hidden = !actions.childElementCount; - return el("section", { - className: "m01lab-cover", - attrs: { "data-cover-form": "" }, - children: [ - el("strong", { text: tc("Head") }), - createText(tc(o.scope === "m02" ? "NoteM02" : "Note"), "hint"), - el("div", { - className: "m01lab-cover__fields", - children: [qty.box.root, ...prices.map((p) => p.box.root)], - }), - error, - actions, - ], - }); -} diff --git a/M01_MasterData/M01_MasterData_UI_LogicLab_Detail.ts b/M01_MasterData/M01_MasterData_UI_LogicLab_Detail.ts index f711da5bb..7d64e9328 100644 --- a/M01_MasterData/M01_MasterData_UI_LogicLab_Detail.ts +++ b/M01_MasterData/M01_MasterData_UI_LogicLab_Detail.ts @@ -2,8 +2,7 @@ * M01_MasterData_UI_LogicLab_Detail.ts * 「단가산출 로직」 상세 화면 — 컨테이너를 위에서 아래로 * ① 기본정보(정본은 읽기 전용 · 비고만 고침 · 자체 로직은 이름 · 단위 · 출처도) ② 수식(줄 쌓기 804-2 · 804-6) - * ③ M02 수식 문서 없는 줄(일위대가 줄 모달 등)만 단가산출 상세 몸(`cover` — 공용 부품 `_LogicLab_Ho.ts`) - * 단가산출 상세 보기 · 자체 로직 시트 편집기 · 시험 고침은 840-1 에 걷음 — 자체 로직도 수식(줄 쌓기)에서 만들고 고침 + * 단가산출 상세 보기 · M02 상세 몸(856-1) · 자체 로직 시트 편집기 · 시험 고침은 840-1 에 걷음 — 자체 로직도 수식(줄 쌓기)에서 만들고 고침 * ========================================================================== */ import { el } from "@ui/ui_template_elements"; @@ -26,27 +25,10 @@ export interface DetailContext { onChange: () => void; /** 시스템 관리자 — 기본 로직 안내 글이 다름(시트에서 고침 / 보기만) */ admin?: boolean; - /** 717-2b M02 단가산출 — 수식 문서 없는 줄의 단가산출 상세 덩이(SK 셈 답 · 고침 표) */ - cover?: { ho: HTMLElement }; /** 수식 탭 = 줄 쌓기 그릇(`A00_Common/line_stack_screen.ts` · 804-2 · 804-6) */ stack?: HTMLElement; } -const section = (title: string, body: HTMLElement[], hint = ""): HTMLElement => - el("section", { - className: "m01-logic__section m01lab__box", - children: [ - el("div", { - className: "m01-logic__section-head", - children: [ - el("h3", { text: title }), - ...(hint ? [el("span", { className: "ui-text ui-text--muted", text: hint })] : []), - ], - }), - ...body, - ], - }); - function infoBox(ctx: DetailContext): HTMLElement[] { const row = ctx.row; const own = isOwnLogic(row); @@ -140,7 +122,7 @@ function infoBox(ctx: DetailContext): HTMLElement[] { /** 자체 로직(키 GX…) — 정본은 아님 */ export const isOwnLogic = (row: LogicRow): boolean => row.키.startsWith("GX"); -/** 상세 화면(기본정보 · 수식 · M02 단가산출 상세 몸)을 `host` 에 쌓음 */ +/** 상세 화면(기본정보 · 수식)을 `host` 에 쌓음 */ export function buildLabDetail(host: HTMLElement, ctx: DetailContext): void { // 다시 그리면 포커스가 빠짐 — 고치던 기본정보 칸을 기억해 되돌림 const active = document.activeElement; @@ -148,11 +130,7 @@ export function buildLabDetail(host: HTMLElement, ctx: DetailContext): void { active instanceof HTMLInputElement || active instanceof HTMLTextAreaElement ? { node: active, from: active.selectionStart, to: active.selectionEnd } : null; - host.replaceChildren( - ...infoBox(ctx), - ...(ctx.stack ? [ctx.stack] : []), - ...(ctx.cover ? [section(tl("Ho_Title"), [ctx.cover.ho])] : []), - ); + host.replaceChildren(...infoBox(ctx), ...(ctx.stack ? [ctx.stack] : [])); const own = kept?.node.dataset.own; // 기본정보 칸은 새로 만들어지므로 이름표로 다시 찾음 const back = own ? host.querySelector(`[data-own="${own}"]`) : kept?.node; if (kept && back && (own || ctx.ownHost.contains(back))) { diff --git a/M01_MasterData/M01_MasterData_UI_LogicLab_Ho.ts b/M01_MasterData/M01_MasterData_UI_LogicLab_Ho.ts deleted file mode 100644 index 9c045149b..000000000 --- a/M01_MasterData/M01_MasterData_UI_LogicLab_Ho.ts +++ /dev/null @@ -1,689 +0,0 @@ -/* ============================================================================= - * M01_MasterData_UI_LogicLab_Ho.ts - * 공용 「단가산출 상세」(PLAN 722-1 · 요구서 내역16 2장 6 · 7) — M01 단가산출 로직 상세가 씀 · (724) M02 단가산출 · 일위대가 모달도. - * 하위 박스 = 서버 `묶음`(인력 · 재료 · 경비(장비) · 하위 — `/text` 줄 덧칸 714-1) · 계산 전 = 호표 종류로 - * · 장비 · 하위 로직 줄 = 박스 안 한 줄(노 · 재 · 경 몫 합) + 누르면 펼침(부른 로직 시간당 줄 · 몫 식 줄) - * 박스 제목 바로 아래 = 그 박스 줄들이 쓰는 입력 고르기(`calc_sheet` 변수 칸 꼴 · 6 → 4 → 3 → 2 → 1 열 격자) + - * 어느 박스도 안 쓰는 입력(공통 옵션)도 모든 박스에 같이(737-3 · 한 값 · 어디서 바꿔도 모두 따라감) - * 「계산식」 열 = 값 든 식(「268,908 × 0.12」 · 서버 `글`) + 표 · 요소 · 로직 알약 + 그 줄 입력 칩 · 변수 이름 식(`이름글`)은 마우스 올리면 - * 맨 아래 = 한 줄 4 칸 — 비목 소계 셋(노무비 · 재료비 · 경비 — 장비 노무는 여기서 인력과 더해짐) + 계 · 화면(모달) 바닥에 붙음(737-1) - * 줄 누름 = 그 줄 자료 모달(`_LogicLab_Modal.ts`) · 고침 고리(`edit`) 있으면 모달 안 「그 자리 고침」(`_LogicLab_Cover.ts`) · 값 = 서버 셈 그대로(박스 소계 · 비목 소계만 줄 금액 합 1 원 버림 751-3) - * ========================================================================== */ - -import { createBadge } from "@ui/ui_template_badge"; -import { createCard } from "@ui/ui_template_card"; -import { el } from "@ui/ui_template_elements"; -import { currentLanguageIndex } from "@ui/ui_template_locale"; -import { emptyRow, tableRow, tableShell, type Column } from "@ui/ui_template_table"; -import { createText } from "@ui/ui_template_text"; -import { optionGrid, sheetFormula, varRow, type SheetUnfold } from "../A00_Common/calc_sheet"; -import type { - CalcLine, - ElementBrief, - HoLine, - LogicRow, - NamedFormula, - TextAnswer, - TextLine, - TextPiece, -} from "./M01_MasterData_UI_Logic_Api"; -import { pctView } from "./M01_MasterData_UI_Logic_Api"; -import { - formatLineMoney, - formatMoney, - formatNumber, - formatPrice, -} from "../common_util/common_util_money"; -import { tx } from "./M01_MasterData_UI_Logic_Text"; -import { coverForm, type CoverPart, type LineCover } from "./M01_MasterData_UI_LogicLab_Cover"; -import { - condText, - openMaterialModal, - openNoteModal, - openRefModal, - openLogic, - openTableModal, - type PickCond, -} from "./M01_MasterData_UI_LogicLab_Modal"; -import { buildFoot, FOOT_KEYS, type FootKey } from "./M01_MasterData_UI_LogicLab_Foot"; -import { rounddown } from "../B09_Estimation/B09_Estimation_Calc_Base"; -import { fragmentRow, type Fragment } from "./M01_MasterData_UI_LogicLab_Pill"; -import { tl } from "./M01_MasterData_UI_LogicLab_Text"; - -/* ── 순수 셈 ── */ -/** 박스로 묶을 줄 — 호표 차례 · 박스 이름 · 한 줄로 합칠지(장비 · 하위) · 금액 */ -export interface HoRowLike { - idx: number; - bundle: string; - merge: boolean; - amount: number | null; - /** 합계 밖 줄(엔진 `합밖`) — 보이되 소계에 안 더함 */ - out?: boolean; -} -export interface HoMerged { - idx: number; - 몫: T[]; - 금액: number | null; -} -export interface HoBox { - 묶음: string; - 줄: (T | HoMerged)[]; - 소계: number; -} -const BOX_ORDER = ["인력", "재료", "경비", "하위"]; - -/** 줄 → 박스(인력 · 재료 · 경비 · 하위 차례) — 합칠 줄은 같은 박스 · 같은 호표 차례끼리 한 줄(몫 차례 그대로) · - * `always` 박스는 줄이 없어도 빈 박스로 */ -export function boxesOf(list: T[], always: string[] = []): HoBox[] { - const boxes = new Map>(); - const take = (name: string): HoBox => { - let b = boxes.get(name); - if (!b) boxes.set(name, (b = { 묶음: name, 줄: [], 소계: 0 })); - return b; - }; - always.forEach(take); - const merged = new Map>(); - for (const e of list) { - const b = take(e.bundle); - if (!e.out) b.소계 += e.amount ?? 0; - if (!e.merge) { - b.줄.push(e); - continue; - } - const id = `${e.bundle}\n${e.idx}`; - let m = merged.get(id); - if (!m) { - merged.set(id, (m = { idx: e.idx, 몫: [], 금액: null })); - b.줄.push(m); - } - m.몫.push(e); - m.금액 = m.금액 === null && e.amount === null ? null : (m.금액 ?? 0) + (e.amount ?? 0); - } - const rank = (x: string): number => (BOX_ORDER.includes(x) ? BOX_ORDER.indexOf(x) : 9); - return [...boxes.values()].sort((a, b) => rank(a.묶음) - rank(b.묶음)); -} -/* ── 순수 셈 끝 ── */ - -const TEXT = { - 인력: ["인력", "Labor"], - 재료: ["재료", "Material"], - 경비: ["경비(장비)", "Expense (equipment)"], - 하위: ["하위 로직", "Sub logic"], - Common: ["공통 옵션", "Common options"], - Basis: ["기준", "Basis"], - Formula: ["계산식", "Formula"], - Short: ["노 {a} · 재 {b} · 경 {c}", "L {a} · M {b} · E {c}"], - Fold: ["누르면 펼침", "Click to expand"], - Per: ["{n} — {v} 원/{u}", "{n} — {v} KRW/{u}"], - Edited: ["시험 고침", "Trial edit"], - EditedM02: ["변경 항목", "Override"], - Out: ["합 밖", "Outside total"], -} as const satisfies Record; -const th = (k: keyof typeof TEXT): string => TEXT[k][currentLanguageIndex as 0 | 1] ?? TEXT[k][0]; -const boxName = (b: string): string => (b in TEXT ? th(b as keyof typeof TEXT) : b); - -/** 고침 고리 — M01 = 시험 값(줄 사본) · M02 = 덮개 보관 · 열쇠 = 호표 줄 차례 */ -export interface HoEdit { - covers: Record; - set: (idx: number, cover: LineCover | null) => void; - scope?: "m01" | "m02"; - /** (M02) 모달 덧 동작 — `head` = 닫기 왼쪽 단추(삭제) · `body` = 고침 칸 아래(기초 빼기 · 별도계상 등) */ - more?: (idx: number, close: () => void) => { head: HTMLElement[]; body: HTMLElement[] }; -} - -/** 고친 줄 꼬리표 — M01 = 시험 고침 · M02 = 변경 항목 · 고침 없음 = "" */ -const editTag = (ctx: HoContext, idx: number): string => - ctx.edit?.covers[idx] ? th(ctx.edit.scope === "m02" ? "EditedM02" : "Edited") : ""; - -export interface HoContext { - row: LogicRow; - prices: Record; - /** 마지막 시험 계산의 줄 — 호표 차례 뒤에 덧줄 */ - lines: CalcLine[] | null; - /** 마지막 시험 계산의 읽는 식 줄(서버가 줌) */ - text: TextAnswer | null; - /** 마지막으로 잘 받은 읽는 식 — `text` 가 멈춤이면 조각을 이걸로 */ - lastText?: TextAnswer; - values: Record; - /** 박스 옵션 · 입력 칩 고침 — 시험 계산 입력 고침 + 다시 셈(없으면 고르기 · 칩 없음) */ - onInput?: (name: string, value: string) => void; - /** 그 자리 고침 고리(없으면 모달은 보기만) */ - edit?: HoEdit; - /** (M02 750-2) Ho 줄 차례 → SK 줄 cid — 읽는 식 줄을 `cid` 로 이음(이름 차례 추측 안 함) */ - cids?: string[]; - /** (M02 750-2) 재료 고름 = SK 문서 `고름`(줄 차례 → 고르는 길 · 없으면 모달은 보기만) — 없으면 시험 입력(M01) */ - pickMat?: (idx: number) => ((it: { ref: string; label: string }) => void) | undefined; -} - -type Group = "labor" | "material" | "cost" | "other"; -const OF_KIND: Record = { 인력: "labor", 재료: "material", 기계: "cost" }; -const OF_COST: Record = { 노무비: "labor", 재료비: "material", 경비: "cost" }; -const BOX_OF: Record = { - labor: "인력", - material: "재료", - cost: "경비", - other: "하위", -}; -const COST_OF: Record = { labor: "노무비", material: "재료비", cost: "경비" }; -const PART_OF: Record = { - labor: "labor", - material: "material", - cost: "expense", - other: "expense", -}; - -/** 줄 종류가 셋 중 어디에도 안 들어가면 「그 밖」 — 다른 로직을 부르는 줄은 비목으로 */ -const groupOfHo = (item: HoLine): Group => - OF_KIND[item.종류] ?? (item.종류 === "로직" ? OF_COST[item.비목 ?? ""] : undefined) ?? "other"; - -interface Entry extends HoRowLike { - group: Group; - name: string; - spec: string; - unit: string; - qty: string; - /** 고른 수량 값(계산 답 `CalcLine.수량` · % 덧줄은 율) — 계산 전 「—」 */ - qtyValue: string; - qtyFrag: Fragment[]; - /** 한 줄이 비목 몫으로 갈렸을 때 이 몫 이름(예 「노무비」) */ - share?: string; - price: string; - /** 갈리기 전 줄 단가(장비 한 줄 머리) */ - linePrice: string; - extra: boolean; - /** 계산 답 줄 · 서버 읽는 식 줄(붙기 전엔 없음) */ - line?: CalcLine; - textLine?: TextLine; - /** 고침 칸 — 로직 줄 = 노 · 재 · 경 · 그 밖 = 그 줄 비목 */ - logic: boolean; - part: CoverPart; - open: (self: Entry) => void; - unitFrag?: Fragment[]; - piecesFrag?: Fragment[]; - unitRef?: string; - unitText?: string; - warn?: string; - /** (M02 727-2) 출처 꼬리표 — 줄 덧칸 `꼬리표` · 칸 폭 고정 · 넘치면 말줄임 + 풍선 */ - source?: string; -} - -/** 서버 조각(`/text` 줄의 `조각`) → 칸 조각 — 요소·표·로직은 알약(글 = 조각 글) · 나머지는 글자 */ -function toFragments(pieces: TextPiece[], ctx: HoContext): Fragment[] { - return pieces.map((piece): Fragment => { - const dim = piece.깊이 ? { dim: true } : {}; - if (piece.kind !== "요소" && piece.kind !== "표" && piece.kind !== "로직") - return { text: piece.글, ...dim }; - const ref = piece.참조; - const open = (): void => { - if (!ref) return openNoteModal(piece.글, tl("Pill_NoPick")); - if (piece.kind === "표") - openTableModal({ title: piece.글, table: ref.키, row: ref.줄 ?? ref.행, col: ref.열 }); - else if (piece.kind === "요소") - openRefModal({ title: piece.글, ref: ref.키, prices: ctx.prices }); - else openLogic(ref.키); - }; - return { pill: { label: piece.글, onClick: open }, ...dim }; - }); -} - -/** 재료 고르기 줄 — `요소` 가 글 대신 {구분·상세구분·규격·대표} 객체 */ -const condOf = (item: HoLine): PickCond | null => - typeof item.요소 === "object" && item.요소 !== null ? (item.요소 as unknown as PickCond) : null; -const condLabel = (cond: PickCond): string => - [cond.구분, cond.상세구분, cond.규격].filter(Boolean).join(" · "); -const nameOf = (item: HoLine): string => - item.이름 ?? (condOf(item) ? condLabel(condOf(item)!) : item.요소); - -/** 수량 칸 = 계산 답의 고른 수량(% 덧줄은 율) · 계산 전 「—」 */ -const qtyOf = (line?: CalcLine): string => (line ? formatNumber(pctView(line).qty) : "—"); - -/** 계산된 줄은 서버가 준 비목별 몫으로 나눔 — 로직을 부르는 줄 · 장비 줄도 노무비·재료비·경비로 갈림 */ -const spread = (e: Entry, line?: CalcLine): Entry[] => { - const parts = Object.entries(line?.비목 ?? {}).filter(([, v]) => v !== 0); - if (!parts.length) return [e]; - return parts.map(([k, v]) => ({ - ...e, - group: OF_COST[k] ?? "other", - bundle: BOX_OF[OF_COST[k] ?? "other"], - amount: v, - ...(parts.length > 1 - ? { - share: k, - // 몫 줄 단가 = 단가 × (몫 금액 ÷ 줄 금액) — 곱하기 수량이 몫 금액과 맞게 - ...(line && line.금액 && line.단가 != null - ? { price: formatPrice((line.단가 * v) / line.금액) } - : {}), - } - : {}), - })); -}; - -/** 줄 모달 — 자료 보기 + (고리 있으면) 그 자리 고침 */ -function modalOf(e: Entry, ctx: HoContext, extra: { cond?: PickCond; item?: HoLine }): void { - const middles: NamedFormula[] = ctx.row.중간 ?? []; - const { cond, item } = extra; - const line = e.line; - const edit = ctx.edit; - const perUnit = (k: string): number | null => - line && line.수량 ? ((line.원문?.비목 ?? line.비목)?.[k] ?? 0) / line.수량 : null; // 세부 줄 = 원문 몫(744-1) - openMaterialModal({ - unitFrag: e.unitFrag, - unitRef: line?.품목?.키 ?? e.unitRef, - unitText: e.unitText, - qtyFrag: e.piecesFrag, - title: e.name, - expr: e.qty, - ...(item ? (cond ? { cond, unit: item.단위 } : { element: item.요소 }) : {}), - prices: ctx.prices, - middles, - values: ctx.values, - // 재료 줄 = 시험 계산 자재 칸과 같은 모달 — 고르면 시험 입력으로 다시 셈(정본 안 바뀜) - kind: item?.종류, - usedSlot: line?.품목?.값칸, - ...(item?.종류 === "재료" && ctx.pickMat ? { onPick: ctx.pickMat(e.idx) } : {}), - // 덧줄(%) = M02 덮개만 율 고침(M01 시험 값은 호표 줄만) - ...(edit && (e.extra ? edit.scope === "m02" : item) - ? { - edit: (close: () => void, head: HTMLElement) => { - const form = coverForm({ - head, - qty: line ? pctView(line).qty : null, - prices: e.extra - ? {} - : e.logic - ? { - labor: perUnit("노무비"), - material: perUnit("재료비"), - expense: perUnit("경비"), - } - : { [e.part]: line ? line.단가 : null }, - cover: edit.covers[e.idx], - scope: edit.scope, - onApply: (c) => (close(), edit.set(e.idx, c)), - }); - const more = edit.more?.(e.idx, close); - head.append(...(more?.head ?? [])); - return more?.body.length ? el("div", { children: [form, ...more.body] }) : form; - }, - } - : {}), - }); -} - -function entries(ctx: HoContext): Entry[] { - const ho = ctx.row.호표 ?? []; - const out: Entry[] = ho.flatMap((item, i) => { - const line = ctx.lines?.[i]; - const cond = condOf(item); - const brief = cond ? ctx.prices[condText(cond)] : ctx.prices[item.요소]; - const price = line ? line.단가 : brief?.값; - const group = groupOfHo(item); - const shown = price === undefined || price === null ? "" : formatPrice(price); - const entry: Entry = { - idx: i, - group, - bundle: BOX_OF[group], - merge: false, - name: nameOf(item), - spec: item.규격 ?? brief?.규격 ?? "", - unit: item.단위 ?? "", - qty: item.수량, - qtyValue: qtyOf(line), - qtyFrag: [{ text: item.수량 }], - price: shown, - linePrice: shown, - amount: line ? line.금액 : null, - out: !!line?.합밖, - warn: line?.단위경고, - extra: false, - line, - logic: item.종류 === "로직", - part: OF_COST[item.비목 ?? ""] ? PART_OF[OF_COST[item.비목 ?? ""]] : PART_OF[group], - open: (self) => modalOf(self, ctx, { cond: cond ?? undefined, item }), - source: tagOf(item), - }; - return spread(entry, line); - }); - (ctx.row.덧줄 ?? []).forEach((extra, i) => { - const line = ctx.lines?.[ho.length + i]; - const group = OF_COST[extra.비목 ?? ""] ?? "other"; - const entry: Entry = { - idx: ho.length + i, - group, - bundle: BOX_OF[group], - merge: false, - name: extra.이름, - spec: "", - unit: line ? pctView(line).unit : "", - qty: extra.식, - qtyValue: qtyOf(line), - qtyFrag: [{ text: extra.식 }], - price: "", - linePrice: "", - amount: line ? line.금액 : null, - out: !!line?.합밖, - extra: true, - line, - logic: false, - part: PART_OF[group], - open: (self) => modalOf(self, ctx, {}), - source: tagOf(extra), - }; - out.push(...spread(entry, line)); - }); - attachPieces(out, ctx); - return out; -} - -/** 서버 `/text` 줄을 호표 줄 차례(덧줄은 덧줄 차례)로 이음 — 서버는 비목마다 호표 차례대로 줄을 주므로 - * 이름을 차례로 따라가며 줄 차례에 맞춤 · 붙은 줄의 `묶음` · `장비` 로 박스를 정함 · - * 끝내 못 찾으면 날식 대신 빈칸(계산 전 · 서버 실패면 식 글자 그대로) */ -function attachPieces(all: Entry[], ctx: HoContext): void { - const source = ctx.text?.ok ? ctx.text : ctx.lastText; - if (!source?.ok) { - if (ctx.text) for (const e of all) e.qtyFrag = e.piecesFrag = []; // 멈춤 · 받은 조각 없음 — 날식 대신 빈칸 - return; - } - const names = [...(ctx.row.호표 ?? []).map(nameOf), ...(ctx.row.덧줄 ?? []).map((x) => x.이름)]; - const found = new Map(); - const byCid = new Map((ctx.cids ?? []).map((c, i) => [c, i])); // M02 750-2 — cid 로 이음 - for (const g of source.groups) { - let from = 0; - for (const line of g.줄) { - if (ctx.cids && line.cid) { - const at = byCid.get(line.cid); - if (at !== undefined) found.set(`${g.비목}|${at}`, line); - continue; - } - const at = names.findIndex((n, i) => i >= from && n === line.이름); - if (at < 0) continue; - found.set(`${g.비목}|${at}`, line); - from = at + 1; - } - } - const costs = Object.keys(OF_COST); - const fresh = ctx.lines !== null; // 묶음은 지금 셈 답에서만(옛 답의 묶음으로 박스를 안 옮김) - for (const e of all) { - const own = costs.find((c) => OF_COST[c] === e.group); - const line = [own, ...costs].map((c) => found.get(`${c}|${e.idx}`)).find(Boolean); - const pieces = line?.조각; - e.qtyFrag = e.piecesFrag = pieces?.length ? toFragments(pieces, ctx) : []; - if (line?.요소조각?.length) { - e.unitFrag = toFragments(line.요소조각, ctx); - const first = line.요소조각.find((piece) => piece.kind === "요소"); - e.unitRef = first?.참조?.키; - e.unitText = first?.글; - } - if (!line || !fresh) continue; - e.textLine = line; - if (line.묶음) e.bundle = line.묶음; - e.merge = !!line.장비 || line.묶음 === "하위"; - } -} - -const COLS: Column[] = [ - { label: tl("Col_Name"), width: "20%" }, - { label: tl("Col_Qty"), width: "9%", align: "end" }, - { label: tl("Col_Unit"), width: "7%" }, - { label: th("Formula"), width: "38%" }, - { label: tl("Col_Price"), width: "13%", align: "end" }, - { label: tl("Col_Amount"), width: "13%", align: "end" }, -]; - -const money = (v: number | null): string => (v === null ? "" : formatLineMoney(v)); // 줄 0.1 원(751-3) - -/** 계산식 칸 — 값 든 식(계산 뒤) · 계산 전 = 수량 식 · 알약 · 이름 식은 풍선(748-3 옵션 값 꼬리표 없음) */ -function formulaCell(e: Entry, text = ""): HTMLElement { - const tline = e.textLine; - const main = text || (tline ? sheetFormula(tline.글) : e.qty); - const pills = e.qtyFrag.some((f) => "pill" in f) ? [fragmentRow(e.qtyFrag)] : []; - const cell = el("div", { - className: "m01lab__qty-cell", - children: [el("div", { className: "m01lab__qty-text", text: main }), ...(text ? [] : pills)], - }); - cell.title = tline?.이름글 ?? e.qty; - return cell; -} - -const tagOf = (x: object): string | undefined => (x as { 꼬리표?: string }).꼬리표 || undefined; -const sourceTag = (text: string): HTMLElement => { - const [shown, ...tip] = text.split("\n"); // 첫 줄 = 보임 · 나머지 = 풍선(없으면 같은 글) — 740-2 - const tag = createBadge(shown, "neutral"); - tag.classList.add("m01lab__src"); - tag.title = tip.length ? tip.join(" ") : shown; - return tag; -}; - -function nameCell(e: Entry, label: string, tag: string): HTMLElement { - return el("div", { - children: [ - e.source - ? el("div", { - className: "m01lab__namerow", // 이름 옆에 꼬리표 — 줄 높이 안 바뀜(740-2) - children: [el("span", { text: label }), sourceTag(e.source)], - }) - : el("div", { text: label }), - ...(e.share && label === e.name ? [createBadge(`${e.share} ${tl("Share")}`, "accent")] : []), - ...(e.spec ? [el("div", { className: "ui-text ui-text--muted", text: e.spec })] : []), - ...(e.out ? [createBadge(th("Out"), "warning")] : []), - ...(e.warn ? [createBadge(`${tx("Calc_UnitWarn")} · ${e.warn}`, "warning")] : []), - ...(tag ? [createBadge(tag, "accent")] : []), - ], - }); -} - -/** 못 셈 줄(725 · M02 단가산출) — 금액 「—」 + 까닭 풍선 */ -const gapCell = (why: string): HTMLElement => el("span", { text: "—", attrs: { title: why } }); - -/** 보통 줄 · 몫 줄 — 누르면 그 줄 모달 */ -function lineRow(e: Entry, ctx: HoContext, label = e.name): HTMLTableRowElement { - const tag = editTag(ctx, e.idx); - const tr = tableRow(COLS, [ - nameCell(e, label, e.share ? "" : tag), - e.qtyValue, - e.unit, - formulaCell(e), - e.price, - e.line?.까닭 ? gapCell(e.line.까닭) : money(e.amount), - ]); - tr.classList.add("m01lab__line"); - if (e.extra) tr.classList.add("m01lab__line--extra"); - if (tag) tr.classList.add("is-changed"); - tr.tabIndex = 0; - tr.dataset.line = e.name; - tr.addEventListener("click", () => e.open(e)); - tr.addEventListener("keydown", (ev) => ev.key === "Enter" && e.open(e)); - return tr; -} - -/** 펼친 장비 줄 — 로직 줄 객체마다 기억(다시 셈 · 다시 그려도 펼친 채) */ -const opened = new WeakMap>(); -const openOf = (row: object): Set => { - let got = opened.get(row); - if (!got) opened.set(row, (got = new Set())); - return got; -}; - -/** 서버 줄 덧칸 — 장비 줄 펼침(714-1b · 부른 기계경비 로직 시간당 줄) */ -type Unfoldable = TextLine & { 펼침?: SheetUnfold | null }; - -/** 장비 · 하위 한 줄 — 머리(노 · 재 · 경 몫 + 합) · 누르면 펼침(부른 로직 시간당 줄 · 몫 줄) */ -function mergedRows(m: HoMerged, ctx: HoContext): HTMLTableRowElement[] { - const first = m.몫[0]; - const share = (cost: string): string => - formatLineMoney( - m.몫 - .filter((x) => (x.share ?? COST_OF[x.group]) === cost) - .reduce((s, x) => s + (x.amount ?? 0), 0), - ); - const short = th("Short") - .replace("{a}", share("노무비")) - .replace("{b}", share("재료비")) - .replace("{c}", share("경비")); - const tag = editTag(ctx, m.idx); - const head = tableRow(COLS, [ - nameCell(first, `▸ ${first.name}`, tag), - first.qtyValue, - first.unit, - formulaCell(first, short), - first.linePrice, - money(m.금액), - ]); - head.classList.add("m01lab__line"); - if (tag) head.classList.add("is-changed"); - head.dataset.equip = first.name; - head.title = th("Fold"); - head.tabIndex = 0; - head.setAttribute("aria-expanded", "false"); - const unfold = m.몫.map((x) => (x.textLine as Unfoldable | undefined)?.펼침).find(Boolean); - const subs: HTMLTableRowElement[] = [ - ...(unfold - ? [ - tableRow(COLS, [ - { - content: createText( - th("Per") - .replace("{n}", unfold.이름) - .replace("{v}", formatPrice(unfold.계 ?? 0)) - .replace("{u}", unfold.단위 || "-"), - "hint", - ), - colSpan: COLS.length, - }, - ]), - ...unfold.줄.map((x) => - tableRow(COLS, [ - `${x.이름} (${x.비목})`, - "", - "", - sheetFormula(x.글), - "", - money(x.금액), - ]), - ), - ] - : []), - ...m.몫.map((x) => lineRow(x, ctx, `${x.share ?? first.name}`)), - ]; - for (const s of subs) { - s.classList.add("is-sub"); - s.hidden = true; - s.dataset.part = first.name; - } - const label = head.querySelector("td > div > div") as HTMLElement; - const keep = openOf(ctx.row); - const show = (open: boolean): void => { - head.setAttribute("aria-expanded", String(open)); - label.textContent = `${open ? "▾" : "▸"} ${first.name}`; - subs.forEach((s) => (s.hidden = !open)); - if (open) keep.add(m.idx); - else keep.delete(m.idx); - }; - const toggle = (): void => show(head.getAttribute("aria-expanded") !== "true"); - if (keep.has(m.idx)) show(true); - head.addEventListener("click", toggle); - head.addEventListener("keydown", (ev) => { - if (ev.key !== "Enter" && ev.key !== " ") return; - ev.preventDefault(); - toggle(); - }); - return [head, ...subs]; -} - -/** 옵션 고르기 줄들 — 이름 차례 · 고르기 있으면 고르기 · 아니면 글 칸 */ -function optionRows(names: string[], ctx: HoContext): HTMLElement[] { - const onInput = ctx.onInput; - if (!onInput) return []; - return (ctx.row.입력 ?? []) - .filter((s) => names.includes(s.이름)) - .map((s) => varRow(s, ctx.values[s.이름] ?? "", (v) => onInput(s.이름, v))); -} - -const usesOf = (b: HoBox): string[] => [ - ...new Set( - b.줄.flatMap((r) => ("몫" in r ? r.몫 : [r]).flatMap((e) => e.textLine?.쓰는입력 ?? [])), - ), -]; - -/** `common` = 어느 박스 줄도 안 쓰는 입력 — 737-3 모든 박스 맨 위 옵션 칸에 같이(한 값 · 어디서 바꿔도 모두 따라감) */ -function boxCard( - b: HoBox, - ctx: HoContext, - calculated: boolean, - common: string[], -): HTMLElement { - const name = boxName(b.묶음); - const lines = b.줄.flatMap((r) => ("몫" in r ? r.몫 : [r])); - const basis = [...new Set(lines.map((e) => e.textLine?.기준단위).filter(Boolean))]; - const notes = [...new Set(lines.map((e) => e.textLine?.환산근거).filter(Boolean))]; - const { root, tbody } = tableShell(COLS, { density: "data" }); - root.classList.add("m01lab__ho"); - // 753-2 옵션으로 빠진 줄은 안 그림(옵션 칸 · 소계는 그대로 — 옵션을 바꾸면 보이는 줄이 바뀜) - const off = (e: Entry): boolean => !!(e.line?.옵션꺼짐 || e.textLine?.옵션꺼짐); - const rows = b.줄.filter((r) => !("몫" in r ? r.몫.every(off) : off(r))); - tbody.append( - ...(rows.length - ? rows.flatMap((r) => ("몫" in r ? mergedRows(r, ctx) : [lineRow(r, ctx)])) - : [emptyRow(COLS, tl("Empty_Group"))]), - ); - const sub = tableRow(COLS, [ - { content: `${name} ${tl("Subtotal")}`, colSpan: 5 }, - calculated ? formatMoney(rounddown(b.소계, 0)) : "—", // 751-3 소계 1 원 버림 - ]); - sub.classList.add("m01lab__subtotal"); - sub.dataset.box = b.묶음; - sub.dataset.subtotal = calculated ? String(b.소계) : ""; - tbody.append(sub); - const card = createCard({ - title: name, - pad: 12, - body: [ - ...(basis.length ? [createText(`${th("Basis")} ${basis.join(" · ")}`, "muted")] : []), - ...(notes.length ? [createText(notes.join(" · "), "hint")] : []), - ...optionGrid(optionRows([...usesOf(b), ...common], ctx)), - root, - ], - }); - card.classList.add("m01lab__ho-box"); - card.dataset.hoBox = b.묶음; - return card; -} - -/** 박스가 하나도 없을 때만 — 어느 박스 줄도 안 쓰는 입력 한 카드 */ -function commonCard(rows: HTMLElement[]): HTMLElement { - const card = createCard({ title: th("Common"), pad: 12, body: optionGrid(rows) }); - card.classList.add("m01lab__ho-box"); - card.dataset.hoBox = "common"; - return card; -} - -/** 748-2 텍스트 수식 줄 → 그 줄 자료 모달 열기(상세 줄과 같은 모달 · 못 찾으면 없음) */ -export function lineOpener(ctx: HoContext): (line: TextLine) => (() => void) | undefined { - const by = new Map void>(); - for (const e of entries(ctx)) if (e.textLine) by.set(e.textLine, () => e.open(e)); - return (line) => by.get(line); -} - -/** 공용 단가산출 상세 몸 — 박스들(맨 위 옵션 칸 · 공통 옵션 포함) · 맨 아래 한 줄(비목 소계 셋 · 계) */ -export function buildHo(ctx: HoContext): HTMLElement[] { - const all = entries(ctx); - const calculated = ctx.lines !== null; - const boxes = boxesOf(all, ["인력", "재료", "경비"]); - const used = new Set(boxes.flatMap(usesOf)); - const common = (ctx.row.입력 ?? []).map((s) => s.이름).filter((n) => !used.has(n)); - const sums = Object.fromEntries( - FOOT_KEYS.map((g) => [ - g, - rounddown( - all.filter((e) => e.group === g && !e.out).reduce((s, e) => s + (e.amount ?? 0), 0), - ), - ]), - ) as Record; // 751-3 비목 소계 = 줄 합 1 원 버림 · 계 = 셋 합(서버와 같은 값) - const total = FOOT_KEYS.reduce((s, g) => s + sums[g], 0); - return [ - ...(boxes.length || !common.length ? [] : [commonCard(optionRows(common, ctx))]), - ...boxes.map((b) => boxCard(b, ctx, calculated, common)), - // 737-1 맨 아래 한 줄 4 칸(노무비 · 재료비 · 경비 · 계) — 화면(모달) 바닥에 붙음 - buildFoot(sums, calculated, total), - ]; -} diff --git a/M01_MasterData/M01_MasterData_UI_LogicLab_Style.css b/M01_MasterData/M01_MasterData_UI_LogicLab_Style.css index 5da731c80..62c2c8b77 100644 --- a/M01_MasterData/M01_MasterData_UI_LogicLab_Style.css +++ b/M01_MasterData/M01_MasterData_UI_LogicLab_Style.css @@ -35,47 +35,6 @@ grid-column: 1 / -1; } -/* 칸 폭 고정(`table-layout: fixed`) — 인력·재료·경비 세 표가 저마다 딴 `` 이라 - 내용 기준으로 폭이 갈리던 것을 막고 셋이 같은 폭으로 맞춰짐(일감35 이어 — 수량 칸 알약화). */ -.m01lab__ho { - table-layout: fixed; -} - -/* 열 = 이름 · 수량 · 단위 · 로직 · 단가 · 금액 */ -.m01lab__ho th:nth-child(1) { - width: 22%; -} - -.m01lab__ho th:nth-child(2) { - width: 9%; -} - -.m01lab__ho th:nth-child(3) { - width: 7%; -} - -.m01lab__ho th:nth-child(4) { - width: 36%; -} - -.m01lab__ho th:nth-child(5), -.m01lab__ho th:nth-child(6) { - width: 13%; -} - -.m01lab__line { - cursor: pointer; -} - -.m01lab__line:hover, -.m01lab__line:focus { - background: var(--color-paper); -} - -.m01lab__line--extra { - font-style: italic; -} - .m01lab__expr { font-family: var(--font-mono, monospace); font-size: var(--text-body-sm); @@ -83,11 +42,6 @@ word-break: break-all; } -/* 수량 칸 — 알약 + 사칙연산 글자를 이어 붙이고, 칸 폭을 넘으면 그 칸 폭 기준으로 줄바꿈 */ -.m01lab__qty-cell { - overflow-wrap: anywhere; -} - .m01lab__qty-frags { display: inline-flex; flex-wrap: wrap; @@ -102,11 +56,6 @@ white-space: pre-wrap; } -.m01lab__subtotal td { - font-weight: 600; - background: var(--color-paper); -} - .m01lab__total { margin: var(--spacing-8) 0 0; font-weight: 700; @@ -199,13 +148,6 @@ overflow: auto; } -/* 722-1 공용 단가산출 상세 — 하위 박스(카드) 안 · 옵션 줄 · 표 사이 간격 · 맨 아래 비목 소계 */ -.m01lab__ho-box > .ui-card__body { - display: flex; - flex-direction: column; - gap: var(--spacing-8); -} - /* 737-1 맨 아래 한 줄 4 칸(노무비 · 재료비 · 경비 · 계) — 화면(모달) 바닥에 붙음 · 칸마다 이름 위 · 값 아래 */ .m01lab__foot { position: sticky; @@ -240,10 +182,6 @@ --m01lab-box-gap: var(--spacing-12); } -.m01lab__ho-box + .m01lab__ho-box { - margin-top: var(--m01lab-box-gap, var(--spacing-12)); -} - .m01lab__foot .ui-calc-row { display: flex; flex-direction: column; @@ -276,29 +214,3 @@ .m01lab__foot .m01lab__total > :last-child { font-variant-numeric: tabular-nums; } - -/* 722-2 줄 모달 「그 자리 고침」 */ -.m01lab-cover { - display: flex; - flex-direction: column; - gap: var(--spacing-8); - padding: var(--spacing-12); - border: 1px solid var(--color-border); - border-radius: var(--radius-lg); -} - -.m01lab-cover__fields { - display: grid; - grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); - gap: var(--spacing-8); -} - -.m01lab-cover__actions { - display: flex; - gap: var(--spacing-8); -} - -.m01lab__ho-box .ui-card__title { - font-size: var(--text-body); - font-weight: 600; -} diff --git a/M01_MasterData/M01_MasterData_UI_LogicLab_Text.ts b/M01_MasterData/M01_MasterData_UI_LogicLab_Text.ts index 10b83ba91..2d69c4105 100644 --- a/M01_MasterData/M01_MasterData_UI_LogicLab_Text.ts +++ b/M01_MasterData/M01_MasterData_UI_LogicLab_Text.ts @@ -20,18 +20,12 @@ const TEXT = { "자체 로직 — 이름 · 단위 · 출처 · 비고는 여기서 · 식은 수식에서 고침", "Own logic — edit the info here · formulas in the Equation view", ], - Ho_Title: ["단가산출 상세", "Unit-price detail"], View_Equation: ["수식", "Equation"], Subtotal: ["소계", "Subtotal"], - Share: ["몫", "Share"], Total: ["계", "Total"], Extra: ["덧줄", "Extra"], Col_Name: ["이름", "Name"], Col_Unit: ["단위", "Unit"], - Col_Qty: ["수량", "Quantity"], - Col_Price: ["단가", "Price"], - Col_Amount: ["금액", "Amount"], - Empty_Group: ["줄 없음", "No lines"], Modal_Close: ["닫기", "Close"], Pill_Tone: ["요소 연결", "Linked element"], Modal_Sum: ["한 줄 풀이", "In one line"], diff --git a/M02_MasterTemplete/M02_MasterTemplete_Hopyo_Imported.ts b/M02_MasterTemplete/M02_MasterTemplete_Hopyo_Imported.ts index 105398dad..5d158ef2a 100644 --- a/M02_MasterTemplete/M02_MasterTemplete_Hopyo_Imported.ts +++ b/M02_MasterTemplete/M02_MasterTemplete_Hopyo_Imported.ts @@ -111,6 +111,7 @@ export function openImported(o: ImportedOptions): void { layer: o.target.layer, owner: o.target.owner, readOnly, + mode: sk ? "ref" : "memory", // 856-1 저장 전 = 가져온 식 문서째 보기 onChanged: (d) => (dirty ||= d), }); draw(); diff --git a/M02_MasterTemplete/M02_MasterTemplete_Labor_Api.ts b/M02_MasterTemplete/M02_MasterTemplete_Labor_Api.ts index 02350b538..9612bbedc 100644 --- a/M02_MasterTemplete/M02_MasterTemplete_Labor_Api.ts +++ b/M02_MasterTemplete/M02_MasterTemplete_Labor_Api.ts @@ -10,7 +10,6 @@ import { type SubBrief, } from "../M01_MasterData/M01_MasterData_UI_Logic_Api"; import type { LaborCalc, LaborFixed, LaborRef, LaborSpec } from "./M02_MasterTemplete_Labor_Calc"; -import type { LinePatch } from "./logic/M02_Sangeun_Cover_Model"; import { call, getActiveLayer, @@ -109,8 +108,6 @@ export interface LaborRow { 자재표시?: Record; /** 고정 줄(705-1 · 705-2 붙여넣기) — 숫자 그대로 · 로직 · 참조 없음 */ 고정?: LaborFixed; - /** 그 줄 덮개(715-3 · 717-3 단가산출 모달) — 로직 줄 · SK 참조 줄 · 서버가 검사 */ - 패치?: LinePatch; /** 넣어 펼친 줄 출처(740-1 · 740-2 꼬리표) — {층, 주인, 키, 이름, 때} · 셈에 안 씀 */ 본뜬?: Record; } @@ -205,7 +202,6 @@ export function normalizeLabor(doc: unknown, column: string): LaborDoc { ...(r.승격 === true && !r.참조 ? { 승격: true } : {}), ...(r.참조 || r.고정 ? {} : cleanShown(r.자재표시)), ...(r.고정 ? { 고정: r.고정 } : {}), // 705-1 — 읽을 때 떨구면 [저장]에서 줄이 사라짐 - ...(r.패치 ? { 패치: r.패치 } : {}), // 717-3 — 떨구면 [저장]에서 줄 덮개가 사라짐 ...(r.본뜬 ? { 본뜬: r.본뜬 } : {}), // 740-2 — 출처 꼬리표 })), 자재: (d.자재 ?? []).map((m) => ({ diff --git a/M02_MasterTemplete/M02_MasterTemplete_Labor_RowModal.ts b/M02_MasterTemplete/M02_MasterTemplete_Labor_RowModal.ts index abb8bef2d..b5cebe2f9 100644 --- a/M02_MasterTemplete/M02_MasterTemplete_Labor_RowModal.ts +++ b/M02_MasterTemplete/M02_MasterTemplete_Labor_RowModal.ts @@ -1,31 +1,24 @@ /* ============================================================================= * M02_MasterTemplete_Labor_RowModal.ts - * 일위대가표 줄 누름 모달(PLAN 723-2 · 723-3 · 요구서_내역16 2장 4 · 5) — 일위대가표에서 빠진 줄 동작을 모달 안으로. - * · 로직 줄(단가산출 문서 없음) · 셈 주입 SK 줄 = 머리(이름 · 「1 ㎡ 당」) · - * 단가산출 상세 줄 모드(717-2b · `Labor_RowSk` · 수식 보기 하나(836-3) · 옛 [항목 추가] · [율 줄 추가] 없음) · + * 일위대가표 줄 누름 모달(PLAN 723-2 · 요구서_내역16 2장 4 · 5 · 856-1) — 일위대가표에서 빠진 줄 동작을 모달 안으로. + * · 로직 줄(단가산출 문서 없음) · 셈 주입 줄(프로젝트 사본) = 머리(이름 · 「1 ㎡ 당」 · 옵션 값 · 메모) + 안내 한 줄 + * (856-1 — 옛 단가산출 상세 몸 · [적용] 걷음 · 고침 = 단가산출 줄 쌓기 · 856-3 에서 줄 쌓기 보기로) · * 로직 자재(바꾸기 · 기본 · 세 칸 · `Labor_LogicMats`) - * · [적용] = 그 줄 덮개(M02 변경 항목) + 옵션(상세 옵션 칸 → 그 줄 입력값) - * · 808-1(요구 701-4 · 5) — 옛 [옵션] · [단가산출로도 저장] · [항목 추가] · [율 줄 추가] 걷음 · 일위대가 줄 = 저장 때 - * M01 로직 줄 + 고침으로 펼쳐 담김(740-1 · `본뜬` = 온 단가산출) → 수식 문서 없음 = 수식 보기 없이 단가산출 상세 몸만 + - * 안내(온 단가산출 이름 · 수식은 그 단가산출에서 고쳐 다시 담음) * · 사용자 자재 줄 = 자재 모달(세 칸 · `Labor_MatTable` 한 줄) * · 고침 = 그 줄 화면 캐시(저장은 [저장]) · 금액은 표가 다시 셈 → `watch` 로 받아 다시 그림 * ========================================================================== */ import { createBanner } from "@ui/ui_template_banner"; -import { createButton, el, showToast } from "@ui/ui_template_elements"; -import { askConfirm, openModal } from "@ui/ui_template_modal"; +import { el, showToast } from "@ui/ui_template_elements"; +import { openModal } from "@ui/ui_template_modal"; import { createText } from "@ui/ui_template_text"; import type { ItemLogic } from "./M02_MasterTemplete_Api_Fetch"; import type { LaborCalc, LaborMat, LaborRow, MatMarkKey } from "./M02_MasterTemplete_Labor_Api"; import { logicMatRows } from "./M02_MasterTemplete_Labor_LogicMats"; import { setLogicMark, setMark } from "./M02_MasterTemplete_Labor_MatMarks"; import { matTable } from "./M02_MasterTemplete_Labor_MatTable"; -import { mountRowSk, type RowSkHandle } from "./M02_MasterTemplete_Labor_RowSk"; import { tc } from "./M02_MasterTemplete_Labor_Text"; -import type { SkScope } from "./M02_MasterTemplete_Sangeun_Cover"; -import { releaseTied } from "./M02_Labor_LogicMats_Model"; -import { keepKnown, valueLine } from "./M02_Labor_Values_Model"; +import { valueLine } from "./M02_Labor_Values_Model"; /** 표가 다시 센 답을 받음 — 돌려준 함수 = 그만 받음 */ export type CalcWatch = (fn: (calc: LaborCalc | null) => void) => () => void; @@ -36,11 +29,8 @@ export interface RowModalOptions { title: string; /** 일위대가 머리(이름 · 「1 ㎡ 당」) */ head: string; - /** 줄 분모(SK 단위 기본) */ - unit: string; - scope: SkScope; readOnly: boolean; - /** 셈 주입(프로젝트 복사본) — 단가산출 상세 없음 */ + /** 셈 주입(프로젝트 복사본) — 안내 글이 다름 */ inject: boolean; /** 사용자 자재 코드 — 로직 자재 [바꾸기]로 같은 품목 막음 */ userMats: string[]; @@ -50,16 +40,18 @@ export interface RowModalOptions { } const TEXT = { - Apply: ["적용", "Apply"], NoDoc: [ - "M01 로직을 바로 쓴 줄 — 수식 탭은 단가산출 문서가 있어야 열림(단가산출을 만들어 담음) · 여기서는 단가산출 상세만", - "Uses the M01 logic directly — the equation tab needs a build-up document", + "M01 로직을 바로 담은 줄 — 단가산출 화면 없음 · 고침은 단가산출로 담아(일위대가 [로직 추가]) 그 줄에서", + "Uses the M01 logic directly — add it as a build-up to edit", ], FromSk: [ - "단가산출 「{k}」 에서 담아 온 줄(담을 때 펼침) — 수식은 그 단가산출에서 고쳐 다시 담음 · 여기서는 단가산출 상세만", - "Copied from build-up 「{k}」 — edit its equation there and re-add", + "단가산출 「{k}」 에서 담아 온 줄 — 고침은 그 단가산출에서 고쳐 다시 담음", + "Copied from build-up 「{k}」 — edit it there and re-add", + ], + Inject: [ + "프로젝트 사본 줄 — 단가산출 화면 없음 · 수식 고침은 M02 단가산출에서 고쳐 [재생성]", + "Project copy line — edit the build-up in M02 and regenerate", ], - Discard: ["적용 안 한 고침이 있음 — 버리고 닫을까?", "Discard unapplied edits?"], } as const; const t = (k: keyof typeof TEXT): string => TEXT[k][0]; @@ -69,7 +61,6 @@ export function openRowModal(o: RowModalOptions): void { const info = el("div", { attrs: { "data-row-head": "" } }); const mats = el("div", { attrs: { "data-row-mats": "" } }); let calc: LaborCalc | null = null; - const line = () => calc?.줄.find((l) => !row.참조 && l.로직 === row.로직); const draw = (): void => { const values = valueLine(o.logic?.입력 ?? [], row.입력값); @@ -117,84 +108,25 @@ export function openRowModal(o: RowModalOptions): void { ); }; - /** 옵션 → 그 줄 입력값(로직 줄만 · 아는 입력만) · 같으면 참 */ - function setValues(next: Record): boolean { - if (row.참조) return true; - const values = o.logic ? keepKnown(o.logic.입력, next).kept : next; - if (JSON.stringify(values) === JSON.stringify(row.입력값)) return true; - const before = row.입력값; - row.입력값 = values; - releaseTied(row, before, line()?.재료 ?? []); // 바뀐 입력에 걸린 고름 = 기본(103-1) - return false; - } - - // 단가산출 상세 줄 모드(723-3) — 셈 주입(프로젝트 복사본)엔 없음 · 수식 단추 = 모달 머리(808-1) - const slot = el("span", { className: "m02-main__tools" }); - const skHost = el("div", { attrs: { "data-row-sk-host": "" } }); - let sk: RowSkHandle | null = null; - const skMount = (): void => { - if (o.inject) return; - sk?.destroy(); - sk = mountRowSk(skHost, { - row, - scope: o.scope, - title: o.title, - unit: o.unit, - readOnly: !edit, - slot, - }); - }; - let close = (): void => {}; - const finish = (): void => { - stop(); - sk?.destroy(); - }; - const apply = createButton({ - label: t("Apply"), - variant: "filled", - onClick: () => { - const got = sk?.take() ?? null; - if (got) { - if (got.patch) row.패치 = got.patch; - else delete row.패치; - setValues(got.values); - o.done(true); - draw(); - } - finish(); // [적용] = 그 줄에 남기고 닫음(저장은 페이지 [저장]) · 코드 닫기는 beforeClose 안 거침 - close(); - }, - }); - // 수식 문서 없는 줄(808-1) — 안내 한 줄(온 단가산출 = `본뜬`) + // 안내 한 줄(856-1) — 로직 줄 = 온 단가산출(`본뜬`) · 셈 주입 = 프로젝트 사본 const from = row.본뜬 && typeof row.본뜬.이름 === "string" ? row.본뜬.이름 : ""; - const noDoc = - !row.참조 && !o.inject - ? createBanner({ - tone: "info", - text: from ? t("FromSk").replace("{k}", from) : t("NoDoc"), - }) - : null; - apply.dataset.rowApply = ""; + const note = createBanner({ + tone: "info", + text: o.inject ? t("Inject") : from ? t("FromSk").replace("{k}", from) : t("NoDoc"), + }); const stop = o.watch((c) => { calc = c; draw(); }); - const tools = edit && !o.inject ? [apply] : []; - ({ close } = openModal({ + openModal({ title: o.title, closeLabel: tc("In_Close"), width: "1100px", wide: true, - actions: row.참조 ? [slot, ...tools] : tools, // 로직 줄 = 머리 단추 없음(상세만) - beforeClose: async () => { - if (sk?.take() && !(await askConfirm({ message: t("Discard"), danger: true }))) return false; - finish(); - return true; - }, - mount: (body) => body.append(info, ...(noDoc ? [noDoc] : []), skHost, mats), - })); + beforeClose: () => (stop(), true), + mount: (body) => body.append(info, note, mats), + }); draw(); - skMount(); } export interface MatModalOptions { diff --git a/M02_MasterTemplete/M02_MasterTemplete_Labor_RowSk.ts b/M02_MasterTemplete/M02_MasterTemplete_Labor_RowSk.ts deleted file mode 100644 index e42d29c13..000000000 --- a/M02_MasterTemplete/M02_MasterTemplete_Labor_RowSk.ts +++ /dev/null @@ -1,101 +0,0 @@ -/* ============================================================================= - * M02_MasterTemplete_Labor_RowSk.ts - * 일위대가 줄 모달 안 단가산출 상세 = 717-2b 단가산출(SK) 상세 「줄 모드」(PLAN 723-3 · 정함 4 · 5). - * · 줄 → 이름 없는 SK 문서(`lineDoc` · 고름 · 자재표시 = 바탕 줄 정체 cid) → `mountSangeunDetail` 그대로 얹음 - * (보기 넷 · 공용 상세(724-1 `LogicLab_Ho`) 줄 모달 품 · 단가 덮개 · 줄 빼기 · 더하기 · 박스 옵션 · 입력 칩) - * · `take()` = [적용] 때 그 줄에 남길 것 — 패치 `{덮개, 뺀줄, 더한줄}`(M02 변경 항목 · M01 안 바뀜 · 내역 17-2) + - * 옵션(시험 입력 → 그 줄 `입력값` · 정함 5) - * · 옛 [단가산출로도 저장] 걷음(808-1 · 요구 701-4 — 일위대가 줄은 단가산출을 담아서만) - * ========================================================================== */ - -import { el } from "@ui/ui_template_elements"; -import { createText } from "@ui/ui_template_text"; -import { fetchAuto } from "../M01_MasterData/M01_MasterData_UI_Logic_Api"; -import type { LaborRow } from "./M02_MasterTemplete_Labor_Api"; -import { calcSangeun, type SkScope } from "./M02_MasterTemplete_Sangeun_Cover"; -import { mountSangeunDetail } from "./M02_MasterTemplete_Sangeun_Detail"; -import { cleanPatch, lineDoc, needsIds, type LinePatch } from "./logic/M02_Sangeun_Cover_Model"; - -export interface RowSkHandle { - /** 고친 것(패치 · 옵션) — 없으면 null */ - take: () => { patch: LinePatch | null; values: Record } | null; - destroy: () => void; -} - -const same = (a: unknown, b: unknown): boolean => JSON.stringify(a) === JSON.stringify(b); - -/** 줄 모드 SK 상세를 `host` 에 — 바탕 줄 정체가 필요하면 먼저 셈 */ -export function mountRowSk( - host: HTMLElement, - o: { - row: LaborRow; - scope: SkScope; - title: string; - unit: string; - readOnly: boolean; - /** 모달 머리 칸(808-1) — 보기 고르기 · 수식 단추(옛 [항목 추가] · [율 줄 추가] 줄 없음) */ - slot?: HTMLElement; - }, -): RowSkHandle { - let handle: ReturnType | null = null; - let alive = true; - /** 자동값(상세가 빈 입력에 채움) — 손대지 않은 자동값은 줄에 안 남김(빈 값 = 자동값 그대로) */ - let auto: Record = {}; - const before = cleanPatch(o.row.패치); - const values0 = Object.fromEntries( - Object.entries(o.row.입력값 ?? {}).map(([k, v]) => [k, String(v)]), - ); - host.replaceChildren(createText("…", "muted")); - void (async () => { - let ids: string[] | null = null; - try { - if (needsIds(o.row)) - ids = (await calcSangeun(o.scope, lineDoc(o.row, null, null))).정체 ?? null; - } catch { - ids = null; // 정체 못 받음 = 고름 · 자재표시 없이(셈 까닭은 상세가 보임) - } - if (!alive) return; - const doc = { - ...lineDoc(o.row, ids, before), - ...(before?.뺀더한줄 ? { 뺀더한줄: before.뺀더한줄 } : {}), // 되살림 기억(744-1 · 셈엔 안 듦) - 이름: o.title, - 단위: o.unit || "식", - }; - const box = el("div", { attrs: { "data-row-sk": "" } }); - host.replaceChildren(box); - handle = mountSangeunDetail(box, doc, { - layer: o.scope.layer, - owner: o.scope.owner, - readOnly: o.readOnly, - onChanged: () => undefined, - slot: o.slot, - }); - if (o.row.로직 && !o.row.참조) auto = await fetchAuto(o.row.로직).catch(() => ({})); - })(); - return { - take: () => { - if (!handle) return null; - const d = handle.getDoc(); - const patch = cleanPatch({ - 덮개: d.덮개 as LinePatch["덮개"], - 뺀줄: d.뺀줄, - 더한줄: d.더한줄, - 뺀더한줄: d.뺀더한줄, - }); - const values = o.row.참조 - ? values0 - : Object.fromEntries( - Object.entries(handle.getValues()).filter( - ([k, v]) => - String(v).trim() !== "" && - (k in values0 || auto[k] == null || String(auto[k]) !== String(v)), - ), - ); - return same(patch, before) && same(values, values0) ? null : { patch, values }; - }, - destroy: () => { - alive = false; - handle?.destroy(); - }, - }; -} diff --git a/M02_MasterTemplete/M02_MasterTemplete_Labor_SkEdit.ts b/M02_MasterTemplete/M02_MasterTemplete_Labor_SkEdit.ts index ad1d96947..73da2c5f3 100644 --- a/M02_MasterTemplete/M02_MasterTemplete_Labor_SkEdit.ts +++ b/M02_MasterTemplete/M02_MasterTemplete_Labor_SkEdit.ts @@ -77,7 +77,7 @@ export async function openSkEdit(opt: SkEditOptions): Promise { readOnly: opt.readOnly, onChanged: (d) => (dirty = d && !opt.readOnly), onVersion: (v) => (version = v), // 수식 저장이 파일 판을 바꿈 — 문서 저장이 이어 받음 - source: true, // 페이지와 같은 길 — 수식 저장 단추는 이 [저장] 한 번에 모임 + mode: "page", // 페이지와 같은 길 — 수식 저장 단추는 이 [저장] 한 번에 모임 slot, }); const ok = createButton({ diff --git a/M02_MasterTemplete/M02_MasterTemplete_Labor_Table.ts b/M02_MasterTemplete/M02_MasterTemplete_Labor_Table.ts index 49dbe6d25..8646e833f 100644 --- a/M02_MasterTemplete/M02_MasterTemplete_Labor_Table.ts +++ b/M02_MasterTemplete/M02_MasterTemplete_Labor_Table.ts @@ -7,7 +7,7 @@ * 금액 빠짐) → 그 줄 금액 · 합계 바로(짝 셈 `Labor_Calc.settle`) · 구조물 조합 · 공사 알약이 이어지면 그 값이 앞섬 * · 합계 열 = 「기준단위 단가」(줄 1 단위) · 「수량 반영 금액」(× 수량) * · 머리 단추 = [항목 추가](736-1 · 자재는 찾기 창에서 고름 → 자재 목록) · 줄 우클릭 · 줄 끝 ⋯ = 위로 · 아래로 · 별칭 · 삭제 - * · 줄 누름 = 줄 모달(`Labor_RowModal` — 옵션 · 메모 · 켜쌓기율 · 로직 자재 바꾸기 · 세 칸 · 단가산출) · + * · 줄 누름 = 줄 모달(`Labor_RowModal` — 옵션 · 메모 · 켜쌓기율 · 로직 자재 바꾸기 · 세 칸 · 안내 한 줄 · 856-1) · * 사전조합 참조 줄 = 서고 원본 모달(`Labor_RefEdit`) · 사용자 자재 줄 = 자재 모달(세 칸) * · 금액 = 서버 calc(최신 응답만 · 저장 안 함) · [저장]은 UI_Main(서버가 다시 셈) * · 안 이은 고정 줄(729-3) = 격자 위 띠 · [연결](`Labor_Unlinked` — 이음만 · 저장은 [저장]) @@ -333,7 +333,7 @@ export function mountLaborTable( closed: () => alive && recalc(), }); if (row.고정) return; // 고정 줄 = 숫자 그대로(이름 · 별칭은 우클릭) - // 단가산출(SK) 줄 = 그 단가산출 문서 모달(수식 탭 · 806-1) — 셈 주입(프로젝트 복사본)엔 옛 줄 모달 + // 단가산출(SK) 줄 = 그 단가산출 문서 모달(수식 탭 · 806-1) — 셈 주입(프로젝트 복사본)엔 줄 모달(안내 · 856-3 까지) if (isSkRef(row.참조) && !opt.calc) return void openSkEdit({ ref: row.참조, @@ -347,9 +347,7 @@ export function mountLaborTable( logic: logics.get(row.로직) ?? null, title: nameOf(row), head: head(), - unit: lineOf(row)?.분모 ?? "", watch, - scope: { layer: opt.layer, owner: library.owner }, readOnly: !edit, inject: !!opt.calc, userMats: cur.자재.map((m) => m.코드), diff --git a/M02_MasterTemplete/M02_MasterTemplete_Sangeun.css b/M02_MasterTemplete/M02_MasterTemplete_Sangeun.css index fb1493f93..1e6c6c43d 100644 --- a/M02_MasterTemplete/M02_MasterTemplete_Sangeun.css +++ b/M02_MasterTemplete/M02_MasterTemplete_Sangeun.css @@ -1,4 +1,4 @@ -/* M02 단가산출(SK) 상세 · 고침 표(PLAN 717-2b) — 표 · 단추 · 배지는 부품 상자 · 여기는 자리 · 고친 칸 색만 */ +/* M02 단가산출(SK) 화면(PLAN 717-2b · 856-1) — 표 · 단추 · 배지는 부품 상자 · 여기는 자리만 */ .m02-sk { display: flex; @@ -29,55 +29,9 @@ min-width: 120px; } -.m02-sk__tags, -.m02-sk__basehead, -.m02-sk__removed, -.m02-sk__removed-item { +.m02-sk__tags { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; } - -.m02-sk__removed { - gap: 8px; -} - -/* 748-0 둘째 기초 머리 줄 — 이름 · 수량 칸 · 단추 한 줄 */ -.m02-sk__basehead { - gap: var(--spacing-8); - align-items: flex-end; -} - -.m02-sk__basename { - flex: 0 1 16em; - min-width: 0; - align-self: center; - font-weight: var(--font-weight-bold); -} - -/* 740-2 이름 + 출처 꼬리표 한 줄 — 이름이 말줄임으로 줄고 꼬리표는 그대로 */ -.m02-sk .m01lab__namerow { - display: flex; - align-items: center; - gap: var(--spacing-4); - min-width: 0; -} - -.m02-sk .m01lab__namerow > span:first-child { - min-width: 0; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} - -/* 727-2 기초 출처 꼬리표 — 칸 폭 고정 · 넘치면 말줄임(풍선 = 온 글) · 이름 칸 폭을 안 바꿈 */ -.m02-sk .m01lab__src { - display: inline-block; - flex: none; - max-width: 9em; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - vertical-align: middle; -} diff --git a/M02_MasterTemplete/M02_MasterTemplete_Sangeun_BaseHead.ts b/M02_MasterTemplete/M02_MasterTemplete_Sangeun_BaseHead.ts deleted file mode 100644 index 999d6eea0..000000000 --- a/M02_MasterTemplete/M02_MasterTemplete_Sangeun_BaseHead.ts +++ /dev/null @@ -1,92 +0,0 @@ -/* ============================================================================= - * M02_MasterTemplete_Sangeun_BaseHead.ts - * 단가산출(SK) 둘째 기초 머리 줄(PLAN 748-0) — 기초마다 한 줄: 이름 · 「수량(기준단위 몇 개)」 칸 하나 · - * [되돌림](넣을 때 수량으로) · [기초 빼기]. 세부 품은 M01 원문 그대로 보임(머리 수량은 이 칸 하나로). - * 값은 문서 `더한줄[k].수량`(화면배 t 로 나눈 화면 값) — 금액은 서버가 셈 · 여기는 칸 · 단추만. - * ========================================================================== */ - -import { createBadge } from "@ui/ui_template_badge"; -import { createButton } from "@ui/ui_template_button"; -import { createCard } from "@ui/ui_template_card"; -import { el } from "@ui/ui_template_elements"; -import { createInputField } from "@ui/ui_template_input"; -import { t as L } from "@ui/ui_template_locale"; -import { createText } from "@ui/ui_template_text"; -import type { SkAnswer, SkDoc } from "./logic/M02_Sangeun_Cover_Model"; - -export interface BaseHeadOptions { - doc: SkDoc; - ans: SkAnswer | null; - edit: boolean; - /** 칸에서 고른 새 수량(화면 값) */ - onQty: (k: number, qty: number) => void; - onReset: (k: number) => void; - onDrop: (k: number, name: string) => void; -} - -const shown = (v: number): string => String(Number(v.toPrecision(8))); -const same = (a: number, b: number): boolean => Math.abs(a - b) <= 1e-9 * Math.max(1, Math.abs(a)); - -/** 둘째 기초(더한줄 로직)마다 머리 줄 한 상자 — 없으면 빈 목록 */ -export function baseHeads(o: BaseHeadOptions): HTMLElement[] { - const t = o.ans?.화면배 ?? 1; - const rows = (o.doc.더한줄 ?? []).flatMap((one, k) => { - if (one.종류 !== "로직") return []; - const line = o.ans?.줄.find((x) => x.cid === `add:#${k}`); - const name = line?.이름 || String(one.로직 ?? ""); - const box = createInputField({ - label: L("M02_SangeunBaseQty"), - value: shown(one.수량 / t), - compact: true, - size: 28, - }); - box.input.inputMode = "decimal"; - box.input.disabled = !o.edit; - box.input.dataset.baseQty = String(k); - box.input.addEventListener("change", () => { - const v = Number(box.input.value.replaceAll(",", "").trim()); - if (box.input.value.trim() === "" || !Number.isFinite(v) || v < 0) - return box.setError(L("M02_SangeunBaseQtyBad")); - box.setError(undefined); - if (!same(v, one.수량 / t)) o.onQty(k, v); - }); - const first = one.처음수량; - return [ - el("div", { - className: "m02-sk__basehead", - attrs: { "data-base-head": String(k) }, - children: [ - el("span", { className: "m02-sk__basename", text: name }), - ...(line?.꼬리표 ? [createBadge(line.꼬리표, "neutral")] : []), - box.root, - ...(line?.단위 ? [createText(line.단위, "muted")] : []), - ...(o.edit && first != null && !same(first, one.수량) - ? [ - createButton({ - label: L("M02_SangeunQtyUndo"), - variant: "ghost", - size: 28, - onClick: () => o.onReset(k), - }), - ] - : []), - ...(o.edit - ? [ - createButton({ - label: L("M02_SangeunDropBase"), - variant: "danger-ghost", - size: 28, - onClick: () => o.onDrop(k, name), - }), - ] - : []), - ], - }), - ]; - }); - if (!rows.length) return []; - const card = createCard({ title: L("M02_SangeunBases"), pad: 12, body: rows }); - card.classList.add("m01lab__ho-box"); // 상자 제목 · 안 간격 = 공용 상세 상자와 같음 - card.dataset.baseHeads = ""; - return [card]; -} diff --git a/M02_MasterTemplete/M02_MasterTemplete_Sangeun_Cover.ts b/M02_MasterTemplete/M02_MasterTemplete_Sangeun_Cover.ts index efecd6315..0bf9ad8da 100644 --- a/M02_MasterTemplete/M02_MasterTemplete_Sangeun_Cover.ts +++ b/M02_MasterTemplete/M02_MasterTemplete_Sangeun_Cover.ts @@ -1,72 +1,50 @@ /* ============================================================================= * M02_MasterTemplete_Sangeun_Cover.ts - * 단가산출(SK) 셈 길 부름 · 뺀 줄 띠(PLAN 717-2b · 717-3 · 724-1) + * 단가산출(SK) 셈 길 부름(PLAN 717-2b · 856-1) — 머리 띠 · 배지용(856-2 에서 문서 답으로 바꾸고 이 파일 지움) * · 셈 = `calcSangeun`(`POST /layers/{층}/sangeun/calc` · 저장 안 함 · 부르는 쪽이 최신 응답만 받음) - * · 고침 표는 공용 상세(`M01_MasterData_UI_LogicLab_Ho` · 724-1) — 여기는 뺀 줄 되살림 띠만 * ========================================================================== */ -import { createBadge } from "@ui/ui_template_badge"; -import { createButton } from "@ui/ui_template_button"; -import { el } from "@ui/ui_template_elements"; -import { t as L } from "@ui/ui_template_locale"; -import { createText } from "@ui/ui_template_text"; import { call, type Layer } from "./M02_MasterTemplete_Api_Fetch"; -import type { SkAnswer } from "./logic/M02_Sangeun_Cover_Model"; import "./M02_MasterTemplete_Sangeun.css"; export interface SkScope { layer: Layer; owner: string | null; } + +/** SK 문서 중 화면 머리가 만지는 칸 */ +export interface SkDoc { + 키?: string; + 이름?: string; + 단위?: string; + 바탕?: { 로직?: string; 참조?: { 층?: string; 주인?: string | null; 키?: string } } | null; + 입력값?: Record; + 바탕판?: string; + [k: string]: unknown; +} + +/** 셈 답 중 머리 띠 · 배지가 읽는 칸 */ +export interface SkAnswer { + 까닭?: string | null; + /** 못 셈 줄(725) — 그 줄만 빠지고 나머지 셈 */ + 빠진줄?: { cid: string; 이름: string; 까닭: string }[]; + 짝잃음?: { cid: string; 까닭: string }[]; + 바탕판: string; + 머리?: string; +} + const q = (scope: SkScope): string => scope.owner && scope.layer !== "system" ? `?owner=${encodeURIComponent(scope.owner)}` : ""; -/** 셈(저장 안 함) — 문서 = 화면 문서 · `given` = 시험 입력(빈 칸 뺌) · 서버가 M01 엔진 한 벌로 셈 */ -export function calcSangeun( +/** 셈(저장 안 함) — 문서 = 화면 문서 · `given` = 시험 입력(빈 칸 뺌) */ +export function calcSangeun( scope: SkScope, doc: Record, given: Record = {}, - seen = true, -): Promise { +): Promise { const 입력값 = Object.fromEntries(Object.entries(given).filter(([, v]) => String(v).trim())); - return call(`/layers/${scope.layer}/sangeun/calc${q(scope)}`, { + return call(`/layers/${scope.layer}/sangeun/calc${q(scope)}`, { method: "POST", - body: JSON.stringify({ 문서: doc, 입력값, 보기: seen }), // 보기 false = 글 · 중간 덧칸 안 지음(바탕 원값 셈) + body: JSON.stringify({ 문서: doc, 입력값, 보기: false }), // 보기 false = 글 · 중간 덧칸 안 지음(몸 걷음 · 856-1) }); } - -/** 뺀 줄(cid · 이름) 띠 — 고칠 수 있으면 [되살림] */ -export function removedStrip( - removed: { cid: string; 이름: string }[], - edit: boolean, - onRestore: (cid: string) => void, -): HTMLElement[] { - if (!removed.length) return []; - return [ - el("div", { - className: "m02-sk__removed", - attrs: { "data-removed": "" }, - children: [ - createText(L("M02_SangeunRemoved")), - ...removed.map((x) => - el("span", { - className: "m02-sk__removed-item", - children: [ - createBadge(x.이름, "neutral"), - ...(edit - ? [ - createButton({ - label: L("M02_SangeunRestore"), - variant: "ghost", - size: 22, - onClick: () => onRestore(x.cid), - }), - ] - : []), - ], - }), - ), - ], - }), - ]; -} diff --git a/M02_MasterTemplete/M02_MasterTemplete_Sangeun_Detail.ts b/M02_MasterTemplete/M02_MasterTemplete_Sangeun_Detail.ts index 0d78feee3..7f02bbaef 100644 --- a/M02_MasterTemplete/M02_MasterTemplete_Sangeun_Detail.ts +++ b/M02_MasterTemplete/M02_MasterTemplete_Sangeun_Detail.ts @@ -1,21 +1,14 @@ /* ============================================================================= * M02_MasterTemplete_Sangeun_Detail.ts - * M02 단가산출(SK) 상세(PLAN 717-2b · 724-1 · 요구서 4장 3 · 4 · 13 · 17 · 24) — M01 「단가산출 로직」 상세 부품을 M02 길로. - * 보기 둘(`_Sangeun_Tabs` · 799-2) = 수식(공용 수식 문서 화면 · 802-4b-2 · 저장 = 페이지 [저장] 한 번(804-8 · 수식 먼저 → 판 · 수식 칸 새로)) · 단가산출 상세(공용 상세 `LogicLab_Ho` · SK 셈 답 줄 = `hoView` · 줄 모달 그 자리 고침 = - * HoEdit → SK 덮개 · 더한줄 · 줄 빼기 · 별도계상) · 기본정보 = 바탕 로직(맨 위 접힘) — 시트 · 인력·재료·경비 · 시험 계산 · 텍스트 수식은 걷음 - * 고침 = SK 덮개 · 더한줄(`Sangeun_Pick`) · 뺀줄(꼴 = 서버 `M02_Sangeun_Doc`) · 값 = 서버 셈 길 최신 응답만 - * 옵션 칸 = SK `입력값`(727-3 · 저장 · 열린입력만 시험 값) · [저장] = 화면 문서 → 서버가 다시 셈(원값 · 바탕판) - * 둘째 기초(727-2) = 서버 `펼침` 세부 줄 · 인력 · 재료 · 경비 상자에 함께 + 꼬리표(기초 둘 이상) · 세부 덮개 · - * 뺀줄 · [기초 빼기] · M01 개정 알림 · 옵션 칸 = 바탕 입력 + 더한줄 기초 입력 - * [항목 추가] 기초 = 바탕 비었으면 바탕(727-2 · 단위가 비거나 「식」이면 기초 결과단위) · 있으면 더한줄 · 바탕 없이 줄만도 됨 - * 단가산출 화면(`source` · 804-8) = M01 과 같은 꼴 — 보기 고르기는 페이지 머리 줄(`slot`) · [항목 추가] · [율 줄 추가] 걷음 - * (줄 더하기 = 수식 탭 [+] 단가산출 복사) · 수식 고침도 페이지 [저장] 한 번에(`flush` 먼저) · 고침 알림 = 기본 + 수식 + * M02 단가산출(SK) 화면(PLAN 717-2b · 804-8 · 856-1) — 머리(이름 · 단위 · 단위 환산 · 바탕) · 머리 띠 · 줄 쌓기(`_Sangeun_Tabs`). + * 모드(856-1 · 옛 키 글자 약속 `SK-000000` 대신) = page(단가산출 화면 · 일위대가 SK 모달 — 원문 패널 · 페이지 [저장] 한 번 · + * 수식 먼저 → 판 · 수식 칸 새로) · ref(저장한 SK — 줄 쌓기 자기 저장 · 불러오기 저장 뒤) · memory(저장 전 가져온 식 · 보기만) + * 머리 띠(까닭 · M01 개정 · 빠진 줄 · 짝 잃음) · 머리 배지 = 서버 셈 길 최신 응답(856-2 에서 문서 답으로) + * 옛 상세 몸(덮개 · 뺀줄 · 더한줄 · 재료 고름 · 줄 모달)은 856-1 에 걷음 — 고침은 줄 쌓기 한 벌 * ========================================================================== */ import { createBadge } from "@ui/ui_template_badge"; import { createBanner } from "@ui/ui_template_banner"; -import { createButton } from "@ui/ui_template_button"; -import { createCheckbox } from "@ui/ui_template_checkbox"; import { el } from "@ui/ui_template_elements"; import { createInputField } from "@ui/ui_template_input"; import { t as L } from "@ui/ui_template_locale"; @@ -23,47 +16,25 @@ import { createText } from "@ui/ui_template_text"; import { fetchLogic, setLogicApiPaths, - type CalcLine, - type LogicInput, type LogicOne, - type LogicRow, - type TextAnswer, } from "../M01_MasterData/M01_MasterData_UI_Logic_Api"; -import { buildLabDetail } from "../M01_MasterData/M01_MasterData_UI_LogicLab_Detail"; -import { buildHo, type HoEdit } from "../M01_MasterData/M01_MasterData_UI_LogicLab_Ho"; import { readTemplate, type Layer } from "./M02_MasterTemplete_Api_Fetch"; -import { baseHeads } from "./M02_MasterTemplete_Sangeun_BaseHead"; -import { calcSangeun, removedStrip } from "./M02_MasterTemplete_Sangeun_Cover"; +import { calcSangeun, type SkAnswer, type SkDoc } from "./M02_MasterTemplete_Sangeun_Cover"; import { createSangeunTabs } from "./M02_MasterTemplete_Sangeun_Tabs"; import { tl } from "../M01_MasterData/M01_MasterData_UI_LogicLab_Text"; -import { createSangeunSide, tabOf, type SourceTab } from "./M02_MasterTemplete_Sangeun_Side"; -import { baseUnitOf, buildUnitSwap, type SwapHow } from "./M02_MasterTemplete_Sangeun_Unit"; -import { - dropBase, - dropLine, - goneRows, - hoView, - removedSubs, - restoreLine, - revisedAdds, - rowsOf, - setApart, - setLineCover, - type CoverRow, - type HoView, - type SkAnswer, - type SkDoc, -} from "./logic/M02_Sangeun_Cover_Model"; -import { resetQty, setQty } from "./logic/M02_Sangeun_Undo"; +import { createSangeunSide, tabOf } from "./M02_MasterTemplete_Sangeun_Side"; +import { buildUnitSwap, type SwapHow } from "./M02_MasterTemplete_Sangeun_Unit"; + +export type SangeunMode = "page" | "ref" | "memory"; export interface SangeunDetailOptions { layer: Layer; owner: string | null; readOnly: boolean; onChanged: (dirty: boolean) => void; - /** 752-1 오른쪽 원문 패널 — 단가산출 화면만 켬(일위대가 줄 모달 안 상세는 끔) */ - source?: boolean; - /** 수식 탭 저장 뒤 그 SK 새 판(페이지 [저장] 409 막음 · 802-4b-2) */ + /** 856-1 화면 모드 — 머리 글 */ + mode: SangeunMode; + /** 수식 저장 뒤 그 SK 새 판(페이지 [저장] 409 막음 · 802-4b-2) */ onVersion?: (version: string) => void; slot?: HTMLElement; // 페이지 머리 줄 빈 자리(804-8) — 보기 고르기를 M01 처럼 머리 줄에 } @@ -77,49 +48,38 @@ export function mountSangeunDetail( opt: SangeunDetailOptions, ): { getDoc: () => SkDoc; - getValues: () => Record; /** 페이지 [저장] 앞 — 수식 고침 저장 · 실패면 던짐 */ flush: () => Promise; destroy: () => void; } { - setLogicApiPaths(LIB); // 상세 부품 길 = M02 로그인 길(717-1) + setLogicApiPaths(LIB); // 바탕 정보 길 = M02 로그인 길(717-1) const doc = clone((doc0 ?? {}) as SkDoc); let saved = JSON.stringify(doc); const edit = !opt.readOnly; + const page = opt.mode === "page"; const scope = { layer: opt.layer, owner: opt.owner }; const values: Record = Object.fromEntries( Object.entries(doc.입력값 ?? {}).map(([k, v]) => [k, String(v)]), ); let base: LogicOne | null = null; - let text: TextAnswer | null = null; - let lastText: TextAnswer | undefined; let ans: SkAnswer | null = null; - let bare: SkAnswer | null = null; let fail = ""; - let extra: LogicInput[] = []; // 더한줄 로직 입력 중 바탕에 없는 것 = 옵션 칸(725-6 · 727-3) - const inputsOf = new Map(); - const infoOf = new Map(); // 더한줄 로직 → 원문 탭(752-1) - let extraKeys: string[] = []; - const side = opt.source ? createSangeunSide() : null; + const side = page ? createSangeunSide() : null; let seq = 0; let alive = true; const head = el("div", { className: "m02-sk__head", attrs: { "data-sk-head": "" } }); const notes = el("div"); - const editor = el("div", { className: "m01-logic__editor" }); let refreshing: Promise = Promise.resolve(); - const tabs = createSangeunTabs(editor, { + const tabs = createSangeunTabs({ edit, scope, onSaved: (v) => void (refreshing = formulaSaved(v)), - page: opt.source ? () => report() : undefined, // 804-8 페이지 [저장] · [되돌림] + page: page ? () => report() : undefined, // 804-8 페이지 [저장] · [되돌림] // 836-5 저장 전 가져온 식(불러오기 미리 보기) = 그 문서째 수식 보기 - memory: () => - doc.가져온 && !/^SK-(?!0{6})\d{6}$/.test(doc.키 ?? "") - ? (doc as Record) - : null, + memory: opt.mode === "memory" ? () => doc as Record : undefined, }); - /** 수식 탭 저장 = 파일 판 · `수식` 칸이 바뀜 — 페이지 판 · 이 화면 문서 `수식` 을 새로(상세 탭 셈이 씀) */ + /** 수식 저장 = 파일 판 · `수식` 칸이 바뀜 — 페이지 판 · 이 화면 문서 `수식` 을 새로 */ async function formulaSaved(version: string): Promise { opt.onVersion?.(version); try { @@ -134,7 +94,6 @@ export function mountSangeunDetail( /* 못 읽음 = 다음 열기 때 새로 */ } } - const ownHost = el("div"); const main = el("div", { className: "m02-sk", attrs: { "data-sangeun-detail": doc.키 ?? "" }, @@ -143,60 +102,20 @@ export function mountSangeunDetail( notes, ...(opt.slot ? [] : [el("div", { className: "m02-sk__head", children: [tabs.tools] })]), tabs.host, - editor, ], }); host.replaceChildren(side ? side.wrap(main) : main); opt.slot?.replaceChildren( el("span", { className: "ui-toolbar m02-main__tools", children: [tabs.tools] }), ); + tabs.draw(opt.mode === "memory" ? "" : (doc.키 ?? "")); - const opened = (): boolean => (doc.열린입력 ?? []).length > 0; - // 바탕 없는 SK 의 지문 = 이름 · 단위 따라 바뀜 — 바탕이 있을 때만 M01 개정으로 봄(725-3) · 둘째 기초 지문(727-2) + // 바탕 없는 SK 의 지문 = 이름 · 단위 따라 바뀜 — 바탕이 있을 때만 M01 개정으로 봄(725-3) const revisedBase = (): boolean => - !!(doc.바탕 && doc.바탕판 && ans?.바탕판 && doc.바탕판 !== ans.바탕판) || - revisedAdds(ans, doc).length > 0; + !!(doc.바탕 && doc.바탕판 && ans?.바탕판 && doc.바탕판 !== ans.바탕판); const baseKey = (): string | null => doc.바탕?.로직 ?? null; - /** 바탕 없는 · 참조 바탕 SK 의 기본정보 자리 줄 */ - const standIn = (): LogicRow => ({ - 키: doc.키 ?? "", - 원문번호: "", - 이름: doc.이름 ?? "", - 결과단위: `원/${doc.단위 ?? ""}`, - 출처: doc.바탕?.참조?.키 ?? L("M02_SangeunNoBase"), - 입력: extra, - 중간: [], - 호표: [], - 덧줄: [], - }); - - /** 더한줄 로직들의 입력을 모음(같은 이름은 하나 · 바탕 입력에 있는 이름 뺌) */ - async function syncExtra(): Promise { - const keys = [ - ...new Set((doc.더한줄 ?? []).flatMap((x) => ("로직" in x ? [String(x.로직)] : []))), - ]; - await Promise.all( - keys - .filter((k) => !inputsOf.has(k)) - .map((k) => - fetchLogic(k).then( - (r) => { - inputsOf.set(k, r.logic.입력 ?? []); - infoOf.set(k, tabOf(r.logic)); - }, - () => void inputsOf.set(k, []), - ), - ), - ); - extraKeys = keys; - const seen = new Set((base?.logic.입력 ?? []).map((i) => i.이름)); - extra = keys - .flatMap((k) => inputsOf.get(k) ?? []) - .filter((i) => !seen.has(i.이름) && seen.add(i.이름)); - } - - /** 고침 알림 — 기본(이름 · 단위 · 옵션 · 덮개) + 수식 탭 */ + /** 고침 알림 — 기본(이름 · 단위 · 환산) + 수식 */ function report(): void { if (alive) opt.onChanged(edit && (JSON.stringify(doc) !== saved || tabs.dirty())); } @@ -206,23 +125,16 @@ export function mountSangeunDetail( else drawHead(); }; + /** 머리 띠 · 배지 = 서버 셈 한 번(최신 응답만) */ async function recalc(): Promise { const mine = ++seq; - await syncExtra(); - if (mine !== seq || !alive) return; - const plain = { ...doc, 덮개: {}, 뺀줄: [], 더한줄: [] }; try { - const [got, was] = await Promise.all([ - calcSangeun(scope, doc, values), - doc.바탕 ? calcSangeun(scope, plain, values, false) : Promise.resolve(null), // 바탕 원값 = 보기 덧칸 없이 - ]); + const got = await calcSangeun(scope, doc, values); if (mine !== seq || !alive) return; // 늦게 온 답 — 버림 - [ans, bare, fail] = [got, was, ""]; - text = got.글 ?? null; // 750-2 텍스트 수식 · 시험 계산 = 이 답 하나(바탕 로직 따로 셈 없음) - if (text?.ok) lastText = text; + [ans, fail] = [got, ""]; } catch (error) { if (mine !== seq || !alive) return; - [ans, text, fail] = [null, null, error instanceof Error ? error.message : String(error)]; + [ans, fail] = [null, error instanceof Error ? error.message : String(error)]; } draw(); } @@ -241,7 +153,6 @@ export function mountSangeunDetail( }; const baseName = base ? `${base.logic.키} ${base.logic.이름}` : null; const baseText = baseName ?? doc.바탕?.참조?.키 ?? L("M02_SangeunNoBase"); - const revised = revisedBase(); const swap = base ? buildUnitSwap({ result: base.logic.결과단위, @@ -265,8 +176,7 @@ export function mountSangeunDetail( children: [ createText(`${L("M02_SangeunBase")} · ${baseText}`, "muted", 14), ...(ans?.머리 ? [createBadge(ans.머리, "info")] : []), - ...(revised ? [createBadge(L("M02_SangeunRevisedBase"), "danger")] : []), - ...(opened() ? [createBadge(L("M02_SangeunScaleOnly"), "warning")] : []), + ...(revisedBase() ? [createBadge(L("M02_SangeunRevisedBase"), "danger")] : []), ], }), ); @@ -275,13 +185,13 @@ export function mountSangeunDetail( function drawNotes(): void { const lost = ans?.짝잃음 ?? []; const gaps = ans?.빠진줄 ?? []; - const revised = revisedBase(); - notes.replaceChildren( ...(fail || ans?.까닭 ? [createBanner({ tone: "danger", text: fail || String(ans?.까닭) })] : []), - ...(revised ? [createBanner({ tone: "warning", text: L("M02_SangeunRevisedNote") })] : []), + ...(revisedBase() + ? [createBanner({ tone: "warning", text: L("M02_SangeunRevisedNote") })] + : []), ...(gaps.length ? [ createBanner({ @@ -307,151 +217,11 @@ export function mountSangeunDetail( if (!alive) return; drawHead(); drawNotes(); - const rows = ans ? rowsOf(ans, bare, doc) : []; - const names = new Map((bare ? rowsOf(bare, null, {}) : []).map((r) => [r.cid, r.이름])); - const removed = [ - ...(doc.뺀줄 ?? []).map((cid) => ({ cid, 이름: names.get(cid) ?? cid })), - ...removedSubs(ans), - ...goneRows(doc), // 뺀 더한줄(744-1) - ]; - const row = base ? { ...base.logic, 입력: [...(base.logic.입력 ?? []), ...extra] } : standIn(); - const view = ans ? hoView(ans, bare, base?.logic ?? null, doc) : null; - tabs.draw(/^SK-(?!0{6})\d{6}$/.test(doc.키 ?? "") ? (doc.키 ?? "") : ""); // SK-000000 = 줄 문서(808-1) - const hoCtx = { - row: view ? { ...row, 호표: view.호표, 덧줄: view.덧줄 } : row, - prices: base?.prices ?? {}, - lines: (view?.lines ?? null) as CalcLine[] | null, - text, - lastText, - values, - onInput, - edit: view && edit ? hoEdit(view, rows) : undefined, - cids: view?.cids, - pickMat: (idx: number) => pickMat(view?.cids[idx]), - }; - const ho = el("div", { - attrs: { "data-sk-cover": "" }, - children: [ - ...removedStrip(removed, edit, (cid) => (restoreLine(doc, cid), touch())), - ...baseHeads({ - doc, - ans, - edit, - onQty: (k, qty) => { - const one = doc.더한줄?.[k]; - if (one) setQty(one, qty * (ans?.화면배 ?? 1)); - touch(); - }, - onReset: (k) => { - const one = doc.더한줄?.[k]; - if (one) resetQty(one); - touch(); - }, - onDrop: (k, name) => (dropBase(doc, k, name), touch()), - }), - ...buildHo(hoCtx), - ], - }); - buildLabDetail(editor, { - row: base?.logic ?? row, - file: base?.file ?? "", - reasons: base?.reasons ?? [], - ownHost, - onChange: () => undefined, - cover: { ho }, - }); - // prettier-ignore - side?.set([ - ...(base ? [tabOf(base.logic)] : []), - ...extraKeys.flatMap((k) => (k === baseKey() ? [] : infoOf.has(k) ? [infoOf.get(k)!] : [])), - ], doc); + side?.set(base ? [tabOf(base.logic)] : [], doc); } - /** 재료 고름(줄 모달) = SK 문서 `고름`(cid → MT) — 둘째 기초 세부 줄은 보기만 */ - function pickMat(cid: string | undefined): ((it: { ref: string }) => void) | undefined { - if (!cid || cid.startsWith("add:#")) return undefined; - return (it) => { - doc.고름 = { ...(doc.고름 ?? {}), [cid]: it.ref }; - touch(); - }; - } - - /** 공용 상세 고침 고리 — 열쇠 = Ho 줄 차례 → cid · 고침 = SK 덮개 · 더한줄(M01 안 바뀜 · 내역 17-2) · - * 모달 덧 동작 = 줄 빼기 · 더한 재료 별도계상 */ - function hoEdit(view: HoView, rows: CoverRow[]): HoEdit { - const by = new Map(rows.map((r) => [r.cid, r])); - const at = (idx: number): CoverRow | undefined => by.get(view.cids[idx]); - return { - covers: view.covers, - scope: "m02", - set: (idx, c) => { - const r = at(idx); - if (!r) return; - setLineCover(doc, r, c, opened()); - touch(); - }, - more: (idx, close) => { - const r = at(idx); - if (!r) return { head: [], body: [] }; - const drop = createButton({ - label: L("M02_SangeunDrop"), - variant: "danger-ghost", - size: 32, - onClick: () => (close(), dropLine(doc, r), touch()), - }); - drop.dataset.skDrop = ""; - const sub = r.sub; - const whole = sub - ? [ - createButton({ - label: L("M02_SangeunDropBase"), - variant: "danger-ghost", - size: 28, - onClick: () => ( - close(), - dropBase(doc, sub.k, ans?.줄.find((x) => x.cid === `add:#${sub.k}`)?.이름), - touch() - ), - }), - ] - : []; - const apart = r.apartPick - ? [ - createCheckbox(L("M02_SangeunApart"), { - chip: true, - size: 28, - checked: r.apart, - onChange: (on) => (close(), setApart(doc, r, on), touch()), - }).root, - ] - : []; - const rest = [...apart, ...whole]; - return { - head: [drop], - body: rest.length ? [el("div", { className: "m02-sk__tags", children: rest })] : [], - }; - }, - }; - } - - /** 옵션 칸(수식 탭 · 단가산출 상세) — 입력 고침 → SK `입력값`(727-3 · 열린입력 = 시험 값만) · 셈 */ - function onInput(name: string, v: string): void { - values[name] = v; - if (edit && !(doc.열린입력 ?? []).includes(name)) { - const kept = { ...(doc.입력값 ?? {}) }; - if (String(v).trim()) kept[name] = v; - else delete kept[name]; - doc.입력값 = kept; - touch(false); - } - void recalc(); // 750-2 옵션 바꿈 = 서버 셈 한 번 — 수식 · 단가산출 상세가 그 답 하나로 다시 그려짐 - } - - /** `fresh` = 막 넣은 바탕 — 단위가 비거나 「식」이면 기초 기준단위(「100본」 · 바꾸면 서버가 환산 · 728-2) */ - async function loadBase(fresh = false): Promise { + async function loadBase(): Promise { const key = baseKey(); - base = null; - text = null; if (key) { try { base = await fetchLogic(key); @@ -460,28 +230,17 @@ export function mountSangeunDetail( } } if (!alive) return; - if (fresh && base && (!doc.단위 || doc.단위 === "식")) { - doc.단위 = baseUnitOf(base.logic.결과단위) || doc.단위; - touch(false); - } draw(); - await recalc(); // 바탕 정체(bare) 먼저 — 시험 계산 칸 항목(재료 잡힌 품목)이 쓰임 + await recalc(); } void loadBase(); return { getDoc: () => { if (ans?.바탕판 && doc.바탕) doc.바탕판 = ans.바탕판; // 저장 = 지금 바탕 확인(서버가 다시 적음) - for (const l of ans?.줄 ?? []) { - const one = l.바탕판 - ? doc.더한줄?.[Number(/^add:#(\d+)$/.exec(l.cid)?.[1] ?? -1)] - : undefined; - if (one) one.바탕판 = l.바탕판; // 둘째 기초도 같음(727-2) - } saved = JSON.stringify(doc); return clone(doc); }, - getValues: () => ({ ...values }), // 723-3 — 일위대가 줄 모달 [적용] = 옵션을 그 줄에 남김 flush: async () => { if (!tabs.dirty()) return; if (!(await tabs.save())) throw new Error(tl("View_Equation")); diff --git a/M02_MasterTemplete/M02_MasterTemplete_Sangeun_Tabs.ts b/M02_MasterTemplete/M02_MasterTemplete_Sangeun_Tabs.ts index 2e09f9c5e..9cc07c8c6 100644 --- a/M02_MasterTemplete/M02_MasterTemplete_Sangeun_Tabs.ts +++ b/M02_MasterTemplete/M02_MasterTemplete_Sangeun_Tabs.ts @@ -1,12 +1,10 @@ /* ============================================================================= * M02_MasterTemplete_Sangeun_Tabs.ts - * M02 단가산출(SK) 상세 보기(PLAN 799-2 · 804-2 · 804-6 · 836-3) — 수식(줄 쌓기) 하나 · 보기 고르기 단추 없음. + * M02 단가산출(SK) 수식 그릇(PLAN 799-2 · 804-2 · 804-6 · 836-3 · 856-1) — 줄 쌓기 하나 · 보기 고르기 단추 없음. * 수식 = 공용 줄 쌓기 화면(`A00_Common/line_stack_screen.ts` · M01 과 같은 꼴) — 길 앞머리만 M02 사본 길 * (`/m02/layers/{층}/sangeun/{키}/doc` · 802-4a) · 층 쓰기 권한 없으면 읽기만 * 저장(804-8 · `page` 있음 = 단가산출 화면) = 페이지 [저장] · [되돌림] 한 번에 — 탭 위 저장 단추 없음(M01 과 같음) - * 수식 문서 없는 줄(일위대가 줄 모달 등) = 상세가 쥔 `editor`(단가산출 상세 몸)만 보임 — 빈 화면 없음 - * 저장 안 한 SK(일위대가 줄 모달 · 새 SK) = 「저장한 단가산출만」 글 - * [단가 갱신] · [재생성](808-1 · 요구 701-3) = `tools` — 머리 줄(수식 보기일 때만) + * [단가 갱신] · [재생성](808-1 · 요구 701-3) = `tools` — 머리 줄 * ========================================================================== */ import { createStackScreen } from "../A00_Common/line_stack_screen"; @@ -20,7 +18,7 @@ export interface SkEquationOptions { onSaved: (version: string) => void; /** 페이지가 저장 · 되돌림을 맡음(804-8) — 수식 고침 있음이 바뀔 때 부름 */ page?: () => void; - /** 저장 전 불러온 단가산출 문서(836-5 · 미리 보기 835-1) — 있으면 그 문서째 수식 보기 · 없으면 null */ + /** 저장 전 불러온 단가산출 문서(836-5 · 미리 보기 835-1) — 그 문서째 수식 보기 */ memory?: () => Record | null; } @@ -34,11 +32,8 @@ export function skDocPath(scope: SkEquationOptions["scope"], key: string, path: return ask ? `${at}?${ask}` : at; } -/** 수식 그릇 — `editor` = 단가산출 상세 그릇(수식 문서 있을 때 숨김) */ -export function createSangeunTabs( - editor: HTMLElement, - opt: SkEquationOptions, -): { +/** 수식 그릇 */ +export function createSangeunTabs(opt: SkEquationOptions): { /** 수식 화면 단추([단가 갱신] · [재생성]) — 머리 줄 */ tools: HTMLElement; host: HTMLElement; @@ -62,20 +57,10 @@ export function createSangeunTabs( tools, memory: opt.memory, }); - const show = (doc: boolean): void => { - stack.root.hidden = tools.hidden = !doc; - editor.hidden = doc; - }; - show(true); return { tools, host: el("div", { className: "m02-sk__views", children: [stack.root] }), - draw: (k: string) => { - // 문서 없는 줄(일위대가 로직 줄 모달 등 · 페이지 아님) = 단가산출 상세 몸만(808-1 · 수식은 문서가 있어야) - const doc = !!k || !!opt.page || !!opt.memory?.(); - show(doc); - if (doc) stack.draw(k); - }, + draw: (k: string) => stack.draw(k), canLeave: () => stack.canLeave(), dirty: () => stack.dirty(), save: () => stack.save(), diff --git a/M02_MasterTemplete/M02_MasterTemplete_Sangeun_View.ts b/M02_MasterTemplete/M02_MasterTemplete_Sangeun_View.ts index f25cd2a8f..3c5b0389c 100644 --- a/M02_MasterTemplete/M02_MasterTemplete_Sangeun_View.ts +++ b/M02_MasterTemplete/M02_MasterTemplete_Sangeun_View.ts @@ -23,7 +23,7 @@ export function mountSangeunView( doc: unknown, opt: SangeunViewOptions, ): { getDoc: () => Promise; destroy: () => void } { - const one = mountSangeunDetail(host, doc, { ...opt, owner: opt.owner ?? null, source: true }); // 752-1 + const one = mountSangeunDetail(host, doc, { ...opt, owner: opt.owner ?? null, mode: "page" }); // 752-1 · 856-1 return { getDoc: () => one.flush().then(() => one.getDoc()), destroy: () => one.destroy(), diff --git a/M02_MasterTemplete/logic/M02_Born_Tag.ts b/M02_MasterTemplete/logic/M02_Born_Tag.ts index fb6021aae..e5a272ccd 100644 --- a/M02_MasterTemplete/logic/M02_Born_Tag.ts +++ b/M02_MasterTemplete/logic/M02_Born_Tag.ts @@ -2,7 +2,7 @@ * M02_Born_Tag.ts * 넣은 줄 출처 꼬리표(740-2 · 요구 581) — 서버 `본뜬 {층, 주인, 키, 이름, 때}`(740-1) → 화면 글. * 순수 계산 — 화면 · fetch 없음. 첫 줄 = 줄 옆에 보이는 짧은 글 · 둘째 줄 = 풍선(키 · 이름 · 층 · 때). - * 공용 상세 꼬리표 칸(`LogicLab_Ho` sourceTag)이 「\n」 앞만 보이고 전체를 풍선으로 씀. + * 격자 비고 칸 · 줄 풍선이 「\n」 앞만 보이고 전체를 풍선으로 씀. * ========================================================================== */ export interface Born { @@ -40,14 +40,5 @@ export function bornText(born: unknown, before = ""): string { return `${shown}\n${tip}`; } -/** 단가산출 줄 열쇠(`add:#k` · `add:#k/…`) → 그 더한줄의 꼬리표 글 */ -export function bornOfCid(cid: string, adds: readonly object[] | undefined, before = ""): string { - const hit = /^add:#(\d+)/.exec(cid); - return bornText( - hit ? (adds?.[Number(hit[1])] as { 본뜬?: unknown } | undefined)?.본뜬 : undefined, - before, - ); -} - /** 격자 비고 칸 글 — 「본뜬 SK-000012」 · 없으면 "" (첫 줄만) */ export const bornNote = (born: unknown): string => bornText(born).split("\n")[0]; diff --git a/M02_MasterTemplete/logic/M02_Sangeun_Cover_Model.ts b/M02_MasterTemplete/logic/M02_Sangeun_Cover_Model.ts deleted file mode 100644 index 0eb520245..000000000 --- a/M02_MasterTemplete/logic/M02_Sangeun_Cover_Model.ts +++ /dev/null @@ -1,627 +0,0 @@ -/* ============================================================================= - * M02_MasterTemplete/logic/M02_Sangeun_Cover_Model.ts - * 단가산출(SK) 고침 꼴(PLAN 717-2b · 717-3 · 724-1 — SK 상세 · 일위대가 줄 모드 같이 씀) — - * 서버 셈 답(`/layers/{층}/sangeun/calc`) → 공용 상세(`M01_MasterData_UI_LogicLab_Ho`) 줄 · 계산서 줄 · - * 고친 칸(`LineCover` · 호표 차례 열쇠) → SK 문서 덮개 · 더한줄 · 뺀줄(꼴 = 서버 `M02_Sangeun_Doc`). - * 금액은 늘 서버가 셈 — 여기는 줄 모양 · 문서 칸 옮김만. - * 줄 정체 cid = `kind:키#n`(바탕 줄) · `add:#k`(더한줄 k 째) · 덮개 원값 = 저장 때 서버가 다시 적음 - * (화면은 고친 첫때 바탕 값을 적어 둠 — 곁 글용) · 열린입력 있는 SK = 품은 배율만 - * 일위대가 줄 → 이름 없는 SK 문서 = `lineDoc`(서버 `M02_Labor_Patch.as_doc` 꼴) - * 둘째 기초(727-2) = 더한줄 로직 줄을 서버 `펼침`(세부 줄)으로 바꿔 놓음 · 열쇠 `add:#k/세부 cid` · - * 고침 = 그 더한줄의 `덮개` · `뺀줄`(품 = 화면 품 ÷ 수량 · 1 기준단위 몫) · 꼬리표 = 기초 둘 이상일 때만 - * SK 단위 환산(728-2) = 서버가 화면 줄을 SK 1 단위 몫으로(`화면배`) — 문서 품 = 화면 품 × 화면배(율 빼고) - * 화면 · fetch · sessionStorage 없음(`CLAUDE.md` 4장). - * ========================================================================== */ - -import type { CalcLine, TextAnswer } from "../../M01_MasterData/M01_MasterData_UI_Logic_Api"; -import { bornOfCid } from "./M02_Born_Tag"; -import { forgetAdd, goneName, reviveAdd, setQty, resetQty } from "./M02_Sangeun_Undo"; - -export type CoverPart = "labor" | "material" | "expense"; -export const PART_OF: Record = { - 노무비: "labor", - 재료비: "material", - 경비: "expense", -}; -const PARTS: CoverPart[] = ["labor", "material", "expense"]; - -export interface SkCover { - qty?: number; - 배율?: number; - labor?: number; - material?: number; - expense?: number; - 원값?: { qty?: number; 단가?: number }; -} - -export interface SkAdded { - 종류?: string; - 수량: number; - 단가?: number; - /** 둘째 기초 세부 고침(727-2) — 열쇠 = 세부 cid */ - 덮개?: Record; - 뺀줄?: string[]; - 바탕판?: string; - /** 넣을 때 수량(744-1) — [되돌림] 값 */ - 처음수량?: number; - [k: string]: unknown; -} - -/** SK 문서 중 고침이 만지는 칸 */ -export interface SkDoc { - 키?: string; - 이름?: string; - 단위?: string; - 바탕?: { 로직?: string; 참조?: { 층?: string; 주인?: string | null; 키?: string } } | null; - 입력값?: Record; - 열린입력?: string[]; - 덮개?: Record; - 더한줄?: SkAdded[]; - 뺀줄?: string[]; - /** 뺀 더한줄 기억(744-1) — [되살림] = 그 차례에 다시 끼움 */ - 뺀더한줄?: { 차례: number; 줄: SkAdded }[]; - 고름?: Record; - 자재표시?: Record; - 바탕판?: string; - [k: string]: unknown; -} - -export interface SkLine { - 이름: string; - 단위?: string; - 수량: number | null; - 단가: number | null; - 금액: number | null; - 비목?: Record; - 묶음?: string | null; - cid: string; - 율?: number; - /** % 줄 밑 이름(「노무비의 %」 · 율 줄 「인력의 %」) */ - 규격?: string; - /** 못 셈 줄(725) — 금액 없음 · 계에 안 듦 */ - 까닭?: string; - /** 둘째 기초(727-2) — 세부 줄 · 뺀 세부 · 그 기초 지문 · 원문번호 */ - 펼침?: SkLine[]; - 뺀세부?: { cid: string; 이름: string }[]; - 바탕판?: string; - 꼬리표?: string; - /** 세부 줄 — 덮기 전 1 기준단위 품 · 단가 */ - 바탕값?: { qty?: number; 단가?: number } | null; - /** 둘째 기초 세부 줄(744-1) — 그 기초 1 기준단위 몫(M01 원문 · 머리 수량 안 곱함) · 화면 품 칸 */ - 원문?: { 수량: number | null; 금액: number | null; 비목?: Record }; - /** 재료 줄이 잡은 품목(시험 계산 재료 칸 · 줄 모달) */ - 품목?: CalcLine["품목"]; - /** (753-1) 옵션으로 빠진 줄 — 화면은 안 그림 */ - 옵션꺼짐?: boolean; - /** (796-2d) 합계에 안 드는 줄 — 엔진 표지 */ - 합밖?: boolean; -} - -export interface SkMat { - 차례: number; - 이름: string; - 단위?: string; - 수량: number | null; - 단가: number | null; - 금액: number | null; -} - -export interface SkAnswer { - 기준: Record | null; - 줄: SkLine[]; - 재료?: SkMat[]; - 까닭?: string | null; - /** 못 셈 줄(725 · 입력 없음 · 수량 없음) — 그 줄만 빠지고 나머지 셈 */ - 빠진줄?: { cid: string; 이름: string; 까닭: string }[]; - 정체: string[]; - 짝잃음: { cid: string; 까닭: string; 바탕?: string }[]; - 바탕판: string; - 머리?: string; - /** 바탕 원문번호(참조 바탕 = 그 키) */ - 꼬리표?: string | null; - /** 바탕 기준단위 → SK 단위 배(728-2) · 화면 줄을 나눈 배(없으면 1 · 문서 품 = 화면 품 × 화면배) */ - 배?: number; - 화면배?: number; - /** 보기 덧칸(750-1) — 텍스트 수식 글(줄마다 cid · 금액 = SK 줄) · 시험 계산 중간값 · 몸 `보기: false` 면 없음 */ - 글?: TextAnswer; - 중간?: Record; -} - -export interface CoverRow { - cid: string; - 묶음: string; - 이름: string; - 단위: string; - 수량: number | null; - 단가: number | null; - 금액: number | null; - /** 비목 몫 금액 */ - parts: Record; - /** % 덧줄 — 수량 = 율 · 단가 못 고침 */ - pct: boolean; - /** 더한줄 차례 · 바탕 줄 = null */ - added: number | null; - /** 기준 밖 재료(일위대가 자재목록으로 셈) — 금액이 계에 안 듦 */ - apart: boolean; - covered: { qty: boolean; price: boolean }; - /** 덮개 배율(열린입력 SK) */ - 배율: number | null; - /** 바탕 값(덮개 · 더한줄 · 뺀줄 없이 셈) · 없으면 null */ - was: { qty: number | null; 단가: number | null } | null; - /** 저장 때 적힌 원값이 지금 바탕 값과 다름(M01 개정) */ - revised: boolean; - priceEdit: boolean; - /** 더한 재료 줄 — 별도계상 고름(기본 계 안) */ - apartPick: boolean; - /** 둘째 기초 세부 줄 — 더한줄 차례 · 세부 cid · 수량(배) · 바탕 줄 · 그 밖 = null */ - sub: { k: number; cid: string; scale: number } | null; - /** 화면배(728-2) — 문서 품 = 화면 품 × t · `was` = 문서 몫 */ - t: number; - /** (753-2) 옵션으로 빠진 줄 — 계산서에서 안 그림 */ - off: boolean; -} - -/* ── 순수 셈 ── */ -const BUNDLE_OF: Record = { 노무비: "인력", 재료비: "재료", 경비: "경비" }; -const ADD_RE = /^add:#(\d+)$/; -const SUB_RE = /^add:#(\d+)\/(.+)$/; - -/** 세부 열쇠 `add:#k/세부 cid` → {k, cid} */ -export function subOf(key: string): { k: number; cid: string } | null { - const m = SUB_RE.exec(key); - return m ? { k: Number(m[1]), cid: m[2] } : null; -} - -/** 셈 답 줄 — 둘째 기초 줄은 세부 줄로 바꿔 놓음(정체도 같은 차례) */ -export function flatLines(ans: SkAnswer): SkLine[] { - return ans.줄.flatMap((l) => l.펼침 ?? [l]); -} -function flatIds(ans: SkAnswer): string[] { - const by = new Map(ans.줄.map((l) => [l.cid, l])); - return ans.정체.flatMap((c) => by.get(c)?.펼침?.map((x) => x.cid) ?? [c]); -} - -/** 율 더한줄(778-4) 비율 — `add:#k` 의 고정 `비율` · 아니면 undefined */ -const rateOf = (doc: SkDoc, cid: string): { 비목: string } | undefined => { - const hit = ADD_RE.exec(cid); - const one = hit ? doc.더한줄?.[Number(hit[1])] : undefined; - return (one?.고정 as { 비율?: { 비목: string } } | undefined)?.비율; -}; - -/** 기초 수 — 로직 바탕 · 더한줄 로직 */ -const baseCount = (doc: SkDoc): number => - (doc.바탕?.로직 ? 1 : 0) + (doc.더한줄 ?? []).filter((x) => x.종류 === "로직").length; - -/** 줄 꼬리표(기초 둘 이상일 때만) — 바탕 줄 = 바탕 원문번호 · 세부 줄 = 그 기초 원문번호 · 그 밖 = "" */ -export function tagsOf(ans: SkAnswer, doc: SkDoc): Map { - const out = new Map(); - if (baseCount(doc) < 2) return out; - for (const l of ans.줄) { - if (l.펼침) for (const x of l.펼침) out.set(x.cid, l.꼬리표 ?? ""); - else if (!ADD_RE.test(l.cid) && ans.꼬리표) out.set(l.cid, ans.꼬리표); - } - return out; -} - -/** 뺀 세부 줄(되살림 띠) */ -export const removedSubs = (ans: SkAnswer | null): { cid: string; 이름: string }[] => - (ans?.줄 ?? []).flatMap((l) => l.뺀세부 ?? []); - -/** M01 개정된 둘째 기초 — 저장 때 지문 ≠ 지금 지문 */ -export function revisedAdds(ans: SkAnswer | null, doc: SkDoc): number[] { - return (ans?.줄 ?? []).flatMap((l) => { - const hit = ADD_RE.exec(l.cid); - const one = hit ? doc.더한줄?.[Number(hit[1])] : undefined; - return one?.바탕판 && l.바탕판 && one.바탕판 !== l.바탕판 ? [Number(hit![1])] : []; - }); -} -const COVER_KEYS = ["qty", "배율", ...PARTS] as const; - -const partsOf = (l: { 비목?: Record }): Record => - Object.fromEntries(Object.entries(l.비목 ?? {}).map(([k, v]) => [k, v ?? 0])); - -/** 바탕 값 — 바탕 셈(덮개 · 더한줄 · 뺀줄 없이)의 줄마다 품(덧줄 = 율) · 단가 */ -export function baseValues( - bare: SkAnswer | null, -): Map { - const out = new Map(); - if (!bare) return out; - for (const l of bare.줄) out.set(l.cid, { qty: l.율 ?? l.수량, 단가: l.단가 }); - for (const m of bare.재료 ?? []) { - const cid = bare.정체[m.차례]; - if (cid && !out.has(cid)) out.set(cid, { qty: m.수량, 단가: m.단가 }); - } - return out; -} - -const near = (a: number | null | undefined, b: number | null | undefined): boolean => - a != null && b != null && Math.abs(a - b) <= 1e-9 * Math.max(1, Math.abs(a), Math.abs(b)); - -/** 셈 답 → 표 줄(엔진 줄 + 기준 밖 재료) */ -export function rowsOf(ans: SkAnswer, bare: SkAnswer | null, doc: SkDoc): CoverRow[] { - const was = baseValues(bare); - const t = ans.화면배 ?? 1; - const rows: CoverRow[] = []; - const row = ( - cid: string, - l: { - 이름: string; - 단위?: string; - 수량: number | null; - 단가: number | null; - 금액: number | null; - }, - parts: Record, - extra: { - 묶음?: string | null; - 율?: number; - apart?: boolean; - 바탕값?: SkLine["바탕값"]; - 옵션꺼짐?: boolean; - }, - ): CoverRow => { - const hit = ADD_RE.exec(cid); - const added = hit ? Number(hit[1]) : null; - const at = subOf(cid); - const one = added === null ? undefined : doc.더한줄?.[added]; - const owner = at ? doc.더한줄?.[at.k] : undefined; - const cover = at ? owner?.덮개?.[at.cid] : added === null ? doc.덮개?.[cid] : undefined; - const pct = (at?.cid ?? cid).startsWith("pct:") || !!rateOf(doc, cid); // 덧줄 · 율 줄(778-4) - const keys = Object.keys(parts); - const shown = added === null && !at ? (was.get(cid) ?? null) : null; - const base = at - ? subWas(extra.바탕값) - : shown && !pct && shown.qty != null - ? { ...shown, qty: shown.qty * t } - : shown; - const old = cover?.원값; - return { - cid, - 묶음: extra.묶음 || BUNDLE_OF[keys[0] ?? ""] || "하위", - 이름: l.이름, - 단위: pct ? "%" : (l.단위 ?? ""), - 수량: pct ? (extra.율 ?? l.수량) : l.수량, - 단가: pct ? null : l.단가, - 금액: l.금액, - parts, - pct, - added, - apart: !!extra.apart, - covered: { - qty: !!cover && ("qty" in cover || "배율" in cover), - price: added === null ? PARTS.some((k) => cover?.[k] != null) : one?.단가 != null, - }, - 배율: cover?.배율 ?? null, - was: base, - revised: - !!old && - !!base && - ((old.qty != null && !near(old.qty, base.qty)) || - (old.단가 != null && !near(old.단가, base.단가))), - priceEdit: !pct && (added === null || ["인력", "재료", "기계"].includes(String(one?.종류))), - apartPick: one?.종류 === "재료", - sub: at ? { ...at, scale: Number(owner?.수량 ?? 1) } : null, - t: pct || at ? 1 : t, // 세부 줄 품 = M01 원문 그대로(744-1) — 화면배 안 곱함 - off: !!extra.옵션꺼짐, - }; - }; - for (const l of flatLines(ans)) rows.push(row(l.cid, l, partsOf(l), l)); - const seen = new Set(rows.map((r) => r.cid)); - for (const m of ans.재료 ?? []) { - const cid = ans.정체[m.차례]; - if (!cid || seen.has(cid)) continue; - rows.push(row(cid, m, { 재료비: m.금액 ?? 0 }, { 묶음: "재료", apart: true })); - } - return rows; -} - -const subWas = (v: SkLine["바탕값"]): CoverRow["was"] => - v ? { qty: v.qty ?? null, 단가: v.단가 ?? null } : null; - -const memo = (base: CoverRow["was"]): SkCover["원값"] | undefined => { - if (!base) return undefined; - const out: { qty?: number; 단가?: number } = {}; - if (base.qty != null) out.qty = base.qty; - if (base.단가 != null) out.단가 = base.단가; - return Object.keys(out).length ? out : undefined; -}; - -function putCover(doc: SkDoc, r: CoverRow, cover: SkCover): void { - const owner = r.sub ? doc.더한줄?.[r.sub.k] : doc; - if (!owner) return; - const key = r.sub?.cid ?? r.cid; - const covers = { ...(owner.덮개 ?? {}) }; - if (COVER_KEYS.some((k) => cover[k] != null)) { - const old = cover.원값 ?? memo(r.was); - covers[key] = { ...cover, ...(old ? { 원값: old } : {}) }; - } else delete covers[key]; - if (r.sub && !Object.keys(covers).length) delete owner.덮개; - else owner.덮개 = covers; -} - -/** 공용 상세 고침 칸(`LogicLab_Cover.LineCover` 와 같은 꼴) — 품 · 비목 단가(로직 줄 = 1 단위 노 · 재 · 경) */ -export type LineCover = Pick; - -/** 공용 상세 고침 한 줄 → 문서 — 더한줄 = 그 줄 수량 · 단가(요소 줄만) · 바탕 줄 = 덮개 - * (열린입력 SK = 품 대신 배율 = 고친 품 ÷ 바탕 품 · 바탕 값과 같은 품 = 덮개 안 둠) · `c` null = 고침 풂 */ -export function setLineCover(doc: SkDoc, r: CoverRow, c: LineCover | null, opened: boolean): void { - const price = r.priceEdit ? PARTS.map((k) => c?.[k]).find((v) => v != null) : undefined; - if (r.added !== null) { - const one = doc.더한줄?.[r.added]; - if (!one) return; - if (c?.qty != null) setQty(one, c.qty * r.t); - else if (!c) resetQty(one); // [되돌림] = 넣을 때 수량(744-1) - if (price == null) delete one.단가; - else one.단가 = price; - return; - } - const cover: SkCover = {}; - // 세부 줄 품 = 화면 품 그대로(M01 원문 = 1 기준단위 몫 · 744-1) — 화면배 · 머리 수량 안 곱함 - const qty = c?.qty == null ? c?.qty : c.qty * r.t; - const open = opened && !r.sub; // 열린입력 = 바탕 입력 — 세부 줄은 품 그대로 - // ponytail: 열린입력 배율 = 고친 품 ÷ 바탕 품(바탕 품 0 · 없음 = 품 고침 못 함) - if (qty != null && open && r.was?.qty) cover.배율 = qty / r.was.qty; - if (qty != null && !open && !near(qty, r.was?.qty)) cover.qty = qty; - if (r.priceEdit) for (const k of PARTS) if (c?.[k] != null) cover[k] = c[k]; - if (cover.배율 != null && near(cover.배율, 1)) delete cover.배율; - putCover(doc, r, cover); -} - -/** 줄 빼기 — 더한줄 = 그 줄 지움 · 바탕 줄 = 뺀줄에 cid(덮개 · 고름 · 자재표시도 지움) */ -export function dropLine(doc: SkDoc, r: CoverRow): void { - const one = r.sub ? doc.더한줄?.[r.sub.k] : undefined; - if (one && r.sub) { - one.뺀줄 = [...(one.뺀줄 ?? []).filter((c) => c !== r.sub!.cid), r.sub.cid]; - if (one.덮개) delete one.덮개[r.sub.cid]; - return; - } - if (r.added !== null) { - forgetAdd(doc, r.added, r.이름); // 뺀더한줄 기억 — 744-1 [되살림] - return; - } - doc.뺀줄 = [...(doc.뺀줄 ?? []).filter((c) => c !== r.cid), r.cid]; - for (const k of ["덮개", "고름", "자재표시"] as const) { - const map = { ...((doc[k] as Record | undefined) ?? {}) }; - delete map[r.cid]; - (doc as Record)[k] = map; - } -} - -/** 더한 재료 줄 별도계상 — 켬 = 계 밖(재료 목록만 · 서버 자재표시) · 끔 = 칸 지움(기본 계 안) */ -export function setApart(doc: SkDoc, r: CoverRow, on: boolean): void { - const one = r.added === null ? undefined : doc.더한줄?.[r.added]; - if (!one || one.종류 !== "재료") return; - if (on) one.별도계상 = true; - else delete one.별도계상; -} - -/** 뺀 줄 되살림 — 세부 열쇠면 그 더한줄의 뺀줄 */ -export function restoreLine(doc: SkDoc, cid: string): void { - const gone = /^gone:(\d+)$/.exec(cid); // 뺀 더한줄(744-1) — 그 차례에 다시 끼움 - if (gone) return reviveAdd(doc, Number(gone[1])); - const at = subOf(cid); - const one = at ? doc.더한줄?.[at.k] : undefined; - if (one && at) { - one.뺀줄 = (one.뺀줄 ?? []).filter((c) => c !== at.cid); - if (!one.뺀줄.length) delete one.뺀줄; - return; - } - doc.뺀줄 = (doc.뺀줄 ?? []).filter((c) => c !== cid); -} - -/** 둘째 기초 통째 빼기 — 그 더한줄을 뺌(기억 744-1 · 되살림 띠 글 = `name`) */ -export function dropBase(doc: SkDoc, k: number, name = ""): void { - forgetAdd(doc, k, name); -} - -/** 뺀 더한줄 되살림 띠 항목 — 열쇠 `gone:n` */ -export const goneRows = (doc: SkDoc): { cid: string; 이름: string }[] => - (doc.뺀더한줄 ?? []).map((g, n) => ({ cid: `gone:${n}`, 이름: goneName(g.줄) })); - -/* ── 공용 상세(Ho) 줄 ── */ -/** Ho 호표 · 덧줄 꼴(`M01_MasterData_UI_Logic_Api` HoLine · NamedFormula 중 쓰는 칸) */ -export interface HoItem { - 종류: string; - 요소: string; - 이름?: string; - 규격?: string; - 단위?: string; - 수량: string; - 비목?: string; - /** 출처 꼬리표(727-2 · 기초 둘 이상) */ - 꼬리표?: string; -} -export interface HoExtra { - 이름: string; - 식: string; - 비목?: string; - 꼬리표?: string; -} -export interface HoView { - 호표: HoItem[]; - 덧줄: HoExtra[]; - /** Ho 줄 차례(호표 → 덧줄)의 셈 줄 — 셈 전 · 못 셈 = null · 별도계상 빠진 줄 = 빈 칸 */ - lines: (SkLine | undefined)[] | null; - /** Ho 줄 차례 → cid(고침 열쇠 옮김) */ - cids: string[]; - /** Ho 줄 차례 → 지금 고침(덮개 · 더한줄) */ - covers: Record; -} - -const KIND_OF: Record = { labor: "인력", material: "재료", machine: "기계" }; -const ELEMENT_KINDS = ["인력", "재료", "기계"]; - -/** SK 셈 답 → 공용 상세 줄 — 줄 차례 = 서버 `정체`(바탕 남은 호표 · 더한줄 · 바탕 남은 덧줄) · - * 바탕 로직 줄을 알면(`base` + 바탕 셈 `bare.정체` 차례) 그 줄 그대로(식 · 요소 · 규격) · - * 더한줄 = 문서 줄 · 그 밖(참조 바탕) = 셈 줄로 지음 */ -export function hoView( - ans: SkAnswer, - bare: SkAnswer | null, - base: { 호표?: HoItem[]; 덧줄?: HoExtra[] } | null, - doc: SkDoc, -): HoView { - const head = base?.호표 ?? []; - const known = new Map(); - if (base && bare) - bare.정체.forEach((cid, i) => { - const it = i < head.length ? head[i] : base.덧줄?.[i - head.length]; - if (it) known.set(cid, it); - }); - const lineBy = new Map(flatLines(ans).map((l) => [l.cid, l])); - const tags = tagsOf(ans, doc); - const t = ans.화면배 ?? 1; - const single = (l?: SkLine): string | undefined => { - const parts = Object.entries(l?.비목 ?? {}).filter(([, v]) => v); - return parts.length === 1 ? parts[0][0] : undefined; - }; - /** 세부 줄 = 수량만 M01 원문(금액 · 비목은 상자 합 몫 그대로) */ - const shown = (l?: SkLine): SkLine | undefined => - l?.원문 ? { ...l, 수량: l.원문.수량 ?? l.수량 } : l; - const ho: [string, HoItem][] = []; - const extra: [string, HoExtra][] = []; - for (const cid of flatIds(ans)) { - const l = lineBy.get(cid); - const name = l?.이름 ?? cid; - const at = subOf(cid); - const born = bornOfCid(cid, doc.더한줄, tags.get(cid) ?? ""); // 넣은 줄 출처(740-2) — 기초 번호 뒤에 붙임 - const tag = born ? { 꼬리표: born } : {}; - if ((at?.cid ?? cid).startsWith("pct:")) { - extra.push([cid, { ...((known.get(cid) as HoExtra) ?? { 이름: name, 식: "" }), ...tag }]); - continue; - } - const rate = rateOf(doc, cid); // 율 더한줄(778-4) = 비목 상자 % 줄(식 = 「인력의 %」) - if (rate) { - extra.push([cid, { 이름: name, 식: String(l?.규격 ?? ""), 비목: rate.비목, ...tag }]); - continue; - } - if (at) { - const kind = KIND_OF[at.cid.split(":")[0]] ?? "로직"; - const qty = String(l?.율 ?? l?.원문?.수량 ?? l?.수량 ?? ""); // 세부 품 = M01 원문(744-1) - const item = { 종류: kind, 요소: "", 이름: name, 단위: l?.단위 ?? "", 수량: qty }; - ho.push([cid, { ...item, 비목: single(l), ...tag }]); - continue; - } - const hit = ADD_RE.exec(cid); - const a = hit ? doc.더한줄?.[Number(hit[1])] : undefined; - const kind = a - ? ELEMENT_KINDS.includes(String(a.종류)) - ? String(a.종류) - : "로직" - : (KIND_OF[cid.split(":")[0]] ?? "로직"); - const made: HoItem = { - 종류: kind, - 요소: typeof a?.요소 === "string" ? a.요소 : "", - 이름: name, - 단위: l?.단위 ?? String(a?.단위 ?? ""), - 수량: String(a ? a.수량 / t : (l?.율 ?? l?.수량 ?? "")), - 비목: typeof a?.비목 === "string" ? a.비목 : single(l), - }; - ho.push([cid, { ...(a ? made : ((known.get(cid) as HoItem) ?? made)), ...tag }]); - } - const cids = [...ho, ...extra].map(([cid]) => cid); - const covers: Record = {}; - cids.forEach((cid, i) => { - const hit = ADD_RE.exec(cid); - const a = hit ? doc.더한줄?.[Number(hit[1])] : undefined; - const part = PART_OF[String(a?.비목 ?? "")]; - const own = rateOf(doc, cid) ? 1 : t; // 율 = 그대로 - if (a) covers[i] = { qty: a.수량 / own, ...(a.단가 != null && part ? { [part]: a.단가 } : {}) }; - const at = subOf(cid); - const owner = at ? doc.더한줄?.[at.k] : undefined; - const c = hit ? undefined : at ? owner?.덮개?.[at.cid] : doc.덮개?.[cid]; - if (!c) return; - const l = lineBy.get(cid); - const out: LineCover = {}; - const per = at || cid.startsWith("pct:") ? 1 : t; // 율 · 세부 품 = 그대로 - if (c.qty != null) out.qty = c.qty / per; - else if (c.배율 != null && l) out.qty = l.율 ?? l.수량 ?? undefined; - for (const k of PARTS) if (c[k] != null) out[k] = c[k]; - covers[i] = out; - }); - return { - 호표: ho.map(([, x]) => x), - 덧줄: extra.map(([, x]) => x), - lines: ans.줄.length ? cids.map((c) => shown(lineBy.get(c))) : null, - cids, - covers, - }; -} - -/* ── 일위대가 줄 → SK 문서(717-3 · 723-3 줄 모드) ── */ -export interface LinePatch { - 덮개?: Record; - 뺀줄?: string[]; - 더한줄?: unknown[]; - /** 뺀 더한줄 기억(744-1) */ - 뺀더한줄?: SkDoc["뺀더한줄"]; -} - -/** 줄 꼴(일위대가 `담은로직[]` 한 줄 · 쓰는 칸만) */ -export interface PatchRow { - 로직?: string; - 참조?: { 층: string; 주인?: string | null; 키: string }; - 입력값?: Record; - 켜쌓기율?: number | null; - 고름?: Record; - 자재표시?: Record; - 패치?: LinePatch; -} - -const keyed = (value: Record | undefined, ids: string[]) => - Object.fromEntries( - Object.entries(value ?? {}).flatMap(([n, v]) => - /^\d+$/.test(n) && Number(n) < ids.length ? [[ids[Number(n)], v]] : [], - ), - ); - -/** 고름 · 자재표시가 있는 로직 줄 = 바탕 줄 정체가 먼저 있어야 함 */ -export const needsIds = (row: PatchRow): boolean => - !row.참조 && - (Object.keys(row.고름 ?? {}).length > 0 || Object.keys(row.자재표시 ?? {}).length > 0); - -/** 줄 → 이름 없는 SK 문서 — `patch` null = 그 일위대가 고침 없는 원래 값 · - * 고름 · 자재표시(호표 차례 열쇠)는 바탕 줄 정체(`ids` · 셈 답 `정체`)로 cid 열쇠로 */ -export function lineDoc( - row: PatchRow, - ids: string[] | null, - patch: LinePatch | null, -): Record { - const head = { - 키: "SK-000000", - 이름: "줄", - 단위: "식", - 덮개: patch?.덮개 ?? {}, - 뺀줄: patch?.뺀줄 ?? [], - 더한줄: patch?.더한줄 ?? [], - 줄모드: true, // 셈 = 일위대가 그 줄 셈(별도계상 기본 · 750-1 · 서버 `calc_doc`) - }; - if (row.참조) return { ...head, 바탕: { 참조: row.참조 } }; - return { - ...head, - ...(row.켜쌓기율 != null ? { 켜쌓기율: row.켜쌓기율 } : {}), - 바탕: { 로직: row.로직 ?? "" }, - 입력값: { ...(row.입력값 ?? {}) }, - 고름: ids ? keyed(row.고름, ids) : {}, - 자재표시: ids ? keyed(row.자재표시, ids) : {}, - }; -} - -/** 빈 칸 · 원값 뺀 패치 — 다 비면 null(줄 칸 안 둠) */ -export function cleanPatch(patch: LinePatch | null | undefined): LinePatch | null { - const covers = Object.fromEntries( - Object.entries(patch?.덮개 ?? {}).flatMap(([cid, c]) => { - const keep = Object.fromEntries( - Object.entries(c ?? {}).filter(([k, v]) => k !== "원값" && typeof v === "number"), - ); - return Object.keys(keep).length ? [[cid, keep]] : []; - }), - ); - const out: LinePatch = { - ...(Object.keys(covers).length ? { 덮개: covers } : {}), - ...(patch?.뺀줄?.length ? { 뺀줄: [...patch.뺀줄] } : {}), - ...(patch?.더한줄?.length ? { 더한줄: [...patch.더한줄] } : {}), - ...(patch?.뺀더한줄?.length ? { 뺀더한줄: [...patch.뺀더한줄] } : {}), - }; - return Object.keys(out).length ? out : null; -} -/* ── 순수 셈 끝 ── */ diff --git a/M02_MasterTemplete/logic/M02_Sangeun_Undo.ts b/M02_MasterTemplete/logic/M02_Sangeun_Undo.ts deleted file mode 100644 index c831ed2b8..000000000 --- a/M02_MasterTemplete/logic/M02_Sangeun_Undo.ts +++ /dev/null @@ -1,93 +0,0 @@ -/* ============================================================================= - * M02_MasterTemplete/logic/M02_Sangeun_Undo.ts - * 단가산출(SK) 되돌리기 기억(PLAN 744-1 서버 · 748-0 화면) — 더한 기초 · 더한 항목 빼기 → 문서 `뺀더한줄` - * `[{차례, 줄}]`(되살림 = 그 차례에 다시 끼움) · 더한 항목 수량 → `처음수량`(넣을 때 값) 되돌림. - * 더한줄 지움 · 끼움 때 뒤 더한줄 열쇠 `add:#j[/…]`(덮개 · 고름 · 자재표시 · 율 줄 기준 목록 778-4)를 - * 한 칸씩 당김 · 밂(지운 줄을 가리킨 기준 열쇠는 버림 — 빈 목록 = 서버 짝잃음 알림). - * 금액은 늘 서버가 셈 — 여기는 문서 칸 옮김만 · 화면 · fetch · sessionStorage 없음(`CLAUDE.md` 4장). - * ========================================================================== */ - -import type { SkAdded, SkDoc } from "./M02_Sangeun_Cover_Model"; - -/* ── 순수 셈 ── */ -const KEYED = ["덮개", "고름", "자재표시"] as const; -const KEY_RE = /^add:#(\d+)(.*)$/; - -/** 문서 열쇠 맵의 `add:#j…` 를 옮김 — `drop` = 지운 j(그 열쇠는 버림) · 뒤 j 는 한 칸 당김 / `push` = 끼운 j 부터 한 칸 밂 */ -function moveKeys(doc: SkDoc, mode: { drop: number } | { push: number }): void { - for (const name of KEYED) { - const map = doc[name] as Record | undefined; - if (!map) continue; - const out: Record = {}; - for (const [key, value] of Object.entries(map)) { - const hit = KEY_RE.exec(key); - if (!hit) { - out[key] = value; - continue; - } - const j = Number(hit[1]); - if ("drop" in mode) { - if (j === mode.drop) continue; - out[j > mode.drop ? `add:#${j - 1}${hit[2]}` : key] = value; - } else out[j >= mode.push ? `add:#${j + 1}${hit[2]}` : key] = value; - } - (doc as Record)[name] = out; - } - for (const one of doc.더한줄 ?? []) { - const rate = (one.고정 as { 비율?: { 기준?: unknown } } | undefined)?.비율; - if (!rate || !Array.isArray(rate.기준)) continue; - rate.기준 = (rate.기준 as string[]).flatMap((key) => { - const hit = KEY_RE.exec(key); - if (!hit) return [key]; - const j = Number(hit[1]); - if ("drop" in mode) - return j === mode.drop ? [] : [j > mode.drop ? `add:#${j - 1}${hit[2]}` : key]; - return [j >= mode.push ? `add:#${j + 1}${hit[2]}` : key]; - }); - } -} - -/** 더한줄 k 를 빼고 기억에 둠 — 이름은 되살림 띠 글(서버가 저장 때 다시 적음) */ -export function forgetAdd(doc: SkDoc, k: number, name: string): void { - const one = doc.더한줄?.[k]; - if (!one) return; - doc.뺀더한줄 = [ - ...(doc.뺀더한줄 ?? []), - { 차례: k, 줄: JSON.parse(JSON.stringify({ ...one, ...(name ? { 이름: name } : {}) })) }, - ]; - doc.더한줄 = (doc.더한줄 ?? []).filter((_, i) => i !== k); - moveKeys(doc, { drop: k }); -} - -/** 기억 n 번째를 그 차례에 다시 끼움(차례가 줄 수보다 크면 맨 끝) */ -export function reviveAdd(doc: SkDoc, n: number): void { - const gone = doc.뺀더한줄?.[n]; - if (!gone) return; - const list = [...(doc.더한줄 ?? [])]; - const at = Math.min(Math.max(gone.차례, 0), list.length); - list.splice(at, 0, gone.줄); - doc.더한줄 = list; - moveKeys(doc, { push: at }); - const rest = (doc.뺀더한줄 ?? []).filter((_, i) => i !== n); - if (rest.length) doc.뺀더한줄 = rest; - else delete doc.뺀더한줄; -} - -/** 되살림 띠 글 — 줄 이름 · 없으면 로직 · 요소 · 참조 키 */ -export function goneName(one: SkAdded): string { - const ref = (one.참조 as { 키?: string } | undefined)?.키; - return String(one.이름 || one.로직 || one.요소 || ref || ""); -} - -/** 더한줄 수량 고침 — 처음 값(옛 문서엔 없음)을 먼저 적어 둠 */ -export function setQty(one: SkAdded, qty: number): void { - one.처음수량 ??= one.수량; - one.수량 = qty; -} - -/** 더한줄 수량 처음 값으로 — 처음 값 모르면 그대로 */ -export function resetQty(one: SkAdded): void { - if (one.처음수량 != null) one.수량 = one.처음수량; -} - -/* ── 순수 셈 끝 ── */ diff --git a/resources/tester/helper_728_2_cover_unit.cjs b/resources/tester/helper_728_2_cover_unit.cjs deleted file mode 100644 index 934bede74..000000000 --- a/resources/tester/helper_728_2_cover_unit.cjs +++ /dev/null @@ -1,44 +0,0 @@ -/* PLAN 728-2 헬퍼 — SK 고침 꼴(`logic/M02_Sangeun_Cover_Model.ts`)이 화면배(SK 1 단위 몫)를 문서 몫으로 되돌리는지. - * 짝 = `test_728_2_sk_unit.py`. 결과 = 표준출력 JSON. - */ -const path = require("path"); -const { makeLoader } = require("./helper_ts_stub_loader.cjs"); - -const ROOT = path.join(__dirname, "..", ".."); -const { load } = makeLoader({ root: ROOT }); -const m = load("M02_MasterTemplete", "logic", "M02_Sangeun_Cover_Model.ts"); - -// GF000287 단목베기 SK 단위 본 — 서버 화면 답 = 100본 몫 ÷100(화면배 100) -const line = (cid, 이름, 수량, 금액) => ({ - cid, - 이름, - 단위: "인", - 수량, - 단가: 금액 / 수량, - 금액, - 비목: { 노무비: 금액 }, -}); -const ans = { - 기준: { 계: 1538.894 }, - 줄: [line("labor:LB000101#0", "벌목부", 0.002, 506.486), line("add:#0", "보통인부", 0.5, 86034)], - 정체: ["labor:LB000101#0", "add:#0"], - 짝잃음: [], - 바탕판: "", - 배: 100, - 화면배: 100, -}; -const bare = { ...ans, 줄: [ans.줄[0]], 정체: ["labor:LB000101#0"] }; -const doc = { - 단위: "본", - 바탕: { 로직: "GF000287" }, - 더한줄: [{ 종류: "인력", 요소: "LB000002", 수량: 50 }], -}; -const rows = m.rowsOf(ans, bare, doc); -const out = { was: rows[0].was, t: rows.map((r) => r.t) }; -m.setLineCover(doc, rows[0], { qty: 0.003 }, false); // 화면 0.003 = 문서 0.3(100본 몫) -m.setLineCover(doc, rows[1], { qty: 0.6 }, false); // 더한 인력 화면 0.6 = 문서 60 -out.cover = doc.덮개; -out.added = doc.더한줄[0].수량; -const view = m.hoView(ans, bare, null, doc); -out.shown = view.covers; -process.stdout.write(JSON.stringify(out)); diff --git a/resources/tester/helper_748_0_sk_undo.cjs b/resources/tester/helper_748_0_sk_undo.cjs deleted file mode 100644 index da05453e1..000000000 --- a/resources/tester/helper_748_0_sk_undo.cjs +++ /dev/null @@ -1,102 +0,0 @@ -/* PLAN 748-0 헬퍼 — SK 고침 꼴(`logic/M02_Sangeun_Cover_Model.ts` · `M02_Sangeun_Undo.ts`): - * 둘째 기초 세부 품 = M01 원문 · 고침 = 원문 몫 그대로 · 빼기 기억(뺀더한줄) · 되살림 · 수량 처음값 되돌림. - * 짝 = `test_748_0_sk_undo.py`. 결과 = 표준출력 JSON. - */ -const path = require("path"); -const { makeLoader } = require("./helper_ts_stub_loader.cjs"); - -const { load } = makeLoader({ root: path.join(__dirname, "..", "..") }); -const m = load("M02_MasterTemplete", "logic", "M02_Sangeun_Cover_Model.ts"); - -// 둘째 기초 GF 한 줄 — 원문 0.871 · 머리 수량 0.01 이면 상자 몫 0.00871 -const detail = { - cid: "add:#1/labor:LB000101#0", - 이름: "벌목부", - 단위: "인", - 수량: 0.00871, - 단가: 100000, - 금액: 871, - 비목: { 노무비: 871 }, - 원문: { 수량: 0.871, 금액: 87100, 비목: { 노무비: 87100 } }, - 바탕값: { qty: 0.871, 단가: 100000 }, -}; -const ans = { - 기준: { 계: 871 }, - 줄: [ - { - cid: "labor:LB000002#0", - 이름: "보통인부", - 단위: "인", - 수량: 1, - 단가: 100, - 금액: 100, - 비목: { 노무비: 100 }, - }, - { - cid: "add:#0", - 이름: "추가 인력", - 단위: "인", - 수량: 2, - 단가: 100, - 금액: 200, - 비목: { 노무비: 200 }, - }, - { - cid: "add:#1", - 이름: "둘째 기초", - 단위: "100㎥", - 수량: 0.01, - 단가: null, - 금액: 871, - 비목: { 노무비: 871 }, - 펼침: [detail], - }, - ], - 정체: ["labor:LB000002#0", "add:#0", "add:#1"], - 짝잃음: [], - 바탕판: "", -}; -const doc = { - 단위: "㎥", - 바탕: { 로직: "GF000099" }, - 더한줄: [ - { 종류: "인력", 요소: "LB000002", 수량: 2, 처음수량: 2 }, - { 종류: "로직", 로직: "GF000316", 수량: 0.01, 처음수량: 0.01 }, - ], - 고름: { "add:#1": "MT1" }, -}; -const out = {}; -const rows = m.rowsOf(ans, null, doc); -const sub = rows.find((r) => r.cid === detail.cid); -const view = m.hoView(ans, null, null, doc); -const at = view.cids.indexOf(detail.cid); -out.shownQty = view.호표[at].수량; // 원문 그대로 -out.lineQty = view.lines[at].수량; -out.lineAmount = view.lines[at].금액; // 상자 몫 그대로 -out.t = sub.t; -// 세부 품 고침 — 화면 0.9 = 문서 덮개 0.9(머리 수량 안 나눔) -m.setLineCover(doc, sub, { qty: 0.9 }, false); -out.cover = doc.더한줄[1].덮개; -out.coverShown = m.hoView(ans, null, null, doc).covers[at].qty; -// 더한 항목 수량 고침 → 처음값 되돌림 -const man = m.rowsOf(ans, null, doc).find((r) => r.cid === "add:#0"); -m.setLineCover(doc, man, { qty: 5 }, false); -out.manQty = doc.더한줄[0].수량; -m.setLineCover(doc, man, null, false); -out.manBack = doc.더한줄[0].수량; -// 더한 항목 빼기 → 기억 + 열쇠 당김 → 되살림 -m.dropLine(doc, man); -out.afterDrop = { adds: doc.더한줄.length, gone: doc.뺀더한줄, pick: doc.고름 }; -out.goneRows = m.goneRows(doc); -m.restoreLine(doc, "gone:0"); -out.afterBack = { - adds: doc.더한줄.map((x) => x.요소 ?? x.로직), - gone: doc.뺀더한줄 ?? null, - pick: doc.고름, -}; -// 둘째 기초 통째 빼기 → 되살림 -m.dropBase(doc, 1, "둘째 기초"); -out.baseGone = { adds: doc.더한줄.length, name: m.goneRows(doc)[0].이름, pick: doc.고름 }; -m.restoreLine(doc, "gone:0"); -out.baseBack = doc.더한줄.map((x) => x.요소 ?? x.로직); -process.stdout.write(JSON.stringify(out)); diff --git a/resources/tester/helper_854_3_screen_leak.cjs b/resources/tester/helper_854_3_screen_leak.cjs index 40c071558..a3e3b5c51 100644 --- a/resources/tester/helper_854_3_screen_leak.cjs +++ b/resources/tester/helper_854_3_screen_leak.cjs @@ -98,7 +98,7 @@ for (let i = 0; i < 5; i++) { const { createSangeunTabs } = load("M02_MasterTemplete/M02_MasterTemplete_Sangeun_Tabs.ts"); const b2 = listeners; for (let i = 0; i < 5; i++) { - const t = createSangeunTabs(new Fake("div"), { edit: false, scope: { layer: "system", owner: null } }); + const t = createSangeunTabs({ edit: false, scope: { layer: "system", owner: null } }); out.tabs.push(listeners - b2); t.destroy(); out.tabs.push(listeners - b2); diff --git a/resources/tester/helper_856_0_sk_screen.cjs b/resources/tester/helper_856_0_sk_screen.cjs index 497c2b03b..ed636c290 100644 --- a/resources/tester/helper_856_0_sk_screen.cjs +++ b/resources/tester/helper_856_0_sk_screen.cjs @@ -311,11 +311,11 @@ async function openSk(doc, opt = {}) { // ① 단가산출 화면(페이지) — 바탕 있음 · 없음 out.page_base = await openSk( { 키: "SK-000001", 이름: "견본", 단위: "㎡", 바탕: { 로직: "GC001109" } }, - { source: true }, + { mode: "page" }, ); - out.page_nobase = await openSk({ 키: "SK-000002", 이름: "견본", 단위: "㎡" }, { source: true }); + out.page_nobase = await openSk({ 키: "SK-000002", 이름: "견본", 단위: "㎡" }, { mode: "page" }); // 불러오기 미리 보기(저장 전 가져온 식) - out.memory = await openSk({ 이름: "가져온", 단위: "식", 가져온: { 파일: "x" } }); + out.memory = await openSk({ 이름: "가져온", 단위: "식", 가져온: { 파일: "x" } }, { mode: "memory" }); // ③ 머리 띠 넷(견본 답) — 까닭 · M01 개정 · 빠진 줄 · 짝 잃음 + 머리 배지 skAnswer = () => @@ -328,12 +328,12 @@ async function openSk(doc, opt = {}) { }); out.bands = await openSk( { 키: "SK-000003", 이름: "띠", 단위: "㎡", 바탕: { 로직: "GC001109" }, 바탕판: "v1" }, - { source: true }, + { mode: "page" }, ); skAnswer = () => { throw new Error("서버 못 닿음"); }; - out.bands_fail = await openSk({ 키: "SK-000004", 이름: "띠", 단위: "㎡" }, { source: true }); + out.bands_fail = await openSk({ 키: "SK-000004", 이름: "띠", 단위: "㎡" }, { mode: "page" }); skAnswer = () => plainAns(); // ② 일위대가 표 줄 누름 — SK 참조 줄 · M01 로직 줄 · 셈 주입(프로젝트 사본) SK 줄 diff --git a/resources/tester/test_717_2b_sangeun_detail.py b/resources/tester/test_717_2b_sangeun_detail.py index d4b2807db..082fc25e8 100644 --- a/resources/tester/test_717_2b_sangeun_detail.py +++ b/resources/tester/test_717_2b_sangeun_detail.py @@ -8,10 +8,6 @@ - 상세 = M01 상세 부품(M02 길) · 부품 상자만 · 마스터 이동 단추 = 등록 없으면 숨김 """ -import json -import re -import shutil -import subprocess from decimal import Decimal from pathlib import Path @@ -24,7 +20,6 @@ from resources.tester.test_m02_labor_ref import world # noqa: F401 — 같은 ROOT = Path(__file__).resolve().parents[2] M02 = ROOT / "M02_MasterTemplete" -MODEL = M02 / "logic" / "M02_Sangeun_Cover_Model.ts" BASE = "GC000278" @@ -32,163 +27,6 @@ def _text(p: Path) -> str: return p.read_text(encoding="utf-8") -def _node(body: str) -> object: - born = _text(M02 / "logic" / "M02_Born_Tag.ts") # 740-2 — 모델이 쓰는 꼬리표 글(import 줄은 뺌) - model = re.sub(r"^import .*$", "", _text(MODEL), flags=re.M) - undo = re.sub(r"^import .*$", "", _text(M02 / "logic" / "M02_Sangeun_Undo.ts"), flags=re.M) - # 751-3 모델이 가져오는 B09 `rounddown`(import 줄을 빼므로 같은 식을 둠) - cut = "const rounddown = (v, p = 0) => { const s = 10 ** p; " + ( - "const a = Math.floor(Math.abs(v) * s + 1e-7) / s; return v < 0 ? -a : a; };" - ) - src = "\n".join((born, undo, cut, model, body)) - out = subprocess.run( - ["node", "--experimental-strip-types", "--no-warnings", - "--input-type=module-typescript", "-e", src], - capture_output=True, text=True, encoding="utf-8", timeout=60, - ) # fmt: skip - assert out.returncode == 0, out.stderr - return json.loads(out.stdout) - - -SAMPLE = """ -const line = (cid, 이름, 수량, 단가, 비목, 묶음) => ({ cid, 이름, 단위: "인", 수량, 단가, - 금액: Object.values(비목).reduce((a, b) => a + b, 0), 비목, 묶음 }); -const bare = { 기준: null, 짝잃음: [], 바탕판: "x", - 정체: ["labor:A#0", "logic:G#0", "material:M#0", "pct:공구#0"], - 줄: [line("labor:A#0", "석공", 0.1, 1000, { 노무비: 100 }, "인력"), - line("logic:G#0", "굴착기", 2, 50, { 노무비: 60, 재료비: 30, 경비: 10 }, "경비")], - 재료: [{ 차례: 2, 이름: "모르타르", 수량: 0.5, 단가: 200, 금액: 100 }] }; -""" - - -@pytest.mark.skipif(shutil.which("node") is None, reason="node 가 없음") -def test_고침_꼴(): - body = ( - SAMPLE - + """ -const doc = { 덮개: {}, 뺀줄: [], - 더한줄: [{ 종류: "재료", 요소: "MT1", 비목: "재료비", 수량: 1 }] }; -const ans = { ...bare, 정체: [...bare.정체, "add:#0"], - 줄: [...bare.줄, line("add:#0", "더한 재료", 1, 300, { 재료비: 300 }, "재료")] }; -const rows = rowsOf(ans, bare, doc); -const by = (cid) => rowsOf(ans, bare, doc).find((r) => r.cid === cid); -const out = {}; -out.rows = rows.map((r) => [r.cid, r.묶음, r.apart, r.added, r.priceEdit]); -setLineCover(doc, by("labor:A#0"), { qty: 0.2 }, false); -out.qty = doc.덮개["labor:A#0"]; -setLineCover(doc, by("labor:A#0"), { qty: 0.1 }, false); // 바탕 값과 같음 = 덮개 지움 -out.qtyBack = doc.덮개["labor:A#0"] ?? null; -setLineCover(doc, by("labor:A#0"), { labor: 1200 }, false); -out.price = doc.덮개["labor:A#0"]; -setLineCover(doc, by("labor:A#0"), null, false); // 고침 풂 -out.unset = doc.덮개["labor:A#0"] ?? null; -setLineCover(doc, by("logic:G#0"), { labor: 60, material: 30, expense: 10 }, false); -out.split = doc.덮개["logic:G#0"]; -setLineCover(doc, by("add:#0"), { qty: 3, material: 350 }, false); -out.added = doc.더한줄[0]; -out.pick = [by("add:#0").apartPick, by("labor:A#0").apartPick]; -setApart(doc, by("add:#0"), true); -out.apartOn = doc.더한줄[0].별도계상 ?? null; -setApart(doc, by("add:#0"), false); -out.apartOff = doc.더한줄[0].별도계상 ?? null; -const opened = { 덮개: {} }; -setLineCover(opened, by("labor:A#0"), { qty: 0.15 }, true); // 바탕 품 0.1 → 배율 1.5 -out.scale = opened.덮개["labor:A#0"]; -setLineCover(opened, by("labor:A#0"), { qty: 0.1 }, true); -out.scaleBack = opened.덮개["labor:A#0"] ?? null; -dropLine(doc, by("labor:A#0")); -out.drop = [doc.뺀줄, doc.덮개["labor:A#0"] ?? null]; -restoreLine(doc, "labor:A#0"); -out.restore = doc.뺀줄; -dropLine(doc, by("add:#0")); -out.dropAdded = doc.더한줄.length; -const covered = { 덮개: { "labor:A#0": { qty: 0.3, 원값: { qty: 0.09, 단가: 1000 } } } }; -out.revised = rowsOf(bare, bare, covered).find((r) => r.cid === "labor:A#0").revised; -// 공용 상세 줄 — 바탕 줄 그대로 · 뺀 줄 없음 · 더한줄 · 별도계상 빠진 줄 = 빈 칸 · 덧줄 -const base = { 호표: [{ 종류: "인력", 요소: "A", 이름: "석공", 수량: "0.1*x" }, - { 종류: "로직", 요소: "로직(G)", 수량: "2" }, { 종류: "재료", 요소: "M", 수량: "0.5" }], - 덧줄: [{ 이름: "공구손료", 식: "노무비 * 3 / 100" }] }; -const doc2 = { 덮개: { "labor:A#0": { qty: 0.3, 원값: { qty: 0.1 } } }, 뺀줄: ["logic:G#0"], - 더한줄: [{ 종류: "인력", 요소: "LB2", 이름: "보통인부", 비목: "노무비", - 수량: 0.01, 단가: 500 }] }; -const ans2 = { ...bare, 정체: ["labor:A#0", "material:M#0", "add:#0", "pct:공구#0"], - 줄: [line("labor:A#0", "석공", 0.3, 1000, { 노무비: 300 }, "인력"), - line("add:#0", "보통인부", 0.01, 500, { 노무비: 5 }, "인력"), - { ...line("pct:공구#0", "공구손료", 9.15, 1, { 경비: 9.15 }, "경비"), 율: 3 }] }; -const v = hoView(ans2, bare, base, doc2); -out.view = [v.호표.map((x) => [x.종류, x.요소, x.수량, x.비목 ?? null]), v.덧줄, v.cids, - v.lines.map((l) => l?.cid ?? null), v.covers]; -out.viewRef = hoView(ans2, bare, null, doc2).호표[0]; -console.log(JSON.stringify(out)); -""" - ) - got = _node(body) - assert got["rows"] == [ - ["labor:A#0", "인력", False, None, True], - ["logic:G#0", "경비", False, None, True], - ["add:#0", "재료", False, 0, True], - ["material:M#0", "재료", True, None, True], - ] - assert got["qty"] == {"qty": 0.2, "원값": {"qty": 0.1, "단가": 1000}} - assert got["qtyBack"] is None - assert got["price"] == {"labor": 1200, "원값": {"qty": 0.1, "단가": 1000}} - assert got["unset"] is None - assert got["split"]["labor"] == 60 and got["split"]["material"] == 30 - assert got["split"]["expense"] == 10 - assert got["added"]["수량"] == 3 and got["added"]["단가"] == 350 - # 더한 재료 줄만 별도계상 고름 · 켬 = 칸 true · 끔 = 칸 지움(기본 계 안) - assert got["pick"] == [True, False] - assert got["apartOn"] is True and got["apartOff"] is None - assert got["scale"]["배율"] == pytest.approx(1.5) and "qty" not in got["scale"] - assert got["scaleBack"] is None - assert got["drop"] == [["labor:A#0"], None] - assert got["restore"] == [] and got["dropAdded"] == 0 - assert got["revised"] is True - ho, extra, cids, lines, covers = got["view"] - assert ho == [ - ["인력", "A", "0.1*x", None], # 바탕 줄 그대로(식) - ["재료", "M", "0.5", None], - ["인력", "LB2", "0.01", "노무비"], # 더한줄 - ] - assert extra == [{"이름": "공구손료", "식": "노무비 * 3 / 100"}] - assert cids == ["labor:A#0", "material:M#0", "add:#0", "pct:공구#0"] - assert lines == ["labor:A#0", None, "add:#0", "pct:공구#0"] # 별도계상 빠진 재료 = 빈 칸 - assert covers == {"0": {"qty": 0.3}, "2": {"qty": 0.01, "labor": 500}} - assert got["viewRef"] == { # 참조 바탕 = 셈 줄로 지음 - "종류": "인력", "요소": "", "이름": "석공", "단위": "인", "수량": "0.3", "비목": "노무비", - } # fmt: skip - - -def test_상세_부품_길_부품상자(): - view = _text(M02 / "M02_MasterTemplete_Sangeun_View.ts") - detail = _text(M02 / "M02_MasterTemplete_Sangeun_Detail.ts") - cover = _text(M02 / "M02_MasterTemplete_Sangeun_Cover.ts") - assert "mountSangeunDetail(host, doc," in view and "createEmpty" not in view - assert 'read: "/m02/logic-lib"' in detail and "setLogicApiPaths(LIB)" in detail - assert "buildLabDetail(editor" in detail and "cover: { ho }," in detail - assert "buildCalc" not in detail # 799-2 시험 계산 보기 걷음 - assert ( - "openSangeunLinePicker" not in detail and "openRateLine" not in detail - ) # 840-1 [항목 추가] · [율 줄 추가] 걷음 - assert "if (mine !== seq || !alive) return" in detail # 최신 응답만 - # 724-1 — 단가산출 상세 = 공용 상세(Ho) · 고침 고리 = SK 덮개 · 옛 고침 표 걷음 - assert "...buildHo(hoCtx)" in detail and 'scope: "m02",' in detail - assert "setLineCover(doc, r, c, opened());" in detail and "skCoverTable" not in detail - ho = _text(ROOT / "M01_MasterData" / "M01_MasterData_UI_LogicLab_Ho.ts") - assert "edit.more?.(e.idx, close)" in ho and '"EditedM02"' in ho - for s in (detail, cover, _text(MODEL)): - assert " ({})); -const m = box.exports; -const job = JSON.parse(fs.readFileSync(0, "utf8")); -const out = {}; -for (const [k, [fn, ...args]] of Object.entries(job)) out[k] = m[fn](...args); -process.stdout.write(JSON.stringify(out)); -""" - - -def _node(job: dict) -> dict: - node = shutil.which("node") - if not node: - pytest.skip("node 없음") - got = subprocess.run( - [node, "-e", MODEL, str(ROOT)], - input=json.dumps(job, ensure_ascii=False), - capture_output=True, - text=True, - encoding="utf-8", - ) - assert got.returncode == 0, got.stderr - return json.loads(got.stdout) - - -def _whole(): - return m01.loaded()[1] - - -def test_화면_문서_서버_as_doc_꼴(): - """고름 · 자재표시(호표 차례) → cid · 패치 · 참조 줄 = 서버 `as_doc` 와 같은 몸.""" - import master_pick as mp - - whole = _whole() - row = whole.logic(TWO_MATS) - item = row["호표"][2] - want = mp.search(whole, item["요소"], {}, item.get("단위"))[1] - drop = {"뺀줄": ["material:" + row["호표"][1]["이름"] + "#0"]} - one = { - "로직": TWO_MATS, - "입력값": {}, - "고름": {"2": want}, - "자재표시": {"2": {"별도계상": "직접계산"}}, - } - ref = {"참조": {"층": "personal", "주인": None, "키": "SK-000001"}, "입력값": {}} - ids = sd.line_ids(row) - got = _node( - { - "logic": ["lineDoc", one, ids, drop], - "ref": ["lineDoc", ref, None, COVER], - "bare": ["lineDoc", one, None, None], - "needs": ["needsIds", one], - "needsRef": ["needsIds", ref], - } - ) - assert got["logic"].pop("줄모드") is True and got["ref"].pop("줄모드") is True # 750-1 - assert got["logic"] == patch.as_doc({**one, "패치": drop}, whole) - assert got["ref"] == patch.as_doc({**ref, "패치": COVER}, whole) - assert got["bare"]["고름"] == {} and got["bare"]["덮개"] == {} - assert got["needs"] is True and got["needsRef"] is False - - -def test_모달_셈_길_값_일위대가_줄_값(world): - """모달 셈(`calc_doc` · 저장 안 함) 기준 = 일위대가 셈 그 줄 기준 · 고친 줄 덮개 칸 = qty · 정체 = 바탕 줄.""" - whole = _whole() - line = {"로직": PCT, "입력값": {}, "수량": {"손": 1}} - doc = _node({"d": ["lineDoc", line, None, COVER]})["d"] - bare = _node({"d": ["lineDoc", line, None, None]})["d"] - with store.at(world["personal"]): - got = calc.calc_doc(doc) - was = calc.calc_doc(bare) - mine = labor.calc(labor.clean({"담은로직": [{**line, "패치": COVER}]}), {})["줄"][0] - plain = labor.calc(labor.clean({"담은로직": [line]}), {})["줄"][0] - assert got["기준"] == pytest.approx(mine["기준"]) - assert was["기준"] == pytest.approx(plain["기준"]) - assert got["기준"]["계"] != was["기준"]["계"] # 품 0.5 로 바뀜 - assert was["정체"] == sd.line_ids(whole.logic(PCT)) - cover = [x for x in got["줄"] if x["cid"] == "labor:LB000036#0"][0] - assert cover["덮개"] == ["qty"] and cover["수량"] == pytest.approx(0.5) - - -def test_패치_정리_순수_함수(): - """원값 뺌 · 빈 칸 뺌 · 다 비면 null(줄 칸 안 둠) — 덮개 고침 자체는 717-2b `setLineCover`.""" - one = {"덮개": {"labor:LB1#0": {"qty": 0.5, "원값": {"qty": 0.2}}, "x:a#0": {"원값": {}}}} - got = _node( - { - "clean": ["cleanPatch", one], - "empty": ["cleanPatch", {"덮개": {}, "뺀줄": [], "더한줄": []}], - "none": ["cleanPatch", None], - "keep": ["cleanPatch", {"뺀줄": ["a:b#0"]}], - } - ) - assert got["clean"] == {"덮개": {"labor:LB1#0": {"qty": 0.5}}} # 원값 = 서버 몫 - assert got["empty"] is None and got["none"] is None - assert got["keep"] == {"뺀줄": ["a:b#0"]} - - -def test_normalizeLabor_줄_패치_지킴(): - node = shutil.which("node") - if not node: - pytest.skip("node 없음") - doc = {"담은로직": [{"로직": PCT, "패치": COVER}, {"로직": TWO_MATS}]} - got = subprocess.run( - [node, str(ROOT / "resources/tester/helper_m02_labor_normalize.cjs")], - input=json.dumps({"doc": doc, "column": "c"}, ensure_ascii=False), - capture_output=True, - text=True, - encoding="utf-8", - ) - assert got.returncode == 0, got.stderr - rows = json.loads(got.stdout)["담은로직"] - assert rows[0]["패치"] == COVER and "패치" not in rows[1] diff --git a/resources/tester/test_722_ho_detail.py b/resources/tester/test_722_ho_detail.py deleted file mode 100644 index 0b9a26a18..000000000 --- a/resources/tester/test_722_ho_detail.py +++ /dev/null @@ -1,98 +0,0 @@ -"""722 M01 단가산출 상세 개편 지킴 시험 — 글 · 순수 함수(화면 · 서버 없음). - -- 722-1 공용 단가산출 상세(`M01_MasterData_UI_LogicLab_Ho.ts`) — 하위 박스(서버 묶음) · 장비 한 줄 + 펼침 · 계산식 열 · 박스 옵션 -- 722-2 그 자리 고침(`M01_MasterData_UI_LogicLab_Cover.ts`) — M01 = 시험 값(줄 사본) · 정본 · 캐시 안 바뀜 -""" - -import json -import shutil -import subprocess -from pathlib import Path - -import pytest - -ROOT = Path(__file__).resolve().parents[2] -M01 = ROOT / "M01_MasterData" -HO = M01 / "M01_MasterData_UI_LogicLab_Ho.ts" -COVER = M01 / "M01_MasterData_UI_LogicLab_Cover.ts" - - -def _text(p: Path) -> str: - return p.read_text(encoding="utf-8") - - -def _pure(p: Path) -> str: - s = _text(p) - return s[s.index("/* ── 순수 셈 ── */") : s.index("/* ── 순수 셈 끝 ── */")] - - -def _node(code: str): - out = subprocess.run( - ["node", "--experimental-strip-types", "--no-warnings", - "--input-type=module-typescript", "-e", code], - capture_output=True, text=True, encoding="utf-8", timeout=60, - ) # fmt: skip - assert out.returncode == 0, out.stderr - return json.loads(out.stdout) - - -def test_상세가_공용_부품을_씀(): - detail = _text(M01 / "M01_MasterData_UI_LogicLab_Detail.ts") - assert ( - "buildHo" not in detail and "trialEdit" not in detail - ) # 840-1 M01 상세 보기 걷음 — M02 줄 모달만 씀 - assert "...buildHo(hoCtx)" in _text( - ROOT / "M02_MasterTemplete" / "M02_MasterTemplete_Sangeun_Detail.ts" - ) - ho = _text(HO) - # 부품 상자만 — 표 · 카드 · 계산 줄 · 변수 칸(calc_sheet) · 입력 칩(텍스트 수식) - for part in ( - "tableShell(", - "tableRow(", - "createCard(", - "varRow(", - "sheetFormula(", - ): - assert part in ho, part - assert "inputChip(" not in ho # 748-3 줄마다 붙던 옵션 값 칩 걷음(위 옵션 칸이 대신) - for s in (ho, _text(COVER)): - assert 'el("table"' not in s and 'el("button"' not in s and 'el("input"' not in s - assert "document.createElement" not in s and "sessionStorage" not in s - assert "export function varRow(" in _text(ROOT / "A00_Common" / "calc_sheet.ts") - for p in (HO, COVER, M01 / "M01_MasterData_UI_LogicLab.ts"): - assert len(_text(p).splitlines()) <= ( - 637 if p.name == "M01_MasterData_UI_LogicLab.ts" else 700 # 794-1 시트 이음 10 줄 - ) - - -def test_시험_고침은_M01_에서_걷음(): - lab = _text(M01 / "M01_MasterData_UI_LogicLab.ts") - assert ( - "trial" not in lab and "drive" not in lab - ) # 840-1 — 시험 값 · 구동 걷음(수식에서 값을 바꾸고 [되돌림]) - cover = _text(COVER) - assert "export const trial" not in cover and "applyCovers" not in cover - assert "drafts" not in cover and "touch" not in cover and "/save" not in cover - modal = _text(M01 / "M01_MasterData_UI_LogicLab_Modal.ts") - assert "...(target.edit ? [target.edit(close, head)] : [])" in modal - - -@pytest.mark.skipif(shutil.which("node") is None, reason="node 가 없음") -def test_박스_묶기(): - body = """ -const e = (idx, bundle, merge, amount) => ({ idx, bundle, merge, amount }); -const got = boxesOf([ - e(0, "인력", false, 10), e(1, "경비", true, 100), e(1, "경비", true, 20), e(1, "경비", true, 30), - e(2, "하위", true, 5), e(2, "하위", true, null), e(3, "재료", false, null), -], ["인력", "재료", "경비"]).map((b) => ({ 묶음: b.묶음, 소계: b.소계, - 줄: b.줄.map((r) => "몫" in r ? [r.idx, r.금액, r.몫.length] : r.idx) })); -console.log(JSON.stringify(got)); -""" - got = _node(_pure(HO) + "\n" + body) - assert [b["묶음"] for b in got] == ["인력", "재료", "경비", "하위"] - assert got[0] == {"묶음": "인력", "소계": 10, "줄": [0]} - assert got[1] == {"묶음": "재료", "소계": 0, "줄": [3]} - assert got[2] == {"묶음": "경비", "소계": 150, "줄": [[1, 150, 3]]} # 장비 한 줄 = 몫 셋 합 - assert got[3]["줄"] == [[2, 5, 2]] - empty = _node(_pure(HO) + '\nconsole.log(JSON.stringify(boxesOf([], ["인력"])))') - assert empty == [{"묶음": "인력", "줄": [], "소계": 0}] diff --git a/resources/tester/test_723_labor_table.py b/resources/tester/test_723_labor_table.py index 5032a6d25..e54fe55ca 100644 --- a/resources/tester/test_723_labor_table.py +++ b/resources/tester/test_723_labor_table.py @@ -47,15 +47,3 @@ def test_화면_서고_상세는_일위대가표만(): for label in ('tc("Up")', 'tc("Down")', 't("Alias")', 'tc("Remove")'): assert label in table # 우클릭 메뉴 assert "fixed: (fx: LaborFixed, name: string)" in table # 721-2 고정 줄 이음 - - -def test_화면_줄_모달은_SK_상세_줄_모드_적용은_덮개와_옵션(): - modal, sk = ( - _src("M02_MasterTemplete_Labor_RowModal.ts"), - _src("M02_MasterTemplete_Labor_RowSk.ts"), - ) - detail = _src("M02_MasterTemplete_Sangeun_Detail.ts") - assert "mountSangeunDetail(box, doc," in sk and "getValues: () => ({ ...values })" in detail - assert "if (got.patch) row.패치 = got.patch;" in modal and "setValues(got.values);" in modal - assert "AlsoSk" not in modal # 808-1 [단가산출로도 저장] 걷음 · 811-1 M01 기초 = SK 사본 참조 - assert "openRowSangeun" not in modal # 717-3 두 보기 갈음 diff --git a/resources/tester/test_725_1_sangeun_add_inputs.py b/resources/tester/test_725_1_sangeun_add_inputs.py index 334e74a26..a6dc4088f 100644 --- a/resources/tester/test_725_1_sangeun_add_inputs.py +++ b/resources/tester/test_725_1_sangeun_add_inputs.py @@ -105,11 +105,3 @@ def test_no_base_common_option_seoul(world): # noqa: F811 assert got["기준"], {k: v for k, v in got.items() if k != "줄"} assert got["기준"]["계"] == pytest.approx(_m01(GF, {"지역": "서울", "보정작업": "해당 없음"})) assert float(got["기준"]["계"]) == 5660 # 751-3 끝수 · 840-5 굴착기 조종원 35,412 → 59,020/시간 - - -def test_screen_no_base_inputs_and_gap_dash(): - """725-6 화면 — 바탕 없음 = 더한줄 로직 입력 모음 칸 · 못 셈 줄 금액 「—」 + 까닭 풍선.""" - ts = (ROOT / "M02_MasterTemplete" / "M02_MasterTemplete_Sangeun_Detail.ts").read_text("utf-8") - assert "입력: extra" in ts and "syncExtra" in ts and "void recalc(); // 750-2" in ts - ho = (ROOT / "M01_MasterData" / "M01_MasterData_UI_LogicLab_Ho.ts").read_text("utf-8") - assert "e.line?.까닭 ? gapCell" in ho and "title: why" in ho diff --git a/resources/tester/test_727_sk_base_add.py b/resources/tester/test_727_sk_base_add.py index 7caa62374..f2e065d97 100644 --- a/resources/tester/test_727_sk_base_add.py +++ b/resources/tester/test_727_sk_base_add.py @@ -202,54 +202,3 @@ def test_727_3_옵션_저장_일위대가_그_옵션(world): # noqa: F811 assert two["입력값"] == rock got = _run(world["personal"], two) assert _line(got, "add:#0")["금액"] == pytest.approx(_m01(GF, rock), rel=1e-9) - - -def _model(ans, doc, script): - body = ( - f"\nconst ans = {json.dumps(ans, ensure_ascii=False)};" - f"\nconst doc = {json.dumps(doc, ensure_ascii=False)};\n{script}" - ) - return _node( - [ - "M02_MasterTemplete/logic/M02_Born_Tag.ts", - "M02_MasterTemplete/logic/M02_Sangeun_Undo.ts", - "M02_MasterTemplete/logic/M02_Sangeun_Cover_Model.ts", - ], - body, - ) - - -def test_727_2_화면_꼴_세부_줄_고침(world): # noqa: F811 - doc = _sk(world["personal"], 바탕={"로직": GF}, 더한줄=[{**SECOND, "수량": 2}]) - ans = _run(world["personal"], doc) - got = _model( - ans, - doc, - """ -const rows = rowsOf(ans, null, doc); -const view = hoView(ans, null, null, doc); -const sub = rows.find((r) => r.cid === "add:#0/labor:LB000036#0"); -setLineCover(doc, sub, { qty: 0.072 }, false); -const covered = JSON.parse(JSON.stringify(doc.더한줄[0])); -dropLine(doc, rows.find((r) => r.cid === "add:#0/pct:공구손료 및 경장비#0")); -const dropped = [...doc.더한줄[0].뺀줄]; -restoreLine(doc, "add:#0/pct:공구손료 및 경장비#0"); -const one = { ...doc, 더한줄: [] }; -console.log(JSON.stringify({ - cids: rows.map((r) => r.cid), boxes: rows.map((r) => r.묶음), sub, covered, dropped, - back: doc.더한줄[0].뺀줄 ?? null, tags: view.호표.map((x) => x.꼬리표 ?? ""), - extraTags: view.덧줄.map((x) => x.꼬리표 ?? ""), viewCids: view.cids, - single: [...tagsOf(ans, one).values()], -})); -""", - ) - assert "add:#0" not in got["cids"] and "add:#0/labor:LB000036#0" in got["cids"] - assert got["sub"]["sub"] == {"k": 0, "cid": "labor:LB000036#0", "scale": 2} - assert got["sub"]["수량"] == pytest.approx(0.036) and got["sub"]["묶음"] == "인력" - assert got["covered"]["덮개"]["labor:LB000036#0"]["qty"] == pytest.approx( - 0.072 - ) # 화면 품 그대로(M01 원문 몫 · 748-0 — 수량 2 로 안 나눔) - assert got["covered"]["덮개"]["labor:LB000036#0"]["원값"] == {"qty": 0.018, "단가": 233250} - assert got["dropped"] == DROP and got["back"] is None - assert got["tags"] == ["9-12-1", "9-12-1", "3-2-1", "3-2-1"] # 바탕 둘 · 둘째 기초 인력 둘 - assert got["extraTags"] == ["3-2-1"] and got["single"] == [] # 기초 하나면 꼬리표 없음 diff --git a/resources/tester/test_728_2_sk_unit.py b/resources/tester/test_728_2_sk_unit.py index bd1b8c6cc..66be11958 100644 --- a/resources/tester/test_728_2_sk_unit.py +++ b/resources/tester/test_728_2_sk_unit.py @@ -4,8 +4,6 @@ from __future__ import annotations -import json -import subprocess import sys from decimal import Decimal from pathlib import Path @@ -91,7 +89,7 @@ def test_둘째_기초_수량_처음값_배(whole): src = (ROOT / "M02_MasterTemplete/M02_MasterTemplete_Sangeun_Detail.ts").read_text( encoding="utf-8" ) - assert "addBase(" not in src and "baseUnitOf(" in src # 840-1 [항목 추가] 걷음 + assert "addBase(" not in src # 840-1 [항목 추가] 걷음 def test_돈_아닌_기초_고르기_창에서_뺌(whole): @@ -107,20 +105,3 @@ def test_돈_아닌_기초_고르기_창에서_뺌(whole): assert len(money) == 65 # 지금 M01(785-7 · 옛 21 = M01 기초 늘기 전) src = (ROOT / "M02_MasterTemplete/M02_MasterTemplete_Find_Pick.ts").read_text(encoding="utf-8") assert '!logic.결과단위.trim().startsWith("원")' in src - - -def test_고침_꼴_화면배_되돌림(): - proc = subprocess.run( # noqa: S603 — 고정 실행 파일 - ["node", str(HERE / "helper_728_2_cover_unit.cjs")], - capture_output=True, - text=True, - encoding="utf-8", - timeout=60, - ) - assert proc.returncode == 0, proc.stderr - out = json.loads(proc.stdout) - assert out["was"]["qty"] == pytest.approx(0.2) # 바탕 값 = 문서 몫(100본) - assert out["cover"]["labor:LB000101#0"]["qty"] == pytest.approx(0.3) - assert out["added"] == pytest.approx(60) - assert out["shown"]["0"]["qty"] == pytest.approx(0.003) # 다시 그리면 화면 몫 - assert out["shown"]["1"]["qty"] == pytest.approx(0.6) diff --git a/resources/tester/test_737_option_grid_foot.py b/resources/tester/test_737_option_grid_foot.py index b5f70f8ba..a7961ddf3 100644 --- a/resources/tester/test_737_option_grid_foot.py +++ b/resources/tester/test_737_option_grid_foot.py @@ -7,7 +7,6 @@ ROOT = Path(__file__).resolve().parents[2] M01 = ROOT / "M01_MasterData" SHEET_CSS = (ROOT / "A00_Common" / "calc_sheet.css").read_text(encoding="utf-8") STYLE = (M01 / "M01_MasterData_UI_LogicLab_Style.css").read_text(encoding="utf-8") -HO = (M01 / "M01_MasterData_UI_LogicLab_Ho.ts").read_text(encoding="utf-8") def test_옵션_격자_폭_따라_6_4_3_2_1(): @@ -27,10 +26,4 @@ def test_합계_한_줄_바닥_고정(): assert "overflow: clip" in STYLE # 메인 칸이 굴림 칸이면 바닥에 안 붙음 foot_ts = (M01 / "M01_MasterData_UI_LogicLab_Foot.ts").read_text(encoding="utf-8") assert 'className: "m01lab__foot"' in foot_ts # 748-3 두 보기가 같은 바닥 줄 부품 - assert "buildFoot(sums, calculated, total)" in HO - assert 'data-cols="3"' in STYLE and ".m01lab__ho-box + .m01lab__ho-box" in STYLE - - -def test_공통_옵션은_모든_박스에_같이(): - assert "optionRows([...usesOf(b), ...common], ctx)" in HO - assert "commonCard(" in HO and "boxes.length ||" in HO # 박스 없을 때만 따로 카드 + assert 'data-cols="3"' in STYLE diff --git a/resources/tester/test_740_2_reset_delete_born.py b/resources/tester/test_740_2_reset_delete_born.py index eca187d26..f8ef919db 100644 --- a/resources/tester/test_740_2_reset_delete_born.py +++ b/resources/tester/test_740_2_reset_delete_born.py @@ -9,17 +9,12 @@ ROOT = Path(__file__).resolve().parents[2] M02 = ROOT / "M02_MasterTemplete" MAIN = (M02 / "M02_MasterTemplete_UI_Main.ts").read_text(encoding="utf-8") ACTIONS = (M02 / "M02_MasterTemplete_Main_Actions.ts").read_text(encoding="utf-8") -HO = (ROOT / "M01_MasterData" / "M01_MasterData_UI_LogicLab_Ho.ts").read_text(encoding="utf-8") -COVER = (M02 / "logic" / "M02_Sangeun_Cover_Model.ts").read_text(encoding="utf-8") def _born(expr: str): """순수 TS(`logic/M02_Born_Tag.ts`)를 Node 로 돌려 JSON 답을 받음.""" uri = (M02 / "logic" / "M02_Born_Tag.ts").as_uri() - code = ( - f"import {{ bornText, bornOfCid, bornNote }} from '{uri}';" - f"console.log(JSON.stringify({expr}));" - ) + code = f"import {{ bornText, bornNote }} from '{uri}';console.log(JSON.stringify({expr}));" out = subprocess.run( # noqa: S603 — 고정 실행 파일 ["node", "--experimental-strip-types", "--no-warnings", "--input-type=module", "-e", code], capture_output=True, @@ -53,14 +48,6 @@ def test_꼬리표_없으면_빈칸_기초번호_뒤에_붙음(): assert got.split("\n")[0] == "A1 · 본뜬 SK-000012" -def test_줄_열쇠에서_그_더한줄_출처를_찾음(): - adds = json.dumps([{}, {"본뜬": BORN}], ensure_ascii=False) - assert _born(f"bornOfCid('add:#1', {adds})").startswith("본뜬 SK-000012") - assert _born(f"bornOfCid('add:#1/add:#0', {adds})").startswith("본뜬 SK-000012") # 펼침 세부 - assert _born(f"bornOfCid('add:#0', {adds})") == "" - assert _born(f"bornOfCid('hopyo:X#3', {adds})") == "" - - def test_머리_단추_차례_초기화_삭제_저장(): kids = MAIN[MAIN.index('className: "m02-main__head"') :] kids = kids[: kids.index("]")] @@ -83,11 +70,6 @@ def test_초기화는_미리보기_뒤_물음_뒤_씀(): assert "옵션 · 기본정보는 그대로" in ACTIONS -def test_공용_꼬리표_칸은_첫줄만_보이고_풍선에_나머지(): - assert 'text.split("\\n")' in HO - assert "bornOfCid(" in COVER - - def test_격자_비고_칸은_첫줄만(): assert _born(f"bornNote({json.dumps(BORN, ensure_ascii=False)})") == "본뜬 SK-000012" assert _born("bornNote(null)") == "" diff --git a/resources/tester/test_748_0_sk_undo.py b/resources/tester/test_748_0_sk_undo.py deleted file mode 100644 index c1746cb27..000000000 --- a/resources/tester/test_748_0_sk_undo.py +++ /dev/null @@ -1,40 +0,0 @@ -"""748-0 지킴 — SK 둘째 기초 세부 품 = M01 원문(머리 수량 안 곱함) · 고침 꼴 · 빼기 기억 · 되살림 · 수량 처음값. -(서버 짝 = `test_744_1_sk_detail_undo.py`)""" - -from __future__ import annotations - -import json -import subprocess -from pathlib import Path - -import pytest - -HERE = Path(__file__).resolve().parent - - -def test_세부_원문_품_고침_빼기_되살림_처음값(): - proc = subprocess.run( # noqa: S603 — 고정 실행 파일 - ["node", str(HERE / "helper_748_0_sk_undo.cjs")], - capture_output=True, - text=True, - encoding="utf-8", - timeout=60, - ) - assert proc.returncode == 0, proc.stderr - out = json.loads(proc.stdout) - assert float(out["shownQty"]) == pytest.approx(0.871) # 곱하지 않은 M01 원문 - assert out["lineQty"] == pytest.approx(0.871) - assert out["lineAmount"] == pytest.approx(871) # 상자 몫은 그대로 - assert out["t"] == 1 - assert out["cover"]["labor:LB000101#0"]["qty"] == pytest.approx(0.9) # 머리 수량 안 나눔 - assert out["coverShown"] == pytest.approx(0.9) # 다시 그려도 같음 - assert out["manQty"] == 5 and out["manBack"] == 2 # [되돌림] = 넣을 때 수량 - drop = out["afterDrop"] - assert drop["adds"] == 1 and drop["gone"][0]["차례"] == 0 - assert drop["pick"] == {"add:#0": "MT1"} # 뒤 더한줄 열쇠 당김 - assert out["goneRows"][0]["cid"] == "gone:0" - back = out["afterBack"] - assert back["adds"] == ["LB000002", "GF000316"] and back["gone"] is None - assert back["pick"] == {"add:#1": "MT1"} # 되살림 = 밂 - assert out["baseGone"] == {"adds": 1, "name": "둘째 기초", "pick": {}} - assert out["baseBack"] == ["LB000002", "GF000316"] diff --git a/resources/tester/test_750_2_views_one_answer.py b/resources/tester/test_750_2_views_one_answer.py index 8ec1e48c9..09aeaf4d8 100644 --- a/resources/tester/test_750_2_views_one_answer.py +++ b/resources/tester/test_750_2_views_one_answer.py @@ -10,84 +10,8 @@ def _ts(rel: str) -> str: return (ROOT / rel).read_text("utf-8") -def test_detail_uses_only_sk_answer(): - ts = _ts("M02_MasterTemplete/M02_MasterTemplete_Sangeun_Detail.ts") - assert "text = got.글" in ts and "answer: async" not in ts and "buildCalc" not in ts - assert "onText" not in ts and "onLines" not in ts # 바탕 `/calc` · `/text` 부름 걷음 - assert "dropText" not in ts and "baseCovers" not in ts and "applyCovers" not in ts - assert "calcSangeun(scope, plain, values, false)" in ts # 바탕 원값 셈 = 보기 덧칸 없이 - assert "doc.고름 = " in ts and "pickMat" in ts # 재료 고름 = SK 문서 고름 - - -def test_text_lines_joined_by_cid(): - ho = _ts("M01_MasterData/M01_MasterData_UI_LogicLab_Ho.ts") - assert "ctx.cids && line.cid" in ho and "pickMat" in ho - api = _ts("M01_MasterData/M01_MasterData_UI_Logic_Api.ts") - assert "cid?: string" in api and "나눔?: number" in api - - def test_calc_drive_is_screenless_and_m02_has_no_calc_hook(): ts = _ts("M01_MasterData/M01_MasterData_UI_Logic_Calc.ts") assert "ctx.answer" not in ts and "CalcShown" not in ts # 799-2 M02 시험 계산 길 걷음 drive = _ts("M01_MasterData/M01_MasterData_UI_Logic_Drive.ts") assert "runCalc(body)" in drive and "document." not in drive # 셈 구동 = 화면 없이 - - -def test_752_1_source_panel_only_on_sangeun_screen(): - """752-1 원문 패널 — 단가산출 화면만 켬 · 일위대가 줄 모달 안 상세는 끔 · 기초마다 탭 · 좁은 폭 접힘.""" - side = _ts("M02_MasterTemplete/M02_MasterTemplete_Sangeun_Side.ts") - assert "/m02/logic-lib/source" in side and "createSidePanels" in side - assert "OPEN_FROM" in side and "createSegment" in side - assert "source: true" in _ts("M02_MasterTemplete/M02_MasterTemplete_Sangeun_View.ts") - assert "source" not in _ts("M02_MasterTemplete/M02_MasterTemplete_Labor_RowSk.ts") - detail = _ts("M02_MasterTemplete/M02_MasterTemplete_Sangeun_Detail.ts") - assert "opt.source ? createSangeunSide()" in detail and "side?.set(" in detail - - -def test_753_2_option_off_flag_reaches_sheet_and_views(): - """753-2 옵션으로 빠진 줄 — SK 줄 `옵션꺼짐` → 표 줄 `off` → 계산서 줄 `옵션꺼짐`(공용 계산서 · 상세 · - 텍스트 수식 · 시험 계산이 안 그림) · 소계 · 금액은 그대로.""" - import json - import re - import shutil - import subprocess - - import pytest - - if shutil.which("node") is None: - pytest.skip("node 가 없음") - m02 = ROOT / "M02_MasterTemplete" - strip = lambda p: re.sub(r"^import .*$", "", p.read_text("utf-8"), flags=re.M) # noqa: E731 - src = "\n".join( - [ - strip(m02 / "logic" / "M02_Born_Tag.ts"), - strip(m02 / "logic" / "M02_Sangeun_Undo.ts"), - # 751-3 모델이 가져오는 B09 `rounddown`(import 줄을 빼므로 같은 식을 둠) - "const rounddown = (v, p = 0) => { const s = 10 ** p; " - "const a = Math.floor(Math.abs(v) * s + 1e-7) / s; return v < 0 ? -a : a; };", - strip(m02 / "logic" / "M02_Sangeun_Cover_Model.ts"), - """ -const line = (cid, 이름, 수량, 금액, 꺼짐) => ({ cid, 이름, 단위: "개", 수량, 단가: 100, 금액, - 비목: { 재료비: 금액 }, 묶음: "재료", ...(꺼짐 ? { 옵션꺼짐: true } : {}) }); -const ans = { 기준: null, 짝잃음: [], 바탕판: "x", 정체: ["material:A#0", "material:B#0"], - 줄: [line("material:A#0", "폼타이 12.7", 0, 0, true), line("material:B#0", "합판", 1, 100, false)] }; -const rows = rowsOf(ans, null, {}); -console.log(JSON.stringify({ off: rows.map((r) => r.off) })); -""", - ] - ) - out = subprocess.run( - ["node", "--experimental-strip-types", "--no-warnings", - "--input-type=module-typescript", "-e", src], - capture_output=True, text=True, encoding="utf-8", timeout=60, - ) # fmt: skip - assert out.returncode == 0, out.stderr - got = json.loads(out.stdout) - assert got["off"] == [True, False] - sheet = (ROOT / "A00_Common" / "calc_sheet.ts").read_text("utf-8") - assert "b.줄.filter(shown)" in sheet and "g.줄.filter(shown)" in sheet - ho = (ROOT / "M01_MasterData" / "M01_MasterData_UI_LogicLab_Ho.ts").read_text("utf-8") - assert "옵션꺼짐" in ho - assert "옵션꺼짐" in (ROOT / "M01_MasterData" / "M01_MasterData_UI_Logic_Calc.ts").read_text( - "utf-8" - ) diff --git a/resources/tester/test_778_4_rate_line.py b/resources/tester/test_778_4_rate_line.py index 53addfdbc..311fc2fd6 100644 --- a/resources/tester/test_778_4_rate_line.py +++ b/resources/tester/test_778_4_rate_line.py @@ -350,24 +350,3 @@ def test_겹침_율_열쇠_새_차례(): # ── 화면 — 더한줄 지움 · 되살림 때 율 기준 열쇠 옮김(`logic/M02_Sangeun_Undo.ts`) ────────── -def test_화면_더한줄_지움_되살림_율_열쇠(): - code = IMPORTS.sub( - "", (ROOT / "M02_MasterTemplete/logic/M02_Sangeun_Undo.ts").read_text("utf-8") - ) - doc = _doc([LABOR[0], LABOR[1], _rate(["add:#1@노무비", "add:#0", "labor:LB000038#0"])]) - body = ( - f"\nconst doc = {json.dumps(doc, ensure_ascii=False)};" - "\nconst key = () => doc.더한줄.at(-1).고정.비율.기준;" - "\nforgetAdd(doc, 0, ''); const a = key(); reviveAdd(doc, 0);" - "\nconsole.log(JSON.stringify([a, key()]));" - ) - got = subprocess.run( - ["node", "--experimental-strip-types", "--no-warnings", - "--input-type=module-typescript", "-e", code + body], - capture_output=True, text=True, encoding="utf-8", timeout=60, - ) # fmt: skip - assert got.returncode == 0, got.stderr - assert json.loads(got.stdout) == [ - ["add:#0@노무비", "labor:LB000038#0"], # 지운 줄 열쇠 버림 · 뒤 줄 당김(비목 꼬리 그대로) - ["add:#1@노무비", "labor:LB000038#0"], # 되살림 = 뒤 줄 밂 - ] diff --git a/resources/tester/test_796_2b_m02_equation.py b/resources/tester/test_796_2b_m02_equation.py index b9dfd5333..4fd833071 100644 --- a/resources/tester/test_796_2b_m02_equation.py +++ b/resources/tester/test_796_2b_m02_equation.py @@ -129,4 +129,3 @@ def test_screen_same_part_first_tab(): tabs = (root / "M02_MasterTemplete_Sangeun_Tabs.ts").read_text(encoding="utf-8") # 799-2 · 836-3 — 시트 · 인력·재료·경비 · 시험 계산 · 텍스트 수식 · 보기 고르기(단가산출 상세 탭) 걷음 assert not re.findall(r'\{ value: "(\w+)", label: ', tabs) and "createSegment" not in tabs - assert "show(true);" in tabs diff --git a/resources/tester/test_796_2d_detail_subtotal.py b/resources/tester/test_796_2d_detail_subtotal.py index 99539d043..3925a3ece 100644 --- a/resources/tester/test_796_2d_detail_subtotal.py +++ b/resources/tester/test_796_2d_detail_subtotal.py @@ -8,13 +8,9 @@ from __future__ import annotations -import json -import shutil -import subprocess from decimal import Decimal as D from pathlib import Path -import pytest from M02_MasterTemplete import M02_MasterTemplete_Store as store from M02_MasterTemplete import M02_Sangeun_Imported as imp @@ -22,7 +18,6 @@ from resources.tester.test_795_1_sk_copy import _calc, _doc, _imported_row from resources.tester.test_m02_labor_ref import world # noqa: F401 — 같은 임시 층 ROOT = Path(__file__).resolve().parents[2] -HO = ROOT / "M01_MasterData" / "M01_MasterData_UI_LogicLab_Ho.ts" COSTS = ("노무비", "재료비", "경비") @@ -65,31 +60,3 @@ def test_plain_sample_has_no_tag(world): assert not any("합밖" in x for x in ans["줄"]) kept = _sum(ans["줄"], True) assert all(int(kept[k]) == int(D(str(ans["기준"][k]))) for k in COSTS) - - -@pytest.mark.skipif(shutil.which("node") is None, reason="node 가 없음") -def test_box_subtotal_skips_outside(): - src = HO.read_text(encoding="utf-8") - pure = src[src.index("/* ── 순수 셈 ── */") : src.index("/* ── 순수 셈 끝 ── */")] - body = """ -const e = (idx, bundle, amount, out) => ({ idx, bundle, merge: false, amount, out }); -const got = boxesOf([e(0, "인력", 10, false), e(1, "인력", 7, true), e(2, "재료", 5)], ["경비"]); -console.log(JSON.stringify(got.map((b) => [b.묶음, b.소계, b.줄.length]))); -""" - run = subprocess.run( - ["node", "--experimental-strip-types", "--no-warnings", - "--input-type=module-typescript", "-e", pure + body], - capture_output=True, text=True, encoding="utf-8", timeout=60, - ) # fmt: skip - assert run.returncode == 0, run.stderr - assert json.loads(run.stdout) == [["인력", 10, 2], ["재료", 5, 1], ["경비", 0, 0]] # 줄은 보임 - - -def test_screen_wiring(): - src = HO.read_text(encoding="utf-8") - assert src.count("out: !!line?.합밖,") == 2 # 호표 줄 · 덧줄 - assert "e.group === g && !e.out" in src # 맨 아래 합계 - assert 'createBadge(th("Out")' in src and len(src.splitlines()) <= 700 - assert "합밖?: boolean" in ( - ROOT / "M01_MasterData" / "M01_MasterData_UI_Logic_Api.ts" - ).read_text(encoding="utf-8") diff --git a/resources/tester/test_799_2_old_tabs_gone.py b/resources/tester/test_799_2_old_tabs_gone.py index aaed062b7..661a22ae1 100644 --- a/resources/tester/test_799_2_old_tabs_gone.py +++ b/resources/tester/test_799_2_old_tabs_gone.py @@ -78,7 +78,7 @@ def test_셈_구동은_화면_없이_상세는_구동만(): ) # 로직 복사 화면이 쓰는 시험 계산 칸 — 구동은 공용 assert "driveRun(ctx)" in calc and "runCalc" not in calc m02 = _text(M02 / "M02_MasterTemplete_Sangeun_Detail.ts") - assert "buildCalc" not in m02 and "calcHost" not in m02 and "createSangeunTabs(editor" in m02 + assert "buildCalc" not in m02 and "calcHost" not in m02 def test_파일_700줄_안(): diff --git a/resources/tester/test_804_7_line_stack_fix.py b/resources/tester/test_804_7_line_stack_fix.py index 4c781b5b0..d03a712e2 100644 --- a/resources/tester/test_804_7_line_stack_fix.py +++ b/resources/tester/test_804_7_line_stack_fix.py @@ -218,7 +218,6 @@ def test_M02_수식탭_M01과_같은_단추_저장_한_번() -> None: tabs = _src("M02_MasterTemplete/M02_MasterTemplete_Sangeun_Tabs.ts") assert "page: opt.page," in tabs and "save: () => stack.save()," in tabs detail = _src("M02_MasterTemplete/M02_MasterTemplete_Sangeun_Detail.ts") - assert "page: opt.source ? () => report() : undefined," in detail assert "JSON.stringify(doc) !== saved || tabs.dirty()" in detail # 고침 알림 = 기본 + 수식 assert ( "addButton" not in detail and "rateButton" not in detail @@ -343,5 +342,3 @@ def test_808_1_수량_칸_식_글_꼬리표_글꼴_머리(): screen = _src("A00_Common/line_stack_screen.ts") assert "opt.tools?.replaceChildren(...tools);" in screen assert "children: opt.tools ? [] : tools" in screen - tabs = _src("M02_MasterTemplete/M02_MasterTemplete_Sangeun_Tabs.ts") - assert "stack.root.hidden = tools.hidden = !doc;" in tabs diff --git a/resources/tester/test_806_1_labor_view.py b/resources/tester/test_806_1_labor_view.py index ffe0f1dca..8b71e9e41 100644 --- a/resources/tester/test_806_1_labor_view.py +++ b/resources/tester/test_806_1_labor_view.py @@ -56,7 +56,7 @@ def test_단가산출_줄은_SK_문서_모달_저장은_그_SK(): r'saveTemplate\(\s*layer,\s*"sangeun",\s*opt\.ref\.키', modal ) # 저장 = 그 SK 문서 assert ( - "mountSangeunDetail(host, doc," in modal and "source: true" in modal + "mountSangeunDetail(host, doc," in modal and 'mode: "page"' in modal ) # 수식 탭 부품 그대로 assert "await handle.flush();" in modal # 수식 저장 먼저 → 문서 저장 assert "if (!opt.readOnly) head.append(ok);" in modal # 읽기만 = [저장] 없음 @@ -130,13 +130,7 @@ def test_808_1_모달_머리_일원화(): row = _src("M02_MasterTemplete_Labor_RowModal.ts") for gone in ("AlsoSk", "createCheckbox", "openLaborInput", "saveAsSk", "Labor_Option"): assert gone not in row, gone - assert "actions: row.참조 ? [slot, ...tools] : tools," in row and 't("FromSk")' in row - assert "slot: o.slot," in _src("M02_MasterTemplete_Labor_RowSk.ts") + assert 't("FromSk")' in row detail = _src("M02_MasterTemplete_Sangeun_Detail.ts") assert "...(opt.slot ? [] : [" in detail # 머리 칸 있으면 머리 줄 없음 assert "children: [tabs.tools]" in detail and "tabs.picker" not in detail - assert r"/^SK-(?!0{6})\d{6}$/" in detail - tabs = _src("M02_MasterTemplete_Sangeun_Tabs.ts") - assert ( - "const doc = !!k || !!opt.page || !!opt.memory?.();" in tabs - ) # 836-3 · 836-5 문서 없는 줄 = 상세 몸만 diff --git a/resources/tester/test_836_5_memory_doc.py b/resources/tester/test_836_5_memory_doc.py index d87536010..cc0266b37 100644 --- a/resources/tester/test_836_5_memory_doc.py +++ b/resources/tester/test_836_5_memory_doc.py @@ -61,13 +61,6 @@ def test_screen_memory_doc_stack_view() -> None: tabs = (ROOT / "M02_MasterTemplete" / "M02_MasterTemplete_Sangeun_Tabs.ts").read_text( encoding="utf-8" ) - assert ( - "const doc = !!k || !!opt.page || !!opt.memory?.();" in tabs - and "memory: opt.memory," in tabs - ) - detail = (ROOT / "M02_MasterTemplete" / "M02_MasterTemplete_Sangeun_Detail.ts").read_text( - encoding="utf-8" - ) - assert "doc.가져온 &&" in detail and "memory: () =>" in detail + assert "memory: opt.memory," in tabs router = (ROOT / "M02_MasterTemplete" / "M02_Doc_Router.py").read_text(encoding="utf-8") assert '"/layers/{layer}/sangeun/-/doc/read"' in router and "write=body.본 is None" in router diff --git a/resources/tester/test_856_0_sk_screen.py b/resources/tester/test_856_0_sk_screen.py index cd171acee..a46c65b0d 100644 --- a/resources/tester/test_856_0_sk_screen.py +++ b/resources/tester/test_856_0_sk_screen.py @@ -31,35 +31,32 @@ def _run() -> dict: def test_sk_page_open_calls_and_hidden_body() -> None: got = _run() - # 바탕 있는 SK = 셈 두 번(바탕 원값 bare) · 바탕 없음 = 한 번 · 상세 몸 DOM 둘(덮개 그릇 · 호표) 숨김 - assert got["page_base"]["calc"] == 2 - assert got["page_nobase"]["calc"] == 1 + # 856-1 — 셈 한 번(머리 띠용 · 바탕 원값 bare 셈 걷음) · 숨은 상세 몸 DOM 0 · 줄 쌓기 한 번 그림 for k in ("page_base", "page_nobase", "memory"): - assert got[k]["body"] == 2, k - assert got[k]["bodyShown"] == 0, k + assert got[k]["calc"] == 1, k + assert got[k]["body"] == 0, k assert got[k]["stack"]["shown"] is True, k - assert {d["key"] for d in got["page_base"]["stack"]["draws"]} == {"SK-000001"} + assert got["page_base"]["stack"]["draws"] == [{"key": "SK-000001", "memory": False}] # 불러오기 미리 보기(저장 전 가져온 식) = 빈 키 + 문서째 - assert all(d == {"key": "", "memory": True} for d in got["memory"]["stack"]["draws"]) - assert got["memory"]["calc"] == 1 + assert got["memory"]["stack"]["draws"] == [{"key": "", "memory": True}] def test_labor_row_click() -> None: sk, logic = _run()["labor"] - # 단가산출 참조 줄 = 그 SK 문서 모달 · 줄 쌓기가 그 키로 보임 · 몸 안 보임 + # 단가산출 참조 줄 = 그 SK 문서 모달 · 줄 쌓기가 그 키로 보임 assert sk["skModal"] == 1 and sk["stack"]["shown"] is True - assert set(sk["stack"]["draws"]) == {"SK-000010"} and sk["body"] == 0 - # M01 로직 줄 = 옛 줄 모달 — 줄 쌓기 숨김 · 상세 몸 보임 · 안내 띠 하나 · 셈 둘(정체 + 상세) - assert logic["skModal"] == 0 and logic["stack"]["shown"] is False - assert logic["body"] == 1 and logic["banners"] == ["info"] and logic["calc"] == 2 + assert sk["stack"]["draws"] == ["SK-000010"] and sk["calc"] == 1 + # M01 로직 줄 = 줄 모달(안내 한 줄) · 상세 몸 · 줄 쌓기 · 셈 없음(856-1) + assert logic["skModal"] == 0 and logic["stack"] is None + assert logic["body"] == 0 and logic["banners"] == ["info"] and logic["calc"] == 0 def test_labor_row_click_inject() -> None: sk, logic = _run()["labor_inject"] - # 셈 주입(프로젝트 사본) = 옛 줄 모달 · 상세 없음 · 안내 띠 없음 · 셈 없음 + # 셈 주입(프로젝트 사본) = 줄 모달 · 안내 한 줄(856-3 까지) · 셈 없음 for row in (sk, logic): assert row["modal"] and row["stack"] is None - assert row["body"] == 0 and row["banners"] == [] and row["calc"] == 0 + assert row["body"] == 0 and row["banners"] == ["info"] and row["calc"] == 0 def test_head_bands_four() -> None: diff --git a/ui_template/ui_template_locale_m2.ts b/ui_template/ui_template_locale_m2.ts index f5f766480..76d522701 100644 --- a/ui_template/ui_template_locale_m2.ts +++ b/ui_template/ui_template_locale_m2.ts @@ -160,20 +160,11 @@ export const ui_locales_m2 = { M02_SangeunNoBase: ["바탕 없음", "No base"], M02_SangeunEdited: ["고친 줄", "Edited rows"], M02_SangeunUsers: ["쓰는 곳", "Used by"], - M02_SangeunRemoved: ["뺀 줄", "Removed rows"], M02_SangeunUnit: ["단위(1 단위 값)", "Unit (value per 1)"], M02_SangeunNeed: ["비우면 저장 안 됨", "Required"], M02_SangeunSwapCoef: ["환산 계수", "Conversion factor"], M02_SangeunSwapWeight: ["단위중량", "Unit weight"], M02_SangeunSwapPick: ["고르세요", "Choose"], - M02_SangeunDrop: ["삭제", "Delete"], - M02_SangeunDropBase: ["기초 빼기", "Remove base"], - M02_SangeunBases: ["더한 기초", "Added bases"], - M02_SangeunBaseQty: ["수량(기준단위 몇 개)", "Quantity (base units)"], - M02_SangeunBaseQtyBad: ["0 이상 수만", "Numbers ≥ 0 only"], - M02_SangeunQtyUndo: ["되돌림", "Undo"], - M02_SangeunRestore: ["되살리기", "Restore"], - M02_SangeunApart: ["별도계상", "Counted separately"], M02_SangeunRevisedBase: ["M01 개정 — 확인", "M01 revised — check"], M02_SangeunRevisedNote: [ "바탕 단가산출 기초가 저장 뒤 바뀜 — 고친 칸의 바탕 값을 확인하고 [저장]하면 새 판으로 맞춤", @@ -187,7 +178,6 @@ export const ui_locales_m2 = { "못 셈 줄 — 금액 빼고 나머지로 셈 · 줄을 빼거나 입력을 채움", "Lines not priced — total uses the rest · drop the line or fill its input", ], - M02_SangeunScaleOnly: ["열린 입력 — 품은 배율만", "Open inputs — quantity as multiplier only"], M02_SangeunSourceNone: ["원문 연결 없음 — 바탕 로직 없음", "No source — no base logic"], M02_SangeunColName: ["이름", "Name"], M02_SangeunColUnit: ["단위", "Unit"], From 78a2d5db85f8653d94332139aa087fbadf674638 Mon Sep 17 00:00:00 2001 From: umsangdon Date: Tue, 17 Nov 2026 19:43:19 +0900 Subject: [PATCH 20/30] =?UTF-8?q?feat(857-1):=20=EB=B6=88=EB=9F=AC?= =?UTF-8?q?=EC=98=A4=EA=B8=B0=20=EC=B1=85=20=ED=95=9C=20=EB=B2=88=20=C2=B7?= =?UTF-8?q?=20=EC=A2=85=EB=A5=98=20=ED=95=9C=20=EB=A7=90=20=E2=80=94=20?= =?UTF-8?q?=EC=9D=BC=EC=9C=84=EB=8C=80=EA=B0=80=20=EC=8B=9C=ED=8A=B8=20?= =?UTF-8?q?=EC=97=86=EB=8A=94=20=EC=97=91=EC=85=80=EB=8F=84=20=EC=98=AC?= =?UTF-8?q?=EB=9D=BC=EA=B0=90=20=C2=B7=20=EC=9E=AC=EB=A3=8C=ED=8C=90=20?= =?UTF-8?q?=EB=AC=B4=ED=9A=A8=20=EC=A7=80=EB=AC=B8=20=C2=B7=20=ED=8C=90=20?= =?UTF-8?q?=EC=85=88=20M01=20=ED=95=9C=20=EB=B2=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 새 M02_San_Workbook — 올린 엑셀을 한 번만 엶(시트 목록 합집합 · xls 서식 책 · 종류 가름 한 말 kind_of) - Hopyo_Excel.read_book · Hopyo_Grid.read · San_Book.sheets · Sangeun_FromHopyo.keep 이 같은 책을 받음 · 전역 _OPENED · _open · opened · _sheets 걷음 - 종류 가름 한 말 — Hopyo_Stmate.is_stmate · San_Book.kind_of 가 Workbook.kind_of 를 씀(단가산출근거 = STmate · 단가산출 = EST) - 올림 길(Router._upload) = 단가산출 시트가 있으면 일위대가 시트 · 호표 없음도 받음(호표 빈 목록 · 단산 목록 보임) · B09 내역서 길(read_book 기본)은 그대로 거절 - 「고를 재료」 판 = 재료판지문(M01 지문 · 별칭 · 자재 칸 포함)이 다르면 다시 셈 · 판 셈 동안 M01 한 벌(M01_MasterData_Store_Cache.steady · M01 파일 안 고침) - 수치: 올림 때 책 열기 2 → 1 · 거창 xlsx 올림 18.0 → 9.0 초 · 판 첫 셈 거창 21.9 → 4.2 · 북부청임도 31.3 → 1.0 · 봉화 34.9 → 1.6 초(재료 종 수 같음) - 지킴: 857-0 블록 전수 3,241 다름 0 · 올림 지문 = 뜻한 바뀜만(2016사방 · 2026수목 거절 → 올라감 · 그 갈래만 다시 뜸 · 재료표 같음) - 시험: 새 test_857_1_workbook(책 한 번 · 종류 · 빈 호표 올림 · 판 무효 · 자국 횟수) · test_857_import_golden 「--write 올림」 갈래 하나 다시 뜨기 - 낡은 시험 고침: test_m02_hopyo_excel(일위대가 · 단가산출 둘 다 없는 책 = 400 · 단가산출만 = 200 호표 0) · test_m02_hopyo_stmate · test_741(옛 _sheets · _xlsx 부름 → 책 한 벌) Co-Authored-By: Claude Opus 5.5 --- M02_MasterTemplete/M02_Hopyo_Excel.py | 97 +++----------- M02_MasterTemplete/M02_Hopyo_Grid.py | 15 ++- M02_MasterTemplete/M02_Hopyo_Router.py | 10 +- M02_MasterTemplete/M02_Hopyo_Stmate.py | 12 +- M02_MasterTemplete/M02_San_Book.py | 40 ++---- M02_MasterTemplete/M02_San_MatPick.py | 28 +++- M02_MasterTemplete/M02_San_Workbook.py | 98 ++++++++++++++ M02_MasterTemplete/M02_Sangeun_FromHopyo.py | 4 +- resources/tester/golden_857_import.json | 12 +- resources/tester/test_741_sheet_widths.py | 3 +- resources/tester/test_857_1_workbook.py | 136 ++++++++++++++++++++ resources/tester/test_857_import_golden.py | 9 +- resources/tester/test_m02_hopyo_excel.py | 9 +- resources/tester/test_m02_hopyo_stmate.py | 3 +- 14 files changed, 338 insertions(+), 138 deletions(-) create mode 100644 M02_MasterTemplete/M02_San_Workbook.py create mode 100644 resources/tester/test_857_1_workbook.py diff --git a/M02_MasterTemplete/M02_Hopyo_Excel.py b/M02_MasterTemplete/M02_Hopyo_Excel.py index 4e617214e..c5ab6ecce 100644 --- a/M02_MasterTemplete/M02_Hopyo_Excel.py +++ b/M02_MasterTemplete/M02_Hopyo_Excel.py @@ -1,7 +1,7 @@ """M02 일위대가 실무자료 읽기(PLAN 324-1) — 설계내역서 엑셀 「일위대가」 시트 → 호표 · 줄 · 갈래 · 검산. -읽기 = .xls `xlrd`(경고가 stdout 으로 안 나가게 logfile) · .xlsx `openpyxl`(빈 칸 None) · +읽기 = 책 한 벌 `M02_San_Workbook.read`(857-1 · .xls xlrd · .xlsx openpyxl · 빈 칸 None) · 시트 · 열은 머리 글(빈칸 뺌)로 찾음 — 호표 · 품명 · 규격 · 수량 · 단위 · 합계 · 노무비 · 재료비 · 경비 · 비고(돈 머리 = 단가 열 · 다음 열 = 금액). 호표 줄 = 「제N호표」 · 호표 1 단위 값 = 금액 열 · 구성 줄 = 호표 칸 빔 · 품명 있음 · @@ -25,7 +25,6 @@ STmate 꼴(「일위대가표」 · 「단가산출근거」 시트) = `M02_Hopy from __future__ import annotations -import io import re from decimal import ROUND_FLOOR, Decimal, InvalidOperation from typing import Any @@ -34,6 +33,7 @@ from M02_MasterTemplete import M02_Hopyo_Clause as hopyo_clause # 출처 풀이 from M02_MasterTemplete import M02_Hopyo_ReadEst as hopyo_est # EST 단가산출 어댑터(776-2) from M02_MasterTemplete import M02_Hopyo_Stmate as hopyo_stmate from M02_MasterTemplete import M02_Hopyo_UnitLine as unit_line +from M02_MasterTemplete import M02_San_Workbook as workbook # 책 한 벌(857-1) SHEET = "일위대가" SUMMARY = "일위대가총괄표" @@ -43,8 +43,7 @@ HEADS = ("호표", "품명", "규격", "수량", "단위", "비고") NO_SHEET = "일위대가 시트 없음" _HOPYO = re.compile(r"제\s*(\d+)\s*호표") _REF = re.compile(r"^(?:(단산|산근|단가산출)|(일위대가|일위|대가))(\d+)(?:참조|호표)?$") -DRM = "문서 보안(DRM)으로 잠긴 파일 — 보안을 푼 사본으로 저장해 올림" -_OLE = b"\xd0\xcf\x11\xe0" +DRM = workbook.DRM _MACHINE_UNITS = ("hr", "시간", "h") _CODE_KIND = { "D": "단가산출", @@ -54,12 +53,7 @@ _CODE_KIND = { "S": "별도계상", "W": "별도계상", } -# ponytail: 마지막 연 책 하나(올림 길 read_book → Grid.read 가 같은 바이트) — 여럿 동시면 다시 엶 -_OPENED: tuple[bytes, dict[str, list[list[Any]]], Any] | None = None - - -class ExcelError(ValueError): - """엉터리 파일 · 시트 없음 — 길이 400 으로 답함.""" +ExcelError = workbook.BookError # 엉터리 파일 · 시트 없음 — 길이 400 으로 답함 def _flat(value: Any) -> str: @@ -93,64 +87,6 @@ def _out(value: Decimal | None) -> int | float | None: return int(value) if value == value.to_integral_value() else float(value) -# ── 파일 → 시트 표(줄마다 값 목록) ──────────────────────────────────────── -def _sheets(name: str, data: bytes, wanted: tuple[str, ...] = ()) -> dict[str, list[list[Any]]]: - """시트 이름 → 줄 목록 — 일위대가 · 총괄표 · 단가산출만 읽음(`wanted` = 더 읽을 시트).""" - return _open(name, data, wanted)[0] - - -def opened(name: str, data: bytes, wanted: tuple[str, ...] = ()) -> tuple[dict[str, Any], Any]: - """(시트 줄, xls 책 | None) — 방금 `read_book` 이 연 같은 바이트면 그 책(한 번 열기 · 776-2) · - 아니면 엶. xls 책 = xlrd `formatting_info`(격자 서식).""" - global _OPENED - got, _OPENED = _OPENED, None - if got is not None and got[0] is data: # read_book 은 목록 시트(LISTS)까지 읽어 둠 - return got[1], got[2] - return _open(name, data, wanted) - - -def _open( - name: str, data: bytes, wanted: tuple[str, ...] = () -) -> tuple[dict[str, list[list[Any]]], Any]: - keep = (SHEET, SUMMARY, hopyo_est.SHEET, *wanted) - if not data: - raise ExcelError("빈 파일") - if b"DRMONE" in data[:256] and data[:4] not in (b"PK\x03\x04", _OLE): - raise ExcelError(DRM) - try: - if data[:4] == b"PK\x03\x04" or name.lower().endswith(".xlsx"): - import openpyxl - - book = openpyxl.load_workbook(io.BytesIO(data), read_only=True, data_only=True) - if hopyo_stmate.is_stmate([t.strip() for t in book.sheetnames]): - keep = (*hopyo_stmate.SHEETS, *wanted) - out = { - ws.title.strip(): [list(row) for row in ws.iter_rows(values_only=True)] - for ws in book.worksheets - if ws.title.strip() in keep - } - book.close() - return out, None - import xlrd - - try: - book = xlrd.open_workbook( - file_contents=data, formatting_info=True, logfile=io.StringIO() - ) - except Exception: # 서식 표가 깨진 파일 — 값만(격자는 그때 서식 없이 다시 엶) - book = xlrd.open_workbook(file_contents=data, logfile=io.StringIO()) - rows = { - sh.name.strip(): [sh.row_values(r) for r in range(sh.nrows)] - for sh in book.sheets() - if sh.name.strip() in keep - } - return rows, book - except ExcelError: - raise - except Exception as error: # 라이브러리마다 다른 예외 — 깨진 파일 · 엑셀 아님 - raise ExcelError("엑셀 파일을 읽지 못함 — xls · xlsx 가 아니거나 깨진 파일") from error - - def _columns(rows: list[list[Any]], money: tuple[str, ...]) -> tuple[int, dict[str, int]]: """(자료 첫 줄, {머리: 열}) — 머리 글은 앞 10 줄 안 「호표」 · 「품명」 이 든 줄.""" for at, row in enumerate(rows[:10]): @@ -297,20 +233,23 @@ def _by_name(raw: list[list[dict[str, Any]]], blocks: dict[int, dict[str, Any]]) # ── 읽기 ────────────────────────────────────────────────────────────── -def read_book(name: str, data: bytes) -> dict[str, Any]: - """엑셀 → `{시트, 호표: [...], 검산: {어긋남: [글 …], 총괄표: 맞춘 수}}` — 값은 JSON 수.""" - global _OPENED - sheets, xls = _open(name, data, LISTS) - _OPENED = (data, sheets, xls) # 격자(`Grid.read`)가 이어 씀 — 한 번 열기 - if hopyo_stmate.is_stmate(sheets): - return unit_line.settle(hopyo_clause.settle(hopyo_stmate.read(sheets))) +def read_book( + name: str, data: bytes, book: workbook.Book | None = None, blocks_only: bool = False +) -> dict[str, Any]: + """엑셀 → `{시트, 호표: [...], 검산: {어긋남: [글 …], 총괄표: 맞춘 수}}` — 값은 JSON 수 · + `book` = 올림 길이 한 번 연 책(857-1) · `blocks_only`(올림 길) = 단가산출 시트가 있으면 일위대가 + 시트 · 호표 없음도 받음(호표 빈 목록 · 단산만).""" + book = book or workbook.read(name, data) + sheets, loose = book.sheets, blocks_only and book.kind is not None + if book.kind == "STmate": + return unit_line.settle(hopyo_clause.settle(hopyo_stmate.read(sheets, loose))) rows = sheets.get(SHEET) - if rows is None: + if rows is None and not loose: raise ExcelError(NO_SHEET) - start, cols = _columns(rows, ("합계", *COSTS)) + start, cols = _columns(rows, ("합계", *COSTS)) if rows is not None else (0, {}) hopyos: list[dict[str, Any]] = [] raw: list[list[dict[str, Any]]] = [] - for at, row in enumerate(rows[start:], start + 1): + for at, row in enumerate((rows or [])[start:], start + 1): head = _flat(_cell(row, cols.get("호표"))) name_ = _text(_cell(row, cols.get("품명"))) hit = _HOPYO.fullmatch(head) @@ -347,7 +286,7 @@ def read_book(name: str, data: bytes) -> dict[str, Any]: line["갈래"] = kind_of(line) line["행"] = hopyos[-1]["행"][1] = at raw[-1].append(line) - if not hopyos: + if not hopyos and not loose: raise ExcelError(f"{SHEET} 시트에 호표(제N호표)가 없음") blocks = hopyo_est.read(sheets.get(hopyo_est.SHEET)) _by_name(raw, blocks) diff --git a/M02_MasterTemplete/M02_Hopyo_Grid.py b/M02_MasterTemplete/M02_Hopyo_Grid.py index e64f19caf..4ad5c00dc 100644 --- a/M02_MasterTemplete/M02_Hopyo_Grid.py +++ b/M02_MasterTemplete/M02_Hopyo_Grid.py @@ -29,6 +29,7 @@ from openpyxl.xml.functions import fromstring, iterparse from M02_MasterTemplete import M02_Hopyo_Excel as hopyo_excel from M02_MasterTemplete import M02_Hopyo_ReadEst as hopyo_basis # EST 단가산출 시트 이름 from M02_MasterTemplete import M02_Hopyo_Stmate as hopyo_stmate +from M02_MasterTemplete import M02_San_Workbook as workbook LIST_E, HOPYO_S = hopyo_excel.LISTS LIST_S = hopyo_stmate.LISTS[0] @@ -241,11 +242,8 @@ def _xlsx_widths( return out -def _xlsx( - name: str, data: bytes, found: dict[str, list[list[Any]]] | None = None -) -> dict[str, Any]: +def _xlsx(name: str, data: bytes, found: dict[str, list[list[Any]]]) -> dict[str, Any]: # ponytail: xlsx 는 값 · 열 폭만(병합 · 서식은 openpyxl 비 read_only 로 무거움) — 필요하면 그때 - found = found or hopyo_excel._sheets(name, data, EXTRA) widths = _xlsx_widths(data, SHEETS) sheets = [] for at, title in enumerate((n for n in SHEETS if n in found), 1): @@ -322,10 +320,13 @@ def _lists(rows: dict[str, Any], parsed: dict[str, Any]) -> dict[str, list[dict[ return {"호표": pair(hopyo), "단산": pair(calc)} -def read(name: str, data: bytes, parsed: dict[str, Any]) -> dict[str, Any]: +def read( + name: str, data: bytes, parsed: dict[str, Any], opened: workbook.Book | None = None +) -> dict[str, Any]: """엑셀 → `{책: Workbook, 호표, 단산, 보기, 원본, 목록, 줄}` — `parsed` = - `M02_Hopyo_Excel.read_book` 결과(행 범위).""" - rows, xls = hopyo_excel.opened(name, data, EXTRA) # 읽기가 연 책 그대로(한 번 열기 · 776-2) + `M02_Hopyo_Excel.read_book` 결과(행 범위) · `opened` = 올림 길이 한 번 연 책(857-1).""" + opened = opened or workbook.read(name, data) + rows, xls = opened.sheets, opened.xls book = _xlsx(name, data, rows) if xls is None else _xls(xls) keep = ("번", "이름", "행") ids = {s["이름"]: s["id"] for s in book["시트"]} diff --git a/M02_MasterTemplete/M02_Hopyo_Router.py b/M02_MasterTemplete/M02_Hopyo_Router.py index 0ac096fc2..c345c0cd1 100644 --- a/M02_MasterTemplete/M02_Hopyo_Router.py +++ b/M02_MasterTemplete/M02_Hopyo_Router.py @@ -32,6 +32,7 @@ from M02_MasterTemplete import M02_Hopyo_Store as hopyo_store from M02_MasterTemplete import M02_Hopyo_View as hopyo_view_ from M02_MasterTemplete import M02_MasterTemplete_Store as store from M02_MasterTemplete import M02_San_MatPick as mat_pick +from M02_MasterTemplete import M02_San_Workbook as workbook from M02_MasterTemplete import M02_Sangeun_FromHopyo as from_hopyo from M02_MasterTemplete.M02_MasterTemplete_Router_Items import Layer, Session, _call from M02_MasterTemplete.M02_MasterTemplete_Router_Items import _root as _layer_root @@ -79,16 +80,17 @@ def _upload(name: str, data: bytes, who: dict[str, Any]) -> dict[str, Any]: if not from_hopyo.has(store.root(), same["키"]): # 793-3b 전에 올린 HP cannot = from_hopyo.keep(store.root(), same["키"], name, data) return {**same, "이어서": True, **({"읽기불가": cannot} if cannot else {})} - try: - parsed = hopyo_excel.read_book(name, data) + try: # 책 한 번(857-1) · 단가산출만 있는 엑셀(일위대가 시트 없음)도 받음 = 호표 빈 목록 + book = workbook.read(name, data) + parsed = hopyo_excel.read_book(name, data, book, blocks_only=True) except hopyo_excel.ExcelError as error: raise store.StoreError(400, str(error)) from error try: - grid = hopyo_grid.read(name, data, parsed) + grid = hopyo_grid.read(name, data, parsed, book) except Exception: # 격자는 보기용 덤 — 못 만들어도 올리기는 됨(보기 창 404) grid = None # 산근 시트(793-3b 가져온 식 열기) = HP 를 목록에 보이기 전에 보관(814-1) · 못 씀 사유 → 화면 토스트(797-1) - keep = lambda key: from_hopyo.keep(store.root(), key, name, data) # noqa: E731 + keep = lambda key: from_hopyo.keep(store.root(), key, name, data, book) # noqa: E731 return hopyo_store.save(store.root(), name, parsed, who, grid, mark, keep) diff --git a/M02_MasterTemplete/M02_Hopyo_Stmate.py b/M02_MasterTemplete/M02_Hopyo_Stmate.py index adb1671d9..46487ec69 100644 --- a/M02_MasterTemplete/M02_Hopyo_Stmate.py +++ b/M02_MasterTemplete/M02_Hopyo_Stmate.py @@ -65,7 +65,10 @@ _TAG = re.compile(r"&([A-Z][A-Z0-9_]*?)(?::[A-Z])?&") # 율 기준 표지 「&P def is_stmate(names: Any) -> bool: - return SHEET in names and CALC in names + """STmate 꼴 — 종류 가름 한 말(`M02_San_Workbook.kind_of` · 857-1).""" + from M02_MasterTemplete import M02_San_Workbook as workbook + + return workbook.kind_of(names) == "STmate" def _cell(row: list[Any], col: int) -> Any: @@ -351,10 +354,11 @@ def _hopyo_line(row: list[Any], one: dict[str, Any], at: int) -> dict[str, Any]: return line -def read(sheets: dict[str, list[list[Any]]]) -> dict[str, Any]: - """STmate 시트 → HP 꼴 `{꼴, 시트, 호표, 단산, 검산}`(값은 JSON 수).""" +def read(sheets: dict[str, list[list[Any]]], loose: bool = False) -> dict[str, Any]: + """STmate 시트 → HP 꼴 `{꼴, 시트, 호표, 단산, 검산}`(값은 JSON 수) · + `loose` = 호표 없음도 받음(857-1).""" hopyos, raw = _hopyos(sheets.get(SHEET) or []) - if not hopyos: + if not hopyos and not loose: raise hopyo_excel.ExcelError(f"{SHEET} 시트에 호표(제N호표)가 없음") table = _lists(sheets) blocks = _blocks(sheets.get(CALC) or [], table) diff --git a/M02_MasterTemplete/M02_San_Book.py b/M02_MasterTemplete/M02_San_Book.py index 027b518d5..7c90f8c93 100644 --- a/M02_MasterTemplete/M02_San_Book.py +++ b/M02_MasterTemplete/M02_San_Book.py @@ -9,9 +9,7 @@ EST(.xls · .xlsx) = 단가산출 시트 블록 글(`M02_Hopyo_ReadEst.read`) + from __future__ import annotations -import io import re -import warnings from typing import Any STM_SHEETS = ( @@ -37,37 +35,21 @@ _X7, _X5 = "_x0007_", "_x0005_" _HEAD = re.compile(r"BDCOD\|([A-Z]\d+).*?POSS\|(\d+).*?POSE\|(\d+)") -def sheets(name: str, data: bytes) -> dict[str, list[list[Any]]]: - """책 바이트 → {시트: 줄} (두 꼴 시트만).""" +def sheets(name: str, data: bytes, book: Any = None) -> dict[str, list[list[Any]]]: + """책 바이트 → {시트: 줄} (두 꼴 시트만) · `book` = 올림 길이 한 번 연 책 + (857-1 `M02_San_Workbook`).""" + from M02_MasterTemplete import M02_San_Workbook as workbook + + book = book or workbook.read(name, data) keep = STM_SHEETS + EST_SHEETS - if data[:4] == b"PK\x03\x04" or name.lower().endswith(".xlsx"): - import openpyxl - - with warnings.catch_warnings(): # 인쇄 영역 이름 경고 - warnings.simplefilter("ignore") - wb = openpyxl.load_workbook(io.BytesIO(data), read_only=True, data_only=True) - try: - return { - ws.title.strip(): [list(r) for r in ws.iter_rows(values_only=True)] - for ws in wb.worksheets - if ws.title.strip() in keep - } - finally: - wb.close() - import xlrd - - wb = xlrd.open_workbook(file_contents=data, logfile=io.StringIO()) - return { - sh.name.strip(): [sh.row_values(r) for r in range(sh.nrows)] - for sh in wb.sheets() - if sh.name.strip() in keep - } + return {k: v for k, v in book.sheets.items() if k in keep} def kind_of(book: dict[str, list]) -> str | None: - if "단가산출근거" in book: - return "STmate" - return "EST" if "단가산출" in book else None + """종류 가름 한 말(`M02_San_Workbook.kind_of`).""" + from M02_MasterTemplete import M02_San_Workbook as workbook + + return workbook.kind_of(book) # ── STmate ───────────────────────────────────────────────────────────── diff --git a/M02_MasterTemplete/M02_San_MatPick.py b/M02_MasterTemplete/M02_San_MatPick.py index e5ec2794a..cf4a080d9 100644 --- a/M02_MasterTemplete/M02_San_MatPick.py +++ b/M02_MasterTemplete/M02_San_MatPick.py @@ -5,7 +5,8 @@ 자리 = 개인 층 `실무자료/재료고름/<파일 지문>.json` {파일, 고름 {종: {키, 이름, 규격, 단위}}} — [끝내기] 뒤에도 남음 · 같은 파일(지문)을 다시 올리면 그대로 보임. 판(`census`) = 그 HP 블록마다 재료 줄 판정(`자원["재료찾기"]` · 827-2)을 종으로 묶음 — - 첫 판 열 때 한 번 셈 → 산근 저장본 칸 `재료판`(HP 지울 때 같이 지움). + 첫 판 열 때 한 번 셈 → 산근 저장본 칸 `재료판` + `재료판지문`(M01 지문 · 다르면 다시 셈 · + 857-1) · HP 지울 때 같이 지움. 만들기(`using` → `M02_Sangeun_FromHopyo._emit` 이 `apply`) = 고른 종 줄: 이음 = 고른 키 · `재료찾기.고름` (문서 셈 = 우리 값 · 엑셀 값 기억 없음 · `M02_Doc_Import._attach`) · 별도계상 줄 = `고름` 만(줄 이음 · 단가 0 그대로). 문서 머리 `가져온.재료` = [{기호, 종, 원래, 판정, 방법, 키, 후보, 단서, 별도계상?, 고름?, 처음}](`entry` · @@ -29,6 +30,7 @@ from M02_MasterTemplete import M02_MasterTemplete_Store as store DIRNAME = "재료고름" CENSUS = "재료판" +MARK = "재료판지문" # 판을 셀 때 M01 지문(857-1 · 별칭 · 자재가 바뀌면 다시 셈) KINDS = ( "규격 없음 — 고르기", "단위 다름 — 고르기", # 840-3 @@ -179,9 +181,24 @@ def entry(item: dict, sym: str, excel: Any) -> dict | None: # ── 판(그 파일 재료 종) ────────────────────────────────────────────────── +def _mark() -> str: + """판 무효 지문 = M01 지문(첫 층 파일 내용 · 기계 폴더 — 별칭 · 자재 칸 포함 · + `San_Basis_Index.stamp`).""" + from M02_MasterTemplete import M02_San_Basis_Index as basis + + return basis.stamp() + + def census(folder: str | Path, key: str) -> list[dict]: """HP 블록마다 재료 줄 판정 → 종 [{종, 이름, 규격, 단위, 판정, 방법, 키, 후보, 단서, 별도계상, 블록, 줄, - 호표?(828-1 일위 구성 줄 · 코드 숫자)}].""" + 호표?(828-1 일위 구성 줄 · 코드 숫자)}] — 셈 동안 M01 한 벌(857-1 · 파일 자국 한 번).""" + from M01_MasterData import M01_MasterData_Store as m01 + + with m01.cache.steady(): + return _census(folder, key) + + +def _census(folder: str | Path, key: str) -> list[dict]: from M02_MasterTemplete import M02_Doc_FromNative as fn from M02_MasterTemplete import M02_Sangeun_FromHopyo as fh @@ -191,12 +208,13 @@ def census(folder: str | Path, key: str) -> list[dict]: saved = json.loads(path.read_bytes()) except (OSError, ValueError) as e: raise store.StoreError(409, fh.RELOAD) from e - if isinstance(saved.get(CENSUS), list): + mark = _mark() + if isinstance(saved.get(CENSUS), list) and saved.get(MARK) == mark: return saved[CENSUS] native = saved.get("원파일") src = native if isinstance(native, dict) else fh._excel_of(path, saved) if saved.get("시트") else {} # fmt: skip groups: dict[str, dict] = {} - # ponytail: 블록마다 셈 전부(기계 찾기 포함 · 70 블록 10~20 초) — 첫 판 한 번 · 느리면 재료 줄만 도는 길 + # ponytail: 블록마다 셈 전부(기계 찾기 포함) — 첫 판 한 번 · 더 느리면 재료 줄만 도는 길 for no in sorted(fn.numbers(src)) if src else []: with using(None): try: @@ -235,7 +253,7 @@ def census(folder: str | Path, key: str) -> list[dict]: if (n := int(str(b["코드"])[1:])) not in hp: hp.append(n) out_ = sorted(groups.values(), key=lambda g: (KINDS.index(g["판정"]) if g["판정"] in KINDS else 9, -len(g["블록"]), g["이름"])) # fmt: skip - atomic_write_json(path, {**saved, CENSUS: out_}) + atomic_write_json(path, {**saved, CENSUS: out_, MARK: mark}) return out_ diff --git a/M02_MasterTemplete/M02_San_Workbook.py b/M02_MasterTemplete/M02_San_Workbook.py new file mode 100644 index 000000000..2624f8656 --- /dev/null +++ b/M02_MasterTemplete/M02_San_Workbook.py @@ -0,0 +1,98 @@ +"""M02 불러오기 책 한 벌(PLAN 857-1) — 올린 엑셀을 한 번만 열어 시트 줄 · xls 서식 책 · 종류를 +같이 넘김. + +읽는 시트 = 호표 쪽(`M02_Hopyo_Excel` 일위대가 · 총괄표 · 단가산출 · 목록 · +`M02_Hopyo_Stmate.SHEETS`) + 산근 쪽(`M02_San_Book.STM_SHEETS` · `EST_SHEETS`) 합집합 · +호표 읽기 · 격자 · 산근 보관이 같은 책을 받음. +종류 가름 한 말 = `kind_of` — 「단가산출근거」 = STmate · 「단가산출」 = EST · 그 밖 None. +xls = xlrd `formatting_info`(격자 서식 · 깨진 서식 표 = 값만) · xlsx = openpyxl read_only · 값만. +엉터리 · 빈 파일 · 문서 보안(DRM) = `BookError`(올림 길 400). +""" + +from __future__ import annotations + +import io +import warnings +from dataclasses import dataclass +from functools import lru_cache +from typing import Any + +DRM = "문서 보안(DRM)으로 잠긴 파일 — 보안을 푼 사본으로 저장해 올림" +_OLE = b"\xd0\xcf\x11\xe0" + + +class BookError(ValueError): + """엉터리 파일 · 시트 없음 — 길이 400 으로 답함.""" + + +@dataclass(frozen=True) +class Book: + """한 번 연 책 — `sheets` = {시트: 줄 목록}(합집합 시트만) · `xls` = xlrd 책 | None.""" + + name: str + sheets: dict[str, list[list[Any]]] + xls: Any + kind: str | None + + +@lru_cache(maxsize=1) +def wanted() -> frozenset[str]: + """읽을 시트 이름 합집합(호표 쪽 + 산근 쪽).""" + from M02_MasterTemplete import M02_Hopyo_Excel as hx + from M02_MasterTemplete import M02_Hopyo_ReadEst as hr + from M02_MasterTemplete import M02_Hopyo_Stmate as hs + from M02_MasterTemplete import M02_San_Book as sb + + return frozenset( + (hx.SHEET, hx.SUMMARY, hr.SHEET, *hx.LISTS, *hs.SHEETS, *sb.STM_SHEETS, *sb.EST_SHEETS) + ) + + +def kind_of(names: Any) -> str | None: + """시트 이름들 → STmate · EST · None(종류 가름 한 곳).""" + if "단가산출근거" in names: + return "STmate" + return "EST" if "단가산출" in names else None + + +def read(name: str, data: bytes) -> Book: + """책 바이트 → `Book`(한 번 열기).""" + if not data: + raise BookError("빈 파일") + if b"DRMONE" in data[:256] and data[:4] not in (b"PK\x03\x04", _OLE): + raise BookError(DRM) + keep = wanted() + try: + if data[:4] == b"PK\x03\x04" or name.lower().endswith(".xlsx"): + import openpyxl + + with warnings.catch_warnings(): # 인쇄 영역 이름 경고 + warnings.simplefilter("ignore") + book = openpyxl.load_workbook(io.BytesIO(data), read_only=True, data_only=True) + try: + sheets = { + ws.title.strip(): [list(row) for row in ws.iter_rows(values_only=True)] + for ws in book.worksheets + if ws.title.strip() in keep + } + finally: + book.close() + return Book(name, sheets, None, kind_of(sheets)) + import xlrd + + try: + xls = xlrd.open_workbook( + file_contents=data, formatting_info=True, logfile=io.StringIO() + ) + except Exception: # 서식 표가 깨진 파일 — 값만(격자는 서식 없이) + xls = xlrd.open_workbook(file_contents=data, logfile=io.StringIO()) + sheets = { + sh.name.strip(): [sh.row_values(r) for r in range(sh.nrows)] + for sh in xls.sheets() + if sh.name.strip() in keep + } + return Book(name, sheets, xls, kind_of(sheets)) + except BookError: + raise + except Exception as error: # 라이브러리마다 다른 예외 — 깨진 파일 · 엑셀 아님 + raise BookError("엑셀 파일을 읽지 못함 — xls · xlsx 가 아니거나 깨진 파일") from error diff --git a/M02_MasterTemplete/M02_Sangeun_FromHopyo.py b/M02_MasterTemplete/M02_Sangeun_FromHopyo.py index 9022a235d..d7577fccc 100644 --- a/M02_MasterTemplete/M02_Sangeun_FromHopyo.py +++ b/M02_MasterTemplete/M02_Sangeun_FromHopyo.py @@ -47,7 +47,7 @@ def unreadable(data: bytes) -> str | None: return None -def keep(folder: str | Path, key: str, name: str, data: bytes) -> str | None: +def keep(folder: str | Path, key: str, name: str, data: bytes, opened: Any = None) -> str | None: """올린 엑셀 → 산근 시트 둠(STmate · EST 꼴만 · 못 읽으면 안 둠 — 올리기는 됨). 돌려줌 = 못 읽은 사유(빈 파일 · DRM 암호 · 형식 오류) · 둠 · 산근 꼴 아님 = None.""" from M02_MasterTemplete import M02_San_Book as book @@ -55,7 +55,7 @@ def keep(folder: str | Path, key: str, name: str, data: bytes) -> str | None: if why := unreadable(data): return why try: - sheets = book.sheets(name, data) + sheets = book.sheets(name, data, opened) # 올림 길이 한 번 연 책(857-1) except Exception as e: # noqa: BLE001 — 산근은 덤(가져온 식 열기만 막힘) · 사유는 돌려줌 return f"엑셀 형식 오류 — {type(e).__name__}: {str(e)[:80]}" if not book.kind_of(sheets): diff --git a/resources/tester/golden_857_import.json b/resources/tester/golden_857_import.json index 30b817611..c44d89ffa 100644 --- a/resources/tester/golden_857_import.json +++ b/resources/tester/golden_857_import.json @@ -3243,8 +3243,16 @@ "블록 엑셀:울진소광#918": "494eacf70e3fb96f" }, "올림": { - "올림 2016사방 올림": "591a8b4dfbe67819", - "올림 2026수목 올림": "591a8b4dfbe67819", + "올림 2016사방 고정": "4f53cda18c2baa0c", + "올림 2016사방 목록": "128c3c95d0fb34e1", + "올림 2016사방 올림": "bd033d8606e78695", + "올림 2016사방 재료": "4f53cda18c2baa0c", + "올림 2016사방 칠": "0246368daa0544d7", + "올림 2026수목 고정": "4f53cda18c2baa0c", + "올림 2026수목 목록": "128c3c95d0fb34e1", + "올림 2026수목 올림": "bd033d8606e78695", + "올림 2026수목 재료": "4f53cda18c2baa0c", + "올림 2026수목 칠": "c9e90bcbd1a88642", "올림 거창 고정": "301f9d50d2aa6e01", "올림 거창 목록": "1b2914680b1c29fc", "올림 거창 올림": "5f32212ea5f045b1", diff --git a/resources/tester/test_741_sheet_widths.py b/resources/tester/test_741_sheet_widths.py index 6c25f8d35..a9aeabb2c 100644 --- a/resources/tester/test_741_sheet_widths.py +++ b/resources/tester/test_741_sheet_widths.py @@ -7,6 +7,7 @@ from pathlib import Path import openpyxl from M02_MasterTemplete import M02_Hopyo_Grid as grid +from M02_MasterTemplete import M02_San_Workbook as workbook ROOT = Path(__file__).parents[2] SS = ROOT / "A00_Common/spreadsheet" @@ -38,7 +39,7 @@ def test_xlsx_without_widths_is_empty_and_garbage_is_safe(): def test_xlsx_sheet_carries_widths(): data = _xlsx({"A": 30}) - sheets = grid._xlsx("a.xlsx", data)["시트"] + sheets = grid._xlsx("a.xlsx", data, workbook.read("a.xlsx", data).sheets)["시트"] assert sheets and sheets[0]["열"]["A"]["폭"] == 30.0 diff --git a/resources/tester/test_857_1_workbook.py b/resources/tester/test_857_1_workbook.py new file mode 100644 index 000000000..877c00b9f --- /dev/null +++ b/resources/tester/test_857_1_workbook.py @@ -0,0 +1,136 @@ +"""857-1 지킴 — 불러오기 책 한 번 · 종류 한 말 · 일위대가 시트 없는 엑셀 올림 · +「고를 재료」 판 무효 지문 · 판 셈 동안 M01 한 벌(`M01_MasterData_Store_Cache.steady`). + +임시 storage 개인 층 · 실무 엑셀 견본(없는 PC = 건너뜀). +""" + +from __future__ import annotations + +import json +import sys +from pathlib import Path + +import pytest + +HERE = Path(__file__).resolve().parent +sys.path.insert(0, str(HERE)) +import helper_857_import as h # noqa: E402 + + +def _path(name: str) -> Path: + p = h.sources().get(f"엑셀:{name}") + if not p or not p.exists(): + pytest.skip(f"견본 없음 — {name}") + return p + + +def _opens(monkeypatch) -> list[str]: + import openpyxl + import xlrd + + seen: list[str] = [] + for mod, attr in ((openpyxl, "load_workbook"), (xlrd, "open_workbook")): + real = getattr(mod, attr) + + def wrap(*a, _real=real, _tag=attr, **k): + seen.append(_tag) + return _real(*a, **k) + + monkeypatch.setattr(mod, attr, wrap) + return seen + + +def test_종류_한_말(): + from M02_MasterTemplete import M02_Hopyo_Stmate as hs + from M02_MasterTemplete import M02_San_Book as sb + from M02_MasterTemplete import M02_San_Workbook as wb + + for names, kind in ( + (["일위대가표", "단가산출근거"], "STmate"), + (["단가산출근거"], "STmate"), + (["일위대가", "단가산출"], "EST"), + (["일위대가"], None), + ): + assert wb.kind_of(names) == kind + assert sb.kind_of(dict.fromkeys(names)) == kind + assert hs.is_stmate(names) == (kind == "STmate") + + +@pytest.mark.parametrize("name", ["봉화", "북부청사방"]) +def test_올림_한_번에_책_한_번(monkeypatch, name): + from M02_MasterTemplete import M02_Hopyo_Router as router + + path = _path(name) + seen = _opens(monkeypatch) + with h.personal(): + row = router._upload(path.name, path.read_bytes(), {"id": 42, "이름": "시험"}) + assert row["호표수"] > 0 and not row.get("읽기불가") + assert len(seen) == 1, seen + + +def test_일위대가_시트_없는_엑셀도_올라감_호표_빈_목록_단산은_보임(): + from M02_MasterTemplete import M02_Hopyo_Excel as hx + from M02_MasterTemplete import M02_Hopyo_Router as router + from M02_MasterTemplete import M02_Hopyo_Store as hstore + from M02_MasterTemplete import M02_MasterTemplete_Store as store + from M02_MasterTemplete import M02_Sangeun_FromHopyo as fh + + path = _path("2026수목") + data = path.read_bytes() + with pytest.raises(hx.ExcelError): # B09 내역서 길(그대로) — 일위대가 시트 없음 = 거절 + hx.read_book(path.name, data) + with h.personal(): + row = router._upload(path.name, data, {"id": 42, "이름": "시험"}) + hp = hstore.read(store.root(), row["키"]) + assert row["호표수"] == 0 and hp["호표"] == [] + assert len(hp["단산"]) == 142 # 단가산출 시트 블록(둘 꼴 산근 수와 같음) + assert fh.has(store.root(), row["키"]) # 가져온 식 열기 자료 보관 + + +def test_재료판_무효_지문_M01_이_바뀌면_다시_셈(monkeypatch): + from M02_MasterTemplete import M02_Hopyo_Router as router + from M02_MasterTemplete import M02_MasterTemplete_Store as store + from M02_MasterTemplete import M02_San_MatPick as mp + from M02_MasterTemplete import M02_Sangeun_FromHopyo as fh + + path = _path("영덕계류") + with h.personal(): + key = router._upload(path.name, path.read_bytes(), {"id": 42, "이름": "시험"})["키"] + first = mp.census(store.root(), key) + saved = json.loads(fh._path(store.root(), key).read_bytes()) + assert saved[mp.MARK] == mp._mark() and saved[mp.CENSUS] == first + runs: list[int] = [] + from M02_MasterTemplete import M02_Doc_FromNative as fn + + emit = fn.emit + monkeypatch.setattr(fn, "emit", lambda *a, **k: runs.append(1) or emit(*a, **k)) + assert mp.census(store.root(), key) == first and not runs # 같은 M01 = 저장본 + monkeypatch.setattr(mp, "_mark", lambda: "다른 M01") + assert mp.census(store.root(), key) == first and runs # 지문 다름 = 다시 셈 · 답 같음 + + +def test_판_셈_동안_M01_파일_자국_한_번(monkeypatch): + from M01_MasterData import M01_MasterData_Store_Cache as cache + from M02_MasterTemplete import M02_Doc_FromNative as fn + from M02_MasterTemplete import M02_Hopyo_Router as router + from M02_MasterTemplete import M02_MasterTemplete_Store as store + from M02_MasterTemplete import M02_San_MatPick as mp + from M02_MasterTemplete import M02_Sangeun_FromHopyo as fh + + path = _path("영덕계류") + counts: list[int] = [] + real = cache._stamps + monkeypatch.setattr(cache, "_stamps", lambda folder: counts.append(1) or real(folder)) + with h.personal(): + key = router._upload(path.name, path.read_bytes(), {"id": 42, "이름": "시험"})["키"] + counts.clear() + held = mp.census(store.root(), key) + with_hold = len(counts) + at = fh._path(store.root(), key) + src = fh._excel_of(at, json.loads(at.read_bytes())) + counts.clear() + for no in sorted(fn.numbers(src)): # 안 쥔 셈(지금 길) — 블록마다 자국을 다시 잼 + with mp.using(None): + fn.emit(src, no) + bare = len(counts) + assert held and with_hold <= 3 < bare diff --git a/resources/tester/test_857_import_golden.py b/resources/tester/test_857_import_golden.py index 64031cef3..77b846b92 100644 --- a/resources/tester/test_857_import_golden.py +++ b/resources/tester/test_857_import_golden.py @@ -7,6 +7,7 @@ - 기본 = 빠른 표본(`QUICK_*`) · 전수 = 환경 `S857_ALL=1` · 견본 없는 PC = 그 갈래 건너뜀(수를 글로). - 다르면 실패 + 갈래 이름 — 뜻대로 바꾼 걸음만 다시 뜸(바뀐 갈래를 커밋 글에): `S857_ALL=1 ./venv/Scripts/python.exe resources/tester/test_857_import_golden.py --write` + (뒤에 「블록」 · 「올림」 = 그 갈래만) """ from __future__ import annotations @@ -61,9 +62,11 @@ def test_엑셀_올림_호표_목록_칠_고정_재료_지문_같음(): if __name__ == "__main__": if "--write" not in sys.argv or not ALL: sys.exit(f"다시 뜨기 = {REDO}") - blocks, skip_b = h.blocks(True) - ups, table, skip_u = h.uploads(True) - body = {"판": 1, "블록": blocks, "올림": ups, "재료표": h.mat_counts(table)} + only = sys.argv[sys.argv.index("--write") + 1 :] # 갈래 하나만(블록 | 올림) · 없으면 둘 다 + blocks, skip_b = (_want()["블록"], 0) if only == ["올림"] else h.blocks(True) + ups, table, skip_u = h.uploads(True) if only != ["블록"] else (_want()["올림"], None, 0) + mats = h.mat_counts(table) if table is not None else _want()["재료표"] + body = {"판": 1, "블록": blocks, "올림": ups, "재료표": mats} FILE.write_text( json.dumps(body, ensure_ascii=False, indent=1, sort_keys=True) + "\n", "utf-8", newline="\n" ) diff --git a/resources/tester/test_m02_hopyo_excel.py b/resources/tester/test_m02_hopyo_excel.py index e2a59a820..258d24fa9 100644 --- a/resources/tester/test_m02_hopyo_excel.py +++ b/resources/tester/test_m02_hopyo_excel.py @@ -182,8 +182,15 @@ def test_올리기_목록_읽기_지우기(client): def test_엉터리_시트없음_큰_파일_400(client, monkeypatch): bad = _post(client, data=b"garbage", name="a.xls") assert bad.status_code == 400 and "읽지 못함" in bad.json()["detail"] - none = _post(client, data=NO_SHEET.read_bytes(), name=NO_SHEET.name) + book = io.BytesIO() + import openpyxl + + openpyxl.Workbook().save(book) # 일위대가 · 단가산출 시트 둘 다 없음 + none = _post(client, data=book.getvalue(), name="빈책.xlsx") assert none.status_code == 400 and none.json()["detail"] == "일위대가 시트 없음" + only = _post(client, data=NO_SHEET.read_bytes(), name=NO_SHEET.name) # 857-1 단가산출만 = 올라감 + assert only.status_code == 200 and only.json()["호표수"] == 0 + assert client.delete(URL.format("personal") + "/" + only.json()["키"]).status_code == 200 monkeypatch.setattr(hopyo_router, "HOPYO_MAX_BYTES", 1000) big = _post(client) assert big.status_code == 400 and "20 MB" in big.json()["detail"] diff --git a/resources/tester/test_m02_hopyo_stmate.py b/resources/tester/test_m02_hopyo_stmate.py index 19bc84682..7c10e6ec2 100644 --- a/resources/tester/test_m02_hopyo_stmate.py +++ b/resources/tester/test_m02_hopyo_stmate.py @@ -16,6 +16,7 @@ from M02_MasterTemplete import M02_Hopyo_ReadEst as hb from M02_MasterTemplete import M02_Hopyo_Excel as hx from M02_MasterTemplete import M02_Hopyo_Stmate as st from M02_MasterTemplete import M02_Hopyo_Store as hs +from M02_MasterTemplete import M02_San_Workbook as workbook from M02_MasterTemplete import M02_Template_Layers as layers from resources.tester import test_m02_hopyo_excel as base from resources.tester.test_m02_hopyo_excel import ROOT, _post, master_hash @@ -129,7 +130,7 @@ def test_기계_자원_하나로(books): def test_노임_이름_어긋남_0(books): names = hb.trade_names() for tag in FILES: - sheets = hx._sheets(_path(tag).name, _path(tag).read_bytes()) + sheets = workbook.read(_path(tag).name, _path(tag).read_bytes()).sheets table = st._lists(sheets) res = [r for b in books[tag]["단산"] for r in b["자원"] if r["갈래"] == "L" and r["이름"]] assert res From 157240a7e50b5e770637f886b4288d7248d25d96 Mon Sep 17 00:00:00 2001 From: umsangdon Date: Tue, 17 Nov 2026 19:46:45 +0900 Subject: [PATCH 21/30] =?UTF-8?q?refactor(855-2-C2):=20=EA=B0=80=EC=A0=B8?= =?UTF-8?q?=EC=98=A8=20=EC=8B=9D=20=EB=AC=B8=EC=84=9C=20=EC=A7=93=EA=B8=B0?= =?UTF-8?q?=20=3D=20=EA=B0=80=EC=A0=B8=EC=98=A8=20=EB=A1=9C=EC=A7=81=20?= =?UTF-8?q?=EC=A4=84=20=EC=A7=81=EC=A0=91=20=E2=80=94=20=EC=98=9B=20?= =?UTF-8?q?=EC=97=94=EC=A7=84=20=EC=85=88(Sangeun=5FCalc.run)=20=EC=95=88?= =?UTF-8?q?=20=EB=8F=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Doc_Import._ctx: 가져온 로직 줄(row_of · 엑셀 단가 기준) + 수식 고침(eqm.on) + SK 고침(sd.patched · 더한줄 입력 채움 · 고정 줄 값) → (색인, 키, 입력, {정체}) · 엔진 run_line 안 부름 · 안쪽 산근(형제 SK) 줄 값 = 0 자리값 — `_attach` 가 형제 SK 연결 + 엑셀 값으로 늘 갈음(옛 길은 형제 SK 를 옛 엔진으로 셈해 넣고 버림) · 옛 셈 길(`_old_ctx`)은 값이 엔진 답인 더한줄(형제 SK · 율 · 세부 고친 둘째 기초)을 단 SK 만 — 2-C1 · 2-C5 몫 - 옛 식 파서(mf.parse · 연산 표) 그대로 · 검산(Sangeun_Imported._run · check)은 2-C3 몫이라 안 고침 · 가져온 값 층 · 초기화 · Q · 모양은 색인에 안 기댐(고칠 곳 0) - 전후 대조(불러오기 블록 전수 3,241 — EST 1,849 · STC 371 · 엑셀 1,021): 지은 문서 지문 다름 0 · 엑셀 · 우리 두 판 셈 답(계 · 비목 · 줄) 다름 0 · 예외 0 Co-Authored-By: Claude Opus 5.5 --- M02_MasterTemplete/M02_Doc_Import.py | 49 +++++++++++++++++++++++++--- 1 file changed, 45 insertions(+), 4 deletions(-) diff --git a/M02_MasterTemplete/M02_Doc_Import.py b/M02_MasterTemplete/M02_Doc_Import.py index 0653bd54e..2b558fa89 100644 --- a/M02_MasterTemplete/M02_Doc_Import.py +++ b/M02_MasterTemplete/M02_Doc_Import.py @@ -70,13 +70,54 @@ def _index(sk: dict, master: Any = None, doc: Any = None) -> Any: return master or imp._whole() -# ── 엑셀 단가 그대로 엔진 줄(옛 셈 길 · SK 고침 얹은 것) ─────────────────── +# ── 엑셀 단가 그대로 고친 줄(가져온 로직 줄 + SK 고침 · 엔진 셈 없음) ───────── +def _engine_adds(doc: dict) -> bool: + """값을 엔진 셈으로만 얻는 더한줄(형제 SK · 율 · 세부 고친 둘째 기초)이 있음 — 옛 길(`_old_ctx`).""" + return any( + one.get("참조") or sd.is_rate(one) or sd.sub_patched(one) for one in doc.get("더한줄") or [] + ) + + def _ctx(sk: dict, whole: Any) -> tuple: - """엑셀 단가 기준 고친 줄 — 옛 셈 길(`OLD`)로 돌려 엔진에 넣은 (색인, 키, 입력, 답, 재료).""" + """엑셀 단가 기준 고친 줄(855 2-C2) — 가져온 로직 줄(`row_of`) + 수식 고침 · SK 고침(`sd.patched`) · + 더한줄 고정 값(`fixed.line`) → (색인, 키, 입력, {정체}, None) · 옛 엔진 안 돎. + 안쪽 산근(형제 SK) 줄 값 = 0 자리값(`_attach` 가 형제 SK 연결 + 엑셀 값으로 갈음). + `_engine_adds` 인 SK 만 옛 셈 길(그 더한줄 값이 엔진 답 — 2-C1 · 2-C5 몫).""" + from M02_MasterTemplete import M02_Sangeun_Calc as calc + from M02_MasterTemplete import M02_Sangeun_Copy as skc + from M02_MasterTemplete import M02_Sangeun_Equation as eqm + + raw = {**sk, imp.KEY: {**sk[imp.KEY], "단가기준": "엑셀"}} + doc = sd.clean(raw, None, whole) + if _engine_adds(doc): + return _old_ctx(raw, whole) + w = skc.over(doc, whole) + base = sd.empty_row(doc) + base = {**base, "호표": [dict(x) for x in base.get("호표") or []]} + for item in base["호표"]: + if "참조" in item and item.get("값묶음") is None: + item["값묶음"] = dict.fromkeys(imp.COSTS, Decimal(0)) + base, _ = eqm.on(base, doc, skc.over(doc, w)) + filled, lack = calc._fill(doc, w, dict(doc.get("입력값") or {})) + got = sd.patched(base, filled, {}, {}) + items = got["줄"]["호표"] + calc._direct(got["자재표시"], items) + for at, cid in enumerate(got["정체"][: len(items)]): + if cid.startswith("add:#") and int(cid[5:]) in lack: + items[at] = calc._gap(items[at], lack[int(cid[5:])]) + row = {**got["줄"], "호표": [dict(x) for x in items]} + calc._bundles(row, w, None, ()) # 더한줄 고정 줄 = 줄 값 · 이은 노임 · 자재(엔진 아님) + key = str(doc.get("키") or "SK-000000") + names = {str(i.get("이름")) for i in row.get("입력") or []} + values = {k: v for k, v in (doc.get("입력값") or {}).items() if k in names} + return _Row(w, key, {**row, "키": key}), key, values, {"정체": got["정체"]}, None + + +def _old_ctx(raw: dict, whole: Any) -> tuple: + """옛 셈 길(`OLD`)로 돌려 엔진에 넣은 (색인, 키, 입력, 답, 재료) — `_engine_adds` SK 만.""" from M02_MasterTemplete import M02_Doc_Sk as dsk from M02_MasterTemplete import M02_Sangeun_Calc as calc - raw = {**sk, imp.KEY: {**sk[imp.KEY], "단가기준": "엑셀"}} box: list = [] token = dsk.OLD.set(True) try: @@ -407,7 +448,7 @@ def _numbers(doc: dict, keep: dict) -> None: def derive(sk: dict, ctx: tuple | None = None, whole: Any = None) -> dict: - """가져온 식 SK → 수식 문서(키 = SK 키) — `ctx` = 엑셀 단가 기준 옛 셈 길이 엔진에 넣은 것.""" + """가져온 식 SK → 수식 문서(키 = SK 키) — `ctx` = 엑셀 단가 기준 고친 줄(`_ctx` · 옛 SK 셈 길이 넘긴 것도 같은 꼴).""" meta = sk[imp.KEY] if ctx is None: ctx = _ctx(sk, whole or imp._whole()) From 358c514c51347126b1a5969c25502b3f64ebd233 Mon Sep 17 00:00:00 2001 From: umsangdon Date: Tue, 17 Nov 2026 20:17:38 +0900 Subject: [PATCH 22/30] =?UTF-8?q?feat(855-2-B4):=20M01=20[=EB=A1=9C?= =?UTF-8?q?=EC=A7=81=20=EB=B3=B5=EC=82=AC/=EC=83=9D=EC=84=B1]=20=EC=8B=9C?= =?UTF-8?q?=ED=97=98=20=EA=B3=84=EC=82=B0=20=E2=80=94=20=EC=98=9B=20?= =?UTF-8?q?=EC=97=94=EC=A7=84(/calc=20=C2=B7=20/text)=20=EB=8C=80=EC=8B=A0?= =?UTF-8?q?=20=EC=88=98=EC=8B=9D=20=EB=AC=B8=EC=84=9C=20=EC=85=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - /logic/formula/preview 답에 「문서」 더함 — 저장하면 지을 수식 문서(Doc.of_row · 빌더 · Doc.make 와 같은 변환 · built 도 이 한 벌) - 시험 계산 칸 = 그 문서를 /logic/doc/preview 로 셈 · 옵션 가로 · 합계 상자 = 줄 쌓기 화면 부품 그대로 · 결과 로직 = 결과 값 · 멈춤 = 까닭 - 고르기 글 → 목록 값으로 보냄(줄 쌓기 usable 과 같음 · 글 「45」 면 표 줄 못 찾음) - 옛 길 본체(서버 /calc · /text · Store.calc · text · 화면 Logic_Drive · Logic_CalcPick · Api runCalc · runText)는 그대로 — 지움은 2-E1 박자 - 시험: test_m01_copy 미리보기 = 문서 셈이 저장 문서 셈과 같음(기본 · 옵션 바꿈) · 소스 글자 시험(149_4 pctView 한 벌 · 750_2 · 799_2 의 Calc 글자 줄)은 걸려 지움 Co-Authored-By: Claude Opus 5.5 --- M01_MasterData/M01_MasterData_Doc.py | 21 +- M01_MasterData/M01_MasterData_Router.py | 6 +- .../M01_MasterData_UI_LogicLab_Copy.ts | 18 +- .../M01_MasterData_UI_Logic_Calc.ts | 339 +++++------------- .../M01_MasterData_UI_Logic_Text.ts | 4 + resources/tester/test_149_4_pct_extra.py | 9 - .../tester/test_750_2_views_one_answer.py | 3 - resources/tester/test_799_2_old_tabs_gone.py | 4 - resources/tester/test_m01_copy.py | 27 +- 9 files changed, 130 insertions(+), 301 deletions(-) diff --git a/M01_MasterData/M01_MasterData_Doc.py b/M01_MasterData/M01_MasterData_Doc.py index 767827b1f..baf38f2c7 100644 --- a/M01_MasterData/M01_MasterData_Doc.py +++ b/M01_MasterData/M01_MasterData_Doc.py @@ -139,21 +139,26 @@ def _file_for(key: str) -> str: def built(key: str) -> dict | None: """빌더가 지을 그 키 문서(옛 로직 줄 변환 · `build_수식문서_802_2`) · 로직 줄 없음 · 변환 틀림 = None.""" - import master_doc_convert as cv - - files, whole = store.loaded() - for data in files.values(): + for data in store.loaded()[0].values(): if data.get("그룹") != "로직": continue for row in data.get("줄") or []: if str(row.get("키")) == key: - try: - return cv.convert(whole, row)[0] - except Exception: # noqa: BLE001 — 변환 틀림 = 빌더 문서 없음(표지 안 담) - return None + return of_row(row) return None +def of_row(row: dict) -> dict | None: + """로직 줄(저장 전 고친 줄도) → 빌더와 같은 변환의 수식 문서 · 변환 틀림 = None — + [로직 복사/생성] 시험 계산(855 2-B4)이 저장하면 지을 문서로 셈.""" + import master_doc_convert as cv + + try: + return cv.convert(store.loaded()[1], row)[0] + except Exception: # noqa: BLE001 — 변환 틀림 = 빌더 문서 없음(표지 안 담) + return None + + def make(key: str) -> bool: """[로직 복사/생성](`Store_Make.logic_new`) 뒤 수식 문서를 지어 씀 — 빌더(`build_수식문서_802_2`)와 같은 변환 · 같은 대조(옛 엔진 = 새 계산기 · 기본 + 옵션 표본 · 부르는 단가산출이 저장본)를 지난 것만 diff --git a/M01_MasterData/M01_MasterData_Router.py b/M01_MasterData/M01_MasterData_Router.py index b56a2cf07..c16cebed8 100644 --- a/M01_MasterData/M01_MasterData_Router.py +++ b/M01_MasterData/M01_MasterData_Router.py @@ -310,8 +310,10 @@ def post_logic_formula_save(body: FormulaLogic) -> dict: @router.post("/logic/formula/preview") def post_logic_formula_preview(body: FormulaPreview) -> dict: - """저장 전 시험 계산용 — 별칭을 원문으로 되돌린 로직 줄만(저장 안 함).""" - return _call(make.logic_formula_preview, body.로직, body.별칭) + """저장 전 시험 계산용 — 별칭을 원문으로 되돌린 로직 줄 + 저장하면 지을 수식 문서 + {logic, 문서}(저장 안 함 · 화면은 `문서` 를 `/logic/doc/preview` 로 셈 · 855 2-B4).""" + got = _call(make.logic_formula_preview, body.로직, body.별칭) + return {**got, "문서": doc_screen.of_row(got["logic"])} # ── 수식 문서(802-3) — 단가산출 기초 정본 · 화면은 같은 계산기로 즉시 셈 ── diff --git a/M01_MasterData/M01_MasterData_UI_LogicLab_Copy.ts b/M01_MasterData/M01_MasterData_UI_LogicLab_Copy.ts index 18388b853..e0c99fda3 100644 --- a/M01_MasterData/M01_MasterData_UI_LogicLab_Copy.ts +++ b/M01_MasterData/M01_MasterData_UI_LogicLab_Copy.ts @@ -4,7 +4,8 @@ * 줄을 고치거나 더한 뒤 자체 로직(GX)으로 저장. * * [본떠 만들기] → GET /logic/formula(별칭 폼) → 별칭 표 바꾸기·로직 부르기 갈래 고르기· - * 식 줄 고치기·더하기 → [시험 계산](POST /logic/formula/preview 로 원문 되돌린 뒤 /calc 재사용) + * 식 줄 고치기·더하기 → [시험 계산](POST /logic/formula/preview 가 원문으로 되돌린 줄을 수식 문서로 지어 줌 → + * 문서 셈 `/logic/doc/preview` · 855 2-B4 — 저장하면 지을 문서와 같은 변환) * → [저장](POST /logic/formula/save) → afterSave 로 새 키를 알림(정본은 손대지 않음). * ========================================================================== */ @@ -30,6 +31,7 @@ import { buildCalc } from "./M01_MasterData_UI_Logic_Calc"; import { fetchTables, type TableHead } from "./M01_MasterData_Api_Fetch"; import { tx } from "./M01_MasterData_UI_Logic_Text"; import { tl } from "./M01_MasterData_UI_LogicLab_Text"; +import type { FormulaDoc } from "../common_util/common_util_formula_doc"; import "./M01_MasterData_UI_LogicLab_Style.css"; import { createBadge } from "@ui/ui_template_badge"; import { createText } from "@ui/ui_template_text"; @@ -263,7 +265,7 @@ export async function openCopyScreen(opt: CopyOptions): Promise { const aliasHost = el("div", { className: "m01-logic__scroll" }); const linesHost = el("div", { className: "m01-logic__scroll" }); const calcHost = el("div", { className: "m01lab__calc" }); - const values: Record = {}; + const given: Record = {}; // 시험 계산에서 고른 옵션 — 줄을 고쳐도 남음 let timer: number | undefined; const refreshCalc = (): void => { @@ -272,15 +274,9 @@ export async function openCopyScreen(opt: CopyOptions): Promise { }; const runPreview = async (): Promise => { try { - const preview = await previewLogicFormula(row, marks); - buildCalc(calcHost, { - savedKey: null, - file: got.file, - row: preview.logic, - dirty: () => true, - values, - onLines: () => undefined, - }); + // 답의 `문서` = 저장하면 지을 수식 문서(서버 변환 · 못 지음 = null) + const preview = (await previewLogicFormula(row, marks)) as { 문서?: FormulaDoc | null }; + buildCalc(calcHost, preview.문서 ?? null, given); } catch (error) { calcHost.replaceChildren(createText(error instanceof Error ? error.message : "", "error")); } diff --git a/M01_MasterData/M01_MasterData_UI_Logic_Calc.ts b/M01_MasterData/M01_MasterData_UI_Logic_Calc.ts index b4da3271e..9642451d0 100644 --- a/M01_MasterData/M01_MasterData_UI_Logic_Calc.ts +++ b/M01_MasterData/M01_MasterData_UI_Logic_Calc.ts @@ -1,270 +1,105 @@ /* ============================================================================= * M01_MasterData_UI_Logic_Calc.ts - * 시험 계산 — 받을 값을 넣고 [계산] → 줄별 금액 · 비목 합 · 멈춘 까닭(엔진 글 그대로) - * 고친 로직은 저장 전 줄(`row`)을 같이 보내 메모리에서 셈(`POST /calc`) — 파일에 안 씀 - * 셈 구동(입력 → 서버 → 답) = `_Logic_Drive.ts` — 로직 상세는 이 칸 없이 그 구동만 씀(799-2) · 이 칸은 로직 복사 화면이 씀 + * 시험 계산(로직 복사 화면 · 855 2-B4) — 저장하면 지을 수식 문서(`/logic/formula/preview` 의 `문서`)를 + * 문서 셈(`POST /m01/logic/doc/preview` · 줄 쌓기 화면과 같은 계산기)으로 셈 · 파일에 안 씀 + * 옵션 가로(`formula_doc_options`) · 합계 상자(`formula_doc_foot`) = 줄 쌓기 화면 부품 그대로 — 금액 = 그 로직 수식 화면 금액 + * 옵션을 바꾸면 바로 다시 셈(늦게 온 옛 답은 버림) * ========================================================================== */ -import { createButton, createSelectField, el, showToast } from "@ui/ui_template_elements"; -import { - pctView, - searchElements, - type CalcAnswer, - type CalcLine, - type ElementBrief, - type LogicRow, -} from "./M01_MasterData_UI_Logic_Api"; -import { - isMaterialKeyInput, - machineControl, - materialRows, - showItems, -} from "./M01_MasterData_UI_Logic_CalcPick"; -import { autoFill, driveRun } from "./M01_MasterData_UI_Logic_Drive"; -import { formatLineMoney, formatMoney, formatNumber } from "../common_util/common_util_money"; +import { API_BASE_URL } from "@config/config_frontend"; +import { el } from "@ui/ui_template_elements"; +import { createText } from "@ui/ui_template_text"; +import type { FormulaDoc } from "../common_util/common_util_formula_doc"; +import type { DocAnswer } from "../common_util/common_util_formula_doc_calc"; +import { formatNumber } from "../common_util/common_util_money"; +import { docFoot } from "../A00_Common/formula_doc_foot"; +import { buildOptions } from "../A00_Common/formula_doc_options"; +import { hiddenByWork } from "../A00_Common/formula_doc_render"; +import "../A00_Common/line_stack.css"; import { safeReason, tx } from "./M01_MasterData_UI_Logic_Text"; -import { createBadge } from "@ui/ui_template_badge"; -import { createDivider } from "@ui/ui_template_divider"; -/** 고르기 값이 마스터 키(자재·기계·직종)면 이름으로 바꿔 보임 — 값 칸은 키 그대로 보냄 */ -const KEY_RE = /^[A-Z]{2}\d{6}$/; -const KEY_GROUP: Record = { MT: "재료", EQ: "기계", LB: "인력" }; -/** 로직마다 다시 그려도 남는 이름 캐시 — 같은 키를 두 번 묻지 않음 */ -const nameCache = new Map(); +/** 그릇마다 셈 차례 — 줄을 고쳐 다시 그려도 늦게 온 옛 답을 버림 */ +const turns = new WeakMap(); -async function keyName(key: string): Promise { - if (nameCache.has(key)) return nameCache.get(key)!; - const group = KEY_GROUP[key.slice(0, 2)]; - if (!group) return null; - let name: string | null = null; - try { - const found = await searchElements(group, key); // q = 키 그대로 — 「키」 칸 부분일치라 그 줄만 걸림 - const hit = found.items.find((it) => it.ref === key); - name = hit ? `${hit.이름 ?? ""}${hit.규격 ? ` ${hit.규격}` : ""}`.trim() || null : null; - } catch { - name = null; - } - nameCache.set(key, name); - return name; +async function previewDoc(문서: FormulaDoc, 입력: Record): Promise { + const r = await fetch(`${API_BASE_URL}/m01/logic/doc/preview`, { + method: "POST", + credentials: "include", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify({ 문서: { ...문서, 키: "_새" }, 입력 }), // 저장 전 = 빈 키(줄 쌓기와 같음) + }); + const data = (await r.json().catch(() => ({}))) as { 셈?: DocAnswer; detail?: unknown }; + if (!r.ok || !data.셈) + throw new Error(typeof data.detail === "string" ? data.detail : r.statusText); + return data.셈; } -export interface CalcContext { - /** 저장된 키 — 새 로직은 null */ - savedKey: string | null; - /** 저장 전 새 초안이면 비움 — 서버가 임시 자리에 얹어 셈 */ - file?: string; - row: LogicRow; - /** 잡힌 품목을 보이는 데 씀 — 재료 줄의 단가 요소 · 조건 글 → 요소 */ - prices?: Record; - dirty: () => boolean; - /** 로직마다 넣은 값 — 다시 그려도 남음 */ - values: Record; - onLines?: (lines: CalcLine[] | null) => void; +function answerView(doc: FormulaDoc, a: DocAnswer): HTMLElement[] { + const stop = + !a.셈됨 && a.까닭 + ? [ + el("div", { + className: "ui-banner ui-banner--danger m01-logic__reasons", + children: [ + el("strong", { text: tx("Calc_Stopped") }), + el("div", { text: safeReason(a.까닭) }), + ], + }), + ] + : []; + if (!doc.결과) return [...stop, docFoot(a)]; // 줄 쌓기 아래 합계 상자와 같은 부품 + const value = + typeof a.결과 === "number" ? `${formatNumber(a.결과)} ${doc.결과단위 ?? ""}`.trim() : "—"; + return [ + ...stop, + el("dl", { + className: "m01-logic__sums", + children: [el("dt", { text: tx("Calc_Result") }), el("dd", { text: value })], + }), + ]; } -const grid = (children: HTMLElement[]): HTMLElement => - el("div", { className: "m01-logic__head", children }); - -const SUMS = ["노무비", "재료비", "경비", "계"]; - -/** 로직마다 첫 셈을 한 번만(다시 그려도 안 부름) */ -const autoAsked = new WeakSet>(); - -export function buildCalc(host: HTMLElement, ctx: CalcContext): void { - // 그릇 폭 280px 고정 칸은 옛 테스트 컨테이너(UI_Test*, 걷힘)의 죽은 CSS 규칙 — - // 지금 쓰는 LogicLab 화면은 그 칸에 안 걸려 폭이 이미 넓음(실측 730px) · 따로 안 풂 - const optionText = (o: string | number): string => - (typeof o === "string" && nameCache.get(o)) || String(o); - const again = (): void => host.querySelector("[data-calc-run]")?.click(); - const fields = (ctx.row.입력 ?? []) - .filter((spec) => !isMaterialKeyInput(spec)) // 재료 키 목록은 표 모달로 바뀌어 걷음 - .map((spec) => { - const name = spec.이름; - let control: HTMLElement; - const picks = spec.고르기; - const machine = machineControl(spec, ctx.values, again); - if (machine) { - control = machine; - } else if (picks?.length) { - const pick = createSelectField({ - options: ["", ...picks.map(String)].map((o) => ({ value: o, text: optionText(o) })), - value: ctx.values[name] ?? "", - compact: true, - onChange: (v) => { - ctx.values[name] = v; - }, - }); - control = pick.root; - const keys = picks.filter((o): o is string => typeof o === "string" && KEY_RE.test(o)); - if (keys.length) { - void Promise.all(keys.map(keyName)).then(() => { - pick.setOptions( - ["", ...picks.map(String)].map((o) => ({ value: o, text: optionText(o) })), - ctx.values[name] ?? "", - ); - }); - } - } else { - const box = el("input", { - className: "ui-input ui-input--sm m01-logic__input", - attrs: { type: "text", inputmode: "decimal" }, - }); - if (spec.범위) box.placeholder = `${spec.범위[0]} ∼ ${spec.범위[1]}`; - box.value = ctx.values[name] ?? ""; - box.addEventListener("input", () => { - ctx.values[name] = box.value; - }); - control = box; - } - const label = spec.단위 ? `${name} (${spec.단위})` : name; - // 긴 이름 줄만 두 칸 차지 — 짧으면 4 열에 맞춰 나란히 - const wide = label.length > 10; - return el("label", { - className: `m01-logic__field${wide ? " m01-logic__field--wide" : ""}`, - children: [el("span", { text: label }), control], - }); - }); - const materials = materialRows(ctx.row, ctx.prices ?? {}, ctx.values, again); - const out = el("div", { className: "m01-logic__calc-out" }); - if (!fields.length && !autoAsked.has(ctx.values)) { - autoAsked.add(ctx.values); // 입력이 없으면 채울 것이 없음 — 열 때 한 번 바로 계산 - queueMicrotask(again); - } else if (ctx.savedKey !== null && !autoAsked.has(ctx.values)) { - autoAsked.add(ctx.values); - void autoFill(ctx).then((filled) => { - if (!filled) return; - buildCalc(host, ctx); // 채운 값을 새로 그리고 바로 계산 - again(); - }); +/** `doc` = 저장하면 지을 수식 문서(못 지음 = null) · `given` = 고른 옵션(다시 그려도 남음) */ +export function buildCalc( + host: HTMLElement, + doc: FormulaDoc | null, + given: Record, +): void { + const title = el("h3", { text: tx("Calc_Title") }); + const note = el("p", { className: "ui-text ui-text--muted", text: tx("Calc_Draft") }); + if (!doc) { + host.replaceChildren(title, createText(tx("Calc_NoDoc"), "error")); + return; } - const money = (ctx.row.결과단위 ?? "").startsWith("원"); const run = async (): Promise => { + const mine = (turns.get(host) ?? 0) + 1; + turns.set(host, mine); try { - const { answer, draft } = await driveRun(ctx); - if (answer.ok && answer.lines) showItems(host, ctx.values, answer.lines); - out.replaceChildren(...answerView(answer, draft, money)); + const answer = await previewDoc(doc, given); + if (turns.get(host) !== mine) return; + const options = buildOptions( + doc, + given, + false, + (k, v, x) => { + // 고르기 글 → 목록 값 그대로(수 45 를 글 「45」 로 보내면 표 줄을 못 찾음 · 줄 쌓기 `usable` 과 같음) + const list = v.연결?.갈래 === "선택" ? (v.연결.목록 ?? []) : []; + given[k] = list.find((o) => String(o) === String(x)) ?? x; + void run(); + }, + undefined, + hiddenByWork(doc, answer), // 줄 쌓기와 같이 — 시간당 식 줄이 안 읽게 된 옵션은 숨김 + ); + host.replaceChildren( + title, + note, + ...(options.length ? [el("div", { className: "fdoc__options", children: options })] : []), + ...answerView(doc, answer), + ); } catch (error) { - showToast(error instanceof Error ? error.message : tx("Load_Failed"), "error"); + if (turns.get(host) !== mine) return; + host.replaceChildren(title, createText(error instanceof Error ? error.message : "", "error")); } }; - const runButton = createButton({ label: tx("Calc_Run"), onClick: () => void run() }); - runButton.setAttribute("data-calc-run", ""); - host.replaceChildren( - el("h3", { text: tx("Calc_Title") }), - // 옵션 고르기 · 자재 고르기 두 격자(기본 4 열) — 사이 수평 구분선(709-1 부품) - ...(fields.length || materials.length - ? [ - ...(fields.length ? [grid(fields)] : []), - ...(fields.length && materials.length ? [createDivider()] : []), - ...(materials.length ? [grid(materials)] : []), - ] - : [el("p", { className: "ui-text ui-text--muted", text: tx("Calc_NoInputs") })]), - runButton, - out, - ); -} - -/** 중간 값 이름이 돈 꼴(경비 · 노무비 · 공구손료 · 금액 · 단가 · 노임) — 1,000 미만이어도 돈 꼴 */ -const MONEY_NAME = /(비|료|액|가|임)$/; - -/** `money` = 결과가 돈(원) — 그때만 결과 값도 정수 · 수량·비율 결과는 소수 그대로 */ -export function answerView(answer: CalcAnswer, draft: boolean, money: boolean): HTMLElement[] { - const note = draft - ? [el("p", { className: "ui-text ui-text--muted", text: tx("Calc_Draft") })] - : []; - if (!answer.ok) { - return [ - ...note, - el("div", { - className: "ui-banner ui-banner--danger m01-logic__reasons", - children: [ - el("strong", { text: tx("Calc_Stopped") }), - el("div", { text: safeReason(answer.reason) }), - ], - }), - ]; - } - const parts: HTMLElement[] = [...note]; - if (answer.lines) { - const visible = answer.lines.filter((line) => !line.옵션꺼짐); // 753-2 옵션으로 빠진 줄은 안 그림 - const rows = visible.map((line) => - el("tr", { - children: [ - el("td", { - children: [ - el("span", { - text: line.출처 - ? `${pctView(line).name} (${line.출처.replace(/[A-Z]{2}\d{6}\./g, "")})` - : pctView(line).name, - }), - ...(line.단위경고 - ? [createBadge(`${tx("Calc_UnitWarn")} · ${line.단위경고}`, "warning")] - : []), - ], - }), - el("td", { text: `${formatNumber(pctView(line).qty)} ${pctView(line).unit}` }), - el("td", { className: "m01-logic__money", text: formatLineMoney(line.금액) }), - ], - }), - ); - parts.push( - el("table", { - className: "ui-table ui-table--data m01-logic__grid", - children: [ - el("thead", { - children: [ - el("tr", { - children: [tx("Head_Name"), tx("Ho_Qty"), tx("Ho_Amount")].map((h) => - el("th", { text: h }), - ), - }), - ], - }), - el("tbody", { children: rows }), - ], - }), - ); - } - if (answer.sums) { - parts.push( - el("dl", { - className: "m01-logic__sums", - children: SUMS.flatMap((k) => [ - el("dt", { text: k === "계" ? tx("Calc_Sum") : k }), - el("dd", { className: "m01-logic__money", text: formatMoney(answer.sums?.[k] ?? 0) }), - ]), - }), - ); - } - if (answer.result !== undefined) { - parts.push( - el("dl", { - className: "m01-logic__sums", - children: [ - el("dt", { text: tx("Calc_Result") }), - el("dd", { text: money ? formatMoney(answer.result) : formatNumber(answer.result) }), - ], - }), - ); - } - // 줄 묶음(객체)은 위 상세와 겹쳐 숨김 · 돈 로직의 큰 수는 정수 - const middle = Object.entries(answer.middle ?? {}).filter(([, v]) => typeof v !== "object"); - if (middle.length) { - parts.push( - el("h4", { text: tx("Middle_Title") }), - el("dl", { - className: "m01-logic__sums", - children: middle.flatMap(([k, v]) => [ - el("dt", { text: k }), - el("dd", { - text: - money && typeof v === "number" && (Math.abs(v) >= 1000 || MONEY_NAME.test(k)) - ? formatLineMoney(v) // 751-3 중간 돈 = 버린 줄 합(0.1 원) - : formatNumber(v), - }), - ]), - }), - ); - } - return parts; + void run(); } diff --git a/M01_MasterData/M01_MasterData_UI_Logic_Text.ts b/M01_MasterData/M01_MasterData_UI_Logic_Text.ts index 8cde0ae2e..891a22684 100644 --- a/M01_MasterData/M01_MasterData_UI_Logic_Text.ts +++ b/M01_MasterData/M01_MasterData_UI_Logic_Text.ts @@ -44,6 +44,10 @@ const TEXT = { Calc_Run: ["계산", "Calculate"], Calc_NoInputs: ["받을 값 없음", "No inputs"], Calc_Draft: ["고친 줄로 계산(저장 전)", "Using unsaved edits"], + Calc_NoDoc: [ + "수식 문서로 못 바꿈 — 고친 식을 확인하세요", + "Cannot build a formula document — check the edits", + ], Calc_Stopped: ["멈춤", "Stopped"], Calc_Result: ["결과", "Result"], Calc_Sum: ["계", "Total"], diff --git a/resources/tester/test_149_4_pct_extra.py b/resources/tester/test_149_4_pct_extra.py index f3a99f00a..b89d99fc2 100644 --- a/resources/tester/test_149_4_pct_extra.py +++ b/resources/tester/test_149_4_pct_extra.py @@ -49,12 +49,3 @@ def test_M01_시험계산도_율_규격(): got = m01_router.post_calc(m01_router.CalcBody(key="GF000227", inputs=given)) extra = [x for x in got["lines"] if x["이름"] == "제잡비"][0] assert extra["율"] == 9 and extra["규격"] == "노무비의 %" - - -def test_화면_두_곳_pctView_한_벌(): - api = (ROOT / "M01_MasterData/M01_MasterData_UI_Logic_Api.ts").read_text("utf-8") - assert "x.율 == null" in api and 'qty: x.율, unit: "%"' in api - rows = (ROOT / "M02_MasterTemplete/M02_MasterTemplete_Labor_Rows.ts").read_text("utf-8") - assert "const shown = pctView(x);" in rows and "qty: shown.qty," in rows - calc = (ROOT / "M01_MasterData/M01_MasterData_UI_Logic_Calc.ts").read_text("utf-8") - assert "formatNumber(pctView(line).qty)" in calc diff --git a/resources/tester/test_750_2_views_one_answer.py b/resources/tester/test_750_2_views_one_answer.py index 8ec1e48c9..1afaa77f7 100644 --- a/resources/tester/test_750_2_views_one_answer.py +++ b/resources/tester/test_750_2_views_one_answer.py @@ -88,6 +88,3 @@ console.log(JSON.stringify({ off: rows.map((r) => r.off) })); assert "b.줄.filter(shown)" in sheet and "g.줄.filter(shown)" in sheet ho = (ROOT / "M01_MasterData" / "M01_MasterData_UI_LogicLab_Ho.ts").read_text("utf-8") assert "옵션꺼짐" in ho - assert "옵션꺼짐" in (ROOT / "M01_MasterData" / "M01_MasterData_UI_Logic_Calc.ts").read_text( - "utf-8" - ) diff --git a/resources/tester/test_799_2_old_tabs_gone.py b/resources/tester/test_799_2_old_tabs_gone.py index aaed062b7..6e7e84c20 100644 --- a/resources/tester/test_799_2_old_tabs_gone.py +++ b/resources/tester/test_799_2_old_tabs_gone.py @@ -73,10 +73,6 @@ def test_셈_구동은_화면_없이_상세는_구동만(): assert "createDrive" not in lab and "buildCalc" not in lab and "data-calc-run" not in lab detail = _text(M01 / "M01_MasterData_UI_LogicLab_Detail.ts") assert "calcHost" not in detail and "data-calc-run" not in detail and "rerun" not in detail - calc = _text( - M01 / "M01_MasterData_UI_Logic_Calc.ts" - ) # 로직 복사 화면이 쓰는 시험 계산 칸 — 구동은 공용 - assert "driveRun(ctx)" in calc and "runCalc" not in calc m02 = _text(M02 / "M02_MasterTemplete_Sangeun_Detail.ts") assert "buildCalc" not in m02 and "calcHost" not in m02 and "createSangeunTabs(editor" in m02 diff --git a/resources/tester/test_m01_copy.py b/resources/tester/test_m01_copy.py index c8d141f29..fdb47e085 100644 --- a/resources/tester/test_m01_copy.py +++ b/resources/tester/test_m01_copy.py @@ -209,11 +209,9 @@ def test_별칭_원문이_부르기가_아니면_막는다(client: TestClient) - assert "찾기" in str(got["detail"]) -def test_미리보기는_저장_없이_원문으로_되돌린_로직만_준다(client: TestClient) -> None: - """3-4 화면의 [시험 계산] 이 쓰는 길 — `/calc` 의 `row`+`file` 로 그대로 넣어 씀.""" - inputs = _inputs(STACK) - was = _sums(client, STACK, inputs) - +def test_미리보기는_저장_없이_원문으로_되돌린_로직과_지을_문서를_준다(client: TestClient) -> None: + """3-4 화면의 [시험 계산] 이 쓰는 길(855 2-B4) — 답의 `문서` 를 문서 셈(`/logic/doc/preview`) + 으로 · 금액 = 그 로직 수식 문서 금액(옵션을 바꿔도).""" view = _get(client, "/api/m01/logic/formula", key=STACK) before_keys = _get(client, "/api/m01/logics")["logics"] preview = _post( @@ -224,13 +222,18 @@ def test_미리보기는_저장_없이_원문으로_되돌린_로직만_준다(c after_keys = _get(client, "/api/m01/logics")["logics"] assert after_keys == before_keys # 아무것도 저장 안 함 - calc = _post( - client, - "/api/m01/calc", - {"key": STACK, "inputs": inputs, "row": preview["logic"], "file": view["file"]}, - ) - assert calc["ok"], calc - assert Decimal(str(calc["sums"]["계"])) == Decimal(str(was["계"])) + def total(doc: dict, given: dict) -> Decimal: + got = _post(client, "/api/m01/logic/doc/preview", {"문서": doc, "입력": given}) + assert got["셈"]["셈됨"], got["셈"] + return Decimal(str(got["셈"]["계"])) + + saved = _get(client, "/api/m01/logic/doc", key=STACK)["문서"] + draft = {**preview["문서"], "키": "_새"} # 화면이 보내는 꼴(저장 전 = 빈 키) + picks = [total(saved, {})] + for given in ({}, {"돌": "견치돌", "쌓기": "켜쌓기", "뒷길이": 45}): + assert total(draft, given) == total(saved, given) + picks.append(total(saved, given)) + assert picks[0] != picks[-1] # 옵션이 금액을 바꿈(같음이 빈 대조가 아님) def test_미리보기도_별칭_원문이_부르기가_아니면_막는다(client: TestClient) -> None: From ecc78dfbcb93b383b6d1062a3598da590a6575c2 Mon Sep 17 00:00:00 2001 From: umsangdon Date: Tue, 17 Nov 2026 20:31:57 +0900 Subject: [PATCH 23/30] =?UTF-8?q?fix(854-4):=20M01=20=EC=9A=94=EC=9C=A8=20?= =?UTF-8?q?=EC=8B=9C=ED=8A=B8=20=EC=B1=84=EC=9B=80=20=EC=B9=B8=20=EA=B8=80?= =?UTF-8?q?=EC=83=89=20=E2=80=94=20=EB=82=A0=20=EC=83=89=20=E2=86=92=20?= =?UTF-8?q?=EA=B3=B5=ED=86=B5=20=EA=B0=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 부품 상자 테마에 `--color-text-on-light`(늘 밝은 바탕 위 글 · 어두운 화면도 같은 값) 더함 - `M01_MasterData_UI_RateSheet.css` 엑셀 원본 채움 칸 글색 #1f1f1f → 공통 값(798-1 이 들인 날 색 · 553-5 규칙) - 화면 확인(8004 · 요율 시트 채움 칸 319): 밝음 · 어두움 모두 채움 칸 글 rgb(31,35,40) · 채움 없는 칸은 테마 따름 Co-Authored-By: Claude Opus 5.5 --- M01_MasterData/M01_MasterData_UI_RateSheet.css | 2 +- ui_template/ui_template_theme.css | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/M01_MasterData/M01_MasterData_UI_RateSheet.css b/M01_MasterData/M01_MasterData_UI_RateSheet.css index 0d0204e79..ddd72981d 100644 --- a/M01_MasterData/M01_MasterData_UI_RateSheet.css +++ b/M01_MasterData/M01_MasterData_UI_RateSheet.css @@ -48,5 +48,5 @@ /* 어두운 화면 — 엑셀 원본 채움(연분홍 · 연파랑 · 연초록)은 밝은 색 그대로라 그 칸 글자만 어둡게 */ .m01-rate__sheet .aislo-cell[style*="background-color"] { - color: #1f1f1f; + color: var(--color-text-on-light); } diff --git a/ui_template/ui_template_theme.css b/ui_template/ui_template_theme.css index 4d9b75a6e..675446853 100644 --- a/ui_template/ui_template_theme.css +++ b/ui_template/ui_template_theme.css @@ -28,6 +28,7 @@ --color-charcoal: #1f2328; /* 본문 텍스트, 아이콘 스트로크 */ --color-carbon: #222222; /* 다크 UI 요소, 니어블랙 액센트 */ --color-ink: #000000; /* 최대 대비 텍스트/보더 */ + --color-text-on-light: #1f2328; /* 늘 밝은 바탕(엑셀 원본 채움) 위 글 — 어두운 화면도 같은 값 */ /* 강조 (Accent) */ --color-accent: #1f7a4d; /* 링크 · 주 액션 · 고른 것 */ From 1b29c9c08a1b5fd867de1c231e3971622adb75be Mon Sep 17 00:00:00 2001 From: umsangdon Date: Tue, 17 Nov 2026 20:32:04 +0900 Subject: [PATCH 24/30] =?UTF-8?q?fix(854-4):=20=EA=B4=80=EB=A0=A8=20?= =?UTF-8?q?=EC=8B=9C=ED=97=98=20=EC=B0=BE=EA=B8=B0=20=E2=80=94=20=EB=A7=88?= =?UTF-8?q?=EC=8A=A4=ED=84=B0=20=EC=9E=90=EB=A3=8C=20json=20=EA=B3=A0?= =?UTF-8?q?=EC=B9=A8=EC=97=90=20=EC=9E=90=EB=A3=8C=20=EC=8B=9C=ED=97=98=20?= =?UTF-8?q?=EB=AA=A9=EB=A1=9D=EB=8F=84=20=EA=B2=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 새 `tools/master_data_tests.txt`(한 줄 = 시험 파일): 791-1 지문 · 713-3 묶음 · 794-2b 개정 · 801-3 묶음 전수 · 855 대조 · 지문 - `related_tests.py` 가 자료 json 고침 때 핵심 넷과 함께 이 목록을 읽음(853-4 기준선에서 자료 고침으로 낡았는데 안 걸린 넷) Co-Authored-By: Claude Opus 5.5 --- tools/master_data_tests.txt | 8 ++++++++ tools/related_tests.py | 12 ++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 tools/master_data_tests.txt diff --git a/tools/master_data_tests.txt b/tools/master_data_tests.txt new file mode 100644 index 000000000..2af201aca --- /dev/null +++ b/tools/master_data_tests.txt @@ -0,0 +1,8 @@ +# 마스터 자료(resources/master_data/**.json)를 고치면 핵심 넷(sync_core_tests.txt)과 함께 도는 시험 — 한 줄 = 시험 파일 +# 자료 json 은 이름이 시험 글에 안 나와 이름 찾기로 안 걸림 · M01 자료를 통째로 읽어 셈 · 지문 · 건수를 보는 시험 +resources/tester/test_791_1_engine_semantics.py +resources/tester/test_713_3_list.py +resources/tester/test_794_2b_edition.py +resources/tester/test_801_3_groups.py +resources/tester/test_855_engine_parity.py +resources/tester/test_855_golden.py diff --git a/tools/related_tests.py b/tools/related_tests.py index eccd9167f..0987c6833 100644 --- a/tools/related_tests.py +++ b/tools/related_tests.py @@ -40,10 +40,14 @@ def related(files: list[str]) -> list[str]: if h.is_file() and any(s in h.read_text(encoding="utf-8", errors="replace") for s in stems): stems.add(h.stem) hit = set(own) - # 마스터 자료(json)는 이름이 시험 글에 안 나옴 → 싱크 관문 핵심 시험으로 - if any(f.replace("\\", "/").startswith("resources/master_data/") and f.endswith(".json") for f in files): - core = (ROOT / "tools" / "sync_core_tests.txt").read_text(encoding="utf-8").split() - hit |= {pathlib.PurePosixPath(c).name for c in core if c.endswith(".py")} + # 마스터 자료(json)는 이름이 시험 글에 안 나옴 → 싱크 관문 핵심 시험 + 자료 시험 목록으로 + if any( + f.replace("\\", "/").startswith("resources/master_data/") and f.endswith(".json") + for f in files + ): + for name in ("sync_core_tests.txt", "master_data_tests.txt"): + listed = (ROOT / "tools" / name).read_text(encoding="utf-8").split() + hit |= {pathlib.PurePosixPath(c).name for c in listed if c.endswith(".py")} for t in sorted(TESTS.glob("test_*.py")): if t.name in hit: continue From 5316533ccb4c82cfd0d691d7766a83da2e6d6d7d Mon Sep 17 00:00:00 2001 From: umsangdon Date: Tue, 17 Nov 2026 20:35:28 +0900 Subject: [PATCH 25/30] =?UTF-8?q?chore(ledger):=20=EC=9A=94=EA=B5=AC=20900?= =?UTF-8?q?=20=EC=9E=A5=EB=B6=80=20=E2=80=94=20=EC=A4=91=EA=B0=84=20?= =?UTF-8?q?=EB=B3=B4=EA=B3=A0=20=EC=97=86=EC=9D=B4=20=EC=A0=84=EC=B2=B4=20?= =?UTF-8?q?=EB=A7=88=EB=AC=B4=EB=A6=AC=20=EB=92=A4=20=ED=86=B5=ED=95=A9=20?= =?UTF-8?q?=EB=B3=B4=EA=B3=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude --- docs/raw/요구_1104/사용자요구_1104.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/raw/요구_1104/사용자요구_1104.md b/docs/raw/요구_1104/사용자요구_1104.md index 312fd38fb..cca69c6b8 100644 --- a/docs/raw/요구_1104/사용자요구_1104.md +++ b/docs/raw/요구_1104/사용자요구_1104.md @@ -1604,3 +1604,7 @@ b09원가에서는 확인할필요 없음. 어차피 m02의정보를 가져가 ## 요구 899 (11-17 · 사용자 · 지금 M02 의 개인 · 회사 · 마스터 데이터는 개발 중 테스트 결과 — 삭제해도 됨) 추가로 현재 M02의 개인/회사/마스터 데이터는 프로그램 개발과정에서 테스트한 결과임. 삭제 해도됨. + +## 요구 900 (11-17 · 사용자 · 중간 보고 필요 없음 · 전체 작업 마무리 뒤 한 번에 통합 보고 · 오전 11 시부터 한 것 전체) + +중간중간 보고할 필요없음. 작업 마무리하고 한번에 보고할것. 오늘 오전 11시부타 작업했던것같은데 전체를 작업 마무리하고 통합보고 해줘. 중간중간에 나온 말든은 확인이 어려움. 난 이제 쉬러감. From 39e0a72931e8145effcff216fa2a59aec2c14a0c Mon Sep 17 00:00:00 2001 From: umsangdon Date: Tue, 17 Nov 2026 20:46:11 +0900 Subject: [PATCH 26/30] =?UTF-8?q?refactor(5-4):=20=EC=97=AC=EB=9F=AC=20?= =?UTF-8?q?=ED=8C=8C=EC=9D=BC=20=EC=93=B0=EA=B8=B0=20=ED=95=9C=20=EC=9E=A0?= =?UTF-8?q?=EA=B8=88=20=E2=80=94=20Store.batch(=EB=8B=A4=EC=8B=9C=20?= =?UTF-8?q?=EB=93=A4=EC=96=B4=EA=B0=80=EB=8A=94=20=EC=9E=A0=EA=B8=88)=20?= =?UTF-8?q?=C2=B7=20=EB=82=98=EB=AC=B4=20=EA=B3=A0=EC=B9=A8=20=C2=B7=20?= =?UTF-8?q?=ED=95=A9=EC=B9=98=EA=B8=B0=20=C2=B7=20=EB=90=98=EB=8F=8C?= =?UTF-8?q?=EB=A6=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Store._LOCK = RLock · Store.batch() = 판 대조부터 마지막 쓰기까지 한 잠금(안에서 Store.write 불러도 됨) - Precombo_Folders.edit(지우기 Library_Delete.remove 포함) · Library_Same_Router.merge · undo(Library_Delete.undo 포함)를 batch 안에서 - merge 판 대조를 「없는 문서」 검사 앞으로 — 지우기와 겹쳐 진 합치기 = 409(옛 = 사라진 파일에서 터짐 · 화면 500) - 늦은 쓰기(_refresh_labor 류) · write_template(5-3) · 권한(5-1) 그대로 · San_MatPick.write(sub8) 안 고침 · remove 되돌림 몸 이동은 5-8 - test_858_shelf_golden 동시 쓰기 셋 뒤집음: 앞 것만 됨 · 뒤 것 409 · 파일 앞판 그대로 — 겹침 꼴을 _race 로(앞 것을 쓰기 자리에서 붙잡음 · 잠금을 빼면 셋 다 실패) · 지문 50 갈래 그대로 Co-Authored-By: Claude Opus 5.5 --- M02_MasterTemplete/M02_Library_Delete.py | 3 +- M02_MasterTemplete/M02_Library_Same_Router.py | 23 +++-- .../M02_MasterTemplete_Store.py | 10 +- M02_MasterTemplete/M02_Precombo_Folders.py | 8 +- resources/tester/test_858_shelf_golden.py | 92 +++++++++---------- 5 files changed, 75 insertions(+), 61 deletions(-) diff --git a/M02_MasterTemplete/M02_Library_Delete.py b/M02_MasterTemplete/M02_Library_Delete.py index 4e8a678b3..47c2f7ccf 100644 --- a/M02_MasterTemplete/M02_Library_Delete.py +++ b/M02_MasterTemplete/M02_Library_Delete.py @@ -178,7 +178,8 @@ def remove( at = refs.folder_of(r["층"], r["주인"]) / r["문서종류"] / f"{r['문서']}.json" files[at] = r done: list[dict[str, Any]] = [] - # ponytail: 여러 파일을 차례로 씀(잠금 없음) — 실패하면 앞서 고친 파일을 앞판 바이트로 되돌림 + # ponytail: 부르는 곳(`Precombo_Folders.edit`)의 `store.batch` 안 — 실패하면 앞서 고친 파일을 + # 앞판 바이트로 되돌림(되돌림 몸을 `batch` 로 옮기는 것은 5-8) for path, r in files.items(): raw = path.read_bytes() try: diff --git a/M02_MasterTemplete/M02_Library_Same_Router.py b/M02_MasterTemplete/M02_Library_Same_Router.py index 362261e12..36dafde1f 100644 --- a/M02_MasterTemplete/M02_Library_Same_Router.py +++ b/M02_MasterTemplete/M02_Library_Same_Router.py @@ -205,6 +205,12 @@ def find(folder: Path, kind: str) -> dict[str, Any]: # ── 합치기 ──────────────────────────────────────────────────────────── def merge(session: Session, folder: Path, kind: str, body: MergeBody) -> dict[str, Any]: + """판 대조부터 마지막 쓰기까지 `store.batch` — 같은 층 지우기 · 나무 고침과 겹치면 진 쪽 409.""" + with store.batch(): + return _merge(session, folder, kind, body) + + +def _merge(session: Session, folder: Path, kind: str, body: MergeBody) -> dict[str, Any]: mine = refs.where(folder) raw = body.남김 or {} keep_at: refs.Here = (str(raw.get("층") or ""), raw.get("주인") or None) @@ -216,13 +222,13 @@ def merge(session: Session, folder: Path, kind: str, body: MergeBody) -> dict[st gone = list(dict.fromkeys(str(k) for k in body.지움)) if not gone or (keep_at == mine and keep["키"] in gone): raise _bad(400, "지울 문서를 고름 — 남김과 달라야 함") + with store.at(folder): + tree_doc, 판 = pre_folders._read(kind) + if 판 != body.판: # 없는 문서 검사 앞 — 겹쳐 진 쪽(그새 지워짐)은 409 + raise _bad(409, {"stale": [pre_folders.file_of(kind)], "판": 판}) have = dict(_docs(mine, kind)) if miss := [k for k in gone if k not in have]: raise _bad(404, f"이 층에 없는 문서 「{' · '.join(miss)}」") - with store.at(folder): - tree_doc, 판 = pre_folders._read(kind) - if 판 != body.판: - raise _bad(409, {"stale": [pre_folders.file_of(kind)], "판": 판}) marks = same.Same() mark = marks.finger(kind, keep_doc) if mark is None or any(marks.finger(kind, have[k]) != mark for k in gone): @@ -259,7 +265,6 @@ def merge(session: Session, folder: Path, kind: str, body: MergeBody) -> dict[st places = dict(tree_doc.get("자리") or {}) done, kept = [], [] when = datetime.now().isoformat(timespec="seconds") - # ponytail: 여러 파일을 차례로 씀(잠금 없음) — 동시에 같은 층을 합치면 앞 것이 이김 for key in gone: if left[key]: kept.append({"키": key, "쓰는곳": left[key]}) @@ -284,7 +289,13 @@ def merge(session: Session, folder: Path, kind: str, body: MergeBody) -> dict[st def undo(session: Session, folder: Path, kind: str, key: str) -> dict[str, Any]: - """`_합친것/<키>` 되돌림 — 문서 · 나무 자리 · 옮긴 참조(아직 남김을 가리키고 쓸 수 있는 곳).""" + """`_합친것/<키>` 되돌림 — 문서 · 나무 자리 · 옮긴 참조(아직 남김을 가리키고 쓸 수 있는 곳) · + 한 `store.batch`(지움 기록 되돌림 `M02_Library_Delete.undo` 도 이 안).""" + with store.batch(): + return _undo(session, folder, kind, key) + + +def _undo(session: Session, folder: Path, kind: str, key: str) -> dict[str, Any]: mine = refs.where(folder) rec_path = folder / GONE / f"{key}.json" try: diff --git a/M02_MasterTemplete/M02_MasterTemplete_Store.py b/M02_MasterTemplete/M02_MasterTemplete_Store.py index aa1f42a59..e80ba2f86 100644 --- a/M02_MasterTemplete/M02_MasterTemplete_Store.py +++ b/M02_MasterTemplete/M02_MasterTemplete_Store.py @@ -76,8 +76,14 @@ _BAD_NAME = re.compile(r'[\\/:*?"<>|\x00-\x1f]|\.\.') # of undefined (reading 'length')") · CAD 쪽도 없으면 새로 채우지만(2026-09-27 sub1 고침) # 뿌리도 처음부터 채움 _BLANK_LAYER = {"id": "기본", "name": "기본", "isVisible": True, "isLocked": False} -# ponytail: 저장은 한 번에 하나(프로세스 안 잠금) · 서버를 여럿 띄우면 파일 잠금으로 -_LOCK = threading.Lock() +# ponytail: 저장은 한 번에 하나(프로세스 안 잠금 · 다시 들어감) · 서버를 여럿 띄우면 파일 잠금으로 +_LOCK = threading.RLock() + + +def batch() -> threading.RLock: + """여러 파일 쓰기 한 묶음(858 5-4) — 판 대조부터 마지막 쓰기까지 한 잠금 · 안에서 `write` · + `delete` 를 불러도 됨(다시 들어가는 잠금) · 겹친 쪽은 잠금 뒤 판 대조에서 409.""" + return _LOCK class StoreError(Exception): diff --git a/M02_MasterTemplete/M02_Precombo_Folders.py b/M02_MasterTemplete/M02_Precombo_Folders.py index b7bb98c53..92ec85a11 100644 --- a/M02_MasterTemplete/M02_Precombo_Folders.py +++ b/M02_MasterTemplete/M02_Precombo_Folders.py @@ -181,7 +181,13 @@ def edit( body: dict[str, Any], kind: str = "precombo", session: dict[str, Any] | None = None ) -> dict[str, Any]: """지금 층 자리 파일을 고쳐 씀(지우기면 문서 파일째 · 쓰는 곳 = `deleting.remove` · 몸 `확인`) → - 새 나무 + 알림(지우기 = `기록` 되돌림 키) · 판 다르면 409.""" + 새 나무 + 알림(지우기 = `기록` 되돌림 키) · 판 다르면 409 · 판 대조부터 쓰기까지 + `store.batch`.""" + with store.batch(): + return _edit(body, kind, session) + + +def _edit(body: dict[str, Any], kind: str, session: dict[str, Any] | None) -> dict[str, Any]: doc, 판 = _read(kind) if 판 != str(body.get("판") or ""): raise store.StoreError(409, {"stale": [file_of(kind)], "판": 판}) diff --git a/resources/tester/test_858_shelf_golden.py b/resources/tester/test_858_shelf_golden.py index 64f489d2c..d1ff49a0e 100644 --- a/resources/tester/test_858_shelf_golden.py +++ b/resources/tester/test_858_shelf_golden.py @@ -7,9 +7,8 @@ 다르면 갈래 이름 + 지금 답 + 다시 뜨는 법으로 실패(건너뛰지 않음). 다시 뜸 = `SHELF_858_WRITE=1 ./venv/Scripts/python.exe -m pytest resources/tester/test_858_shelf_golden.py` (뜻한 바뀜일 때만 · 커밋 글에 까닭). 답 통째 전후 대조 = `SHELF_858_DUMP=tmp/<파일>.json`. -② 동시 쓰기 — 잠금 없는 나무 고침 · 나무 지우기 · 합치기를 같은 판으로 겹쳐 부름. 지금 사실을 - 그대로 단언(나무 = 둘 다 됨 · 뒤 것이 이김 · 지우기 + 합치기 = 앞 것이 이기고 뒤 것은 터짐) — - 「5-4 에서 뒤집을 단언」 표시 줄은 5-4 가 바꿈. +② 동시 쓰기 — 나무 고침 · 나무 지우기 · 합치기를 같은 판으로 겹쳐 부름. 한 잠금(`store.batch` · + 5-4) 안에서 판 대조 → 앞 것만 이기고 뒤 것은 409 · 파일은 앞 것이 쓴 그대로(반쯤 써짐 없음). """ from __future__ import annotations @@ -354,45 +353,36 @@ def test_서고_길_답_지문(shelf, world): ) -# ── ② 동시 쓰기 — 잠금 없는 여러 파일 쓰기(설계 858 1-4 「잠금 없는 쓰기」 · 5-4 몫) ───────── -def _two(first, second, meet: list[tuple[Any, str]], late: tuple[Any, str]): - """둘을 같이 돌림 — 둘 다 판 대조를 지난 뒤 `meet` 함수 앞에서 만나고, 그 뒤 `second` 쪽 - `late` 함수를 늦춤 → (먼저 답 · 나중 답 — 예외면 예외).""" - gate = threading.Barrier(2, timeout=10) - slow = threading.local() - saved = [(late[0], late[1], getattr(*late))] + [(o, n, None) for o, n in meet] +# ── ② 동시 쓰기 — 여러 파일 쓰기 한 잠금(설계 858 1-4 「잠금 없는 쓰기」 · 5-4) ───────── +def _race(win, lose, inside: tuple[Any, str]): + """`win` 을 먼저 돌려 `inside`(판 대조 뒤 · 쓰기 앞) 안에서 붙잡아 둔 사이 `lose` 를 돌림 → + (win 답 · lose 답 — 예외면 예외). 잠금이 없으면 `lose` 도 옛 판으로 대조를 지나 둘 다 됨.""" + entered = threading.Event() + held = threading.local() + real = getattr(*inside) - def later(*a, _real=saved[0][2], **k): - if getattr(slow, "on", False): + def hold(*a, **k): + if getattr(held, "on", False): + entered.set() threading.Event().wait(0.3) - return _real(*a, **k) + return real(*a, **k) - setattr(*late, later) # 안쪽 = 늦춤 · 바깥 = 만남(같은 함수면 만난 뒤 늦춤) - for i, (owner, name, _) in enumerate(saved[1:], 1): - inner = getattr(owner, name) - saved[i] = (owner, name, inner) - - def wait(*a, _inner=inner, **k): - gate.wait() - return _inner(*a, **k) - - setattr(owner, name, wait) - - def run(fn, is_late): - slow.on = is_late + def run(fn, is_win): + held.on = is_win try: return fn() - except Exception as error: # 지금 사실(터짐)도 답으로 + except Exception as error: # 진 쪽 409 도 답으로 return error + setattr(*inside, hold) try: with ThreadPoolExecutor(2) as pool: - a = pool.submit(run, first, False) - b = pool.submit(run, second, True) + a = pool.submit(run, win, True) + assert entered.wait(10), "앞 것이 쓰기 자리에 못 닿음" + b = pool.submit(run, lose, False) return a.result(), b.result() finally: - for owner, name, real in reversed(saved): - setattr(owner, name, real) + setattr(*inside, real) def _sk(me: Path, name: str, price: int, again: bool = False) -> str: @@ -415,37 +405,40 @@ def _folders(me: Path) -> list[list[str]]: return pre_folders.view("sangeun")["폴더"] -def test_동시_나무_고침_둘_다_됨_뒤_것이_이김(world): +def _lost(answer) -> bool: + return isinstance(answer, store.StoreError) and answer.status == 409 + + +def test_동시_나무_고침_앞_것만_됨_뒤_것은_409(world): me = world["personal"] with store.at(me): 판 = pre_folders.view("sangeun")["판"] - first, second = _two( + first, second = _race( _edit(me, {"op": "add-folder", "경로": [], "이름": "가", "판": 판}), _edit(me, {"op": "add-folder", "경로": [], "이름": "나", "판": 판}), - [(pre_folders, "apply_many")], - (pre_folders, "atomic_write_json"), + (pre_folders, "apply_many"), ) - assert first["알림"]["경로"] == ["가"] and second["알림"]["경로"] == ["나"] # 둘 다 됨 - assert _folders(me) == [["나"]] # 5-4 에서 뒤집을 단언 — 지금은 뒤 것이 이김(앞 「가」 사라짐) + assert first["알림"]["경로"] == ["가"] and _lost(second) + assert _folders(me) == [["가"]] # 앞 것만 — 뒤 「나」 는 판이 달라 안 씀 -def test_동시_나무_지우기와_고침_둘_다_됨_뒤_것이_이김(world): +def test_동시_나무_고침과_지우기_앞_것만_됨_뒤_지우기는_409(world): me = world["personal"] gone = _sk(me, "지울것", 1000) with store.at(me): 판 = pre_folders.view("sangeun")["판"] - first, second = _two( + first, second = _race( _edit(me, {"op": "add-folder", "경로": [], "이름": "가", "판": 판}), _edit(me, {"op": "delete", "대상": [{"키": gone}], "판": 판}), - [(pre_folders, "apply_many")], - (pre_folders, "atomic_write_json"), + (pre_folders, "apply_many"), ) - assert first["알림"]["경로"] == ["가"] and second["알림"]["기록"] # 둘 다 됨 - assert not (me / "sangeun" / f"{gone}.json").exists() - assert _folders(me) == [] # 5-4 에서 뒤집을 단언 — 지금은 뒤 것(지우기)이 이김(「가」 사라짐) + assert first["알림"]["경로"] == ["가"] and _lost(second) + assert (me / "sangeun" / f"{gone}.json").is_file() # 지우기 = 안 됨 · 문서 그대로 + assert _folders(me) == [["가"]] + assert not (me / same_router.GONE).exists() or not list((me / same_router.GONE).glob("*.json")) -def test_동시_지우기와_합치기_앞_것이_이기고_뒤_것은_터짐(world): +def test_동시_지우기와_합치기_앞_것만_됨_뒤_합치기는_409(world): me = world["personal"] gone = _sk(me, "겹침", 1000) keep = _sk(me, "겹침", 1000, again=True) @@ -454,16 +447,13 @@ def test_동시_지우기와_합치기_앞_것이_이기고_뒤_것은_터짐(wo body = same_router.MergeBody( 남김={"층": "personal", "주인": "7/42", "키": keep}, 지움=[gone], 판=판 ) - first, second = _two( + first, second = _race( _edit(me, {"op": "delete", "대상": [{"키": gone}], "판": 판}), lambda: same_router.merge(dict(USER), me, "sangeun", body), - [(pre_folders, "apply_many"), (same_router, "_user_index")], - (same_router, "_user_index"), + (pre_folders, "apply_many"), ) assert first["알림"]["기록"] == gone # 지우기 = 됨(기록 키 = 그 문서) - # 5-4 에서 뒤집을 단언 — 지금은 뒤 합치기가 판 · 지문 대조를 지난 뒤 사라진 파일에서 터짐 - # (화면 = 500) · 5-4 뒤 = 409 · 파일 앞판 그대로 - assert isinstance(second, FileNotFoundError) + assert _lost(second) # 뒤 합치기 = 판이 달라 409(옛 = 사라진 파일에서 터짐 · 화면 500) assert not (me / "sangeun" / f"{gone}.json").exists() assert (me / "sangeun" / f"{keep}.json").is_file() assert [p.stem for p in (me / same_router.GONE).glob("*.json")] == [gone] # 지우기 기록만 From bd41d87996b575c066f6295ce35918dab24da82e Mon Sep 17 00:00:00 2001 From: umsangdon Date: Tue, 17 Nov 2026 21:02:43 +0900 Subject: [PATCH 27/30] =?UTF-8?q?refactor(856-4):=20=EA=B3=B5=EC=9A=A9=20?= =?UTF-8?q?=EC=A4=84=20=EC=8C=93=EA=B8=B0=EA=B0=80=20M02=20=C2=B7=20M01=20?= =?UTF-8?q?=EC=9D=84=20=EA=B1=B0=EA=BE=B8=EB=A1=9C=20=EB=B6=80=EB=A5=B4?= =?UTF-8?q?=EB=8A=94=20=EA=B2=83=20=EB=81=8A=EC=9D=8C=20=E2=80=94=20?= =?UTF-8?q?=EC=B8=B5=20=C2=B7=20=EB=B6=80=EB=A6=84=20=C2=B7=20=EC=B0=BE?= =?UTF-8?q?=EA=B8=B0=20=EC=B0=BD=20=C2=B7=20=EB=8B=A8=EC=9C=84=20=EA=B3=A0?= =?UTF-8?q?=EB=A5=B4=EA=B8=B0=20=C2=B7=20=ED=95=A9=EA=B3=84=20=EC=83=81?= =?UTF-8?q?=EC=9E=90=20=C2=B7=20=EA=B8=B0=EA=B3=84=20=EC=B9=B8=20=EA=B3=A0?= =?UTF-8?q?=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 층 이름 · /api/m02 부름 = common_util_m02_call 새 조각(M02 Api_Fetch 는 그대로 내보냄 — M02 부르는 곳 안 바뀜) - 찾아 넣기 창 = 페이지가 넘김(StackFind · 줄 쌓기 화면 · 기계 시트 · 편집 · 제어 구역 훅) — M01 · M02 가 M02 openFindPicker 를 넘김 - 단위 고르기 = 부품 상자 ui_template_unit_pick(옛 M02 DataFlow/DF_UnitPick · 표준 표 읽기 같이 옮김) - 합계 상자 = A00 formula_doc_foot 로 합침(옛 M01 LogicLab_Foot · 쓰는 곳 하나) · 그 CSS = formula_doc_foot.css · 안 쓰는 세 칸 갈래 · 글 키 걷음 - 기계 제어 구역 ↔ 작업량 고리 = 칸 부품 line_stack_machine_cell 로(수 칸 · 바뀜 표시) - 수치: 공용(A00) → M01 · M02 import 9 파일 17 → 3 파일 7(남은 것 = 기계 · 불러온 재료 훅 — 858 · 857 몫) · ctl ↔ work 고리 0 - 동작 불변(화면 확인 · 시험) · 시험: 옮긴 파일 이름 · 경로만 고침 · 걸린 글 대조 줄 지움(721 · 737) Co-Authored-By: Claude Opus 5.5 --- .../M01_MasterData_UI_LogicLab_Foot.ts | 53 ------------------- .../ui_template_unit_pick.css | 0 .../ui_template_unit_pick.ts | 0 3 files changed, 53 deletions(-) delete mode 100644 M01_MasterData/M01_MasterData_UI_LogicLab_Foot.ts rename M02_MasterTemplete/DataFlow/M02_DF_UnitPick.css => ui_template/ui_template_unit_pick.css (100%) rename M02_MasterTemplete/DataFlow/M02_DF_UnitPick.ts => ui_template/ui_template_unit_pick.ts (100%) diff --git a/M01_MasterData/M01_MasterData_UI_LogicLab_Foot.ts b/M01_MasterData/M01_MasterData_UI_LogicLab_Foot.ts deleted file mode 100644 index d69648568..000000000 --- a/M01_MasterData/M01_MasterData_UI_LogicLab_Foot.ts +++ /dev/null @@ -1,53 +0,0 @@ -/* ============================================================================= - * M01_MasterData_UI_LogicLab_Foot.ts - * 화면(모달) 바닥에 붙는 비목 소계 줄(737-1 · PLAN 748-3) — 단가산출 상세(노무비 · 재료비 · 경비 · 계 네 칸) · - * 텍스트 수식(노무비 · 재료비 · 경비 세 칸 · 계 칸 없음 — 중복 표기) 두 보기가 같이 씀. - * 값 = 서버 셈 그대로(여기서 다시 셈 안 함) · 계산 전 「—」. - * ========================================================================== */ - -import { createCalcFormulaRow } from "@ui/ui_template_calc_row"; -import { el } from "@ui/ui_template_elements"; -import { formatMoney } from "../common_util/common_util_money"; -import { tl } from "./M01_MasterData_UI_LogicLab_Text"; - -export type FootKey = "labor" | "material" | "cost"; -const LABEL: Record = { labor: "노무비", material: "재료비", cost: "경비" }; -export const FOOT_KEYS = Object.keys(LABEL) as FootKey[]; - -/** 비목 소계 줄 — `total` 을 주면 맨 끝 「계」 칸까지 네 칸(주지 않으면 세 칸) */ -export function buildFoot( - sums: Record, - calculated: boolean, - total?: number, -): HTMLElement { - const cells = FOOT_KEYS.map((k) => { - const out = el("span", { - className: "ui-calc-row__out is-key", - text: calculated ? formatMoney(sums[k]) : "—", - }); - const row = createCalcFormulaRow(LABEL[k], null, out); - row.dataset.group = k; - row.dataset.subtotal = calculated ? String(sums[k]) : ""; - return row; - }); - const foot = el("div", { - className: "m01lab__foot", - children: [ - el("div", { className: "m01lab__sums", children: cells }), - ...(total === undefined - ? [] - : [ - el("p", { - className: "m01lab__total", - attrs: { "data-sum": calculated ? String(total) : "" }, - children: [ - el("span", { text: `${tl("Total")} ` }), - el("span", { text: calculated ? formatMoney(total) : "—" }), - ], - }), - ]), - ], - }); - if (total === undefined) foot.dataset.cols = "3"; - return foot; -} diff --git a/M02_MasterTemplete/DataFlow/M02_DF_UnitPick.css b/ui_template/ui_template_unit_pick.css similarity index 100% rename from M02_MasterTemplete/DataFlow/M02_DF_UnitPick.css rename to ui_template/ui_template_unit_pick.css diff --git a/M02_MasterTemplete/DataFlow/M02_DF_UnitPick.ts b/ui_template/ui_template_unit_pick.ts similarity index 100% rename from M02_MasterTemplete/DataFlow/M02_DF_UnitPick.ts rename to ui_template/ui_template_unit_pick.ts From a8d6b426d0926b99da83c0feda685593a08fc0f0 Mon Sep 17 00:00:00 2001 From: umsangdon Date: Tue, 17 Nov 2026 21:02:55 +0900 Subject: [PATCH 28/30] =?UTF-8?q?refactor(856-4):=20=EA=B1=B0=EA=BE=B8?= =?UTF-8?q?=EB=A1=9C=20=EB=B6=80=EB=A6=84=20=EB=81=8A=EA=B8=B0=20=EB=B3=B8?= =?UTF-8?q?=EB=AC=B8=20=E2=80=94=20=EC=95=9E=20=EC=BB=A4=EB=B0=8B(bd41d879?= =?UTF-8?q?9)=EC=9D=80=20=EC=9D=B4=EB=A6=84=20=EC=98=AE=EA=B9=80=EB=A7=8C?= =?UTF-8?q?=20=EB=8B=B4=EA=B9=80=20=C2=B7=20=EC=9D=B4=20=EC=BB=A4=EB=B0=8B?= =?UTF-8?q?=EA=B3=BC=20=ED=95=9C=20=EB=AC=B6=EC=9D=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 앞 커밋 글 그대로(층 · 부름 common_util_m02_call · 찾아 넣기 창 StackFind 주입 · 단위 고르기 부품 상자 · 합계 상자 A00 · 기계 칸 부품) - 앞 커밋에서 git add 가 옛 경로에 걸려 고친 파일이 빠짐 — 두 커밋을 같이 올림 Co-Authored-By: Claude Opus 5.5 --- A00_Common/formula_doc_foot.css | 64 +++++++++++++++ A00_Common/formula_doc_foot.ts | 47 ++++++++--- A00_Common/line_stack_edit.ts | 9 ++- A00_Common/line_stack_machine.ts | 2 +- A00_Common/line_stack_machine_cell.ts | 66 ++++++++++++++++ A00_Common/line_stack_machine_ctl.ts | 77 +++---------------- A00_Common/line_stack_machine_sheet.ts | 4 + A00_Common/line_stack_machine_work.ts | 2 +- A00_Common/line_stack_material.ts | 2 +- A00_Common/line_stack_pick.ts | 46 +++++++++-- A00_Common/line_stack_rows.ts | 3 +- A00_Common/line_stack_screen.ts | 6 +- M01_MasterData/M01_MasterData_UI_LogicLab.ts | 2 + .../M01_MasterData_UI_LogicLab_Style.css | 68 ---------------- .../M01_MasterData_UI_LogicLab_Text.ts | 1 - .../M01_MasterData_UI_MachineDetail.ts | 2 + M01_MasterData/M01_MasterData_UI_Parts.ts | 2 + M02_MasterTemplete/DataFlow/M02_DF_Api.ts | 16 +--- .../M02_MasterTemplete_Api_Fetch.ts | 42 +--------- .../M02_MasterTemplete_Find_Pick.ts | 3 +- .../M02_MasterTemplete_Hopyo_MatPick.ts | 2 + .../M02_MasterTemplete_Labor_Table.ts | 2 +- .../M02_MasterTemplete_Sangeun_Tabs.ts | 2 + M02_MasterTemplete/M02_Material_Pick.ts | 2 +- M02_MasterTemplete/M02_MyMachine_Form.ts | 2 + M02_MasterTemplete/M02_MyMaterial_View.ts | 2 +- common_util/common_util_m02_call.ts | 47 +++++++++++ resources/tester/helper_845_2_unit_show.cjs | 2 +- resources/tester/helper_856_0_sk_screen.cjs | 2 +- resources/tester/test_721_find_pick.py | 1 - resources/tester/test_737_option_grid_foot.py | 11 --- resources/tester/test_804_7_line_stack_fix.py | 4 +- .../tester/ui_checks/51-5_단위단추_크기.js | 2 +- ui_template/ui_template_unit_pick.ts | 20 ++++- 34 files changed, 330 insertions(+), 235 deletions(-) create mode 100644 A00_Common/formula_doc_foot.css create mode 100644 A00_Common/line_stack_machine_cell.ts create mode 100644 common_util/common_util_m02_call.ts diff --git a/A00_Common/formula_doc_foot.css b/A00_Common/formula_doc_foot.css new file mode 100644 index 000000000..72407d841 --- /dev/null +++ b/A00_Common/formula_doc_foot.css @@ -0,0 +1,64 @@ +/* formula_doc_foot.css — 수식 화면 맨 아래 합계 상자(PLAN 737-1 · 803-2a · 856-4 — M01 LogicLab_Style 에서 옮김) */ + +.m01lab__total { + margin: var(--spacing-8) 0 0; + font-weight: 700; + text-align: right; +} + +/* 737-1 맨 아래 한 줄 4 칸(노무비 · 재료비 · 경비 · 계) — 화면(모달) 바닥에 붙음 · 칸마다 이름 위 · 값 아래 */ +.m01lab__foot { + position: sticky; + bottom: 0; + z-index: 2; + display: grid; + grid-template-columns: repeat(4, minmax(0, 1fr)); + gap: var(--spacing-8); + margin-top: var(--m01lab-box-gap, var(--spacing-12)); + padding: var(--spacing-8) var(--spacing-12); + border: 1px solid var(--color-border); + border-radius: var(--radius-lg); + background: var(--color-surface-raised); +} + +/* 합계 줄이 화면 바닥에 붙으려면 메인 칸이 굴림 칸(overflow:auto)이 아니어야 함 — 메인은 높이가 안 묶여 안 굴렀음 */ +.ui-workflow-layout__main:has(.m01lab__foot) { + overflow: clip; +} + +.m01lab__sums { + display: contents; +} + +.m01lab__foot .ui-calc-row { + display: flex; + flex-direction: column; + align-items: stretch; + gap: 0; + min-height: 0; +} + +.m01lab__foot .ui-calc-row > :empty { + display: none; +} + +.m01lab__foot .ui-calc-row__out { + padding: 0; + text-align: left; +} + +.m01lab__foot .m01lab__total { + display: flex; + flex-direction: column; + margin: 0; + text-align: left; +} + +.m01lab__foot .m01lab__total > :first-child { + color: var(--color-text-secondary); + font-weight: var(--font-weight-regular, 400); +} + +.m01lab__foot .m01lab__total > :last-child { + font-variant-numeric: tabular-nums; +} diff --git a/A00_Common/formula_doc_foot.ts b/A00_Common/formula_doc_foot.ts index 3a224b188..95bce3371 100644 --- a/A00_Common/formula_doc_foot.ts +++ b/A00_Common/formula_doc_foot.ts @@ -1,20 +1,49 @@ /* ============================================================================= * formula_doc_foot.ts - * 수식 탭 맨 아래 합계 상자(PLAN 803-2a · 요구 667-2) — 단가산출 상세 탭과 같은 부품(`buildFoot` · 노무비 · 재료비 · 경비 · 계) - * 값 = 계산기 셈 그대로(여기서 다시 셈 안 함) · 셈 못 함 = 「—」 + * 수식 탭 맨 아래 합계 상자(PLAN 803-2a · 요구 667-2 · 737-1) — 노무비 · 재료비 · 경비 · 계 네 칸 · 화면(모달) 바닥에 붙음 + * 값 = 계산기 셈 그대로(여기서 다시 셈 안 함) · 셈 못 함 = 「—」 · 856-4 = M01 `LogicLab_Foot` 을 여기로(쓰는 곳 하나) * ========================================================================== */ +import { createCalcFormulaRow } from "@ui/ui_template_calc_row"; +import { el } from "@ui/ui_template_elements"; +import { formatMoney } from "../common_util/common_util_money"; import type { DocAnswer } from "../common_util/common_util_formula_doc_calc"; -import { buildFoot } from "../M01_MasterData/M01_MasterData_UI_LogicLab_Foot"; -import "../M01_MasterData/M01_MasterData_UI_LogicLab_Style.css"; +import { ft } from "./formula_doc_text"; +import "./formula_doc_foot.css"; const num = (v: unknown): number => (typeof v === "number" && Number.isFinite(v) ? v : 0); +const PARTS = [ + ["labor", "노무비"], + ["material", "재료비"], + ["cost", "경비"], +] as const; export function docFoot(a: DocAnswer): HTMLElement { const done = !!a.셈됨 && typeof a.계 === "number"; - return buildFoot( - { labor: num(a.노무비), material: num(a.재료비), cost: num(a.경비) }, - done, - num(a.계), - ); + const sums = { labor: num(a.노무비), material: num(a.재료비), cost: num(a.경비) }; + const total = num(a.계); + const cells = PARTS.map(([k, label]) => { + const out = el("span", { + className: "ui-calc-row__out is-key", + text: done ? formatMoney(sums[k]) : "—", + }); + const row = createCalcFormulaRow(label, null, out); + row.dataset.group = k; + row.dataset.subtotal = done ? String(sums[k]) : ""; + return row; + }); + return el("div", { + className: "m01lab__foot", + children: [ + el("div", { className: "m01lab__sums", children: cells }), + el("p", { + className: "m01lab__total", + attrs: { "data-sum": done ? String(total) : "" }, + children: [ + el("span", { text: `${ft("Sum")} ` }), + el("span", { text: done ? formatMoney(total) : "—" }), + ], + }), + ], + }); } diff --git a/A00_Common/line_stack_edit.ts b/A00_Common/line_stack_edit.ts index eaeabf304..b68e5e8d6 100644 --- a/A00_Common/line_stack_edit.ts +++ b/A00_Common/line_stack_edit.ts @@ -56,7 +56,7 @@ import { unswap, } from "../common_util/common_util_line_stack_pick"; import { shownUnitOf, type TableLook } from "../common_util/common_util_line_stack_unit"; -import { createUnitPick, NO_UNIT } from "../M02_MasterTemplete/DataFlow/M02_DF_UnitPick"; +import { createUnitPick, NO_UNIT } from "@ui/ui_template_unit_pick"; import { hiddenByWork, reach } from "./formula_doc_render"; import { attachDrag } from "./line_stack_drag"; import type { WorkSpec } from "../common_util/common_util_formula_doc_work"; @@ -64,7 +64,7 @@ import { openMachineWindow, type MachineCtx } from "./line_stack_machine"; import { dropCover } from "../common_util/common_util_formula_doc_cover_drop"; import { buildMachineCtl, lineCall } from "./line_stack_machine_ctl"; import { putWork, swapMachine } from "./line_stack_machine_work"; -import { openStackPick, type StackTake } from "./line_stack_pick"; +import { openStackPick, type StackFind, type StackTake } from "./line_stack_pick"; import { buildBlock, sourceTag } from "./line_stack_rows"; import { lt, type LsKey } from "./line_stack_text"; @@ -99,6 +99,8 @@ export interface EditHooks { upper?: Cover | null; /** 848-3 M01 기초 제어 구역 엶(시스템 관리자) — M02 = 층(`machine.scope`)이 엶 */ ctlEdit?: boolean; + /** 856-4 찾아 넣기 창(페이지가 넘김) */ + find: StackFind; } const field = ( @@ -229,7 +231,7 @@ function moneyBody(h: EditHooks, i: number): HTMLElement[] { query, pick: fixed ? swapFixed : swap, }) - : openStackPick(kind, swap, undefined, query), + : openStackPick(h.find, kind, swap, undefined, query), }); pick.classList.add("lstk-res"); pick.title = `${lt("Repick")}${res ? ` — ${res}` : ""}`; @@ -406,6 +408,7 @@ function readQty(text: string, note: string, tag: string): HTMLElement { function addLine(h: EditHooks, at: number, kind: string): void { if (["인력", "재료", "기계", "단가산출"].includes(kind)) return openStackPick( + h.find, kind as MoneyKind, (p) => h.change((d, items) => void addPicked(d, items[at], kind as MoneyKind, p)), h.take, diff --git a/A00_Common/line_stack_machine.ts b/A00_Common/line_stack_machine.ts index 4d57a7e77..f4cf6c2ef 100644 --- a/A00_Common/line_stack_machine.ts +++ b/A00_Common/line_stack_machine.ts @@ -14,7 +14,7 @@ import { openModal } from "@ui/ui_template_modal"; import { createText } from "@ui/ui_template_text"; import { isDraftNo, type DraftItem } from "../common_util/common_util_line_stack_draft"; import type { Picked } from "../common_util/common_util_line_stack_pick"; -import { call, type Layer } from "../M02_MasterTemplete/M02_MasterTemplete_Api_Fetch"; +import { call, type Layer } from "../common_util/common_util_m02_call"; import { listMyMachines, machineArg, diff --git a/A00_Common/line_stack_machine_cell.ts b/A00_Common/line_stack_machine_cell.ts new file mode 100644 index 000000000..a867eeff7 --- /dev/null +++ b/A00_Common/line_stack_machine_cell.ts @@ -0,0 +1,66 @@ +/* ============================================================================= + * line_stack_machine_cell.ts + * 기계 제어 구역 칸 부품(PLAN 856-4) — 수 칸 · 「바뀜」 표시(출처 테두리 · 원래 값 풍선) + * 제어 구역(`line_stack_machine_ctl`) · 작업량 묶음(`line_stack_machine_work`)이 같이 씀 — 둘이 서로 부르던 고리 끊음 + * ========================================================================== */ + +import { setUiDiff, type UiDiff } from "@ui/ui_template_button"; +import { el, showToast } from "@ui/ui_template_elements"; +import { createInputField } from "@ui/ui_template_input"; +import { MINE, type Source } from "../common_util/common_util_formula_doc_cover"; +import { lt } from "./line_stack_text"; + +/** 출처(848-3) — 나 · 위 층. 테두리는 나만(892) · 풍선(원래 값)은 둘 다 */ +export type DiffSrc = UiDiff | "upper"; +export const diffOf = (src: Source | undefined): DiffSrc | null => + src === undefined ? null : src === MINE ? "mine" : "upper"; + +/** 칸 묶음 안 입력 · 고르기 · 이름 단추에 「바뀜」 상태(나만) · 풍선(원래 값) */ +export function markDiff(box: HTMLElement, diff: DiffSrc | null, was?: string): void { + const own = ["ui-input", "ui-select", "ui-btn"].some((c) => box.classList.contains(c)); + const nodes = own ? [box] : ["ui-input", "ui-select", "lstk-res"].flatMap((c) => [...box.querySelectorAll(`.${c}`)]); // prettier-ignore + for (const n of nodes) { + setUiDiff(n, diff === "mine" ? "mine" : null); + if (diff && was !== undefined) + n.title = `${n.title ? `${n.title} — ` : ""}${lt("Ctl_Was")} ${was}`; + } +} + +const num = (t: string): number | null => { + const n = Number(t.trim().replace(/,/g, "")); + return t.trim() !== "" && Number.isFinite(n) ? n : null; +}; + +/** 수 칸 — 빈 글 = 원래대로(null) · 음수 · 글 = 알림 · 단위 = 칸 바로 뒤(공식 묶음 값 칸과 같은 자리 · 845-2 ㉥) */ +export function numBox( + label: string, + value: unknown, + unit: string, + ro: boolean, + set: (n: number | null) => void, + hint = "", +): HTMLElement { + const f = createInputField({ + value: value === undefined || value === null ? "" : String(value), + placeholder: hint, + compact: true, + size: 24, + }); + f.root.classList.add("lstk-f-s"); + f.input.setAttribute("aria-label", label); + f.input.title = label; + f.input.disabled = ro; + f.input.addEventListener("change", () => { + const t = f.input.value; + const n = num(t); + if (t.trim() === "") return set(null); + if (n === null || n < 0) { + f.input.value = value === undefined || value === null ? "" : String(value); + return void showToast(lt("Ctl_Bad"), "warning"); + } + set(n); + }); + return unit + ? el("span", { className: "lstk-qty", children: [f.root, el("span", { className: "lstk-unit", text: unit })] }) // prettier-ignore + : f.root; +} diff --git a/A00_Common/line_stack_machine_ctl.ts b/A00_Common/line_stack_machine_ctl.ts index d22bfb7be..ff4091f36 100644 --- a/A00_Common/line_stack_machine_ctl.ts +++ b/A00_Common/line_stack_machine_ctl.ts @@ -16,10 +16,10 @@ * 「고침」 글 배지 없음(테두리로) · 칸 풍선 = 원래 값 · M01 기초(시스템 관리자) = ① 없음 → 기초 고침 = 「나」 * ========================================================================== */ -import { createButton, createIconButton, setUiDiff, type UiDiff } from "@ui/ui_template_button"; +import { createButton, createIconButton } from "@ui/ui_template_button"; import { eqText } from "@ui/ui_template_equation"; -import { el, showToast } from "@ui/ui_template_elements"; -import { createInputField, createSelectField } from "@ui/ui_template_input"; +import { el } from "@ui/ui_template_elements"; +import { createSelectField } from "@ui/ui_template_input"; import { varId, type FormulaDoc, type Link } from "../common_util/common_util_formula_doc"; import { WORK, workKey, type WorkCover } from "../common_util/common_util_formula_doc_work"; import type { DocAnswer } from "../common_util/common_util_formula_doc_calc"; @@ -28,7 +28,6 @@ import { defaultsOf, layeredCover, machineKey, - MINE, partsOf, putCover, rowEntry, @@ -38,7 +37,6 @@ import { type CrewRow, type CoverEntry, type MiscRow, - type Source, } from "../common_util/common_util_formula_doc_cover"; import { subInputs, type StackDoc } from "../common_util/common_util_line_stack"; import type { Picked } from "../common_util/common_util_line_stack_pick"; @@ -46,9 +44,9 @@ import { machineUnit } from "../common_util/common_util_line_stack_unit"; import { attachHost, workAt, workOfMachine } from "../common_util/common_util_line_stack_work"; import { sites, type WorkSpec } from "../common_util/common_util_formula_doc_work"; import { machineCellName } from "../common_util/common_util_machine_symbol_name"; -import { openFindPicker } from "../M02_MasterTemplete/M02_MasterTemplete_Find_Pick"; import { buildWorkGroup, putWork } from "./line_stack_machine_work"; -import { openStackPick } from "./line_stack_pick"; +import { openStackPick, type StackFind } from "./line_stack_pick"; +import { diffOf, markDiff, numBox } from "./line_stack_machine_cell"; import { lt } from "./line_stack_text"; export interface CtlHooks { @@ -69,22 +67,8 @@ export interface CtlHooks { work?: (machine: string) => WorkSpec[]; /** 848-3 ① 위 층 고침(SK 읽기 답 `위덮음` · M01 = 없음) */ upper?: Cover | null; -} - -/** 출처(848-3) — 나 · 위 층. 테두리는 나만(892) · 풍선(원래 값)은 둘 다 */ -export type DiffSrc = UiDiff | "upper"; -export const diffOf = (src: Source | undefined): DiffSrc | null => - src === undefined ? null : src === MINE ? "mine" : "upper"; - -/** 칸 묶음 안 입력 · 고르기 · 이름 단추에 「바뀜」 상태(나만) · 풍선(원래 값) */ -export function markDiff(box: HTMLElement, diff: DiffSrc | null, was?: string): void { - const own = ["ui-input", "ui-select", "ui-btn"].some((c) => box.classList.contains(c)); - const nodes = own ? [box] : ["ui-input", "ui-select", "lstk-res"].flatMap((c) => [...box.querySelectorAll(`.${c}`)]); // prettier-ignore - for (const n of nodes) { - setUiDiff(n, diff === "mine" ? "mine" : null); - if (diff && was !== undefined) - n.title = `${n.title ? `${n.title} — ` : ""}${lt("Ctl_Was")} ${was}`; - } + /** 856-4 찾아 넣기 창(페이지가 넘김) */ + find: StackFind; } const FUELS = ["경유", "휘발유", "실내등유"]; @@ -120,45 +104,6 @@ export function ctlOf(h: CtlHooks, link: Link | undefined, at?: number) { return { machine, sub, vals, base, up, top: upperOf(base, up), entry: coverOf(h.doc)[machine] }; } -const num = (t: string): number | null => { - const n = Number(t.trim().replace(/,/g, "")); - return t.trim() !== "" && Number.isFinite(n) ? n : null; -}; - -/** 수 칸 — 빈 글 = 원래대로(null) · 음수 · 글 = 알림 · 단위 = 칸 바로 뒤(공식 묶음 값 칸과 같은 자리 · 845-2 ㉥) */ -export function numBox( - label: string, - value: unknown, - unit: string, - ro: boolean, - set: (n: number | null) => void, - hint = "", -): HTMLElement { - const f = createInputField({ - value: value === undefined || value === null ? "" : String(value), - placeholder: hint, - compact: true, - size: 24, - }); - f.root.classList.add("lstk-f-s"); - f.input.setAttribute("aria-label", label); - f.input.title = label; - f.input.disabled = ro; - f.input.addEventListener("change", () => { - const t = f.input.value; - const n = num(t); - if (t.trim() === "") return set(null); - if (n === null || n < 0) { - f.input.value = value === undefined || value === null ? "" : String(value); - return void showToast(lt("Ctl_Bad"), "warning"); - } - set(n); - }); - return unit - ? el("span", { className: "lstk-qty", children: [f.root, el("span", { className: "lstk-unit", text: unit })] }) // prettier-ignore - : f.root; -} - const kind = (text: string): HTMLElement => el("span", { className: "lstk-kind", text }); /** 기계 제어 구역 — `link` = 그 기계 줄 단가 기호 연결 · `at` = 그 금액 줄 차례(작업량) */ @@ -243,7 +188,7 @@ export function buildMachineCtl( lt("K_인력"), crewName(r, i), ro, - () => openStackPick("인력", (p) => setCrew(swapAt(crew, i, { ...r, 키: p.키, 이름: p.이름 })), undefined, crewName(r, i)), // prettier-ignore + () => openStackPick(h.find, "인력", (p) => setCrew(swapAt(crew, i, { ...r, 키: p.키, 이름: p.이름 })), undefined, crewName(r, i)), // prettier-ignore [numBox(lt("Ctl_Crew_Qty"), r.인, lt("Ctl_Per_Day"), ro, (n) => setCrew(swapAt(crew, i, { ...r, 인: n ?? 0 })))], // prettier-ignore "노무비", () => setCrew(crew.filter((_, k) => k !== i)), @@ -265,7 +210,7 @@ export function buildMachineCtl( return [r.줄, fuel].filter(Boolean).join(" · "); }; const pickMat = (done: (p: Picked) => void, query: string): void => - openFindPicker({ + h.find({ layer: "system", owner: null, title: `${lt("Find_Title")} — ${lt("Ctl_Misc")}`, @@ -363,7 +308,9 @@ export function buildMachineCtl( lt("Ctl_Crew"), entry.조종원 !== undefined, () => - openStackPick("인력", (p) => setCrew([...crew, { 키: p.키, 이름: p.이름, 인: 1 }])), + openStackPick(h.find, "인력", (p) => + setCrew([...crew, { 키: p.키, 이름: p.이름, 인: 1 }]), + ), () => put({ ...entry, 조종원: undefined }), ro, ), diff --git a/A00_Common/line_stack_machine_sheet.ts b/A00_Common/line_stack_machine_sheet.ts index 015022972..73e4dc688 100644 --- a/A00_Common/line_stack_machine_sheet.ts +++ b/A00_Common/line_stack_machine_sheet.ts @@ -69,6 +69,7 @@ import { sheetWorkCard, sheetWorkOut, type SheetWorkOpts } from "./line_stack_ma import { buildOut } from "./line_stack_out"; import "./line_stack.css"; import "./line_stack_machine_sheet.css"; +import type { StackFind } from "./line_stack_pick"; export interface MachineSimilar { key: string; @@ -91,6 +92,8 @@ export interface MachineSheetOptions { findSimilar?: (q: string) => Promise; onSimilar?: (item: MachineSimilar) => void; onChange?: () => void; + /** 856-4 찾아 넣기 창(조종원 · 잡품 고르기 — 페이지가 넘김) */ + find: StackFind; } export interface MachineSheetState { @@ -287,6 +290,7 @@ export function createMachineSheet(o: MachineSheetOptions) { readOnly: ro, lists: () => engineVals(orig, mine), lock, + find: o.find, }, { ...link, 키: info.키 }, ); diff --git a/A00_Common/line_stack_machine_work.ts b/A00_Common/line_stack_machine_work.ts index bf7edda61..0f1bad65a 100644 --- a/A00_Common/line_stack_machine_work.ts +++ b/A00_Common/line_stack_machine_work.ts @@ -47,7 +47,7 @@ import type { Picked } from "../common_util/common_util_line_stack_pick"; import type { Values } from "../common_util/common_util_formula_doc_view"; import { varUnit } from "../common_util/common_util_line_stack_unit"; import { workUnit } from "../common_util/common_util_line_stack_work"; -import { diffOf, markDiff, numBox, type DiffSrc } from "./line_stack_machine_ctl"; +import { diffOf, markDiff, numBox, type DiffSrc } from "./line_stack_machine_cell"; import { lt } from "./line_stack_text"; import { workRows } from "./line_stack_work"; diff --git a/A00_Common/line_stack_material.ts b/A00_Common/line_stack_material.ts index a50317865..c14071c4f 100644 --- a/A00_Common/line_stack_material.ts +++ b/A00_Common/line_stack_material.ts @@ -12,7 +12,7 @@ import { showToast } from "@ui/ui_template_elements"; import { askConfirm } from "@ui/ui_template_modal"; import type { FormulaDoc } from "../common_util/common_util_formula_doc"; import type { Picked } from "../common_util/common_util_line_stack_pick"; -import { call, type Layer } from "../M02_MasterTemplete/M02_MasterTemplete_Api_Fetch"; +import { call, type Layer } from "../common_util/common_util_m02_call"; import { at } from "../M02_MasterTemplete/M02_MasterTemplete_Hopyo_Api"; import { placeNote } from "../M01_MasterData/M01_MasterData_Api_Fetch"; import type { MachineCtx } from "./line_stack_machine"; diff --git a/A00_Common/line_stack_pick.ts b/A00_Common/line_stack_pick.ts index c9db700a0..6e93a1deb 100644 --- a/A00_Common/line_stack_pick.ts +++ b/A00_Common/line_stack_pick.ts @@ -1,7 +1,8 @@ /* ============================================================================= * line_stack_pick.ts * 줄 쌓기 고르기 창(PLAN 804-3 · 804-4 · 요구 678-1 · 678-3 · 680-1 · 681) - * 찾아 넣기 = M02 [항목 추가] 창 그대로(`openFindPicker` · 탭 M01 전체 · 찾기 칸 · 표) — 줄 갈래마다 그 종류만 + * 찾아 넣기 = M02 [항목 추가] 창 그대로(`openFindPicker` · 탭 M01 전체 · 찾기 칸 · 표) — 줄 갈래마다 그 종류만 · + * 창은 페이지가 넘김(`StackFind` · 856-4 — 공용 화면은 M02 를 부르지 않음) * 인력(노임 LB) · 재료(자재 MT) · 기계(EQ → 시간당 경비 로직 + 기계='원문번호') · 다른 단가산출(M01 단가산출 로직) * 기계 + M02 개인 층(821-3) = 품셈 기계 위 「내 기계」 묶음 · 머리 [새 기계 만들기] — 고름 = 로직 + 기계='개인 EQP…' * 재료 + M02 개인 층(840-4) = M01 재료 위 「내 재료」 묶음 — 고름 = 요소 PM 키(M01 재료와 같은 꼴) @@ -22,11 +23,45 @@ import type { DocTable } from "../common_util/common_util_formula_doc_table"; import type { MoneyKind } from "../common_util/common_util_line_stack"; import type { Picked } from "../common_util/common_util_line_stack_pick"; import { showToast } from "@ui/ui_template_elements"; -import type { Layer } from "../M02_MasterTemplete/M02_MasterTemplete_Api_Fetch"; -import { openFindPicker, type FindKind } from "../M02_MasterTemplete/M02_MasterTemplete_Find_Pick"; +import type { Layer } from "../common_util/common_util_m02_call"; import { lt } from "./line_stack_text"; -const KINDS: Partial> = { +/** 찾아 넣기 종류 — logic = M01 단가산출 · 기초 · labor = 인력 · material = 재료 · machine = 기계 · oil = 유가 · sk = M02 단가산출 · pre = 일위대가 */ +export type StackFindKind = "logic" | "labor" | "material" | "machine" | "oil" | "sk" | "pre"; + +/** 고른 M01 요소 중 공용 화면이 읽는 칸 */ +interface FoundElement { + 코드: string; + 이름: string; + 규격: string; + 단위: string; + /** 기계(804-3) — 시간당 경비 로직 키 · 기종 원문번호 */ + 로직?: string; + 원문번호?: string; +} + +/** 찾아 넣기 창 옵션 — 공용 화면이 쓰는 칸만(M02 `FindPickOptions` 와 같은 뜻) */ +export interface StackFindOptions { + layer: Layer; + owner: string | null; + title?: string; + kinds?: StackFindKind[]; + query?: string; + /** 돈 아닌 기초(작업량 등 결과)만 */ + results?: boolean; + logic: (x: { 키: string; 이름: string; 결과단위: string }) => void; + ref?: (r: { 층: string; 주인: string | null; 키: string }) => void; + element?: (e: FoundElement) => void; + machine?: (e: FoundElement) => void; + oil?: (e: FoundElement) => void; + mine?: { owner: string | null }; + mineMat?: { owner: string | null }; +} + +/** 찾아 넣기 창(856-4) — 페이지가 넘김(M01 · M02 = M02 `openFindPicker`) */ +export type StackFind = (o: StackFindOptions) => void; + +const KINDS: Partial> = { 인력: "labor", 재료: "material", 기계: "machine", @@ -44,6 +79,7 @@ export interface StackTake { /** 찾아 넣기 — 고르면 `done(고른 것)` · 닫으면 아무것도 안 함 · `m02` 있고 다른 단가산출 = 복사해 펼침 · * `query` = 찾기 칸에 넣고 연 결과(이름 단추 · 요구 687-9) */ export function openStackPick( + find: StackFind, kind: MoneyKind, done: (p: Picked) => void, m02?: StackTake, @@ -53,7 +89,7 @@ export function openStackPick( if (!want) return; const spec = (e: { 규격: string }) => (e.규격 ? { 규격: e.규격 } : {}); const copy = kind === "단가산출" && m02 ? m02 : null; - openFindPicker({ + find({ layer: copy?.layer ?? "system", owner: copy?.owner ?? null, title: `${lt("Find_Title")} — ${lt(copy ? "K_복사" : (`K_${kind}` as never))}`, diff --git a/A00_Common/line_stack_rows.ts b/A00_Common/line_stack_rows.ts index 96cb3676c..d7a1d1548 100644 --- a/A00_Common/line_stack_rows.ts +++ b/A00_Common/line_stack_rows.ts @@ -45,7 +45,6 @@ import { tableAlias, } from "../common_util/common_util_line_stack_pick"; import { shownUnitOf, unitText } from "../common_util/common_util_line_stack_unit"; -import { openFindPicker } from "../M02_MasterTemplete/M02_MasterTemplete_Find_Pick"; import type { EditHooks } from "./line_stack_edit"; import { openTablePick } from "./line_stack_pick"; import { lt } from "./line_stack_text"; @@ -282,7 +281,7 @@ export function buildBlock( variant: "ghost", size: 24, onClick: () => - openFindPicker({ + h.find({ layer: "system", owner: null, title: lt("K_단가산출"), diff --git a/A00_Common/line_stack_screen.ts b/A00_Common/line_stack_screen.ts index 0fb1bbb6b..3db308cc7 100644 --- a/A00_Common/line_stack_screen.ts +++ b/A00_Common/line_stack_screen.ts @@ -70,7 +70,7 @@ import { hiddenByWork } from "./formula_doc_render"; import { ft } from "./formula_doc_text"; import { addTaken, type Taken } from "../common_util/common_util_line_stack_copy"; import { machineWork } from "../common_util/common_util_line_stack_work"; -import type { Layer } from "../M02_MasterTemplete/M02_MasterTemplete_Api_Fetch"; +import type { Layer } from "../common_util/common_util_m02_call"; import { applyDiff } from "./line_stack_diff"; import { buildEdit } from "./line_stack_edit"; import { openMachineWindow, type CopyAnswer, type MachineCtx } from "./line_stack_machine"; @@ -78,6 +78,7 @@ import { dropPath } from "../common_util/common_util_formula_doc_cover_drop"; import { buildOut } from "./line_stack_out"; import { lt } from "./line_stack_text"; import "./line_stack.css"; +import type { StackFind } from "./line_stack_pick"; export interface StackScreenOptions { /** 길 앞머리(`/m01/logic/doc`) — GET ?key · POST /preview · /save · /links */ @@ -94,6 +95,8 @@ export interface StackScreenOptions { tools?: HTMLElement; /** 저장 전 SK 문서(836-5 · 불러오기 미리 보기) — 빈 키일 때 이 문서를 서버가 읽어 줌(파일 안 읽음 · 안 씀) */ memory?: () => Record | null; + /** 856-4 찾아 넣기 창(M01 · M02 = M02 `openFindPicker`) — 공용 화면은 M02 를 부르지 않음 */ + find: StackFind; } type Docs = Record; @@ -408,6 +411,7 @@ export function createStackScreen(opt: StackScreenOptions) { ...(edit() || mem() ? [ buildEdit({ + find: opt.find, doc, answer, items, diff --git a/M01_MasterData/M01_MasterData_UI_LogicLab.ts b/M01_MasterData/M01_MasterData_UI_LogicLab.ts index d15e0934e..8571dce69 100644 --- a/M01_MasterData/M01_MasterData_UI_LogicLab.ts +++ b/M01_MasterData/M01_MasterData_UI_LogicLab.ts @@ -47,6 +47,7 @@ import { buildHeadBar } from "./M01_MasterData_UI_Head"; import { fetchSessionUser } from "../A06_Login/A06_Login_Api_Fetch"; import "./M01_MasterData_UI_Logic_Style.css"; import { createEmpty } from "@ui/ui_template_empty"; +import { openFindPicker } from "../M02_MasterTemplete/M02_MasterTemplete_Find_Pick"; /** 저장 안 한 로직 하나 — origKey null = 새 로직 · row null = 지움 */ interface Draft { @@ -99,6 +100,7 @@ export async function mountM01LogicLab( .catch(() => false); // 수식 = 줄 쌓기(804-2 · 804-6 옛 수식 문서 탭 걷음) — 수식 문서 · 캐시 m01_doc_drafts const stack = createStackScreen({ + find: openFindPicker, // 856-4 찾아 넣기 창(M02 창 · M01 전체 탭만) base: "/m01/logic/doc", admin, cache: "m01_doc_drafts", diff --git a/M01_MasterData/M01_MasterData_UI_LogicLab_Style.css b/M01_MasterData/M01_MasterData_UI_LogicLab_Style.css index 62c2c8b77..90ee00aa9 100644 --- a/M01_MasterData/M01_MasterData_UI_LogicLab_Style.css +++ b/M01_MasterData/M01_MasterData_UI_LogicLab_Style.css @@ -56,12 +56,6 @@ white-space: pre-wrap; } -.m01lab__total { - margin: var(--spacing-8) 0 0; - font-weight: 700; - text-align: right; -} - .m01lab__modal { overflow: auto; } @@ -148,69 +142,7 @@ overflow: auto; } -/* 737-1 맨 아래 한 줄 4 칸(노무비 · 재료비 · 경비 · 계) — 화면(모달) 바닥에 붙음 · 칸마다 이름 위 · 값 아래 */ -.m01lab__foot { - position: sticky; - bottom: 0; - z-index: 2; - display: grid; - grid-template-columns: repeat(4, minmax(0, 1fr)); - gap: var(--spacing-8); - margin-top: var(--m01lab-box-gap, var(--spacing-12)); - padding: var(--spacing-8) var(--spacing-12); - border: 1px solid var(--color-border); - border-radius: var(--radius-lg); - background: var(--color-surface-raised); -} - -/* 합계 줄이 화면 바닥에 붙으려면 메인 칸이 굴림 칸(overflow:auto)이 아니어야 함 — 메인은 높이가 안 묶여 안 굴렀음 */ -.ui-workflow-layout__main:has(.m01lab__foot) { - overflow: clip; -} - -.m01lab__sums { - display: contents; -} - -/* 748-3 텍스트 수식 바닥 줄 = 세 칸(계 칸 없음) */ -.m01lab__foot[data-cols="3"] { - grid-template-columns: repeat(3, minmax(0, 1fr)); -} - /* 748-3 비목 상자 사이 간격 = 바닥 고정 줄 위 여유(같은 값 · 두 보기) */ .m01-logic__editor { --m01lab-box-gap: var(--spacing-12); } - -.m01lab__foot .ui-calc-row { - display: flex; - flex-direction: column; - align-items: stretch; - gap: 0; - min-height: 0; -} - -.m01lab__foot .ui-calc-row > :empty { - display: none; -} - -.m01lab__foot .ui-calc-row__out { - padding: 0; - text-align: left; -} - -.m01lab__foot .m01lab__total { - display: flex; - flex-direction: column; - margin: 0; - text-align: left; -} - -.m01lab__foot .m01lab__total > :first-child { - color: var(--color-text-secondary); - font-weight: var(--font-weight-regular, 400); -} - -.m01lab__foot .m01lab__total > :last-child { - font-variant-numeric: tabular-nums; -} diff --git a/M01_MasterData/M01_MasterData_UI_LogicLab_Text.ts b/M01_MasterData/M01_MasterData_UI_LogicLab_Text.ts index 2d69c4105..3176231c2 100644 --- a/M01_MasterData/M01_MasterData_UI_LogicLab_Text.ts +++ b/M01_MasterData/M01_MasterData_UI_LogicLab_Text.ts @@ -22,7 +22,6 @@ const TEXT = { ], View_Equation: ["수식", "Equation"], Subtotal: ["소계", "Subtotal"], - Total: ["계", "Total"], Extra: ["덧줄", "Extra"], Col_Name: ["이름", "Name"], Col_Unit: ["단위", "Unit"], diff --git a/M01_MasterData/M01_MasterData_UI_MachineDetail.ts b/M01_MasterData/M01_MasterData_UI_MachineDetail.ts index 44f689d12..5955d09f4 100644 --- a/M01_MasterData/M01_MasterData_UI_MachineDetail.ts +++ b/M01_MasterData/M01_MasterData_UI_MachineDetail.ts @@ -32,6 +32,7 @@ import { type MachineUses, } from "./M01_MasterData_Machine_Api"; import type { Pick } from "./M01_MasterData_UI_Side"; +import { openFindPicker } from "../M02_MasterTemplete/M02_MasterTemplete_Find_Pick"; export interface MachineDetailOptions { target: string; @@ -105,6 +106,7 @@ async function build(host: HTMLElement, opts: MachineDetailOptions, alive: () => const notice = el("div"); const form = createMachineSheet({ + find: openFindPicker, // 856-4 orig: (orig ?? cur) as Row, cur, mine: false, diff --git a/M01_MasterData/M01_MasterData_UI_Parts.ts b/M01_MasterData/M01_MasterData_UI_Parts.ts index 246e44db2..5a9db6e44 100644 --- a/M01_MasterData/M01_MasterData_UI_Parts.ts +++ b/M01_MasterData/M01_MasterData_UI_Parts.ts @@ -15,6 +15,7 @@ import { currentLanguageIndex } from "@ui/ui_template_locale"; import { createText } from "@ui/ui_template_text"; import { createStackScreen } from "../A00_Common/line_stack_screen"; import type { Pick } from "./M01_MasterData_UI_Side"; +import { openFindPicker } from "../M02_MasterTemplete/M02_MasterTemplete_Find_Pick"; interface Part { 키: string; @@ -47,6 +48,7 @@ export function renderParts(host: HTMLElement, pick: Pick, openLogic: (key: stri /** 줄 쌓기 읽기 창 — 고침 없음 · [단가산출 기초에서 열기] = 수식 탭에서 고침 */ const show = (p: Part): void => { partsStack ??= createStackScreen({ + find: openFindPicker, // 856-4 base: "/m01/logic/doc", admin: false, cache: "m01_parts_view", diff --git a/M02_MasterTemplete/DataFlow/M02_DF_Api.ts b/M02_MasterTemplete/DataFlow/M02_DF_Api.ts index bad809f25..b04f0da09 100644 --- a/M02_MasterTemplete/DataFlow/M02_DF_Api.ts +++ b/M02_MasterTemplete/DataFlow/M02_DF_Api.ts @@ -1,23 +1,11 @@ /* ============================================================================= * M02_DF_Api.ts - * 단위 표준 표 읽기 — 서버 `GET /api/m02/df/standards`(`M02_DF_Router.py`) - * 부르는 곳 = 단위 고르기(`M02_DF_UnitPick`) · 옵션 기계 이름(`formula_doc_options`) + * 기계 이름 · 끈 기계 읽기 — 서버 `GET /api/m02/df/machine-names` · `machine-off`(`M02_DF_Router.py`) + * 부르는 곳 = 옵션 기계 이름(`formula_doc_options`) · 단위 표준 표 읽기는 단위 고르기(`ui_template_unit_pick`)로 옮김(856-4) * ========================================================================== */ import { API_BASE_URL } from "@config/config_frontend"; -/** 단위 표준 표 */ -export interface CfStandards { - unit: { 이름: string; 줄: Record[]; [k: string]: unknown }; - saved: boolean; -} - -export async function cfStandards(): Promise { - const response = await fetch(`${API_BASE_URL}/m02/df/standards`, { credentials: "include" }); - if (!response.ok) throw new Error(`표준 표 읽기 실패 (${response.status})`); - return (await response.json()) as CfStandards; -} - let machineNames: Promise> | null = null; /** 기계 원문번호 → 「이름 규격」 — 한 번 받아 둠(못 받으면 빈 표 · 다음에 다시) */ diff --git a/M02_MasterTemplete/M02_MasterTemplete_Api_Fetch.ts b/M02_MasterTemplete/M02_MasterTemplete_Api_Fetch.ts index 2ec735fed..ebb143f0c 100644 --- a/M02_MasterTemplete/M02_MasterTemplete_Api_Fetch.ts +++ b/M02_MasterTemplete/M02_MasterTemplete_Api_Fetch.ts @@ -3,10 +3,10 @@ * 마스터 템플릿 서버 호출 — 계약 `6_계약.md` 서버 길 · 시스템 층은 시스템 관리자만 * ========================================================================== */ -import { API_BASE_URL } from "@config/config_frontend"; +import { call, type Layer } from "../common_util/common_util_m02_call"; -/** 층 이름 — 서버와 같은 글 */ -export type Layer = "system" | "company" | "personal" | "project"; +// 층 이름 · `/api/m02` 부름 = 공용 조각(856-4 — 줄 쌓기 공용 화면도 씀) · 여기서 그대로 내보냄 +export { call, StaleError, type Layer } from "../common_util/common_util_m02_call"; /** 서버 종류 — 화면의 「표 양식」 = table · 「도면 양식」 = drawing · 「구조물 도면」 = structure · * 「면적산출」 = area(구조물집계표 열마다 한 통합문서) · * 「일위대가」 = labor(열마다 문서 · 39장) · @@ -31,42 +31,6 @@ export interface TemplateDoc { 문서: unknown; } -/** 서버가 판 불일치로 막았을 때 · `detail` = 서버 몸 그대로(729-3 `{까닭, 남은줄}`) */ -export class StaleError extends Error { - constructor( - message: string, - readonly detail?: unknown, - ) { - super(message); - } -} - -/** `/api/m02` 아래 길 부름 — 409 = StaleError · 그 밖 실패 = 서버 까닭 글(하위 폴더도 씀) */ -export async function call(path: string, init: RequestInit = {}): Promise { - const response = await fetch(`${API_BASE_URL}/m02${path}`, { - credentials: "include", - headers: { "Content-Type": "application/json" }, - ...init, - }); - const body = (await response.json().catch(() => ({}))) as { detail?: unknown } & T; - if (response.status === 409) - throw new StaleError(reason(body.detail, response.status), body.detail); - if (!response.ok) throw new Error(reason(body.detail, response.status)); - return body; -} - -/** 서버가 막은 까닭 그대로 — 문장 · `{errors: [...]}` · 입력 검사 목록(`[{msg}]`) */ -function reason(detail: unknown, status: number): string { - if (typeof detail === "string") return detail; - const why = (detail as { 까닭?: unknown } | null)?.까닭; - if (typeof why === "string") return why; - const list = Array.isArray(detail) ? detail : (detail as { errors?: unknown } | null)?.errors; - const lines = Array.isArray(list) - ? list.map((x) => (typeof x === "string" ? x : String((x as { msg?: unknown })?.msg ?? ""))) - : []; - return lines.filter(Boolean).join(" · ") || `HTTP ${status}`; -} - /** 지금 화면의 층 — 시스템 · 회사 · 개인 모두 `/layers/{층}` 아래(구조물집계표 · 조합 길 모두 · 읽기는 * 로그인 누구나 · 쓰기는 서버 층 권한 · 옛 `/api/m02/templates/*` 는 시스템 관리자 전용이라 안 씀) · * `owner` = 남의 층을 볼 때 주인(회사 `{C}` · 개인 `{C}/{U}` · 자기 층 = null · PLAN 27-1c) — diff --git a/M02_MasterTemplete/M02_MasterTemplete_Find_Pick.ts b/M02_MasterTemplete/M02_MasterTemplete_Find_Pick.ts index 45ebc0f92..70a6874b3 100644 --- a/M02_MasterTemplete/M02_MasterTemplete_Find_Pick.ts +++ b/M02_MasterTemplete/M02_MasterTemplete_Find_Pick.ts @@ -46,6 +46,7 @@ import { listLayerDocs, SANGEUN_KIND, type SangeunRow } from "./M02_MasterTemple import { logicHeads as heads } from "./logic/M02_Find_Heads"; import "../M01_MasterData/M01_MasterData_UI_Logic_Style.css"; // 창 겉틀 import "./M02_MasterTemplete_Labor.css"; +import type { StackFindKind } from "../A00_Common/line_stack_pick"; type Scope = Omit; type Tab = "m01" | "sk" | "pre"; @@ -66,7 +67,7 @@ export interface M01Element { } /** 고를 수 있는 종류 — logic = M01 단가산출 · 기초 로직 · labor = 인력 · material = 재료 · machine = 기계 · sk = M02 단가산출 · pre = 일위대가 */ -export type FindKind = "logic" | "labor" | "material" | "machine" | "oil" | "sk" | "pre"; +export type FindKind = StackFindKind; // 856-4 — 공용 줄 쌓기 창 종류와 한 벌 export interface FindPickOptions { layer: Layer; diff --git a/M02_MasterTemplete/M02_MasterTemplete_Hopyo_MatPick.ts b/M02_MasterTemplete/M02_MasterTemplete_Hopyo_MatPick.ts index e0187ecb4..871a88497 100644 --- a/M02_MasterTemplete/M02_MasterTemplete_Hopyo_MatPick.ts +++ b/M02_MasterTemplete/M02_MasterTemplete_Hopyo_MatPick.ts @@ -21,6 +21,7 @@ import { openStackPick } from "../A00_Common/line_stack_pick"; import { call } from "./M02_MasterTemplete_Api_Fetch"; import { at, type HopyoScope } from "./M02_MasterTemplete_Hopyo_Api"; import { placeNote } from "../M01_MasterData/M01_MasterData_Api_Fetch"; +import { openFindPicker } from "./M02_MasterTemplete_Find_Pick"; export interface MatCand { 키: string; @@ -120,6 +121,7 @@ export function createMatPick(opt: { scope: HopyoScope; key: string; target: Hop iconStart: "search", onClick: () => openStackPick( + openFindPicker, "재료", (p) => set(k, { 키: p.키, 이름: p.이름, 규격: p.규격 ?? "", 단위: p.단위 ?? "" }), undefined, diff --git a/M02_MasterTemplete/M02_MasterTemplete_Labor_Table.ts b/M02_MasterTemplete/M02_MasterTemplete_Labor_Table.ts index 8646e833f..cbddeba71 100644 --- a/M02_MasterTemplete/M02_MasterTemplete_Labor_Table.ts +++ b/M02_MasterTemplete/M02_MasterTemplete_Labor_Table.ts @@ -53,7 +53,7 @@ import { openMatModal, openRowModal } from "./M02_MasterTemplete_Labor_RowModal" import { tc } from "./M02_MasterTemplete_Labor_Text"; import { insideKeys } from "./M02_Labor_LogicMats_Model"; import { valueLine } from "./M02_Labor_Values_Model"; -import { createUnitPick, NO_UNIT } from "./DataFlow/M02_DF_UnitPick"; +import { createUnitPick, NO_UNIT } from "@ui/ui_template_unit_pick"; import { libMeta } from "./M02_MasterTemplete_Labor_LibMeta"; import "../M01_MasterData/M01_MasterData_UI_Logic_Style.css"; import "../M01_MasterData/M01_MasterData_UI_LogicLab_Style.css"; diff --git a/M02_MasterTemplete/M02_MasterTemplete_Sangeun_Tabs.ts b/M02_MasterTemplete/M02_MasterTemplete_Sangeun_Tabs.ts index 9cc07c8c6..47b618ffd 100644 --- a/M02_MasterTemplete/M02_MasterTemplete_Sangeun_Tabs.ts +++ b/M02_MasterTemplete/M02_MasterTemplete_Sangeun_Tabs.ts @@ -10,6 +10,7 @@ import { createStackScreen } from "../A00_Common/line_stack_screen"; import { el } from "@ui/ui_template_elements"; import type { Layer } from "./M02_MasterTemplete_Api_Fetch"; +import { openFindPicker } from "./M02_MasterTemplete_Find_Pick"; export interface SkEquationOptions { scope: { layer: Layer; owner: string | null }; @@ -48,6 +49,7 @@ export function createSangeunTabs(opt: SkEquationOptions): { } { const tools = el("span", { className: "m02-sk__tools", attrs: { "data-sk-tools": "" } }); // [단가 갱신] · [재생성](808-1) const stack = createStackScreen({ + find: openFindPicker, // 856-4 찾아 넣기 창 base: "", admin: opt.edit, cache: "m02_sk_doc_drafts", diff --git a/M02_MasterTemplete/M02_Material_Pick.ts b/M02_MasterTemplete/M02_Material_Pick.ts index f897cf044..c9eb8297c 100644 --- a/M02_MasterTemplete/M02_Material_Pick.ts +++ b/M02_MasterTemplete/M02_Material_Pick.ts @@ -12,7 +12,7 @@ import { createButton, createInputField, el, showToast } from "@ui/ui_template_e import { openModal } from "@ui/ui_template_modal"; import { searchMaterials } from "../M01_MasterData/M01_MasterData_Api_Fetch"; import { call } from "./M02_MasterTemplete_Api_Fetch"; -import { createUnitPick, NO_UNIT } from "./DataFlow/M02_DF_UnitPick"; +import { createUnitPick, NO_UNIT } from "@ui/ui_template_unit_pick"; import { createBadge } from "@ui/ui_template_badge"; import { createText } from "@ui/ui_template_text"; import { createEmpty } from "@ui/ui_template_empty"; diff --git a/M02_MasterTemplete/M02_MyMachine_Form.ts b/M02_MasterTemplete/M02_MyMachine_Form.ts index bdb9f5941..4a5b312b8 100644 --- a/M02_MasterTemplete/M02_MyMachine_Form.ts +++ b/M02_MasterTemplete/M02_MyMachine_Form.ts @@ -37,6 +37,7 @@ import { StaleError } from "./M02_MasterTemplete_Api_Fetch"; import { confirmMyMachineImpact } from "./M02_MyMachine_Impact"; import { mt } from "./M02_MyMachine_Text"; import "./M02_MyMachine.css"; +import { openFindPicker } from "./M02_MasterTemplete_Find_Pick"; export interface MyMachineFormOptions { owner: string | null; @@ -109,6 +110,7 @@ export async function mountMyMachineForm( let m01Same = false; const sheet = createMachineSheet({ + find: openFindPicker, // 856-4 orig: start, mine: true, readOnly: false, diff --git a/M02_MasterTemplete/M02_MyMaterial_View.ts b/M02_MasterTemplete/M02_MyMaterial_View.ts index 165178c89..7e92db159 100644 --- a/M02_MasterTemplete/M02_MyMaterial_View.ts +++ b/M02_MasterTemplete/M02_MyMaterial_View.ts @@ -12,7 +12,7 @@ import { createButton } from "@ui/ui_template_button"; import { createDataTable } from "@ui/ui_template_data_table"; import { createInputField, el, showConfirmDialog, showToast } from "@ui/ui_template_elements"; import { createText } from "@ui/ui_template_text"; -import { createUnitPick, NO_UNIT } from "./DataFlow/M02_DF_UnitPick"; +import { createUnitPick, NO_UNIT } from "@ui/ui_template_unit_pick"; import { addMyMaterial, dropMyMaterial, diff --git a/common_util/common_util_m02_call.ts b/common_util/common_util_m02_call.ts new file mode 100644 index 000000000..04053dbd4 --- /dev/null +++ b/common_util/common_util_m02_call.ts @@ -0,0 +1,47 @@ +/* ============================================================================= + * common_util_m02_call.ts + * M02 서버 길 부름(PLAN 856-4) — 층 이름 · `/api/m02` 아래 부름 한 함수 · 409 = 판 다름. + * M02 화면(`M02_MasterTemplete_Api_Fetch` 가 그대로 내보냄)과 공용 줄 쌓기 화면(`A00_Common/line_stack_*`)이 같이 씀 + * — 공용 화면이 M02 를 거꾸로 부르지 않게 + * ========================================================================== */ + +import { API_BASE_URL } from "@config/config_frontend"; + +/** 층 이름 — 서버와 같은 글 */ +export type Layer = "system" | "company" | "personal" | "project"; + +/** 서버가 판 불일치로 막았을 때 · `detail` = 서버 몸 그대로(729-3 `{까닭, 남은줄}`) */ +export class StaleError extends Error { + constructor( + message: string, + readonly detail?: unknown, + ) { + super(message); + } +} + +/** `/api/m02` 아래 길 부름 — 409 = StaleError · 그 밖 실패 = 서버 까닭 글(하위 폴더도 씀) */ +export async function call(path: string, init: RequestInit = {}): Promise { + const response = await fetch(`${API_BASE_URL}/m02${path}`, { + credentials: "include", + headers: { "Content-Type": "application/json" }, + ...init, + }); + const body = (await response.json().catch(() => ({}))) as { detail?: unknown } & T; + if (response.status === 409) + throw new StaleError(reason(body.detail, response.status), body.detail); + if (!response.ok) throw new Error(reason(body.detail, response.status)); + return body; +} + +/** 서버가 막은 까닭 그대로 — 문장 · `{errors: [...]}` · 입력 검사 목록(`[{msg}]`) */ +function reason(detail: unknown, status: number): string { + if (typeof detail === "string") return detail; + const why = (detail as { 까닭?: unknown } | null)?.까닭; + if (typeof why === "string") return why; + const list = Array.isArray(detail) ? detail : (detail as { errors?: unknown } | null)?.errors; + const lines = Array.isArray(list) + ? list.map((x) => (typeof x === "string" ? x : String((x as { msg?: unknown })?.msg ?? ""))) + : []; + return lines.filter(Boolean).join(" · ") || `HTTP ${status}`; +} diff --git a/resources/tester/helper_845_2_unit_show.cjs b/resources/tester/helper_845_2_unit_show.cjs index 733b5d592..03893f2d1 100644 --- a/resources/tester/helper_845_2_unit_show.cjs +++ b/resources/tester/helper_845_2_unit_show.cjs @@ -213,7 +213,7 @@ const noop = () => undefined; const load = makeLoader({ katex: { render: (t, box) => (box.tex = t) }, formula_doc_options: { machineText: () => null, optionText: (x) => x, liveOptions: (l) => l, nameMachines: noop }, - M02_DF_UnitPick: { + ui_template_unit_pick: { NO_UNIT: "(단위 없음)", createUnitPick: (o) => Object.assign(new FakeNode("select"), { value: o.value }), }, diff --git a/resources/tester/helper_856_0_sk_screen.cjs b/resources/tester/helper_856_0_sk_screen.cjs index ed636c290..3cb4c1ce2 100644 --- a/resources/tester/helper_856_0_sk_screen.cjs +++ b/resources/tester/helper_856_0_sk_screen.cjs @@ -198,7 +198,7 @@ const stubs = { M02_MasterTemplete_Labor_Grid: { laborBlock: (cur) => ({ lines: cur.담은로직.map(() => ({ note: "", amounts: { sum: 1 } })) }), }, - M02_DF_UnitPick: { createUnitPick: () => box("div"), NO_UNIT: "-" }, + ui_template_unit_pick: { createUnitPick: () => box("div"), NO_UNIT: "-" }, M02_MasterTemplete_Labor_Unlinked: { unlinkedBar: () => null }, M02_MasterTemplete_Labor_Text: { tc: (k) => k }, M02_MasterTemplete_Labor_LibMeta: { libMeta: () => [] }, diff --git a/resources/tester/test_721_find_pick.py b/resources/tester/test_721_find_pick.py index f0004d1df..a3f8bdd86 100644 --- a/resources/tester/test_721_find_pick.py +++ b/resources/tester/test_721_find_pick.py @@ -121,7 +121,6 @@ def test_736_1_항목_추가_찾기_창_하나(): assert "material: lib.material," in pick find = _text(M02 / "M02_MasterTemplete_Find_Pick.ts") assert 'kind === "재료" && opt.material' in find and "? opt.material" in find - assert '"logic" | "labor" | "material" | "machine" | "oil" | "sk" | "pre"' in find # 785-3 oil def test_736_2_빠진_길_둘_신규_자재_기계_탭(): diff --git a/resources/tester/test_737_option_grid_foot.py b/resources/tester/test_737_option_grid_foot.py index a7961ddf3..a3aba2396 100644 --- a/resources/tester/test_737_option_grid_foot.py +++ b/resources/tester/test_737_option_grid_foot.py @@ -4,9 +4,7 @@ import re from pathlib import Path ROOT = Path(__file__).resolve().parents[2] -M01 = ROOT / "M01_MasterData" SHEET_CSS = (ROOT / "A00_Common" / "calc_sheet.css").read_text(encoding="utf-8") -STYLE = (M01 / "M01_MasterData_UI_LogicLab_Style.css").read_text(encoding="utf-8") def test_옵션_격자_폭_따라_6_4_3_2_1(): @@ -18,12 +16,3 @@ def test_옵션_격자_폭_따라_6_4_3_2_1(): assert "container-type: inline-size" in SHEET_CSS # 창 폭이 아니라 상자 폭 기준 -def test_합계_한_줄_바닥_고정(): - foot = STYLE[STYLE.index(".m01lab__foot {") :] - foot = foot[: foot.index("}")] - assert "position: sticky" in foot and "bottom: 0" in foot - assert "repeat(4, minmax(0, 1fr))" in foot - assert "overflow: clip" in STYLE # 메인 칸이 굴림 칸이면 바닥에 안 붙음 - foot_ts = (M01 / "M01_MasterData_UI_LogicLab_Foot.ts").read_text(encoding="utf-8") - assert 'className: "m01lab__foot"' in foot_ts # 748-3 두 보기가 같은 바닥 줄 부품 - assert 'data-cols="3"' in STYLE diff --git a/resources/tester/test_804_7_line_stack_fix.py b/resources/tester/test_804_7_line_stack_fix.py index d03a712e2..e90adcd4b 100644 --- a/resources/tester/test_804_7_line_stack_fix.py +++ b/resources/tester/test_804_7_line_stack_fix.py @@ -177,7 +177,7 @@ def test_요소키_기호_이름_0_전수() -> None: def test_단위_고르기_공용_친글() -> None: edit = _src("A00_Common/line_stack_edit.ts") assert "createUnitPick({" in edit and "free: true," in edit - pick = _src("M02_MasterTemplete/DataFlow/M02_DF_UnitPick.ts") + pick = _src("ui_template/ui_template_unit_pick.ts") assert "if (opts.free && typed && !all.includes(typed)) shown.push(typed);" in pick main = _src("main.py") at = main.index("M02_MasterTemplete.DataFlow.M02_DF_Router") @@ -275,7 +275,7 @@ def test_단위표_더한_단위_문서_전수() -> None: assert len(lines) > 5000 missing = {u for u in lines if u and same.get(u, u) not in units} assert not missing, missing - pick = _src("M02_MasterTemplete/DataFlow/M02_DF_UnitPick.ts") + pick = _src("ui_template/ui_template_unit_pick.ts") assert ( '...(table["더한 단위"] ?? []),' in pick and '(u && table["같은 단위"]?.[u]) || u' in pick ) diff --git a/resources/tester/ui_checks/51-5_단위단추_크기.js b/resources/tester/ui_checks/51-5_단위단추_크기.js index 9fd87f7d3..f5760dbeb 100644 --- a/resources/tester/ui_checks/51-5_단위단추_크기.js +++ b/resources/tester/ui_checks/51-5_단위단추_크기.js @@ -1,4 +1,4 @@ -/* 51-5 — 단위 고르기 단추(공용 M02_DF_UnitPick) 높이 · 글자 = [저장] 단추와 같음 +/* 51-5 — 단위 고르기 단추(공용 ui_template_unit_pick) 높이 · 글자 = [저장] 단추와 같음 * 시작 화면: M02 마스터 템플릿 · 마스터 층(#/m02-master-template?open=구조물조합&root=master) · 시스템 관리자 * 부르는 법: orca eval --expression "$(tr '\n' ' ' < 이 파일)" (async 식 · JSON 글을 돌려줌) * 하는 일: item1 → 일위대가 [수정] 상세 → 단위 단추 · [저장] 단추 높이 · 글자 크기 잼 diff --git a/ui_template/ui_template_unit_pick.ts b/ui_template/ui_template_unit_pick.ts index 74492291e..aa4ffb249 100644 --- a/ui_template/ui_template_unit_pick.ts +++ b/ui_template/ui_template_unit_pick.ts @@ -1,6 +1,6 @@ /* ============================================================================= - * M02_DF_UnitPick.ts - * 단가산출 흐름도 공용 단위 고르기 — 치면 걸러진 목록 · 고르기만(손글 안 받음 · `free` = 목록에 없는 친 글도 씀) · 「-」 = 없음 + * ui_template_unit_pick.ts + * 공용 단위 고르기(856-4 — 옛 M02 `DataFlow/M02_DF_UnitPick`) — 치면 걸러진 목록 · 고르기만(손글 안 받음 · `free` = 목록에 없는 친 글도 씀) · 「-」 = 없음 * 목록 = 단위 표준(산림품셈 1-2-2) 단위 + 표의 「더한 단위」(수식 문서 줄 단위) + 부른 쪽이 주는 마스터 결과단위 등 + 원 · 「같은 단위」(kg → ㎏) 는 하나만 * 표준 표 읽는 길은 `setUnitSource` 로 바꿔 끼움(기본 = 서버 /standards) — 다른 판도 이것을 씀 * 글 [한, 영] 짝은 아래 TEXT @@ -9,8 +9,8 @@ import { currentLanguageIndex } from "@ui/ui_template_locale"; import { createButton, el } from "@ui/ui_template_elements"; import type { UiSize } from "@ui/ui_template_button"; -import { cfStandards } from "./M02_DF_Api"; -import "./M02_DF_UnitPick.css"; +import { API_BASE_URL } from "@config/config_frontend"; +import "./ui_template_unit_pick.css"; import { createEmpty } from "@ui/ui_template_empty"; import "@ui/ui_template_list_row.css"; @@ -22,6 +22,18 @@ const TEXT = { Pick: ["단위 고르기", "Pick a unit"], } as const; +/** 단위 표준 표 */ +interface CfStandards { + unit: { 이름: string; 줄: Record[]; [k: string]: unknown }; + saved: boolean; +} + +async function cfStandards(): Promise { + const response = await fetch(`${API_BASE_URL}/m02/df/standards`, { credentials: "include" }); + if (!response.ok) throw new Error(`표준 표 읽기 실패 (${response.status})`); + return (await response.json()) as CfStandards; +} + const tu = (key: keyof typeof TEXT): string => TEXT[key][currentLanguageIndex === 1 ? 1 : 0]; /** 「없음」 을 뜻하는 단위 글 */ From 6dd8856ea1afb3aa05cdbb20dc28f051d2aa262e Mon Sep 17 00:00:00 2001 From: umsangdon Date: Tue, 17 Nov 2026 21:10:36 +0900 Subject: [PATCH 29/30] =?UTF-8?q?refactor(855-2-C3):=20=EA=B0=80=EC=A0=B8?= =?UTF-8?q?=EC=98=A8=20=EC=8B=9D=20=EA=B2=80=EC=82=B0=20=3D=20=EB=AC=B8?= =?UTF-8?q?=EC=84=9C=20=EA=B3=84=EC=82=B0=EA=B8=B0=20=E2=80=94=20=EC=98=9B?= =?UTF-8?q?=20=EC=97=94=EC=A7=84(Sangeun=5FCalc.run=20=C2=B7=20mf.run=20?= =?UTF-8?q?=C2=B7=20mcut)=20=EC=95=88=20=EB=8F=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - check: 가져온 줄(엑셀 단가 · 고침 없음)을 줄 차례 그대로 문서로(`_doc_of` — 변환기 · 다듬기 없음) → `Doc_Import.run`(엑셀 판) 셈 · 1 단위 = 문서 셈 ÷ 배(`ratio_of` · 옛 `1단위` 와 같음) - 줄 맞댐 열쇠 = 줄 정체 cid(글줄 `자리` · `_named`) ↔ 검산 문서 금액 줄 같은 차례 · `mid:이름` = 그 중간 변수 값 · `단계:이름` = 문서 단계 계 · 빈 산근 = 0 원 - 안쪽 산근 줄 = 형제 SK 연결(부르는 쪽 단가기준 · `Doc_Import.Links` 문서 셈) — 옛 `_inner`(엔진 날 셈 · Expand) 지움 - `_run` 은 `to_price`(전 · 후 1 단위 = SK 셈 한 길 · 2-C1 몫)만 씀 - 전후 대조(불러오기 블록 전수 3,241): 검산 판정 · 합계 · 글줄마다 판정 · 셈 값 다름 0 · 예외 0 · test_857_import_golden 전수 · test_812_1 전수 같음 Co-Authored-By: Claude Opus 5.5 --- M02_MasterTemplete/M02_Sangeun_Imported.py | 114 ++++++++++++++++----- 1 file changed, 86 insertions(+), 28 deletions(-) diff --git a/M02_MasterTemplete/M02_Sangeun_Imported.py b/M02_MasterTemplete/M02_Sangeun_Imported.py index 951f94479..b9d9ff5e4 100644 --- a/M02_MasterTemplete/M02_Sangeun_Imported.py +++ b/M02_MasterTemplete/M02_Sangeun_Imported.py @@ -343,7 +343,54 @@ def _json(value: Any) -> Any: return labor._json(value) +class _One: + """M01 색인 위에 가져온 줄 하나 — `logic(키)` 만 가로챔(문서 변환 색인 · 그 밖 그대로).""" + + def __init__(self, whole: Any, key: str, row: dict) -> None: + self._whole, self._key, self._row = whole, key, row + + def logic(self, ref: str) -> dict: + return self._row if ref == self._key else self._whole.logic(ref) + + def __getattr__(self, name: str) -> Any: + return getattr(self._whole, name) + + +def _doc_of(bare: dict, whole: Any) -> tuple[dict, list[str], dict]: + """검산 문서(855 2-C3) — 가져온 줄(엑셀 단가 · 고침 없음)을 줄 차례 그대로 문서로(다듬기 없음 · + 금액 줄 k = 줄 정체 k) · 안쪽 산근 줄 = 형제 SK 연결(문서 셈 · 부르는 쪽 단가기준) → + (문서, 줄 정체, {중간 이름: 기호}).""" + from M02_MasterTemplete import M02_Doc_Copy as dc + + key = str(bare.get("키") or "SK-000000") + row = {**row_of(bare), "키": key} + row["호표"] = [dict(x) for x in row["호표"]] + for item in row["호표"]: # 형제 SK 줄 = 아래에서 연결로 갈음 — 변환 자리값 + if item.get("참조") and item.get("값묶음") is None: + item["값묶음"] = dict.fromkeys(COSTS, Decimal(0)) + master = _One(whole, key, row) + doc, _ = dc.cv.convert(master, row, dc.given_of(master, key, bare.get("입력값"))) + by = {dc.md.var_id(v): v for v in doc.get("변수") or []} + for item, line in zip(row["호표"], doc.get("금액") or []): + var = by.get(str(line.get("단가") or "").removesuffix(".계")) + if not item.get("참조") or var is None: + continue + ref = item["참조"] + link = { + "갈래": "단가산출", + "키": ref["키"], + "참조": {"층": ref["층"], "주인": ref.get("주인")}, + } + if item.get("참조비목") in COSTS: # 안쪽 산근의 그 비목만(`Doc_Import._attach` 와 같음) + link["칸"] = item["참조비목"] + line["단가"], line["비목"] = dc.md.var_id(var), item["참조비목"] + var["연결"] = link + mids = {str(v.get("열쇠")): dc.md.var_id(v) for v in doc.get("변수") or []} + return doc, sd.line_ids(row), mids + + def _run(doc: dict, whole: Any) -> dict: + """SK 셈(`to_price` 전 · 후 1 단위) — `Sangeun_Calc.run` 한 길(2-C1 몫 · 검산은 `_doc_of`).""" from M02_MasterTemplete import M02_Sangeun_Calc as calc return calc.run(sd.clean(doc, None, whole), whole) @@ -366,8 +413,13 @@ def _same(mine: Any, excel: Any) -> bool: def check(doc: dict, whole: Any = None) -> dict[str, Any]: - """검산 — 가져온 줄(엑셀 단가 · 고침 없음)을 엔진으로 다시 셈 → 엑셀 금액 · 줄마다 맞댐 · - 못 셈 = {같음 False, 까닭}.""" + """검산 — 가져온 줄(엑셀 단가 · 고침 없음)을 문서 계산기로 다시 셈(855 2-C3 · 옛 엔진 안 돎) → + 엑셀 금액 · 글줄마다 맞댐(글줄 `자리` = 줄 정체 cid ↔ 검산 문서 금액 줄 같은 차례 · `mid:이름` = + 중간 변수 값 · `단계:이름` = 단계 계) · 못 셈 = {같음 False, 까닭}.""" + from M02_MasterTemplete import M02_Doc_Copy as dc + from M02_MasterTemplete import M02_Doc_Import as dim + from M02_MasterTemplete import M02_Sangeun_Calc as calc + whole = whole or _whole() meta = doc[KEY] bare = {k: doc.get(k) for k in ("키", "이름", "단위", "입력값", "환산")} @@ -375,17 +427,45 @@ def check(doc: dict, whole: Any = None) -> dict[str, Any]: src = meta.get("원본") or {} excel = src.get("엑셀금액") or {} try: - got = _run(bare, whole) + bare = sd.clean(bare, None, whole) + times = calc.ratio_of(bare, row_of(bare), whole) # 1 단위 = 문서 셈 ÷ 배(옛 `1단위`) except sd.DocError as e: return {"같음": False, "까닭": str(e), "셈": None, "엑셀": excel, "줄": []} - mine = _money(got) - now = {x.get("cid"): x.get("금액") for x in got.get("줄") or []} | _inner(bare, whole) + try: + mine_doc, ids, mids = _doc_of(bare, whole) + got = dim.run(mine_doc, bare, whole) + except Exception as e: # noqa: BLE001 — 변환 · 셈 틀림 = 맞댈 값 없음 + got, ids, mids, mine_doc = {"셈됨": False, "까닭": str(e)}, [], {}, None + money = dc.money(got) if got.get("셈됨") else None + if ( + money is None + and mine_doc is not None + and not (mine_doc.get("금액") or mine_doc.get("결과")) + ): + money = dict.fromkeys(dc.COSTS, Decimal(0)) # 빈 산근 = 엑셀 0 원(줄 없음 합) + mine = {k: Decimal(str(v)) / times for k, v in money.items()} if money else None + now = {cid: x.get("금액") for cid, x in zip(ids, got.get("줄") or [])} + values = got.get("값") or {} + now |= {f"mid:{k}": values[v] for k, v in mids.items() if isinstance(values.get(v), Decimal)} + steps = got.get("단계") or {} + steps = ( + steps + if isinstance(steps, dict) + else {x.get("이름"): x for x in steps if isinstance(x, dict)} + ) + now |= {f"단계:{k}": (v or {}).get("계") for k, v in steps.items()} group = _groups(src.get("글줄")) lines = [x for x in (_compare(one, now, group=group) for one in src.get("글줄") or []) if x] ok = bool(mine) and excel != {} and _all_same(mine, excel) rate = (src.get("계약") or {}).get("낙찰률") ok = ok or bool(mine and rate and excel and _all_same(_contract(mine, rate), excel)) - why = None if ok else (got.get("까닭") or ("엑셀 금액 없음" if not excel else "금액 다름")) + why = ( + None + if ok + else ( + (dc.why(got) if not money else "") or ("엑셀 금액 없음" if not excel else "금액 다름") + ) + ) ok = ok and all(x["같음"] for x in lines) return _json({"같음": ok, "까닭": why, "셈": mine, "엑셀": excel, "줄": lines}) @@ -403,28 +483,6 @@ def _contract(mine: dict, rate: float) -> dict: return out | {"계": sum(out.values())} -def _inner(doc: dict, whole: Any) -> dict: - """엔진 날 셈의 중간 `mid:이름` · 단계 `단계:이름` 계(검산 맞댈 값) · 못 셈 = 빈.""" - from M02_MasterTemplete import M02_Sangeun_Calc as calc - - m01, key = calc.labor.m01, str(doc.get("키") or "SK-000000") - row = {**row_of(doc), "키": key} - if any(x.get("참조") for x in row["호표"]): # 안쪽 산근 값 채움(797-1 · 셈 길과 같음) - from M02_MasterTemplete.M02_Labor_Expand import Expand - - row["호표"] = [dict(x) for x in row["호표"]] - calc._bundles(row, whole, Expand(whole), ()) - over = calc._Over(whole, key, row) - try: - auto = {k: v for k, v in m01.mau.values(over, over.logic(key)).items() if v is not None} - given = {**auto, **m01._dec(doc.get("입력값") or {})} - got = calc.labor.mcut.engine(over, key, m01.cm.mf.run(over, key, given)) - except Exception: # noqa: BLE001 — 엔진 FormulaError · 셈 틀림 = 맞댈 값 없음 - return {} - out = {f"mid:{k}": v for k, v in (got.get("중간") or {}).items()} - return out | {f"단계:{x.get('이름')}": x.get("계") for x in got.get("단계") or []} - - def _groups(texts: Any) -> dict[str, Decimal]: """첫 자리가 같은 값 든 글줄 여럿 → 첫 자리별 값 합(814-1 기계 노 · 재 · 경 세 글줄 = 묶은 한 줄 · 노 줄만 딸린 기계까지 자리들).""" From 846ef519da65535f9b543f4aefc4596a4e5ef967 Mon Sep 17 00:00:00 2001 From: umsangdon Date: Tue, 17 Nov 2026 21:28:53 +0900 Subject: [PATCH 30/30] =?UTF-8?q?test(854-4):=20=EB=8A=90=EB=A6=B0=20?= =?UTF-8?q?=EC=A0=84=EC=88=98=20=EC=8B=9C=ED=97=98=20=E2=80=94=20=EA=B8=B0?= =?UTF-8?q?=EB=B3=B8=20=3D=20=ED=91=9C=EB=B3=B8=20=C2=B7=20=EC=A0=84?= =?UTF-8?q?=EC=88=98=20=3D=20AISLO=5FTEST=5FALL=3D1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 새 `helper_test_all.py` — `ALL`(AISLO_TEST_ALL · 옛 S855_ALL · S8121_ALL 같은 뜻) · `spread`(차례 고르게 n · 처음 · 끝 포함) · 표본은 전수의 부분 - 812-3 · 810-2 · 810-3 원파일 블록 = 파일마다 고르게(8 · 812-3 은 4 · 큰 파일 1/50 · main 1,569 → 31) · 801-3 = 호표 로직 600 · m01_text 「모든 로직」 둘 = 400 · 800-1 기호 한글 · 겹침 = 600 · 826-2 저장 검사 = 갈래마다 아홉 · 855-golden = 300(빠짐 · 새 키는 전수에서) - 855-engine-parity · 812-1 은 같은 스위치로 - 새 `tools/full_sweep_tests.txt` — 전수 한 번에 도는 목록 · 명령은 머리 줄 - 기본 시간(혼자 · 다른 창 같이 돎): 812-3 1,450 → 74 초 · 810-2 917 → 103 · 810-3 646 → 62 · 801-3 75 → 58 · 855-golden 95 → 37 · 826-2 160 → 88 · m01_text 361 → 194 · 전수(AISLO_TEST_ALL=1) 열 파일 모두 초록 Co-Authored-By: Claude Opus 5.5 --- resources/tester/helper_test_all.py | 20 ++++++++ resources/tester/test_800_1_var_symbols.py | 4 +- resources/tester/test_801_3_groups.py | 49 +++++++++++--------- resources/tester/test_810_2_native_doc.py | 10 +++- resources/tester/test_810_3_native_screen.py | 3 +- resources/tester/test_812_1_xlsx_golden.py | 5 +- resources/tester/test_812_3_native_layout.py | 3 +- resources/tester/test_826_2_machine_files.py | 18 +++++++ resources/tester/test_855_engine_parity.py | 7 +-- resources/tester/test_855_golden.py | 15 ++++-- resources/tester/test_m01_text.py | 37 +++++++-------- tools/full_sweep_tests.txt | 13 ++++++ 12 files changed, 127 insertions(+), 57 deletions(-) create mode 100644 resources/tester/helper_test_all.py create mode 100644 tools/full_sweep_tests.txt diff --git a/resources/tester/helper_test_all.py b/resources/tester/helper_test_all.py new file mode 100644 index 000000000..35ddc3ac7 --- /dev/null +++ b/resources/tester/helper_test_all.py @@ -0,0 +1,20 @@ +"""시험 표본 · 전수 한 벌 — 기본 = 표본(파일마다 60 초 안쪽) · 전수 = 환경 `AISLO_TEST_ALL=1`. + +옛 이름 `S855_ALL=1` · `S8121_ALL=1` 도 같은 뜻. 전수 한 번에 = `tools/full_sweep_tests.txt` 머리 명령. +표본은 전수의 부분 — 표본에서 실패하는 것은 전수에서도 실패. +""" + +from __future__ import annotations + +import os + +ALL = any(os.environ.get(k) == "1" for k in ("AISLO_TEST_ALL", "S855_ALL", "S8121_ALL")) + + +def spread(items, n: int) -> list: + """전수면 그대로 · 아니면 차례 고르게 n 개(처음 · 끝 포함 · 차례 유지).""" + items = list(items) + if ALL or len(items) <= n: + return items + step = (len(items) - 1) / (n - 1) + return [items[round(i * step)] for i in range(n)] diff --git a/resources/tester/test_800_1_var_symbols.py b/resources/tester/test_800_1_var_symbols.py index 04646b351..02c7239a1 100644 --- a/resources/tester/test_800_1_var_symbols.py +++ b/resources/tester/test_800_1_var_symbols.py @@ -2,6 +2,7 @@ ① 규칙(`master_symbol.rule`) 표본 — 끝말 → 머리글자 · 아래첨자 · 갈래별(찾기 위 「표」 · 요소 · 합 · 결과). ② 입력 · 중간 변수 — 기호에 한글 0 · 한 로직 안 겹침 0 · 같은 이름 같은 기호(원문 796-3 제외). + (한글 0 · 겹침 0 = 기본 로직 차례 고르게 600 · 전수 = `AISLO_TEST_ALL=1`) ③ 빌더 — 채운 정본에 쓸 것 없음 · 채운 것을 걷으면 같은 수만큼 다시 채움. ④ 수식 내보내기 — 표본 로직 전 변수 기호에 한글 0(찾기 · 요소 · 합 · 결과 포함) · 한 로직 안 겹침 없음. ⑤ 보이기만 — 변수표를 걷어도 엔진 셈 · 끝수 지문 같음(금액 전후 같음). @@ -17,6 +18,7 @@ import re from functools import lru_cache import pytest +from helper_test_all import spread from M01_MasterData import M01_MasterData_Store as store @@ -63,7 +65,7 @@ def test_규칙_표본(): def test_기호에_한글_0_한_로직_겹침_0(): - for r in logic_rows(): + for r in spread(logic_rows(), 600): seen: dict[str, str] = {} for v in meq.table(r): assert not HAN.search(v["기호"]), (r["키"], v["열쇠"], v["기호"]) diff --git a/resources/tester/test_801_3_groups.py b/resources/tester/test_801_3_groups.py index 6d9c3f8ac..8d92722d4 100644 --- a/resources/tester/test_801_3_groups.py +++ b/resources/tester/test_801_3_groups.py @@ -2,6 +2,7 @@ ① 묶음 = 부른 단가산출(갈래 블록) 하나씩 + 직접 줄 한 묶음(갈래 직접) · 돈 없는 줄 = 묶음 아님 · 안쪽 말 0 ② M01 전수 — 묶음 합 + 끝수 = 합계(엔진 비목 합 그대로) · 직접 묶음 하나뿐 + (기본 = 호표 로직 키 차례 고르게 600 · 전수 = `AISLO_TEST_ALL=1`) ③ 부품 — 묶음 하나 = 머리 없음 · 계 / 둘 이상 = 머리 · 소계 / 단가산출 둘 이상 = 합계 · 안쪽 말 글 0 """ @@ -11,6 +12,8 @@ import importlib from decimal import Decimal as D from pathlib import Path +from helper_test_all import spread + from M01_MasterData import M01_MasterData_Store as store mf = importlib.import_module("master_formula") @@ -78,29 +81,31 @@ def test_거푸집_한_묶음_굴착기_한_묶음(): def test_M01_전수_묶음_합_끝수_합계_안쪽_말_0(): w = _w() many = seen = 0 - for tid, rows in sorted(w.index.items()): - if mf.mk.GROUP_OF.get(tid) != "로직": + keys = [ + logic["키"] + for tid, rows in sorted(w.index.items()) + if mf.mk.GROUP_OF.get(tid) == "로직" + for logic in rows.values() + if logic.get("호표") + ] + for key in spread(keys, 600): + try: + eq = _export(key) + except mf.FormulaError: continue - for logic in rows.values(): - if not logic.get("호표"): - continue - try: - eq = _export(logic["키"]) - except mf.FormulaError: - continue - sub = eq.get("소계") - if not sub: - continue - seen += 1 - lines = sub["줄"] - assert sum(r["갈래"] == "직접" for r in lines) <= 1, logic["키"] - assert all(r["계"] != 0 for r in lines), logic["키"] - for r in lines: - assert not any(b in r["이름"] for b in BAD), (logic["키"], r["이름"]) - for k in COSTS: - got = sum((r[k] for r in lines), D(0)) + sub["끝수"][k] - assert got == eq["합계"][k], (logic["키"], k) - many += sum(r["갈래"] == "블록" for r in lines) >= 2 + sub = eq.get("소계") + if not sub: + continue + seen += 1 + lines = sub["줄"] + assert sum(r["갈래"] == "직접" for r in lines) <= 1, key + assert all(r["계"] != 0 for r in lines), key + for r in lines: + assert not any(b in r["이름"] for b in BAD), (key, r["이름"]) + for k in COSTS: + got = sum((r[k] for r in lines), D(0)) + sub["끝수"][k] + assert got == eq["합계"][k], (key, k) + many += sum(r["갈래"] == "블록" for r in lines) >= 2 assert seen > 400 and many >= 10, (seen, many) diff --git a/resources/tester/test_810_2_native_doc.py b/resources/tester/test_810_2_native_doc.py index 9c7ce5473..71bf0d72e 100644 --- a/resources/tester/test_810_2_native_doc.py +++ b/resources/tester/test_810_2_native_doc.py @@ -9,6 +9,7 @@ (d) 올림 길(814-1 파일 하나) — 원파일 = 새 HP(단가산출표 판 · 일위대가 없음 · 엑셀 HP 에 안 붙음) · 가져온 식 = 원파일 · 엑셀 HP = 엑셀 길 그대로 원파일 · 실무 엑셀 없으면 그 시험만 skip(다른 PC). +표본(기본) = 원파일마다 블록 차례 고르게 8 개 이상(큰 파일 = 1/50 · main 1,569 → 31) · 전수 = `AISLO_TEST_ALL=1`. """ from __future__ import annotations @@ -28,6 +29,7 @@ for p in (ROOT, HERE): sys.path.insert(0, str(p)) import helper_m02_hopyo_golden as golden # noqa: E402 +from helper_test_all import spread # noqa: E402 from test_810_1_estx import FILES as EST # noqa: E402 from test_810_1_stc import FILES as STC # noqa: E402 @@ -62,6 +64,12 @@ def whole(): return imp._whole() +def picked(saved: dict, few: int = 8) -> dict: + """산근 블록 표본(번 → 블록) — 원파일마다 차례 고르게 · 전수 = AISLO_TEST_ALL=1.""" + nums = fn.numbers(saved) + return {no: nums[no] for no in spread(nums, max(few, len(nums) // 50))} + + def sk_of(out: dict) -> dict: """{로직, 원본} → 저장 없는 가져온 식 SK(만들기 몸과 같은 꼴 · 키 = 시험용).""" row = out["로직"] @@ -80,7 +88,7 @@ def doc_and_money(out: dict) -> tuple[dict, dict, dict]: # ── (a) 전수 ───────────────────────────────────────────────────────────── def _sweep(saved: dict) -> dict: stat = {"블록": 0, "같음": 0, "표지없는틀린줄": 0, "다름": []} - for no, blk in fn.numbers(saved).items(): + for no, blk in picked(saved).items(): out = fn.emit(saved, no) sk, _, got = doc_and_money(out) mine = {c: got.get(k) for c, k in COST} diff --git a/resources/tester/test_810_3_native_screen.py b/resources/tester/test_810_3_native_screen.py index c33014b78..b864653fc 100644 --- a/resources/tester/test_810_3_native_screen.py +++ b/resources/tester/test_810_3_native_screen.py @@ -9,6 +9,7 @@ (d) 소계 줄 — 합 밖 · 비목 없음(화면 비목 칸 빈칸 · 종류 「소계」 — `line_stack_edit` · `line_stack_out` 글 대조) 원파일 없으면 그 시험만 skip(다른 PC). 추정 표지 수 표 = tmp/s8103/guess.json(일회 기록). +표본(기본) = 원파일마다 블록 차례 고르게 8 개 이상(`test_810_2.picked` · main 1,569 → 31) · 전수 = `AISLO_TEST_ALL=1`. """ from __future__ import annotations @@ -68,7 +69,7 @@ def _file(kind: str, tag: str) -> list[tuple[int, dict, dict, dict]]: """블록마다 (번, 원본, 문서, 서버 답 · 기록) — 서버 길 그대로.""" saved = t2.native(kind, tag) out = [] - for no in t2.fn.numbers(saved): + for no in t2.picked(saved): # 표본(기본) · 전수 = AISLO_TEST_ALL=1 emitted = t2.fn.emit(saved, no) sk = t2.sk_of(emitted) doc = dim.derive(sk, None, t2.whole()) diff --git a/resources/tester/test_812_1_xlsx_golden.py b/resources/tester/test_812_1_xlsx_golden.py index 0f62d6cb4..6ef3924af 100644 --- a/resources/tester/test_812_1_xlsx_golden.py +++ b/resources/tester/test_812_1_xlsx_golden.py @@ -7,13 +7,12 @@ 읽기기 → 원파일 구조 줄과 같음(EST 1,849 · STC 371 블록) · 원파일 자체 엇갈림(같은 글 · 다른 표지)은 `ODD` 로 고정 ③ 금액 — 실무 엑셀 11 = 읽기기 → `M02_Doc_FromNative` → 수식 문서 셈 = 엑셀 블록 금액 100 % -빠른 견본 기본 · 전수 = 환경 S8121_ALL=1 · 파일 없으면 skip(다른 PC). +빠른 견본 기본 · 전수 = 환경 AISLO_TEST_ALL=1(옛 S8121_ALL=1) · 파일 없으면 skip(다른 PC). """ from __future__ import annotations import math -import os import re import sys import unicodedata @@ -33,12 +32,12 @@ import helper_m02_hopyo_golden as golden # noqa: E402 import test_797_1a_import_flags as practice # noqa: E402 import test_810_1_estx as estx # noqa: E402 import test_810_1_stc as stc # noqa: E402 +from helper_test_all import ALL # noqa: E402 from M02_MasterTemplete import M02_Doc_FromNative as fn # noqa: E402 from M02_MasterTemplete import M02_San_Book as book # noqa: E402 from M02_MasterTemplete import M02_San_Xlsx as sx # noqa: E402 -ALL = os.environ.get("S8121_ALL") == "1" F = sx.flat FIELDS = ("연결뜻", "비목", "변수", "줄참조", "결과", "합계") #: 원파일 자체 엇갈림 — 같은 보인 글 · 금액 칸인데 원파일 표지가 다른 줄(엑셀이 못 가름 · 고정) diff --git a/resources/tester/test_812_3_native_layout.py b/resources/tester/test_812_3_native_layout.py index d83e8a071..2220ff3bd 100644 --- a/resources/tester/test_812_3_native_layout.py +++ b/resources/tester/test_812_3_native_layout.py @@ -11,6 +11,7 @@ 수 표 = tmp/s8123/sweep.json(일회 기록) (c) M01 문서 1,518 — 차림 안 바뀜(쌓기 없음 · 왕복 같음 · 거울 같음) 원파일 없으면 그 시험만 skip(다른 PC). +(b) 표본(기본) = 원파일마다 블록 차례 고르게 4 개 이상(main 1,569 → 31) · 전수 = `AISLO_TEST_ALL=1`. """ from __future__ import annotations @@ -177,7 +178,7 @@ def _sweep() -> dict: for tag, path in files.items(): if not path.exists(): continue - for no in t2.fn.numbers(t2.native(kind, tag)): + for no in t2.picked(t2.native(kind, tag), few=4): sk, doc = _doc(kind, tag, no) _, plain = _doc(kind, tag, no, laid=False) stat["블록"] += 1 diff --git a/resources/tester/test_826_2_machine_files.py b/resources/tester/test_826_2_machine_files.py index fecb9708e..6ba1edb8c 100644 --- a/resources/tester/test_826_2_machine_files.py +++ b/resources/tester/test_826_2_machine_files.py @@ -4,6 +4,7 @@ ② 한 대 고침 = 파일 하나만 · 새 기계 = 파일 하나 더함(끝) · 지움 = 파일 하나 지움 · 판 충돌 409 ③ 내 기계 — 옛 `내기계.json` 은 읽을 때 폴더로 한 번 옮김(내용 · 다음 번호 같음 · 옛 파일 지움) ④ 저장 검사 좁히기 — 옛 길(폴더 두 번 읽고 전체 검사 두 번)과 같은 오류 목록(견본 고침 스물) + 기본 = 갈래(기계 · 자재 · 인력 · 유가 · 표 · 로직 · 조합)마다 하나 이상 아홉(`SAMPLE`) · 전수 = `AISLO_TEST_ALL=1` """ from __future__ import annotations @@ -23,6 +24,20 @@ from M02_MasterTemplete import M02_MyMachine as mym ROOT = Path(__file__).resolve().parents[2] sys.path.insert(0, str(ROOT / "resources" / "master_data" / "scripts")) import master_machine_files as mmf # noqa: E402 +from helper_test_all import ALL # noqa: E402 + +#: ④ 기본 표본 — 갈래마다 하나 이상 · 오류 남 · 안 남 둘 다 +SAMPLE = { + "기계 값", + "기계 지움(로직이 씀)", + "자재 지움(로직이 씀)", + "인력 준용 끊김", + "유가 값", + "표 조건 틀림", + "로직 요소 끊김", + "로직 지움(일위대가 문서가 씀)", + "조합 지움", +} REAL = store.FOLDER cm, mk = store.cm, store.mk @@ -229,7 +244,10 @@ def test_narrow_check_same_as_before(master: Path, tmp_path: Path, monkeypatch) ("조합 지움", lambda: _delete(cm.mcb.FILE, combo[-1]), False), ("새 자재", lambda: _add(MT, "MT000008", 이름="sub1임시새자재"), False), ] # fmt: skip + assert SAMPLE <= {name for name, _, _ in cases} for name, make, bad in cases: + if not ALL and name not in SAMPLE: + continue batch = make() want = _old(batch) got = _new(batch) diff --git a/resources/tester/test_855_engine_parity.py b/resources/tester/test_855_engine_parity.py index 3c9088393..4801179bb 100644 --- a/resources/tester/test_855_engine_parity.py +++ b/resources/tester/test_855_engine_parity.py @@ -1,6 +1,6 @@ """855-A 지킴 ① — 로직 전수 옛 엔진 대 새 계산기(저장된 수식 문서) · 걸음 2 동안 「다름 0」 자. -- 기본 입력 전수(관문 · 십여 초) · 옵션 표본 전수 = 환경 `S855_ALL=1`(3 분 남짓). +- 기본 입력 전수(관문 · 십여 초) · 옵션 표본 전수 = 환경 `AISLO_TEST_ALL=1`(옛 `S855_ALL=1` · 3 분 남짓). - 층 L0 합계 · L1 줄 비목 · L2 줄 꼴 · L3 수량 · 단가(`helper_855_engine.level`). - 다름 = 채택된 차이와 같아야 함(합계 = 빌더 `ADOPTED` 그대로 · 줄 비목 = 같은 까닭의 문서만) · 「보임」(보이는 단가만 · 금액 같음)은 허용 갈래로 셈. @@ -9,11 +9,8 @@ from __future__ import annotations -import os - import helper_855_engine as h - -ALL = os.environ.get("S855_ALL") == "1" +from helper_test_all import ALL # noqa: E402 def _diffs(options: bool) -> dict[str, list]: diff --git a/resources/tester/test_855_golden.py b/resources/tester/test_855_golden.py index 03a8c9e85..0a9ae4cce 100644 --- a/resources/tester/test_855_golden.py +++ b/resources/tester/test_855_golden.py @@ -4,6 +4,7 @@ - 다르면 실패 — 계산기 · 수식 문서 · M01 자료가 금액을 바꿨다는 뜻. 자료 · 규칙을 **뜻대로 바꾼 걸음만** 다시 뜸: `./venv/Scripts/python.exe resources/tester/test_855_golden.py --write`(바뀐 키를 커밋 글에). - 옛 엔진을 지운 뒤(2-E4) 옛 → 새 대조(`test_855_engine_parity` · `test_802_2`)를 이것이 대신함. +- 기본 = 로직 키 차례 고르게 300(지문 대조만) · 전수 = `AISLO_TEST_ALL=1`(빠짐 · 새 키까지). """ from __future__ import annotations @@ -17,18 +18,24 @@ FILE = HERE / "golden_855_engine.json" REDO = "./venv/Scripts/python.exe resources/tester/test_855_golden.py --write" -def current() -> dict[str, str]: +def current(n: int | None = None) -> dict[str, str]: import helper_855_engine as h + from helper_test_all import spread rows, _, docs, _ = h.world() - return {str(r["키"]): h.fingerprint(str(r["키"]), r) for r in rows if str(r["키"]) in docs} + rows = [r for r in rows if str(r["키"]) in docs] + rows = spread(rows, n) if n else rows + return {str(r["키"]): h.fingerprint(str(r["키"]), r) for r in rows} def test_새_계산기_답_지문_같음(): + from helper_test_all import ALL + want = json.loads(FILE.read_text("utf-8"))["지문"] - got = current() + got = current(None if ALL else 300) changed = sorted(k for k in want.keys() & got.keys() if want[k] != got[k]) - gone, new = sorted(want.keys() - got.keys()), sorted(got.keys() - want.keys()) + gone = sorted(want.keys() - got.keys()) if ALL else [] + new = sorted(got.keys() - want.keys()) assert not (changed or gone or new), ( f"지문 다름 — 바뀜 {len(changed)} {changed[:20]} · 빠짐 {gone[:20]} · 새 키 {new[:20]}\n" f"뜻대로 금액을 바꾼 걸음이면 다시 뜸: {REDO} (아니면 고친 코드 · 자료를 되짚음)" diff --git a/resources/tester/test_m01_text.py b/resources/tester/test_m01_text.py index d761507ed..ad5832f56 100644 --- a/resources/tester/test_m01_text.py +++ b/resources/tester/test_m01_text.py @@ -1,6 +1,7 @@ """M01 읽는 식 줄(`POST /text`) — 계약 `resources/master_data/_화면_계약.md` 3장. 견본 셋: 산림 13-4-1 메쌓기 · 12-4 합판거푸집 · 12-17-1 펌프카 타설. +「모든 로직을 돌려도 멈추지 않는다」 둘 = 기본 로직 키 차례 고르게 400 · 전수 = `AISLO_TEST_ALL=1`. """ from __future__ import annotations @@ -21,6 +22,7 @@ from M01_MasterData import M01_MasterData_Store as store sys.path.insert(0, str(Path(__file__).resolve().parents[1] / "master_data/scripts")) import master_text as mt # noqa: E402 +from helper_test_all import spread # noqa: E402 REAL = store.FOLDER STACK = "GF000219" # 13-4-1 메쌓기(인력) — 증가율이 걸린 줄 @@ -387,13 +389,12 @@ def test_모든_로직을_값_없이_돌려도_멈추지_않는다() -> None: files = store.cm.load(folder=REAL) master = store.cm.master(REAL) stops = [] - for rows in master.index.values(): - for key in rows: - if key[:2] in mt.mf.mk.GROUP_OF and mt.mf.mk.GROUP_OF[key[:2]] == "로직": - try: - mt.lines(files, key, {}) - except mt._CALC_ERRORS as e: - stops.append((key, str(e))) + keys = [k for rows in master.index.values() for k in rows] + for key in spread([k for k in keys if mt.mf.mk.GROUP_OF.get(k[:2]) == "로직"], 400): + try: + mt.lines(files, key, {}) + except mt._CALC_ERRORS as e: + stops.append((key, str(e))) assert not stops, stops[:3] @@ -413,18 +414,16 @@ def test_자동값으로_모든_로직을_돌려도_멈추지_않는다() -> Non files = store.cm.load(folder=REAL) master = store.cm.master(REAL) stops = [] - for rows in master.index.values(): - for key in rows: - if mt.mf.mk.GROUP_OF.get(key[:2]) != "로직": - continue - given = {n: store._dec(v) for n, v in store.auto(key)["값"].items()} - # 고르기가 빈 입력 = 내 기계 · 불러오기 전용 식(M01 정본 기계가 안 씀) — 자동값 고를 것이 없음 - if any(i.get("고르기") == [] for i in master.logic(key).get("입력", [])): - continue - try: - mt.lines(files, key, given) - except mt._CALC_ERRORS as e: - stops.append((key, str(e))) + keys = [k for rows in master.index.values() for k in rows] + for key in spread([k for k in keys if mt.mf.mk.GROUP_OF.get(k[:2]) == "로직"], 400): + given = {n: store._dec(v) for n, v in store.auto(key)["값"].items()} + # 고르기가 빈 입력 = 내 기계 · 불러오기 전용 식(M01 정본 기계가 안 씀) — 자동값 고를 것이 없음 + if any(i.get("고르기") == [] for i in master.logic(key).get("입력", [])): + continue + try: + mt.lines(files, key, given) + except mt._CALC_ERRORS as e: + stops.append((key, str(e))) assert not stops, stops[:3] diff --git a/tools/full_sweep_tests.txt b/tools/full_sweep_tests.txt new file mode 100644 index 000000000..2c64678a3 --- /dev/null +++ b/tools/full_sweep_tests.txt @@ -0,0 +1,13 @@ +# 전수 한 번에 — 기본 = 표본인 시험(`helper_test_all.py`) + 늘 전수인 느린 시험 · 걸음 끝 · 싱크 앞에 브레인이 돌림 +# AISLO_TEST_ALL=1 ./venv/Scripts/python.exe -m pytest $(grep -v '^#' tools/full_sweep_tests.txt) -q -p no:cacheprovider -rs +resources/tester/test_812_3_native_layout.py +resources/tester/test_810_2_native_doc.py +resources/tester/test_810_3_native_screen.py +resources/tester/test_812_1_xlsx_golden.py +resources/tester/test_m01_text.py +resources/tester/test_801_3_groups.py +resources/tester/test_800_1_var_symbols.py +resources/tester/test_826_2_machine_files.py +resources/tester/test_855_golden.py +resources/tester/test_855_engine_parity.py +resources/tester/test_802_2_convert.py