M-BOM 가공업체 빈값 저장이 reload 시 RPS로 복원되던 문제 수정

기존 fn_preprocessBomData 가 PROCESSING_VENDOR 비어있으면 무조건 RPS('0000008377')로 자동주입하여, 사용자가 저장한 빈값이 다시 복원되는 invariant 위반이 있었음. 컨트롤러의 bomDataType('SAVED'/'ASSIGNED_*'/'TEMPLATE')을 JSP로 전달해, 신규 할당/템플릿 단계에서만 자동주입하고 SAVED 재오픈 시에는 DB값을 그대로 보존하도록 변경.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-29 14:37:50 +09:00
parent 4baf05d05e
commit 009659d50b
2 changed files with 8 additions and 3 deletions

View File

@@ -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) {

View File

@@ -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";
}