Merge pull request '창고코드 같이 올라가게 수정' (#330) from feature/screen-management into main

Reviewed-on: http://39.117.244.52:3000/kjs/ERP-node/pulls/330
This commit is contained in:
kjs 2026-01-06 15:34:02 +09:00
commit 0eb005ce35
3 changed files with 20 additions and 8 deletions

View File

@ -605,7 +605,7 @@ export const RackStructureComponent: React.FC<RackStructureComponentProps> = ({
location_type: context?.locationType || "선반", location_type: context?.locationType || "선반",
status: context?.status || "사용", status: context?.status || "사용",
// 추가 필드 (테이블 컬럼명과 동일) // 추가 필드 (테이블 컬럼명과 동일)
warehouse_id: context?.warehouseCode, warehouse_code: context?.warehouseCode,
warehouse_name: context?.warehouseName, warehouse_name: context?.warehouseName,
floor: context?.floor, floor: context?.floor,
zone: context?.zone, zone: context?.zone,
@ -623,6 +623,18 @@ export const RackStructureComponent: React.FC<RackStructureComponentProps> = ({
setPreviewData(locations); setPreviewData(locations);
setIsPreviewGenerated(true); 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); onChange?.(locations);
}, [conditions, context, generateLocationCode, onChange, missingFields, hasRowOverlap, duplicateErrors, existingLocations, rowOverlapErrors]); }, [conditions, context, generateLocationCode, onChange, missingFields, hasRowOverlap, duplicateErrors, existingLocations, rowOverlapErrors]);

View File

@ -27,7 +27,7 @@ export interface GeneratedLocation {
location_type?: string; // 위치 유형 location_type?: string; // 위치 유형
status?: string; // 사용 여부 status?: string; // 사용 여부
// 추가 필드 (상위 폼에서 매핑된 값) // 추가 필드 (상위 폼에서 매핑된 값)
warehouse_id?: string; // 창고 ID/코드 warehouse_code?: string; // 창고 코드 (DB 컬럼명과 동일)
warehouse_name?: string; // 창고명 warehouse_name?: string; // 창고명
floor?: string; // 층 floor?: string; // 층
zone?: string; // 구역 zone?: string; // 구역

View File

@ -1375,17 +1375,17 @@ export class ButtonActionExecutor {
// 저장 전 중복 체크 // 저장 전 중복 체크
const firstLocation = locations[0]; 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 floor = firstLocation.floor;
const zone = firstLocation.zone; const zone = firstLocation.zone;
if (warehouseId && floor && zone) { if (warehouseCode && floor && zone) {
console.log("🔍 [handleRackStructureBatchSave] 기존 데이터 중복 체크:", { warehouseId, floor, zone }); console.log("🔍 [handleRackStructureBatchSave] 기존 데이터 중복 체크:", { warehouseCode, floor, zone });
try { try {
const existingResponse = await DynamicFormApi.getTableData(tableName, { const existingResponse = await DynamicFormApi.getTableData(tableName, {
filters: { filters: {
warehouse_id: warehouseId, warehouse_code: warehouseCode,
floor: floor, floor: floor,
zone: zone, zone: zone,
}, },
@ -1435,8 +1435,8 @@ export class ButtonActionExecutor {
location_name: loc.location_name || loc.locationName, location_name: loc.location_name || loc.locationName,
row_num: loc.row_num || String(loc.rowNum), row_num: loc.row_num || String(loc.rowNum),
level_num: loc.level_num || String(loc.levelNum), level_num: loc.level_num || String(loc.levelNum),
// 창고 정보 (렉 구조 컴포넌트에서 전달) // 창고 정보 (렉 구조 컴포넌트에서 전달) - DB 컬럼명은 warehouse_code
warehouse_id: loc.warehouse_id || loc.warehouseCode, warehouse_code: loc.warehouse_code || loc.warehouse_id || loc.warehouseCode,
warehouse_name: loc.warehouse_name || loc.warehouseName, warehouse_name: loc.warehouse_name || loc.warehouseName,
// 위치 정보 (렉 구조 컴포넌트에서 전달) // 위치 정보 (렉 구조 컴포넌트에서 전달)
floor: loc.floor, floor: loc.floor,