From f529aea087f83d1d1aadc9cc117f46d3d83f16e1 Mon Sep 17 00:00:00 2001 From: kent Date: Thu, 15 Jan 2026 22:02:09 +0900 Subject: [PATCH] =?UTF-8?q?feat(WEB):=20=EC=9E=91=EC=97=85=EC=A7=80?= =?UTF-8?q?=EC=8B=9C=20=EC=83=9D=EC=84=B1=20=EA=B0=9C=EB=B3=84=ED=92=88?= =?UTF-8?q?=EB=AA=A9=20=EB=A7=A4=EC=B9=AD=20=EB=A1=9C=EC=A7=81=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit matchItemToProcess 함수에 개별품목(process_items) 매칭 지원: - 정확한 이름/코드 매칭 - 부분 매칭 지원 (예: "상부 케이스" ↔ "상부 케이스 1219mm") - 3개 공정(스크린/절곡/슬랫)에 14개 품목 정상 분류 --- .../[id]/production-order/page.tsx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/app/[locale]/(protected)/sales/order-management-sales/[id]/production-order/page.tsx b/src/app/[locale]/(protected)/sales/order-management-sales/[id]/production-order/page.tsx index aac8ee92..13e65b56 100644 --- a/src/app/[locale]/(protected)/sales/order-management-sales/[id]/production-order/page.tsx +++ b/src/app/[locale]/(protected)/sales/order-management-sales/[id]/production-order/page.tsx @@ -216,6 +216,22 @@ function matchItemToProcess( for (const rule of process.classificationRules) { if (!rule.isActive) continue; + // 개별품목 규칙 (process_items에서 변환된 규칙) + if (rule.registrationType === "individual" && rule.items) { + const matched = rule.items.some((item) => { + // 1. 정확한 이름 매칭 + if (item.name === itemName) return true; + // 2. 정확한 코드 매칭 + if (itemCode && item.code === itemCode) return true; + // 3. 부분 매칭: 등록된 품목명이 주문 품목명을 포함 (예: "상부 케이스 1219mm" contains "상부 케이스") + if (item.name.includes(itemName)) return true; + // 4. 역 부분 매칭: 주문 품목명이 등록된 품목명을 포함 + if (itemName.includes(item.name)) return true; + return false; + }); + if (matched) return process; + } + // 패턴 매칭 규칙 if (rule.registrationType === "pattern") { let targetValue = "";