From ba6dff6f9ebc4ff45e07cd9db1a7541426457ca1 Mon Sep 17 00:00:00 2001 From: daekuk Date: Tue, 30 Dec 2025 10:36:27 +0900 Subject: [PATCH] =?UTF-8?q?-=20=EA=B0=99=EC=9D=80=20ID=20=EB=A1=9C=20DEL?= =?UTF-8?q?=20->=20INSERT=20=EC=8B=9C=20=EC=B6=A9=EB=8F=8C=EB=8C=80?= =?UTF-8?q?=EC=9D=91=20-=20API=2020=EA=B1=B4=20=EC=A1=B0=ED=9A=8C=20->=20?= =?UTF-8?q?=EC=A0=84=EC=B2=B4=EC=A1=B0=ED=9A=8C=20-=20API=20LIST=20?= =?UTF-8?q?=EC=A0=80=EC=9E=A5=EC=8B=9C=20=EC=9A=94=EC=B2=AD/=EC=99=84?= =?UTF-8?q?=EB=A3=8C=20=EC=95=8C=20=EC=88=98=20=EC=9E=88=EB=8F=84=EB=A1=9D?= =?UTF-8?q?=20=EB=B2=84=ED=8A=BC=20=EC=A0=9C=EC=96=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jsp/onl/admin/authserver/scopeManDetail.jsp | 10 +++++++++- .../onl/authserver/ScopeEntityService.java | 16 +++++++++++++--- .../entity/onl/eaimsg/EAIMessageService.java | 2 -- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/WebContent/jsp/onl/admin/authserver/scopeManDetail.jsp b/WebContent/jsp/onl/admin/authserver/scopeManDetail.jsp index 2e5f6be..505483e 100644 --- a/WebContent/jsp/onl/admin/authserver/scopeManDetail.jsp +++ b/WebContent/jsp/onl/admin/authserver/scopeManDetail.jsp @@ -151,6 +151,10 @@ function saveApiGridData(scopeId, returnUrl) { type : "POST", url:mapping_url, data: postData, + beforeSend: function() { + $("[id^='btn_']").prop("disabled", true); + $("#btn_modify").text("처리중 . . . . ."); + }, success:function(args){ alert("저장 되었습니다."); @@ -158,7 +162,11 @@ function saveApiGridData(scopeId, returnUrl) { }, error:function(e){ alert(e.responseText); - } + }, + complete: function() { + $("[id^='btn_']").prop("disabled", false); + $("#btn_modify").text("수정"); + } }); } diff --git a/src/main/java/com/eactive/eai/rms/data/entity/onl/authserver/ScopeEntityService.java b/src/main/java/com/eactive/eai/rms/data/entity/onl/authserver/ScopeEntityService.java index 2f42d64..89b2a1e 100644 --- a/src/main/java/com/eactive/eai/rms/data/entity/onl/authserver/ScopeEntityService.java +++ b/src/main/java/com/eactive/eai/rms/data/entity/onl/authserver/ScopeEntityService.java @@ -1,21 +1,31 @@ package com.eactive.eai.rms.data.entity.onl.authserver; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; +import javax.persistence.EntityManager; +import javax.persistence.PersistenceContext; import com.eactive.eai.data.entity.onl.authserver.QScopeEntity; import com.eactive.eai.data.entity.onl.authserver.ScopeEntity; import com.eactive.eai.data.entity.onl.authserver.ScopeEntityId; import com.eactive.eai.data.jpa.AbstractDataService; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + @Service @Transactional public class ScopeEntityService extends AbstractDataService { - + + @PersistenceContext + private EntityManager entityManager; // AbstractDataService 의 entityManager가 private이라 접근 불가하여 별도 주입 + public void deleteByIdScopeId(String scopeId) { getJPAQueryFactory().delete(QScopeEntity.scopeEntity) .where(QScopeEntity.scopeEntity.id.scopeid.eq(scopeId)) .execute(); + + // 동일 트랜잭션 내에서 같은 ID로 재저장 시 충돌(EntityExistsException)을 방지 + entityManager.flush(); + entityManager.clear(); } } diff --git a/src/main/java/com/eactive/eai/rms/data/entity/onl/eaimsg/EAIMessageService.java b/src/main/java/com/eactive/eai/rms/data/entity/onl/eaimsg/EAIMessageService.java index 0cdc9c3..2aeb0e3 100644 --- a/src/main/java/com/eactive/eai/rms/data/entity/onl/eaimsg/EAIMessageService.java +++ b/src/main/java/com/eactive/eai/rms/data/entity/onl/eaimsg/EAIMessageService.java @@ -310,8 +310,6 @@ public class EAIMessageService extends AbstractDataService(result, pageable, result.size());