feature/screen-management #351
|
|
@ -705,43 +705,27 @@ export const ExcelUploadModal: React.FC<ExcelUploadModalProps> = ({
|
|||
}
|
||||
} else {
|
||||
// 기존 단일 테이블 업로드 로직
|
||||
console.log("📊 단일 테이블 업로드 시작:", {
|
||||
tableName,
|
||||
uploadMode,
|
||||
numberingRuleId,
|
||||
numberingTargetColumn,
|
||||
dataCount: filteredData.length,
|
||||
});
|
||||
|
||||
let successCount = 0;
|
||||
let failCount = 0;
|
||||
|
||||
// 🆕 단일 테이블 채번 설정 확인
|
||||
// 단일 테이블 채번 설정 확인
|
||||
const hasNumbering = numberingRuleId && numberingTargetColumn;
|
||||
console.log("📊 채번 설정:", { hasNumbering, numberingRuleId, numberingTargetColumn });
|
||||
|
||||
for (const row of filteredData) {
|
||||
try {
|
||||
let dataToSave = { ...row };
|
||||
|
||||
// 🆕 채번 적용: 각 행마다 채번 API 호출
|
||||
// 채번 적용: 각 행마다 채번 API 호출
|
||||
if (hasNumbering && uploadMode === "insert") {
|
||||
try {
|
||||
const { apiClient } = await import("@/lib/api/client");
|
||||
console.log(`📊 채번 API 호출: /numbering-rules/${numberingRuleId}/allocate`);
|
||||
const numberingResponse = await apiClient.post(`/numbering-rules/${numberingRuleId}/allocate`);
|
||||
console.log(`📊 채번 API 응답:`, numberingResponse.data);
|
||||
// 응답 구조: { success: true, data: { generatedCode: "..." } }
|
||||
const generatedCode = numberingResponse.data?.data?.generatedCode || numberingResponse.data?.data?.code;
|
||||
if (numberingResponse.data?.success && generatedCode) {
|
||||
dataToSave[numberingTargetColumn] = generatedCode;
|
||||
console.log(`✅ 채번 적용: ${numberingTargetColumn} = ${generatedCode}`);
|
||||
} else {
|
||||
console.warn(`⚠️ 채번 실패: 응답에 코드 없음`, numberingResponse.data);
|
||||
}
|
||||
} catch (numError) {
|
||||
console.error("채번 오류:", numError);
|
||||
// 채번 실패 시에도 계속 진행 (채번 컬럼만 비워둠)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4835,19 +4835,7 @@ export class ButtonActionExecutor {
|
|||
*/
|
||||
private static async handleExcelUpload(config: ButtonActionConfig, context: ButtonActionContext): Promise<boolean> {
|
||||
try {
|
||||
console.log("📤 엑셀 업로드 모달 열기:", {
|
||||
config,
|
||||
context,
|
||||
userId: context.userId,
|
||||
tableName: context.tableName,
|
||||
screenId: context.screenId,
|
||||
// 채번 설정 디버깅
|
||||
numberingRuleId: config.excelNumberingRuleId,
|
||||
numberingTargetColumn: config.excelNumberingTargetColumn,
|
||||
afterUploadFlows: config.excelAfterUploadFlows,
|
||||
});
|
||||
|
||||
// 🆕 마스터-디테일 구조 확인 (화면에 분할 패널이 있으면 자동 감지)
|
||||
// 마스터-디테일 구조 확인 (화면에 분할 패널이 있으면 자동 감지)
|
||||
let isMasterDetail = false;
|
||||
let masterDetailRelation: any = null;
|
||||
let masterDetailExcelConfig: any = undefined;
|
||||
|
|
|
|||
Loading…
Reference in New Issue