From 8440ac29c7dcbef992039678ecc0fabff2fd04ec Mon Sep 17 00:00:00 2001
From: dujinkim <dujin.kim@dtsolution.co.kr>
Date: Mon, 1 Dec 2025 00:58:23 +0000
Subject: (대표님) S-EDP 관련 대표님 작업사항
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 components/form-data-plant/import-excel-form.tsx | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

(limited to 'components/form-data-plant/import-excel-form.tsx')

diff --git a/components/form-data-plant/import-excel-form.tsx b/components/form-data-plant/import-excel-form.tsx
index ffc6f2f9..8ac70c59 100644
--- a/components/form-data-plant/import-excel-form.tsx
+++ b/components/form-data-plant/import-excel-form.tsx
@@ -23,7 +23,8 @@ export interface ImportExcelOptions {
   tableData: GenericData[];
   columnsJSON: DataTableColumnJSON[];
   formCode?: string;
-  contractItemId?: number;
+  projectCode: string;
+  packageCode: string;
   editableFieldsMap?: Map<string, string[]>; // 새로 추가
   onPendingChange?: (isPending: boolean) => void;
   onDataUpdate?: (updater: ((prev: GenericData[]) => GenericData[]) | GenericData[]) => void;
@@ -218,7 +219,8 @@ export async function importExcelData({
   tableData,
   columnsJSON,
   formCode,
-  contractItemId,
+  projectCode,
+  packageCode,
   editableFieldsMap = new Map(), // 새로 추가
   onPendingChange,
   onDataUpdate
@@ -527,14 +529,14 @@ export async function importExcelData({
       }
     });
 
-    // If formCode and contractItemId are provided, save directly to DB
     // importExcelData 함수에서 DB 저장 부분
-    if (formCode && contractItemId) {
+    if (formCode && projectCode && packageCode) {
       try {
         // 배치 업데이트 함수 호출
         const result = await updateFormDataBatchInDB(
           formCode,
-          contractItemId,
+          projectCode,
+          packageCode,
           importedData // 모든 imported rows를 한번에 전달
         );
 
@@ -633,7 +635,6 @@ export async function importExcelData({
       }
 
     } else {
-      // formCode나 contractItemId가 없는 경우 - 로컬 업데이트만
       if (onDataUpdate) {
         onDataUpdate(() => mergedData);
       }
-- 
cgit v1.2.3

