From 6794321c72112c4c4574e2e8c0d4865d5a2a0f65 Mon Sep 17 00:00:00 2001 From: jiwoo Date: Fri, 19 Jan 2024 14:32:58 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9D=B4=EC=A7=80=EC=9A=B0=20-=20=EC=82=AC?= =?UTF-8?q?=EC=9A=A9=EC=9E=90=20=EB=82=B4=20=EC=95=8C=EB=A6=BC=20=EC=82=AD?= =?UTF-8?q?=EC=A0=9C=EA=B8=B0=EB=8A=A5=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/kcc/let/my/web/MyPageController.java | 38 +++++++++++++- .../notify/service/NotifyManageService.java | 2 + .../uss/notify/service/NotifyManageVO.java | 7 +++ .../notify/service/impl/NotifyManageDAO.java | 5 +- .../service/impl/NotifyManageServiceImpl.java | 6 +++ .../sym/ccm/notify/VEANotify_SQL_Tibero.xml | 6 +++ .../WEB-INF/jsp/web/my/myNotifyMngList.jsp | 50 +++++++++++++++++-- 7 files changed, 107 insertions(+), 7 deletions(-) diff --git a/src/main/java/kcc/let/my/web/MyPageController.java b/src/main/java/kcc/let/my/web/MyPageController.java index f0dda77a..04c10994 100644 --- a/src/main/java/kcc/let/my/web/MyPageController.java +++ b/src/main/java/kcc/let/my/web/MyPageController.java @@ -16,6 +16,7 @@ import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.mvc.support.RedirectAttributes; import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationInfo; @@ -493,7 +494,42 @@ public class MyPageController { return "web/my/myQnaMngDetail"; } - + @RequestMapping(value = { "/web/my/myNotifyMngDeleteAjax.do"}) + public ModelAndView myNotifyMngDeleteAjax( + @ModelAttribute("notifyManageVO") NotifyManageVO notifyManageVO + , ModelMap model + , RedirectAttributes redirectAttributes + , HttpSession session + , HttpServletRequest request + , String[] chk + ) throws Exception { + + ModelAndView modelAndView = new ModelAndView(); + modelAndView.setViewName("jsonView"); + + //로그인 처리==================================== + //로그인 정보 가져오기 + LoginVO loginVO = checkLoginUtil.getAuthLoginVO(); //권한에 따른 로그인 정보 가져오기 + SsoLoginVO ssoLoginVO = checkLoginUtil.getSSOLoginVO(request); //SSO 로그인 정보 가져오기 + + if (loginVO == null || ssoLoginVO == null) { + modelAndView.addObject("result", "loginFail"); + } + //로그인 처리==================================== + + try { + notifyManageVO.setCmmNotifyOrdArr(chk); + notifyManageService.updateChkedUseYnN(notifyManageVO); + modelAndView.addObject("result", "success"); + }catch(Exception e) { + e.printStackTrace(); + modelAndView.addObject("result", "fail"); + } + + //세부과정 목록 조회 + + return modelAndView; + } ////////////////////////////////////////////////////////////////////////////////////////////////////////////// // diff --git a/src/main/java/kcc/let/uss/notify/service/NotifyManageService.java b/src/main/java/kcc/let/uss/notify/service/NotifyManageService.java index 1e95bc60..38137c33 100644 --- a/src/main/java/kcc/let/uss/notify/service/NotifyManageService.java +++ b/src/main/java/kcc/let/uss/notify/service/NotifyManageService.java @@ -60,6 +60,8 @@ public interface NotifyManageService { int selectNotifyCnt(String uniqId); void updateM7DaysUseYnN(); + + void updateChkedUseYnN(NotifyManageVO notifyManageVO); } diff --git a/src/main/java/kcc/let/uss/notify/service/NotifyManageVO.java b/src/main/java/kcc/let/uss/notify/service/NotifyManageVO.java index 81a71248..9fb49704 100644 --- a/src/main/java/kcc/let/uss/notify/service/NotifyManageVO.java +++ b/src/main/java/kcc/let/uss/notify/service/NotifyManageVO.java @@ -46,6 +46,7 @@ public class NotifyManageVO extends ComDefaultVO implements Serializable { private String mngUserId; private String mngUserNm; + private String[] cmmNotifyOrdArr; public String getCmmNotifyOrd() { return cmmNotifyOrd; @@ -143,6 +144,12 @@ public class NotifyManageVO extends ComDefaultVO implements Serializable { public void setMngUserNm(String mngUserNm) { this.mngUserNm = mngUserNm; } + public String[] getCmmNotifyOrdArr() { + return cmmNotifyOrdArr; + } + public void setCmmNotifyOrdArr(String[] cmmNotifyOrdArr) { + this.cmmNotifyOrdArr = cmmNotifyOrdArr; + } diff --git a/src/main/java/kcc/let/uss/notify/service/impl/NotifyManageDAO.java b/src/main/java/kcc/let/uss/notify/service/impl/NotifyManageDAO.java index 9938ac02..78b19f10 100644 --- a/src/main/java/kcc/let/uss/notify/service/impl/NotifyManageDAO.java +++ b/src/main/java/kcc/let/uss/notify/service/impl/NotifyManageDAO.java @@ -5,8 +5,6 @@ import java.util.List; import org.springframework.stereotype.Repository; import egovframework.rte.psl.dataaccess.EgovAbstractDAO; -import kcc.com.cmm.service.CmmnDetailCode; -import kcc.let.sym.ccm.cde.service.CmmnDetailCodeVO; import kcc.let.uss.notify.service.NotifyManageVO; /** @@ -85,6 +83,9 @@ public class NotifyManageDAO extends EgovAbstractDAO { public void updateM7DaysUseYnN() { update("VEANotifyDAO.updateM7DaysUseYnN"); } + public void updateChkedUseYnN(NotifyManageVO notifyManageVO) { + update("VEANotifyDAO.updateChkedUseYnN", notifyManageVO); + } } diff --git a/src/main/java/kcc/let/uss/notify/service/impl/NotifyManageServiceImpl.java b/src/main/java/kcc/let/uss/notify/service/impl/NotifyManageServiceImpl.java index 42ff852e..639b1763 100644 --- a/src/main/java/kcc/let/uss/notify/service/impl/NotifyManageServiceImpl.java +++ b/src/main/java/kcc/let/uss/notify/service/impl/NotifyManageServiceImpl.java @@ -392,4 +392,10 @@ public class NotifyManageServiceImpl extends EgovAbstractServiceImpl implements notifyManageDAO.updateM7DaysUseYnN(); } + + @Override + public void updateChkedUseYnN(NotifyManageVO notifyManageVO) { + notifyManageDAO.updateChkedUseYnN(notifyManageVO); + + } } diff --git a/src/main/resources/egovframework/sqlmap/let/sym/ccm/notify/VEANotify_SQL_Tibero.xml b/src/main/resources/egovframework/sqlmap/let/sym/ccm/notify/VEANotify_SQL_Tibero.xml index 93155c2f..82ffc45c 100644 --- a/src/main/resources/egovframework/sqlmap/let/sym/ccm/notify/VEANotify_SQL_Tibero.xml +++ b/src/main/resources/egovframework/sqlmap/let/sym/ccm/notify/VEANotify_SQL_Tibero.xml @@ -165,4 +165,10 @@ WHERE FRST_REGIST_PNTTM SYSDATE - 7; + + + UPDATE VEA_CMM_NOTIFY + SET USE_YN = 'N' + WHERE #cmmNotifyOrdArr[]# + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/jsp/web/my/myNotifyMngList.jsp b/src/main/webapp/WEB-INF/jsp/web/my/myNotifyMngList.jsp index e8f222c8..5fbeef35 100644 --- a/src/main/webapp/WEB-INF/jsp/web/my/myNotifyMngList.jsp +++ b/src/main/webapp/WEB-INF/jsp/web/my/myNotifyMngList.jsp @@ -40,9 +40,44 @@ function fn_goDetail(cmmNotifyOrd){ form.submit(); } - - +function chkDelete(){ + var chkLen = $(listForm).find("input[name=chk]:checked").length; + if(chkLen == 0){ + alert("선택된 항목이 없습니다."); + return; + } + if(confirm("삭제하시겠습니까?")){ + var data = new FormData(document.getElementById("listForm")); + var url = "" + $.ajax({ + type : "Post", + url : url, + data : data, + dataType : 'json', + async : false, + processData : false, + contentType : false, + cache : false, + success : function(returnData){ + if(returnData.result == "success"){ + alert("삭제되었습니다."); + location.reload(); + }else{ + alert("실패하였습니다.") + } + }, + error : function(request, status, error){ + alert("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+error); + } + + }) + } + + +} + + @@ -81,12 +116,15 @@ function fn_goDetail(cmmNotifyOrd){ + + + - - + + @@ -95,6 +133,9 @@ function fn_goDetail(cmmNotifyOrd){ +
내알림 : 분야, 메시지, 등록일 등의 정보제공
분야 메시지 등록일
+ " type="checkbox" value=""/> + NEW @@ -126,6 +167,7 @@ function fn_goDetail(cmmNotifyOrd){
+