엑셀 업로드 문제 수정

This commit is contained in:
kjs
2026-01-12 13:53:57 +09:00
parent 5f991db9c4
commit 9cc5bbbf05
2 changed files with 30 additions and 4 deletions

View File

@@ -47,8 +47,13 @@ export interface SplitPanelConfig {
columns: Array<{ name: string; label: string; width?: number }>;
relation?: {
type: string;
foreignKey: string;
leftColumn: string;
foreignKey?: string;
leftColumn?: string;
// 복합키 지원 (새로운 방식)
keys?: Array<{
leftColumn: string;
rightColumn: string;
}>;
};
};
}
@@ -210,8 +215,21 @@ class MasterDetailExcelService {
}
// 2. 분할 패널의 relation 정보가 있으면 우선 사용
let masterKeyColumn = splitPanel.rightPanel.relation?.leftColumn;
let detailFkColumn = splitPanel.rightPanel.relation?.foreignKey;
// 🔥 keys 배열을 우선 사용 (새로운 복합키 지원 방식)
let masterKeyColumn: string | undefined;
let detailFkColumn: string | undefined;
const relationKeys = splitPanel.rightPanel.relation?.keys;
if (relationKeys && relationKeys.length > 0) {
// keys 배열에서 첫 번째 키 사용
masterKeyColumn = relationKeys[0].leftColumn;
detailFkColumn = relationKeys[0].rightColumn;
logger.info(`keys 배열에서 관계 정보 사용: ${masterKeyColumn} -> ${detailFkColumn}`);
} else {
// 하위 호환성: 기존 leftColumn/foreignKey 사용
masterKeyColumn = splitPanel.rightPanel.relation?.leftColumn;
detailFkColumn = splitPanel.rightPanel.relation?.foreignKey;
}
// 3. relation 정보가 없으면 column_labels에서 Entity 관계 조회
if (!masterKeyColumn || !detailFkColumn) {