From cdc1a6f34286c0cb6954dc91afaa296346743891 Mon Sep 17 00:00:00 2001 From: eastargh Date: Tue, 4 Aug 2026 17:58:24 +0900 Subject: [PATCH] =?UTF-8?q?IIM=20delete=20=EC=97=B0=EB=8F=99=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manage/rule/layoutsync/LayoutSyncService.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/eactive/eai/rms/onl/manage/rule/layoutsync/LayoutSyncService.java b/src/main/java/com/eactive/eai/rms/onl/manage/rule/layoutsync/LayoutSyncService.java index 10905ff..67cb6df 100644 --- a/src/main/java/com/eactive/eai/rms/onl/manage/rule/layoutsync/LayoutSyncService.java +++ b/src/main/java/com/eactive/eai/rms/onl/manage/rule/layoutsync/LayoutSyncService.java @@ -25,12 +25,15 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Service; +import com.eactive.eai.data.entity.onl.transformer.layout.QLayoutEntity; +import com.eactive.eai.data.entity.onl.transformer.layout.QLayoutItemEntity; import com.eactive.eai.rms.common.base.OnlBaseService; import com.eactive.eai.rms.common.datasource.DataSourceContextHolder; import com.eactive.eai.rms.common.util.StringUtils; import com.eactive.eai.rms.data.entity.onl.layout.LayoutService; import com.eactive.eai.rms.onl.manage.rule.layout.LayoutDao; import com.eactive.eai.rms.onl.manage.serviceinfo.eaimsg.EaiMsgDao; +import com.querydsl.jpa.impl.JPAQueryFactory; @Service("layoutSyncService") public class LayoutSyncService extends OnlBaseService { @@ -75,7 +78,16 @@ public class LayoutSyncService extends OnlBaseService { public void deleteLayout(HashMap vo) throws Exception { - layoutService.findById(Objects.toString(vo.get("loutName"))).ifPresent(layoutService::delete); + //등록안된 전문유형을 가진 레이아웃 경우 에러발생하기 때문에 JPA 사용 못함 + //layoutService.findById(Objects.toString(vo.get("loutName"))).ifPresent(layoutService::delete); + + String loutName = Objects.toString(vo.get("loutName")); + JPAQueryFactory qf = layoutService.getJPAQueryFactory(); + QLayoutItemEntity qItem = QLayoutItemEntity.layoutItemEntity; + QLayoutEntity qLayout = QLayoutEntity.layoutEntity; + + qf.delete(qItem).where(qItem.id.loutname.eq(loutName)).execute(); // tseaitr08 먼저 + qf.delete(qLayout).where(qLayout.loutname.eq(loutName)).execute(); // tseaitr07 } public List> getAllLayouts() throws Exception {