Merge branch 'mhkim-node' of http://39.117.244.52:3000/kjs/ERP-node into jskim-node
This commit is contained in:
parent
2cf5c8de32
commit
7e34b7bf35
|
|
@ -191,3 +191,6 @@ mcp-task-queue/
|
||||||
.cursor/rules/multi-agent-tester.mdc
|
.cursor/rules/multi-agent-tester.mdc
|
||||||
.cursor/rules/multi-agent-reviewer.mdc
|
.cursor/rules/multi-agent-reviewer.mdc
|
||||||
.cursor/rules/multi-agent-knowledge.mdc
|
.cursor/rules/multi-agent-knowledge.mdc
|
||||||
|
|
||||||
|
# 파이프라인 회고록 (자동 생성)
|
||||||
|
docs/retrospectives/
|
||||||
|
|
|
||||||
|
|
@ -97,10 +97,23 @@ export interface ExcelUploadModalProps {
|
||||||
interface ColumnMapping {
|
interface ColumnMapping {
|
||||||
excelColumn: string;
|
excelColumn: string;
|
||||||
systemColumn: string | null;
|
systemColumn: string | null;
|
||||||
// 중복 체크 설정 (해당 컬럼을 중복 체크 키로 사용할지)
|
|
||||||
checkDuplicate?: boolean;
|
checkDuplicate?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function flattenCategoryValues(
|
||||||
|
values: Array<{ valueCode: string; valueLabel: string; children?: any[] }>
|
||||||
|
): Array<{ valueCode: string; valueLabel: string }> {
|
||||||
|
const result: Array<{ valueCode: string; valueLabel: string }> = [];
|
||||||
|
const traverse = (items: any[]) => {
|
||||||
|
for (const item of items) {
|
||||||
|
result.push({ valueCode: item.valueCode, valueLabel: item.valueLabel });
|
||||||
|
if (item.children?.length > 0) traverse(item.children);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
traverse(values);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
export const ExcelUploadModal: React.FC<ExcelUploadModalProps> = ({
|
export const ExcelUploadModal: React.FC<ExcelUploadModalProps> = ({
|
||||||
open,
|
open,
|
||||||
onOpenChange,
|
onOpenChange,
|
||||||
|
|
@ -681,12 +694,8 @@ export const ExcelUploadModal: React.FC<ExcelUploadModalProps> = ({
|
||||||
const valuesResponse = await getCategoryValues(targetTableName, catCol.systemCol);
|
const valuesResponse = await getCategoryValues(targetTableName, catCol.systemCol);
|
||||||
if (!valuesResponse.success || !valuesResponse.data) continue;
|
if (!valuesResponse.success || !valuesResponse.data) continue;
|
||||||
|
|
||||||
const validValues = valuesResponse.data as Array<{
|
const validValues = flattenCategoryValues(valuesResponse.data as any[]);
|
||||||
valueCode: string;
|
|
||||||
valueLabel: string;
|
|
||||||
}>;
|
|
||||||
|
|
||||||
// 유효한 코드와 라벨 Set 생성
|
|
||||||
const validCodes = new Set(validValues.map((v) => v.valueCode));
|
const validCodes = new Set(validValues.map((v) => v.valueCode));
|
||||||
const validLabels = new Set(validValues.map((v) => v.valueLabel));
|
const validLabels = new Set(validValues.map((v) => v.valueLabel));
|
||||||
const validLabelsLower = new Set(validValues.map((v) => v.valueLabel.toLowerCase()));
|
const validLabelsLower = new Set(validValues.map((v) => v.valueLabel.toLowerCase()));
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,20 @@ interface ColumnMapping {
|
||||||
targetColumn: string | null;
|
targetColumn: string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function flattenCategoryValues(
|
||||||
|
values: Array<{ valueCode: string; valueLabel: string; children?: any[] }>
|
||||||
|
): Array<{ valueCode: string; valueLabel: string }> {
|
||||||
|
const result: Array<{ valueCode: string; valueLabel: string }> = [];
|
||||||
|
const traverse = (items: any[]) => {
|
||||||
|
for (const item of items) {
|
||||||
|
result.push({ valueCode: item.valueCode, valueLabel: item.valueLabel });
|
||||||
|
if (item.children?.length > 0) traverse(item.children);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
traverse(values);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
export const MultiTableExcelUploadModal: React.FC<MultiTableExcelUploadModalProps> = ({
|
export const MultiTableExcelUploadModal: React.FC<MultiTableExcelUploadModalProps> = ({
|
||||||
open,
|
open,
|
||||||
onOpenChange,
|
onOpenChange,
|
||||||
|
|
@ -356,10 +370,7 @@ export const MultiTableExcelUploadModal: React.FC<MultiTableExcelUploadModalProp
|
||||||
const valuesResponse = await getCategoryValues(level.tableName, catColName);
|
const valuesResponse = await getCategoryValues(level.tableName, catColName);
|
||||||
if (!valuesResponse.success || !valuesResponse.data) continue;
|
if (!valuesResponse.success || !valuesResponse.data) continue;
|
||||||
|
|
||||||
const validValues = valuesResponse.data as Array<{
|
const validValues = flattenCategoryValues(valuesResponse.data as any[]);
|
||||||
valueCode: string;
|
|
||||||
valueLabel: string;
|
|
||||||
}>;
|
|
||||||
|
|
||||||
const validCodes = new Set(validValues.map((v) => v.valueCode));
|
const validCodes = new Set(validValues.map((v) => v.valueCode));
|
||||||
const validLabels = new Set(validValues.map((v) => v.valueLabel));
|
const validLabels = new Set(validValues.map((v) => v.valueLabel));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue