From c1425be57fa888ee3fe490b15c95febaefde6f6a Mon Sep 17 00:00:00 2001 From: kjs Date: Tue, 6 Jan 2026 15:33:44 +0900 Subject: [PATCH] =?UTF-8?q?=EC=B0=BD=EA=B3=A0=EC=BD=94=EB=93=9C=20?= =?UTF-8?q?=EA=B0=99=EC=9D=B4=20=EC=98=AC=EB=9D=BC=EA=B0=80=EA=B2=8C=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rack-structure/RackStructureComponent.tsx | 14 +++++++++++++- .../registry/components/rack-structure/types.ts | 2 +- frontend/lib/utils/buttonActions.ts | 12 ++++++------ 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/frontend/lib/registry/components/rack-structure/RackStructureComponent.tsx b/frontend/lib/registry/components/rack-structure/RackStructureComponent.tsx index d80fd2c7..77eadca0 100644 --- a/frontend/lib/registry/components/rack-structure/RackStructureComponent.tsx +++ b/frontend/lib/registry/components/rack-structure/RackStructureComponent.tsx @@ -605,7 +605,7 @@ export const RackStructureComponent: React.FC = ({ location_type: context?.locationType || "선반", status: context?.status || "사용", // 추가 필드 (테이블 컬럼명과 동일) - warehouse_id: context?.warehouseCode, + warehouse_code: context?.warehouseCode, warehouse_name: context?.warehouseName, floor: context?.floor, zone: context?.zone, @@ -623,6 +623,18 @@ export const RackStructureComponent: React.FC = ({ setPreviewData(locations); setIsPreviewGenerated(true); + + console.log("🏗️ [RackStructure] 생성된 위치 데이터:", { + locationsCount: locations.length, + firstLocation: locations[0], + context: { + warehouseCode: context?.warehouseCode, + warehouseName: context?.warehouseName, + floor: context?.floor, + zone: context?.zone, + }, + }); + onChange?.(locations); }, [conditions, context, generateLocationCode, onChange, missingFields, hasRowOverlap, duplicateErrors, existingLocations, rowOverlapErrors]); diff --git a/frontend/lib/registry/components/rack-structure/types.ts b/frontend/lib/registry/components/rack-structure/types.ts index 5ab7bd7e..8670d4a0 100644 --- a/frontend/lib/registry/components/rack-structure/types.ts +++ b/frontend/lib/registry/components/rack-structure/types.ts @@ -27,7 +27,7 @@ export interface GeneratedLocation { location_type?: string; // 위치 유형 status?: string; // 사용 여부 // 추가 필드 (상위 폼에서 매핑된 값) - warehouse_id?: string; // 창고 ID/코드 + warehouse_code?: string; // 창고 코드 (DB 컬럼명과 동일) warehouse_name?: string; // 창고명 floor?: string; // 층 zone?: string; // 구역 diff --git a/frontend/lib/utils/buttonActions.ts b/frontend/lib/utils/buttonActions.ts index 53373d41..099daa91 100644 --- a/frontend/lib/utils/buttonActions.ts +++ b/frontend/lib/utils/buttonActions.ts @@ -1374,17 +1374,17 @@ export class ButtonActionExecutor { // 저장 전 중복 체크 const firstLocation = locations[0]; - const warehouseId = firstLocation.warehouse_id || firstLocation.warehouseCode; + const warehouseCode = firstLocation.warehouse_code || firstLocation.warehouse_id || firstLocation.warehouseCode; const floor = firstLocation.floor; const zone = firstLocation.zone; - if (warehouseId && floor && zone) { - console.log("🔍 [handleRackStructureBatchSave] 기존 데이터 중복 체크:", { warehouseId, floor, zone }); + if (warehouseCode && floor && zone) { + console.log("🔍 [handleRackStructureBatchSave] 기존 데이터 중복 체크:", { warehouseCode, floor, zone }); try { const existingResponse = await DynamicFormApi.getTableData(tableName, { filters: { - warehouse_id: warehouseId, + warehouse_code: warehouseCode, floor: floor, zone: zone, }, @@ -1434,8 +1434,8 @@ export class ButtonActionExecutor { location_name: loc.location_name || loc.locationName, row_num: loc.row_num || String(loc.rowNum), level_num: loc.level_num || String(loc.levelNum), - // 창고 정보 (렉 구조 컴포넌트에서 전달) - warehouse_id: loc.warehouse_id || loc.warehouseCode, + // 창고 정보 (렉 구조 컴포넌트에서 전달) - DB 컬럼명은 warehouse_code + warehouse_code: loc.warehouse_code || loc.warehouse_id || loc.warehouseCode, warehouse_name: loc.warehouse_name || loc.warehouseName, // 위치 정보 (렉 구조 컴포넌트에서 전달) floor: loc.floor, -- 2.43.0