- document-snapshot-architecture-plan.md: B안(HTML 스냅샷) + 구조화 데이터 병행 계획 - mng-bending-document-matching-plan.md: 절곡 중간검사/작업일지 MNG 매칭 계획 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
8.8 KiB
MNG 절곡 문서 React 매칭 계획
작성일: 2026-03-05 목적: MNG 절곡 문서(중간검사성적서 #36, 작업일지 #39)의 상세보기를 React와 동일하게 수정 상태: 🔄 진행중 영향 범위: mng만 (React/API 변경 없음)
현재 진행 상태
| 항목 | 내용 |
|---|---|
| 마지막 완료 작업 | Task 2.2: 절곡 작업일지 전용 렌더링 블록 추가 |
| 다음 작업 | 브라우저 검증 (사용자 확인 필요) |
| 진행률 | 5/6 (83%) |
| 마지막 업데이트 | 2026-03-05 |
1. 개요
1.1 배경
MNG(mng.sam.kr/documents/36, /documents/39)에서 절곡 문서의 상세보기가 React(dev.sam.kr/production/worker-screen > 절곡공정)와 다르다.
- MNG: DB 템플릿(
document_templates,document_template_columns)을 동적으로 읽어 범용 렌더링 - React: 전용 하드코딩 컴포넌트(
BendingInspectionContent.tsx,BendingWorkLogContent.tsx)로 렌더링
React가 더 상세하고 정확하므로, MNG를 React에 맞춰 수정한다.
1.2 핵심 원칙
- MNG only 수정 (React/API 변경 없음)
- DB 템플릿 컬럼 수정 + show.blade.php 전용 렌더링 블록 추가
- 기존 범용 렌더링 로직은 유지 (다른 문서에 영향 없도록)
1.3 변경 승인 정책
| 분류 | 예시 | 승인 |
|---|---|---|
| 즉시 가능 | blade 템플릿 수정, DB 시더/컬럼 업데이트 | 불필요 |
| 컨펌 필요 | DocumentController 로직 변경, 새 쿼리 추가 | 필수 |
| 금지 | 테이블 구조 변경, API 엔드포인트 변경 | 별도 협의 |
2. 차이점 분석
2.1 중간검사성적서 (#36) - 중간검사 DATA 테이블
React 컬럼 구조 (BendingInspectionContent.tsx):
| 컬럼 | 타입 | 비고 |
|---|---|---|
| 분류 | text | KWE01 등 제품코드 |
| 제품명 | text | 가이드레일, 케이스 등 |
| 타입 | text | 벽면형, 측면형 등 |
| 겉모양/절곡상태 | check | 양호/불량 체크 |
| 길이 - 도면치수 | text | 설계값 |
| 길이 - 측정값 | input | 입력값 |
| 너비 - 도면치수 | text | 설계값 |
| 너비 - 측정값 | input | 입력값 |
| 간격 - 포인트 | text | 1~5 등 |
| 간격 - 도면치수 | text | 설계값 |
| 간격 - 측정값 | input | 입력값 |
| 판정 | auto | 적/부 자동판정 |
핵심 차이:
- React는 7개 제품 x 다중 gapPoints(간격 측정점)로 rowSpan 사용
- MNG 현재 DB에는 "간격" 컬럼, "판정" 컬럼 없음
- MNG "분류/제품명"이 하나로 합쳐져 있을 수 있음
React 제품 목록 (INITIAL_PRODUCTS):
- 가이드레일 벽면형 (gapPoints: 5개)
- 가이드레일 측면형 (gapPoints: 5개)
- 케이스 (gapPoints: 2개)
- 하단마감재 (gapPoints: 2개)
- 하단L-BAR (gapPoints: 1개)
- 연기차단재 W50 (gapPoints: 1개)
- 연기차단재 W80 (gapPoints: 2개)
2.2 작업일지 (#39) - 절곡 전용 구조
React 구조 (BendingWorkLogContent.tsx):
헤더: "작업일지 (절곡)" + 문서번호/작성일자 + 결재란
신청업체/신청내용 테이블 (수주일, 현장명, 수주처, 작업일자, 담당자, LOT NO, 연락처, 생산담당자, 출고예정일)
제품 정보 테이블 (제품명, 재질, 마감, 유형)
4개 카테고리 섹션:
1. GuideRailSection (가이드레일 벽면형/측면형)
2. BottomBarSection (하단마감재)
3. ShutterBoxSection (셔터박스)
4. SmokeBarrierSection (연기차단재 W50/W80)
생산량 합계 [kg] (SUS/EGI)
비고
핵심 차이:
- MNG 현재: 범용 work_order_items 플랫 테이블 (line 137, 섹션 없는 문서)
- React: 절곡 전용 4개 카테고리 섹션 + 제품정보 + 생산량합계
- React는
bendingInfo데이터(work_order.options.bending_info)를 사용 - MNG Controller에서 bending_info를 아직 view에 전달하지 않음
3. 작업 범위
Phase 1: 중간검사성적서 (#36)
| # | 작업 항목 | 상태 | 비고 |
|---|---|---|---|
| 1.1 | 현재 DB 템플릿 컬럼 조회 (tinker) | ✅ | template_id=60, 7컬럼 (간격/판정 포함) |
| 1.2 | show.blade.php 절곡 검사 전용 렌더링 블록 추가 | ✅ | partials/bending-inspection-data.blade.php |
| 1.3 | 브라우저 검증 | ⏳ | mng.sam.kr/documents/36 |
Phase 2: 작업일지 (#39)
| # | 작업 항목 | 상태 | 비고 |
|---|---|---|---|
| 2.1 | DocumentController에 bending_info 전달 추가 | ✅ | work_order.options에서 추출 |
| 2.2 | show.blade.php 절곡 작업일지 전용 렌더링 블록 추가 | ✅ | partials/bending-worklog.blade.php |
| 2.3 | 브라우저 검증 | ⏳ | mng.sam.kr/documents/39 |
4. 상세 작업 내용
4.1 Task 1.2: show.blade.php 절곡 검사 전용 블록
위치: show.blade.php 섹션 렌더링 영역 (line ~400)
조건: template category가 '절곡' 또는 template name에 '절곡' 포함
렌더링 구조:
<table>
<thead>
<tr>
<th rowSpan=2>분류</th>
<th rowSpan=2>제품명</th>
<th rowSpan=2>타입</th>
<th rowSpan=2>겉모양/절곡상태</th>
<th colSpan=2>길이</th>
<th colSpan=2>너비</th>
<th colSpan=3>간격</th>
<th rowSpan=2>판정</th>
</tr>
<tr>
<th>도면치수</th><th>측정값</th>
<th>도면치수</th><th>측정값</th>
<th>포인트</th><th>도면치수</th><th>측정값</th>
</tr>
</thead>
<tbody>
<!-- 각 제품별 gapPoints 수만큼 행 (rowSpan 사용) -->
</tbody>
</table>
데이터 소스: document_data EAV + INITIAL_PRODUCTS 정적 구조
- section_id, column_id, row_index, field_key로 조회
- 간격 데이터: field_key
gap_point_{n},gap_design_{n},gap_measured_{n}
4.2 Task 2.1: Controller bending_info 전달
파일: mng/app/Http/Controllers/DocumentController.php show()
추가 로직:
// 절곡 작업일지용: bending_info 추출
$bendingInfo = null;
if ($workOrder) {
$woOptions = json_decode($workOrder->options, true) ?? [];
$bendingInfo = $woOptions['bending_info'] ?? null;
}
view 전달: 'bendingInfo' => $bendingInfo
4.3 Task 2.2: show.blade.php 절곡 작업일지 전용 블록
위치: show.blade.php line ~137 (작업일지 전용 영역)
조건: 절곡 공정인 경우 (template name에 '절곡' 포함 또는 공정 확인)
렌더링 구조:
- 신청업체/신청내용 테이블
- 제품 정보 테이블 (제품명, 재질, 마감, 유형)
- 4개 카테고리 섹션 (가이드레일, 하단마감재, 셔터박스, 연기차단재)
- 생산량 합계 [kg] (SUS/EGI)
- 비고
PHP 유틸 함수 필요:
getMaterialMapping($productCode, $finishMaterial)- React utils.ts 포팅calculateProductionSummary($bendingInfo, $mapping)- React utils.ts 포팅
5. 참고 파일
React (타겟 - 읽기 전용)
react/src/components/production/WorkOrders/documents/BendingInspectionContent.tsx(547행)react/src/components/production/WorkOrders/documents/BendingWorkLogContent.tsx(207행)react/src/components/production/WorkOrders/documents/bending/types.tsreact/src/components/production/WorkOrders/documents/bending/utils.tsreact/src/components/production/WorkOrders/documents/bending/GuideRailSection.tsxreact/src/components/production/WorkOrders/documents/bending/BottomBarSection.tsxreact/src/components/production/WorkOrders/documents/bending/ShutterBoxSection.tsxreact/src/components/production/WorkOrders/documents/bending/SmokeBarrierSection.tsxreact/src/components/production/WorkOrders/documents/bending/ProductionSummarySection.tsx
MNG (수정 대상)
mng/resources/views/documents/show.blade.php(메인 렌더링)mng/app/Http/Controllers/DocumentController.php(show 메서드)
DB 참고
mng/database/seeders/MidInspectionTemplateSeeder.php(절곡 검사 템플릿)mng/database/seeders/WorkLogTemplateSeeder.php(절곡 작업일지 템플릿)
문서
docs/features/documents/README.md- 문서관리 시스템docs/system/database/documents.md- DB 스키마docs/dev/dev_plans/document-system-mid-inspection.md- 중간검사 계획docs/dev/dev_plans/document-system-work-log.md- 작업일지 계획
6. 변경 이력
| 날짜 | 항목 | 변경 내용 | 파일 | 승인 |
|---|---|---|---|---|
| 2026-03-05 | - | 계획 문서 작성 | - | - |
7. 검증 결과
작업 완료 후 이 섹션에 검증 결과 추가
7.1 성공 기준
| 기준 | 달성 | 비고 |
|---|---|---|
| mng.sam.kr/documents/36 검사 DATA 테이블이 React와 동일 구조 | ⏳ | rowSpan, 간격, 판정 포함 |
| mng.sam.kr/documents/39 작업일지가 React와 동일 구조 | ⏳ | 4개 카테고리, 생산량합계 포함 |
| 기존 다른 문서 렌더링에 영향 없음 | ⏳ | 조건 분기로 절곡 전용만 |