summaryrefslogtreecommitdiff
path: root/lib/items-tech/table/ship
diff options
context:
space:
mode:
Diffstat (limited to 'lib/items-tech/table/ship')
-rw-r--r--lib/items-tech/table/ship/import-item-handler.tsx6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/items-tech/table/ship/import-item-handler.tsx b/lib/items-tech/table/ship/import-item-handler.tsx
index 2a23d9d6..77bed4f0 100644
--- a/lib/items-tech/table/ship/import-item-handler.tsx
+++ b/lib/items-tech/table/ship/import-item-handler.tsx
@@ -59,12 +59,14 @@ export async function processFileImport(
try {
// 필드 매핑 (한글/영문 필드명 모두 지원)
const itemCode = row["아이템 코드"] || row["itemCode"] || "";
+ const itemName = row["아이템 명"] || row["itemName"] || "기술영업"; // 기본값 설정
const workType = row["기능(공종)"] || row["workType"] || "";
const itemList = row["아이템 리스트"] || row["itemList"] || null;
// 데이터 정제
const cleanedRow = {
itemCode: typeof itemCode === 'string' ? itemCode.trim() : String(itemCode).trim(),
+ itemName: typeof itemName === 'string' ? itemName.trim() : String(itemName).trim(),
workType: typeof workType === 'string' ? workType.trim() : String(workType).trim(),
itemList: itemList ? (typeof itemList === 'string' ? itemList : String(itemList)) : null,
};
@@ -94,7 +96,7 @@ export async function processFileImport(
// "option" 값으로 아이템 생성
const result = await createShipbuildingImportItem({
itemCode: cleanedRow.itemCode,
- itemName: "기술영업", // 기본값 사용
+ itemName: cleanedRow.itemName, // Excel에서 가져온 값 또는 기본값 사용
workType: cleanedRow.workType as "기장" | "전장" | "선실" | "배관" | "철의",
shipTypes: { "OPTION": true },
description: null,
@@ -115,7 +117,7 @@ export async function processFileImport(
for (const { type } of shipTypeEntries) {
const result = await createShipbuildingImportItem({
itemCode: cleanedRow.itemCode,
- itemName: "기술영업", // 기본값 사용
+ itemName: cleanedRow.itemName, // Excel에서 가져온 값 또는 기본값 사용
workType: cleanedRow.workType as "기장" | "전장" | "선실" | "배관" | "철의",
shipTypes: { [type]: true },
description: null,