From 009659d50b2a6e5c2af58fcd1edc8624e07ddf54 Mon Sep 17 00:00:00 2001 From: hjjeong Date: Wed, 29 Apr 2026 14:37:50 +0900 Subject: [PATCH] =?UTF-8?q?M-BOM=20=EA=B0=80=EA=B3=B5=EC=97=85=EC=B2=B4=20?= =?UTF-8?q?=EB=B9=88=EA=B0=92=20=EC=A0=80=EC=9E=A5=EC=9D=B4=20reload=20?= =?UTF-8?q?=EC=8B=9C=20RPS=EB=A1=9C=20=EB=B3=B5=EC=9B=90=EB=90=98=EB=8D=98?= =?UTF-8?q?=20=EB=AC=B8=EC=A0=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 기존 fn_preprocessBomData 가 PROCESSING_VENDOR 비어있으면 무조건 RPS('0000008377')로 자동주입하여, 사용자가 저장한 빈값이 다시 복원되는 invariant 위반이 있었음. 컨트롤러의 bomDataType('SAVED'/'ASSIGNED_*'/'TEMPLATE')을 JSP로 전달해, 신규 할당/템플릿 단계에서만 자동주입하고 SAVED 재오픈 시에는 DB값을 그대로 보존하도록 변경. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../WEB-INF/view/productionplanning/mBomPopupLeft.jsp | 9 ++++++--- src/com/pms/controller/ProductionPlanningController.java | 2 ++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/WebContent/WEB-INF/view/productionplanning/mBomPopupLeft.jsp b/WebContent/WEB-INF/view/productionplanning/mBomPopupLeft.jsp index 668899a..a75d67a 100644 --- a/WebContent/WEB-INF/view/productionplanning/mBomPopupLeft.jsp +++ b/WebContent/WEB-INF/view/productionplanning/mBomPopupLeft.jsp @@ -1020,8 +1020,10 @@ function fn_initGrid() { // 서버에서 전달받은 데이터 확인 var bomTreeData = ${bomTreeListJson}; + var bomDataType = '${bomDataType}'; console.log("bomTreeData:", bomTreeData); console.log("bomTreeData length:", bomTreeData ? bomTreeData.length : 0); + console.log("bomDataType:", bomDataType); // 대소문자 무관하게 필드값 가져오기 (PostgreSQL map은 소문자, UpperKeyMap은 대문자) function fn_getField(row, upperName) { @@ -1093,9 +1095,10 @@ function fn_initGrid() { } else { row.ORDER_QTY = fn_calcOrderQty(row); } - - // 가공업체 기본값: Level 2 이상 비구매품에만 RPS 설정 (Level 1 제외) - if(!row.PROCESSING_VENDOR) { + + // 가공업체 기본값: 할당(ASSIGNED_*/TEMPLATE) 단계의 신규 표시에만 RPS 자동주입. + // SAVED는 사용자가 저장한 값(빈값 포함)을 그대로 보존. + if(bomDataType !== 'SAVED' && !row.PROCESSING_VENDOR) { var partTypeTitle = row.PART_TYPE_TITLE || row.part_type_title || ''; var level = parseInt(row.LEVEL || row.LEV || 0); if(level > 1 && partTypeTitle.indexOf('구매품') < 0) { diff --git a/src/com/pms/controller/ProductionPlanningController.java b/src/com/pms/controller/ProductionPlanningController.java index 52f26f3..9a49bb8 100644 --- a/src/com/pms/controller/ProductionPlanningController.java +++ b/src/com/pms/controller/ProductionPlanningController.java @@ -1259,6 +1259,7 @@ public class ProductionPlanningController extends BaseService { request.setAttribute("MAXLEV", maxLevel); request.setAttribute("bomTreeListJson", gson.toJson(mbomDetailList)); + request.setAttribute("bomDataType", bomDataType); return "/productionplanning/mBomPopupLeft"; } } @@ -1270,6 +1271,7 @@ public class ProductionPlanningController extends BaseService { // 데이터가 없을 때 빈 배열 설정 request.setAttribute("MAXLEV", 1); request.setAttribute("bomTreeListJson", "[]"); + request.setAttribute("bomDataType", ""); return "/productionplanning/mBomPopupLeft"; }