diff --git a/WebContent/WEB-INF/applicationContext-datasource-DEV.xml b/WebContent/WEB-INF/applicationContext-datasource-DEV.xml index ae71097..d3a8c40 100644 --- a/WebContent/WEB-INF/applicationContext-datasource-DEV.xml +++ b/WebContent/WEB-INF/applicationContext-datasource-DEV.xml @@ -49,7 +49,7 @@ class="com.eactive.eai.rms.common.datasource.DataSourceType" p:name="MONITORING" p:text="MONITORING" - p:schema="EMSADM" + p:schema="EMSAPP" p:dynamic="false" p:online="false" p:jndiName="jdbc/dsOBP_EMS" diff --git a/WebContent/WEB-INF/applicationContext-datasource-LOCAL.xml b/WebContent/WEB-INF/applicationContext-datasource-LOCAL.xml index 0333af5..44d3a57 100644 --- a/WebContent/WEB-INF/applicationContext-datasource-LOCAL.xml +++ b/WebContent/WEB-INF/applicationContext-datasource-LOCAL.xml @@ -49,7 +49,7 @@ class="com.eactive.eai.rms.common.datasource.DataSourceType" p:name="MONITORING" p:text="MONITORING" - p:schema="EMSADM" + p:schema="EMSAPP" p:dynamic="false" p:online="false" p:jndiName="jdbc/dsOBP_EMS" diff --git a/WebContent/WEB-INF/applicationContext-datasource-PROD.xml b/WebContent/WEB-INF/applicationContext-datasource-PROD.xml index de93916..a5934af 100644 --- a/WebContent/WEB-INF/applicationContext-datasource-PROD.xml +++ b/WebContent/WEB-INF/applicationContext-datasource-PROD.xml @@ -49,7 +49,7 @@ class="com.eactive.eai.rms.common.datasource.DataSourceType" p:name="MONITORING" p:text="MONITORING" - p:schema="EMSADM" + p:schema="EMSAPP" p:dynamic="false" p:online="false" p:jndiName="jdbc/dsOBP_EMS" diff --git a/WebContent/WEB-INF/applicationContext-datasource-STG.xml b/WebContent/WEB-INF/applicationContext-datasource-STG.xml index 5f851cc..a988edf 100644 --- a/WebContent/WEB-INF/applicationContext-datasource-STG.xml +++ b/WebContent/WEB-INF/applicationContext-datasource-STG.xml @@ -49,7 +49,7 @@ class="com.eactive.eai.rms.common.datasource.DataSourceType" p:name="MONITORING" p:text="MONITORING" - p:schema="EMSADM" + p:schema="EMSAPP" p:dynamic="false" p:online="false" p:jndiName="jdbc/dsOBP_EMS" diff --git a/WebContent/WEB-INF/properties/env.D.properties b/WebContent/WEB-INF/properties/env.D.properties index 21b5169..485aa23 100644 --- a/WebContent/WEB-INF/properties/env.D.properties +++ b/WebContent/WEB-INF/properties/env.D.properties @@ -10,7 +10,7 @@ hibernate.dialect=org.hibernate.dialect.Oracle12cDialect # Priority of the was -D option inst.Name=emsSvr11 -eai.tableowner=EMSADM +eai.tableowner=EMSAPP # P/T/D/S eai.systemmode=D eai.drmode=N diff --git a/WebContent/WEB-INF/properties/env.L.properties b/WebContent/WEB-INF/properties/env.L.properties index bb74413..412d981 100644 --- a/WebContent/WEB-INF/properties/env.L.properties +++ b/WebContent/WEB-INF/properties/env.L.properties @@ -10,7 +10,7 @@ hibernate.dialect=org.hibernate.dialect.Oracle12cDialect # Priority of the was -D option inst.Name=emsSvr96 -eai.tableowner=EMSADM +eai.tableowner=EMSAPP # P/T/D/S eai.systemmode=L eai.drmode=N diff --git a/WebContent/WEB-INF/properties/env.P.properties b/WebContent/WEB-INF/properties/env.P.properties index 2a732cc..83647b4 100644 --- a/WebContent/WEB-INF/properties/env.P.properties +++ b/WebContent/WEB-INF/properties/env.P.properties @@ -10,7 +10,7 @@ hibernate.dialect=org.hibernate.dialect.Oracle12cDialect # Priority of the was -D option inst.Name=emsSvr11 -eai.tableowner=EMSADM +eai.tableowner=EMSAPP # P/T/D/S eai.systemmode=P eai.drmode=N diff --git a/WebContent/WEB-INF/properties/env.T.properties b/WebContent/WEB-INF/properties/env.T.properties index 54c8578..a8f1b7e 100644 --- a/WebContent/WEB-INF/properties/env.T.properties +++ b/WebContent/WEB-INF/properties/env.T.properties @@ -10,7 +10,7 @@ hibernate.dialect=org.hibernate.dialect.Oracle12cDialect # Priority of the was -D option inst.Name=emsSvr11 -eai.tableowner=EMSADM +eai.tableowner=EMSAPP # P/T/D/S eai.systemmode=T eai.drmode=N diff --git a/WebContent/jsp/onl/apim/portalnotice/portalNoticeMan.jsp b/WebContent/jsp/onl/apim/portalnotice/portalNoticeMan.jsp index 0980d1c..d70554a 100644 --- a/WebContent/jsp/onl/apim/portalnotice/portalNoticeMan.jsp +++ b/WebContent/jsp/onl/apim/portalnotice/portalNoticeMan.jsp @@ -46,8 +46,39 @@ var icon = rowObject.hasAttachment ? 'File Attached' : ''; return cellvalue + icon; } - - + + function deleteSelectedRows() { + var selectedIds = $("#grid").jqGrid('getGridParam', 'selarrrow'); + + if (selectedIds.length === 0) { + alert('항목을 선택하세요.'); + return; + } + + if (!confirm('선택된 ' + selectedIds.length + '개 항목을 삭제하시겠습니까?')) { + return; + } + + $.ajax({ + type: "POST", + url: url, + dataType: "json", + data: { + cmd: 'DELETE_BULK', + ids: selectedIds.join(',') + }, + success: function(data) { + alert('삭제되었습니다.'); + $("#grid").jqGrid('clearGridData', true); + $("#grid").trigger("reloadGrid"); + }, + error: function(e) { + alert('삭제 중 오류가 발생했습니다.'); + } + }); + } + + function init(){ $.ajax({ type : "POST", @@ -103,6 +134,8 @@ autowidth: true, viewrecords: true, rowList : eval('[${rmsDefaultRowList}]'), + multiselect: true, + multiboxonly: true, ondblClickRow: function(rowId) { var rowData = $(this).getRowData(rowId); var id = rowData['id']; @@ -157,6 +190,10 @@ goNav(url2); }); + $("#btn_delete_selected").click(function(){ + deleteSelectedRows(); + }); + $("select[name=searchUseYn], input[name^=search]").keydown(function(key){ if (key.keyCode == 13){ $("#btn_search").click(); @@ -179,6 +216,7 @@
+
공지사항 목록공지사항을 관리합니다.
diff --git a/src/main/java/com/eactive/eai/rms/data/entity/onl/apim/portalnotice/PortalNoticeService.java b/src/main/java/com/eactive/eai/rms/data/entity/onl/apim/portalnotice/PortalNoticeService.java index be03578..70184f2 100644 --- a/src/main/java/com/eactive/eai/rms/data/entity/onl/apim/portalnotice/PortalNoticeService.java +++ b/src/main/java/com/eactive/eai/rms/data/entity/onl/apim/portalnotice/PortalNoticeService.java @@ -13,10 +13,16 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Sort; +import java.util.List; + @Service @Transactional(transactionManager = "transactionManagerForEMS") public class PortalNoticeService extends AbstractEMSDataSerivce { + public void deleteByIds(List ids) { + repository.deleteAllById(ids); + } + public Page findAll(Pageable pageable, PortalNoticeUISearch portalNoticeUISearch) { QPortalNotice qPortalNotice = QPortalNotice.portalNotice; diff --git a/src/main/java/com/eactive/eai/rms/onl/apim/portalnotice/PortalNoticeManController.java b/src/main/java/com/eactive/eai/rms/onl/apim/portalnotice/PortalNoticeManController.java index 3db73dd..c02bb8c 100644 --- a/src/main/java/com/eactive/eai/rms/onl/apim/portalnotice/PortalNoticeManController.java +++ b/src/main/java/com/eactive/eai/rms/onl/apim/portalnotice/PortalNoticeManController.java @@ -80,4 +80,10 @@ public class PortalNoticeManController extends BaseAnnotationController { return ResponseEntity.ok().build(); } + @PostMapping(value = "/onl/apim/portalnotice/portalNoticeMan.json", params = "cmd=DELETE_BULK") + public ResponseEntity deleteBulk(String ids) { + portalNoticeManService.deleteBulk(ids); + return ResponseEntity.ok().build(); + } + } diff --git a/src/main/java/com/eactive/eai/rms/onl/apim/portalnotice/PortalNoticeManService.java b/src/main/java/com/eactive/eai/rms/onl/apim/portalnotice/PortalNoticeManService.java index 09bf0ad..a668864 100644 --- a/src/main/java/com/eactive/eai/rms/onl/apim/portalnotice/PortalNoticeManService.java +++ b/src/main/java/com/eactive/eai/rms/onl/apim/portalnotice/PortalNoticeManService.java @@ -23,6 +23,8 @@ import java.io.IOException; import java.io.UnsupportedEncodingException; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; import java.util.Optional; @Service @@ -147,4 +149,20 @@ public class PortalNoticeManService extends BaseService { portalNoticeService.deleteById(id); } + public void deleteBulk(String ids) { + if (StringUtils.isBlank(ids)) { + return; + } + + List idList = Arrays.asList(ids.split(",")); + + // 첨부파일 정리 (단건 삭제와 동일한 처리) + idList.forEach(id -> { + PortalNotice portalNotice = portalNoticeService.getById(id); + Optional.ofNullable(portalNotice.getFileId()).ifPresent(fileService::deleteFile); + }); + + portalNoticeService.deleteByIds(idList); + } + }