포탈 공지사항 삭제 기능 추가 / ADM -> APP
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -46,8 +46,39 @@
|
||||
var icon = rowObject.hasAttachment ? '<img src="' + iconPath + '" alt="File Attached" style="vertical-align: middle; margin-left: 5px; width: 16px; height: 16px;">' : '';
|
||||
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 @@
|
||||
<div class="search_wrap">
|
||||
<button type="button" class="cssbtn" id="btn_new" level="W"><i class="material-icons">add</i> <%= localeMessage.getString("button.new") %></button>
|
||||
<button type="button" class="cssbtn" id="btn_search" level="R"><i class="material-icons">search</i> <%= localeMessage.getString("button.search") %></button>
|
||||
<button type="button" class="cssbtn" id="btn_delete_selected" level="W" style="background-color: #dc3545; border-color: #dc3545; color: white;"><i class="material-icons">delete_forever</i> 선택 삭제</button>
|
||||
</div>
|
||||
<div class="title">공지사항 목록<span class="tooltip">공지사항을 관리합니다.</span></div>
|
||||
<form id="ajaxForm" onsubmit="return false;">
|
||||
|
||||
+6
@@ -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<PortalNotice, String, PortalNoticeRepository> {
|
||||
|
||||
public void deleteByIds(List<String> ids) {
|
||||
repository.deleteAllById(ids);
|
||||
}
|
||||
|
||||
public Page<PortalNotice> findAll(Pageable pageable, PortalNoticeUISearch portalNoticeUISearch) {
|
||||
QPortalNotice qPortalNotice = QPortalNotice.portalNotice;
|
||||
|
||||
|
||||
@@ -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<String> deleteBulk(String ids) {
|
||||
portalNoticeManService.deleteBulk(ids);
|
||||
return ResponseEntity.ok().build();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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<String> idList = Arrays.asList(ids.split(","));
|
||||
|
||||
// 첨부파일 정리 (단건 삭제와 동일한 처리)
|
||||
idList.forEach(id -> {
|
||||
PortalNotice portalNotice = portalNoticeService.getById(id);
|
||||
Optional.ofNullable(portalNotice.getFileId()).ifPresent(fileService::deleteFile);
|
||||
});
|
||||
|
||||
portalNoticeService.deleteByIds(idList);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user