From a82b944d5d1ec99c418a0ae0a0c9d59c3d8a93ac Mon Sep 17 00:00:00 2001 From: hjjeong Date: Fri, 20 Mar 2026 10:53:57 +0900 Subject: [PATCH] =?UTF-8?q?=ED=94=84=EB=A1=9C=EC=A0=9D=ED=8A=B8=20?= =?UTF-8?q?=EC=A4=91=EB=B3=B5=20=EC=83=9D=EC=84=B1=20=EB=B0=A9=EC=A7=80!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../contractMgmt/estimateAndOrderRegistFormPopup.jsp | 11 ++++++++++- .../pms/salesmgmt/service/ContractMgmtService.java | 10 ++++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/WebContent/WEB-INF/view/contractMgmt/estimateAndOrderRegistFormPopup.jsp b/WebContent/WEB-INF/view/contractMgmt/estimateAndOrderRegistFormPopup.jsp index 76301f2..bc921fc 100644 --- a/WebContent/WEB-INF/view/contractMgmt/estimateAndOrderRegistFormPopup.jsp +++ b/WebContent/WEB-INF/view/contractMgmt/estimateAndOrderRegistFormPopup.jsp @@ -125,14 +125,21 @@ return data.toString().replace(/,/g, ""); } + var isSaving = false; + function fn_save() { + if(isSaving) return false; + if (fnc_valitate("form1")) { // 품목 유효성 검사 if(!fn_validateItems()) { return false; } - + if(confirm("등록하시겠습니까?")) { + isSaving = true; + $("#btnSave").prop("disabled", true); + // 품목 데이터 수집 var itemsData = fn_collectItemsData(); console.log("최종 전송 데이터:", JSON.stringify(itemsData, null, 2)); @@ -163,6 +170,8 @@ }, error : function(jqxhr, status, error) { alert("저장 중 오류가 발생했습니다."); + isSaving = false; + $("#btnSave").prop("disabled", false); } }); } diff --git a/src/com/pms/salesmgmt/service/ContractMgmtService.java b/src/com/pms/salesmgmt/service/ContractMgmtService.java index ae1e293..4944207 100644 --- a/src/com/pms/salesmgmt/service/ContractMgmtService.java +++ b/src/com/pms/salesmgmt/service/ContractMgmtService.java @@ -2788,9 +2788,10 @@ private String encodeImageToBase64(String imagePath) { System.out.println("제품구분: Machine(0000928) - 품목별 수량만큼 프로젝트 생성"); } - // 품목별로 프로젝트 생성 또는 업데이트 + // 품목별로 프로젝트 생성 또는 업데이트 (같은 트랜잭션의 sqlSession 사용) paramMap.put("contractObjId", contract_objid); - List contractItems = getContractItems(paramMap); + List contractItemsRaw = sqlSession.selectList("contractMgmt.getContractItems", paramMap); + List> contractItems = CommonUtils.toUpperCaseMapKey(contractItemsRaw); if(contractItems != null && !contractItems.isEmpty()) { System.out.println("품목 개수: " + contractItems.size() + "개 - 프로젝트 " + (hasProject ? "업데이트" : "생성") + " 시작" + (isMachine ? " (Machine - 수량별 생성)" : "")); @@ -3021,9 +3022,10 @@ private String encodeImageToBase64(String imagePath) { System.out.println("제품구분: Machine(0000928) - 품목별 수량만큼 프로젝트 생성"); } - // 품목별로 프로젝트 생성 또는 업데이트 + // 품목별로 프로젝트 생성 또는 업데이트 (같은 트랜잭션의 sqlSession 사용) paramMap.put("contractObjId", contract_objid); - List contractItems = getContractItems(paramMap); + List contractItemsRaw2 = sqlSession.selectList("contractMgmt.getContractItems", paramMap); + List> contractItems = CommonUtils.toUpperCaseMapKey(contractItemsRaw2); if(contractItems != null && !contractItems.isEmpty()) { System.out.println("품목 개수: " + contractItems.size() + "개 - 프로젝트 " + (hasProject ? "업데이트" : "생성") + " 시작" + (isMachine ? " (Machine - 수량별 생성)" : ""));