feat(842-3): 기계 시간당 셈 한 길 — 식 문서 계산기 + 기계 줄 인력 · 잡품 목록 바탕 덮음

- 읽기 view(Master.value) = 인력 · 잡품 목록 → 식이 읽는 조종원 수 · 직종 · 잡재료율(옛 꼴 = 그대로)
- 목록이 식 한 줄로 안 풀리면 row_entry 바탕 덮음 · 단가산출 기계덮음은 merge 로 부분별 위에(짝 TS)
- M02_Machine_Hourly.hourly · brief · M02_MyMachine.hourly = 문서 엔진(doc_sums) · 식 문서 없는 식만 옛 로직 엔진
- pick · _operated · why · logic_key · 호표 기계 고름 · 불러오기 기계 수 = 인력 줄로
- 내 기계 clean = 인력 · 잡품 목록 받음(옛 칸 = from_old) · M01 fix · check_master = 목록 꼴 검사
- 사본 자동 따라옴 = 옛 꼴 사본 줄 대 새 꼴 M01 줄은 새 꼴로 바꿔 대조(덮음 안 지움)
- 시험 836_1 몸 검사: 조종원 빈 키 = 식 입력 직종으로 받음 → 틀림 꼴을 「키 없음」으로 고침
- 전후: 655 대 로직 엔진 = 문서 엔진 611 같음 · 다름 0 · 코드만 바꾼 뒤 655 대 hourly · brief · 문서 셈 전후 같음

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-15 18:23:04 +09:00
co-authored by Claude Opus 5.5
parent 6c3c00ff66
commit e8d5534c11
17 changed files with 466 additions and 49 deletions
@@ -18,6 +18,7 @@ from __future__ import annotations
from numbers import Number
CREW, MISC = "인력", "잡품"
LISTS = (CREW, MISC)
OLD = ("조종원", "조종원직종", "잡재료율")
BASE = ("주연료", "전력") # 잡품 줄 기본 = 이 재료 줄(값 > 0)
@@ -87,3 +88,59 @@ def summary(vals) -> str:
for r in vals.get(MISC) or []
]
return " · ".join([*crew, *(["잡품 " + ", ".join(misc)] if misc else [])])
def from_old_row(row: dict) -> dict:
"""옛 꼴 기계 줄 → 새 꼴(값 · 단위 · 출처) — M01 자료 옮김(842-3) · 사본 대조가 같은 규칙.
단위 = 인력 「인/일」 · 잡품 「%」 · 출처 = 인력 ← 조종원 · 조종원직종 · 잡품 ← 잡재료율."""
vals = row.get("값") if isinstance(row, dict) else None
if not isinstance(vals, dict) or is_new(vals):
return row
new = from_old(vals)
out = {**row, "값": new}
for part in ("단위", "출처"):
box = row.get(part)
if not isinstance(box, dict):
continue
got = {k: v for k, v in box.items() if k not in OLD}
if CREW in new:
src = " · ".join(
dict.fromkeys(x for x in (box.get("조종원"), box.get("조종원직종")) if x)
)
got[CREW] = "인/일" if part == "단위" else src
if MISC in new:
got[MISC] = "%" if part == "단위" else (box.get("잡재료율") or "")
out[part] = got
return out
def check(vals) -> list[str]:
"""목록 칸 틀 — 인력 = [{키 'LB…' | 빈 글, 인 ≥ 0}] · 잡품 = [{줄 주연료 · 전력 | 키, 수량? ≥ 0, 율 ≥ 0}] ·
30 줄까지 · 옛 칸과 같이 = 두 벌(M01 틀 검사 `check_master` · 저장 손질 `M01_MasterData_Machine.fix`)."""
if not isinstance(vals, dict):
return []
out: list[str] = []
if any(k in vals for k in LISTS) and any(k in vals for k in OLD):
out.append("인력 · 잡품 목록과 옛 칸(조종원 · 조종원직종 · 잡재료율)이 같이 있음")
for col, need in ((CREW, "인"), (MISC, "율")):
rows = vals.get(col)
if rows is None:
continue
if not isinstance(rows, list) or len(rows) > 30:
out.append(f"{col} — 목록(30 줄까지)")
continue
for n, r in enumerate(rows, 1):
bad = not isinstance(r, dict) or not _isnum(r.get(need)) or r[need] < 0
if not bad and r.get("수량") is not None:
bad = not _isnum(r["수량"]) or r["수량"] < 0
if not bad and col == CREW:
bad = not isinstance(r.get("키", ""), str) or not (
r.get("키", "") == "" or str(r["키"]).startswith("LB")
)
if not bad and col == MISC:
bad = bool(r.get("줄")) == bool(r.get("키")) or (
bool(r.get("줄")) and r["줄"] not in BASE
)
if bad:
out.append(f"{col} {n} 줄 — 꼴 틀림")
return out