diff --git a/backend-node/src/services/tableManagementService.ts b/backend-node/src/services/tableManagementService.ts index e9104bd6..38fc77b1 100644 --- a/backend-node/src/services/tableManagementService.ts +++ b/backend-node/src/services/tableManagementService.ts @@ -144,6 +144,19 @@ export class TableManagementService { logger.info( `컬럼 정보 캐시에서 조회: ${tableName}, ${cachedResult.columns.length}/${cachedResult.total}개` ); + + // 디버깅: 캐시된 currency_code 확인 + const cachedCurrency = cachedResult.columns.find( + (col: any) => col.columnName === "currency_code" + ); + if (cachedCurrency) { + console.log(`💾 [캐시] currency_code:`, { + columnName: cachedCurrency.columnName, + inputType: cachedCurrency.inputType, + webType: cachedCurrency.webType, + }); + } + return cachedResult; } @@ -165,10 +178,6 @@ export class TableManagementService { const offset = (page - 1) * size; // 🔥 company_code가 있으면 table_type_columns 조인하여 회사별 inputType 가져오기 - console.log( - `🔍 [getColumnList] 시작: table=${tableName}, company=${companyCode}` - ); - const rawColumns = companyCode ? await query( `SELECT @@ -256,22 +265,6 @@ export class TableManagementService { [tableName, size, offset] ); - // 디버깅: currency_code 확인 - const currencyCol = rawColumns.find( - (col: any) => col.columnName === "currency_code" - ); - if (currencyCol) { - console.log(`🎯 [getColumnList] currency_code 원본 쿼리 결과:`, { - columnName: currencyCol.columnName, - inputType: currencyCol.inputType, - ttc_input_type: currencyCol.ttc_input_type, - cl_input_type: currencyCol.cl_input_type, - webType: currencyCol.webType, - }); - } else { - console.log(`⚠️ [getColumnList] currency_code가 rawColumns에 없음`); - } - // 🆕 category_column_mapping 조회 const tableExistsResult = await query( `SELECT EXISTS ( @@ -804,8 +797,13 @@ export class TableManagementService { ] ); + // 🔥 캐시 무효화: 해당 테이블의 컬럼 캐시 삭제 + const cacheKeyPattern = `${CacheKeys.TABLE_COLUMNS(tableName, 1, 1000)}_${companyCode}`; + cache.delete(cacheKeyPattern); + cache.delete(CacheKeys.TABLE_COLUMN_COUNT(tableName)); + logger.info( - `컬럼 입력 타입 설정 완료: ${tableName}.${columnName} = ${inputType}, company: ${companyCode}` + `컬럼 입력 타입 설정 완료: ${tableName}.${columnName} = ${inputType}, company: ${companyCode} (캐시 무효화 완료)` ); } catch (error) { logger.error( diff --git a/frontend/lib/registry/components/selected-items-detail-input/SelectedItemsDetailInputComponent.tsx b/frontend/lib/registry/components/selected-items-detail-input/SelectedItemsDetailInputComponent.tsx index 23238eb2..5cf9dd23 100644 --- a/frontend/lib/registry/components/selected-items-detail-input/SelectedItemsDetailInputComponent.tsx +++ b/frontend/lib/registry/components/selected-items-detail-input/SelectedItemsDetailInputComponent.tsx @@ -92,12 +92,22 @@ export const SelectedItemsDetailInputComponent: React.FC { const loadCodeOptions = async () => { + console.log("🔄 [loadCodeOptions] 시작:", { + additionalFields: componentConfig.additionalFields, + targetTable: componentConfig.targetTable, + }); + // 🆕 code/category 타입 필드 + codeCategory가 있는 필드 모두 처리 const codeFields = componentConfig.additionalFields?.filter( (field) => field.inputType === "code" || field.inputType === "category" ); - if (!codeFields || codeFields.length === 0) return; + console.log("🔍 [loadCodeOptions] code/category 필드:", codeFields); + + if (!codeFields || codeFields.length === 0) { + console.log("⚠️ [loadCodeOptions] code/category 타입 필드가 없습니다"); + return; + } const newOptions: Record> = { ...codeOptions }; @@ -338,15 +348,17 @@ export const SelectedItemsDetailInputComponent: React.FC {categoryOptions && categoryOptions.length > 0 ? ( - categoryOptions.map((option) => ( - - {option.label} - - )) + categoryOptions + .filter((option) => option.value !== "") + .map((option) => ( + + {option.label} + + )) ) : ( - +
옵션 로딩 중... - +
)}
@@ -374,7 +386,7 @@ export const SelectedItemsDetailInputComponent: React.FC - {field.options?.map((option) => ( + {field.options?.filter((option) => option.value !== "").map((option) => ( {option.label} diff --git a/frontend/lib/utils/getComponentConfigPanel.tsx b/frontend/lib/utils/getComponentConfigPanel.tsx index 877495a5..2f01e4c9 100644 --- a/frontend/lib/utils/getComponentConfigPanel.tsx +++ b/frontend/lib/utils/getComponentConfigPanel.tsx @@ -216,6 +216,7 @@ export const DynamicComponentConfigPanel: React.FC = columnName: col.columnName || col.column_name, columnLabel: col.displayName || col.columnLabel || col.column_label || col.columnName || col.column_name, dataType: col.dataType || col.data_type || col.dbType, + inputType: col.inputType || col.input_type, // 🆕 inputType 추가 })); console.log("✅ 원본 테이블 컬럼 초기 로드 완료:", columns.length); @@ -238,6 +239,8 @@ export const DynamicComponentConfigPanel: React.FC = columnName: col.columnName || col.column_name, columnLabel: col.displayName || col.columnLabel || col.column_label || col.columnName || col.column_name, dataType: col.dataType || col.data_type || col.dbType, + inputType: col.inputType || col.input_type, // 🆕 inputType 추가 + codeCategory: col.codeCategory || col.code_category, // 🆕 codeCategory 추가 })); console.log("✅ 대상 테이블 컬럼 초기 로드 완료:", columns.length);