fix(B09 설계내역서): 엑셀 내역 불러오기 화면 검증 흠 — 단가만 빈칸 · 운반 줄 오붙음 · 차례 · 표 높이 (PLAN 707-1)

- 단가만 갈래 = 붙인 자동 줄에 B08 수량이 없으면 엑셀 수량(빈칸 금액 막음)
- 운반 자동 줄(「모래」 · 「시멘트」 = 자재대 줄 이름) = 붙이지 않음 · 지우기만
- 불러온 공종 = 관급자재대 앞(엑셀 차례 · 표 끝에 묻히지 않음)
- 결과 창 = 표를 다시 그린 뒤 따로 엶(열린 창 가림막을 표 아래 자리로 재어 표가 한 줄로 줄던 것) · 어긋난 줄 표 칸 폭 줄임
- 못 읽은 파일(빈 · DRM · 내역 시트 없음) = 프로젝트 import 폴더에 안 둠

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-31 16:13:34 +09:00
co-authored by Claude Opus 5.5
parent 02886d5d4d
commit c33f6837f2
4 changed files with 60 additions and 35 deletions
@@ -66,9 +66,9 @@ def _keep(root: Path, name: str, data: bytes) -> str:
return key
def _parse(path: Path) -> dict[str, Any]:
def _parse(name: str, data: bytes) -> dict[str, Any]:
try:
return read_bill(path.name, path.read_bytes())
return read_bill(name, data)
except BillExcelError as error:
raise HTTPException(status_code=400, detail=str(error)) from error
@@ -137,11 +137,13 @@ async def import_bill(
data = await file.read(MAX_BYTES + 1)
if len(data) > MAX_BYTES:
raise HTTPException(status_code=400, detail="파일이 너무 큼(50MB 넘음)")
parsed = await asyncio.to_thread(_parse, file.filename or "", data) # 읽힌 파일만 둠
file_key = await asyncio.to_thread(_keep, root, file.filename or "", data)
if not file_key:
raise HTTPException(status_code=400, detail="파일을 고름")
path = _saved(root, file_key)
parsed = await asyncio.to_thread(_parse, path)
if file is None:
parsed = await asyncio.to_thread(_parse, path.name, path.read_bytes())
rows = (await payload(project_id, root, _draft(user), True))["sheets"]["bill"]["rows"]
found = await asyncio.to_thread(_found, session, path.name, _numbers(parsed))
return {
@@ -170,7 +172,7 @@ async def apply_bill(
raise HTTPException(status_code=400, detail="수량 갈래는 take · price 중 하나")
root = await _project_root(project_id)
path = _saved(root, body.file_key)
parsed = await asyncio.to_thread(_parse, path)
parsed = await asyncio.to_thread(_parse, path.name, path.read_bytes())
draft = _draft(body.user) or await asyncio.to_thread(store.read_user, root)
rows = (await payload(project_id, root, draft, True))["sheets"]["bill"]["rows"]
found = await asyncio.to_thread(_found, session, path.name, _numbers(parsed))