From 822377619dadd0383a0f7866b5dfaf84881bd77f Mon Sep 17 00:00:00 2001 From: jjh Date: Tue, 12 Sep 2023 15:51:25 +0900 Subject: [PATCH] =?UTF-8?q?=EB=AF=BC=EC=9B=90=EC=83=81=EB=8B=B4=20?= =?UTF-8?q?=EB=82=B4=EC=97=AD=20=EB=93=B1=EB=A1=9D,=20=EC=88=98=EC=A0=95,?= =?UTF-8?q?=20=EC=82=AD=EC=A0=9C=20=EC=B2=98=EB=A6=AC=EC=8B=9C=20=EB=A9=94?= =?UTF-8?q?=EC=8B=9C=EC=A7=80=20=EA=B4=80=EB=A0=A8=20=EC=88=98=EC=A0=95.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xit/fims/sprt/service/Sprt04Service.java | 6 +-- .../fims/sprt/service/bean/Sprt04Bean.java | 48 ++++++++++++++++--- .../sprt/service/bean/Sprt04ServiceBean.java | 6 +-- .../xit/fims/sprt/web/Sprt04Controller.java | 36 +++++++++++--- .../WEB-INF/jsp/fims/excl/excl01020-info.jsp | 8 ++-- .../WEB-INF/jsp/fims/sprt/sprt02080-info.jsp | 23 +++++---- .../WEB-INF/jsp/fims/sprt/sprt04020-info.jsp | 16 ++++--- 7 files changed, 106 insertions(+), 37 deletions(-) diff --git a/src/main/java/cokr/xit/fims/sprt/service/Sprt04Service.java b/src/main/java/cokr/xit/fims/sprt/service/Sprt04Service.java index bf7bb61b..663393dd 100644 --- a/src/main/java/cokr/xit/fims/sprt/service/Sprt04Service.java +++ b/src/main/java/cokr/xit/fims/sprt/service/Sprt04Service.java @@ -43,7 +43,7 @@ public interface Sprt04Service { *
  • 그렇지 않으면 false
  • * */ - boolean createCvlcptDscsnCn(CvlcptDscsnCn cvlcptDscsnCn); + String createCvlcptDscsnCn(CvlcptDscsnCn cvlcptDscsnCn); /**민원 상담 내용 정보를 수정한다. * @param cvlcptDscsnCn 민원 상담 내용 @@ -52,7 +52,7 @@ public interface Sprt04Service { *
  • 그렇지 않으면 false
  • * */ - boolean updateCvlcptDscsnCn(CvlcptDscsnCn cvlcptDscsnCn); + String updateCvlcptDscsnCn(CvlcptDscsnCn cvlcptDscsnCn); /**민원 상담 내용 정보를 삭제한다. * @param cvlcptDscsnCn 민원 상담 내용 @@ -61,6 +61,6 @@ public interface Sprt04Service { *
  • 그렇지 않으면 false
  • * */ - boolean removeCvlcptDscsnCn(CvlcptDscsnCn cvlcptDscsnCn); + String removeCvlcptDscsnCn(CvlcptDscsnCn cvlcptDscsnCn); } diff --git a/src/main/java/cokr/xit/fims/sprt/service/bean/Sprt04Bean.java b/src/main/java/cokr/xit/fims/sprt/service/bean/Sprt04Bean.java index 6da07e11..97721012 100644 --- a/src/main/java/cokr/xit/fims/sprt/service/bean/Sprt04Bean.java +++ b/src/main/java/cokr/xit/fims/sprt/service/bean/Sprt04Bean.java @@ -72,7 +72,11 @@ public class Sprt04Bean extends AbstractComponent { *
  • 그렇지 않으면 false
  • * */ - public boolean createCvlcptDscsnCn(CvlcptDscsnCn cvlcptDscsnCn) { + public String createCvlcptDscsnCn(CvlcptDscsnCn cvlcptDscsnCn) { + // 변수 선언 + boolean retSuccess = false; // DB 처리 결과 + String retMessage = ""; // 처리 결과 메시지 + if (cvlcptDscsnCn.getCvlcptRcptSeCd().equals("01")) { cvlcptDscsnCn.setVhrno(null); cvlcptDscsnCn.setRtpyrNo(null); @@ -82,7 +86,15 @@ public class Sprt04Bean extends AbstractComponent { cvlcptDscsnCn.setVhrno(null); } - return cvlcptDscsnCnMapper.insert(cvlcptDscsnCn); + retSuccess = cvlcptDscsnCnMapper.insert(cvlcptDscsnCn); + if (!retSuccess) { + // 예외를 발생시켜서 오류메세지를 보내고 DB Rollback + throw new RuntimeException("민원상담내용 대장 등록에 실패하였습니다."); + } + + retMessage = "[S] 작업이 정상 처리 되었습니다."; + + return retMessage; } /**민원 상담 내용 정보를 수정한다. @@ -92,8 +104,20 @@ public class Sprt04Bean extends AbstractComponent { *
  • 그렇지 않으면 false
  • * */ - public boolean updateCvlcptDscsnCn(CvlcptDscsnCn cvlcptDscsnCn) { - return cvlcptDscsnCnMapper.update(cvlcptDscsnCn); + public String updateCvlcptDscsnCn(CvlcptDscsnCn cvlcptDscsnCn) { + // 변수 선언 + boolean retSuccess = false; // DB 처리 결과 + String retMessage = ""; // 처리 결과 메시지 + + retSuccess = cvlcptDscsnCnMapper.update(cvlcptDscsnCn); + if (!retSuccess) { + // 예외를 발생시켜서 오류메세지를 보내고 DB Rollback + throw new RuntimeException("민원상담내용 대장 수정에 실패하였습니다."); + } + + retMessage = "[S] 작업이 정상 처리 되었습니다."; + + return retMessage; } /**민원 상담 내용 정보를 삭제한다. @@ -103,8 +127,20 @@ public class Sprt04Bean extends AbstractComponent { *
  • 그렇지 않으면 false
  • * */ - public boolean removeCvlcptDscsnCn(CvlcptDscsnCn cvlcptDscsnCn) { - return cvlcptDscsnCnMapper.delete(cvlcptDscsnCn); + public String removeCvlcptDscsnCn(CvlcptDscsnCn cvlcptDscsnCn) { + // 변수 선언 + boolean retSuccess = false; // DB 처리 결과 + String retMessage = ""; // 처리 결과 메시지 + + retSuccess = cvlcptDscsnCnMapper.delete(cvlcptDscsnCn); + if (!retSuccess) { + // 예외를 발생시켜서 오류메세지를 보내고 DB Rollback + throw new RuntimeException("민원상담내용 대장 삭제에 실패하였습니다."); + } + + retMessage = "[S] 작업이 정상 처리 되었습니다."; + + return retMessage; } } diff --git a/src/main/java/cokr/xit/fims/sprt/service/bean/Sprt04ServiceBean.java b/src/main/java/cokr/xit/fims/sprt/service/bean/Sprt04ServiceBean.java index f2385d94..4866a4de 100644 --- a/src/main/java/cokr/xit/fims/sprt/service/bean/Sprt04ServiceBean.java +++ b/src/main/java/cokr/xit/fims/sprt/service/bean/Sprt04ServiceBean.java @@ -50,17 +50,17 @@ public class Sprt04ServiceBean extends AbstractServiceBean implements Sprt04Serv } @Override - public boolean createCvlcptDscsnCn(CvlcptDscsnCn cvlcptDscsnCn) { + public String createCvlcptDscsnCn(CvlcptDscsnCn cvlcptDscsnCn) { return sprt04Bean.createCvlcptDscsnCn(cvlcptDscsnCn); } @Override - public boolean updateCvlcptDscsnCn(CvlcptDscsnCn cvlcptDscsnCn) { + public String updateCvlcptDscsnCn(CvlcptDscsnCn cvlcptDscsnCn) { return sprt04Bean.updateCvlcptDscsnCn(cvlcptDscsnCn); } @Override - public boolean removeCvlcptDscsnCn(CvlcptDscsnCn cvlcptDscsnCn) { + public String removeCvlcptDscsnCn(CvlcptDscsnCn cvlcptDscsnCn) { return sprt04Bean.removeCvlcptDscsnCn(cvlcptDscsnCn); } diff --git a/src/main/java/cokr/xit/fims/sprt/web/Sprt04Controller.java b/src/main/java/cokr/xit/fims/sprt/web/Sprt04Controller.java index 9f3e7ad6..c371b37b 100644 --- a/src/main/java/cokr/xit/fims/sprt/web/Sprt04Controller.java +++ b/src/main/java/cokr/xit/fims/sprt/web/Sprt04Controller.java @@ -96,10 +96,18 @@ public class Sprt04Controller extends ApplicationController { */ @PostMapping(name = "민원 상담 내용 등록", value = "/020/create.do") public ModelAndView createCvlcptDscsnCn(CvlcptDscsnCn cvlcptDscsnCn) { - boolean saved = sprt04Service.createCvlcptDscsnCn(cvlcptDscsnCn); + boolean saved = false; + String retMessage = sprt04Service.createCvlcptDscsnCn(cvlcptDscsnCn); + + if (retMessage.contains("[S]")) { + saved = true; + } else { + saved = false; + } return new ModelAndView("jsonView") - .addObject("saved", saved); + .addObject("saved", saved) + .addObject("retMessage", retMessage); } /**민원 상담 내용 정보를 수정한다. @@ -111,10 +119,18 @@ public class Sprt04Controller extends ApplicationController { */ @PostMapping(name = "민원 상담 내용 수정", value = "/020/update.do") public ModelAndView updateCvlcptDscsnCn(CvlcptDscsnCn cvlcptDscsnCn) { - boolean saved = sprt04Service.updateCvlcptDscsnCn(cvlcptDscsnCn); + boolean saved = false; + String retMessage = sprt04Service.updateCvlcptDscsnCn(cvlcptDscsnCn); + + if (retMessage.contains("[S]")) { + saved = true; + } else { + saved = false; + } return new ModelAndView("jsonView") - .addObject("saved", saved); + .addObject("saved", saved) + .addObject("retMessage", retMessage); } /**지정한 민원 상담 내용를 제거한다. @@ -127,9 +143,17 @@ public class Sprt04Controller extends ApplicationController { */ @PostMapping(name = "민원 상담 내용 제거", value = "/010/remove.do") public ModelAndView removeCvlcptDscsnCn(CvlcptDscsnCn cvlcptDscsnCn) { - boolean saved = sprt04Service.removeCvlcptDscsnCn(cvlcptDscsnCn); + boolean saved = false; + String retMessage = sprt04Service.removeCvlcptDscsnCn(cvlcptDscsnCn); + + if (retMessage.contains("[S]")) { + saved = true; + } else { + saved = false; + } return new ModelAndView("jsonView") - .addObject("saved", saved); + .addObject("saved", saved) + .addObject("retMessage", retMessage); } } diff --git a/src/main/webapp/WEB-INF/jsp/fims/excl/excl01020-info.jsp b/src/main/webapp/WEB-INF/jsp/fims/excl/excl01020-info.jsp index e9cd57fc..e2ca3202 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/excl/excl01020-info.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/excl/excl01020-info.jsp @@ -141,7 +141,7 @@ * **************************************************************************/ // 부과제외 구분에 따른 부과제외 사유 코드 설정 - function setFim021(seCode, rsnCode) { + setFim021 = (seCode, rsnCode) => { let cmnCode = FIM021[seCode]; $("#levyExclSeCd--${pageName}").val(cmnCode.code); @@ -159,14 +159,14 @@ * 초기 셋팅 **************************************************************************/ // 검색조건 초기값 셋팅 - function initForm${pageName}() { + initForm${pageName} = () => { // 달력 초기화 initDatepicker("frmEdit--${pageName}"); $("#levyExclYmd--${pageName}").datepicker("setDate", new Date()); } // 이벤트 설정 - function setEvent${pageName}() { + setEvent${pageName} = () => { // form-date 항목에서 키보드로 입력시 날짜 포맷팅 적용 $("#frmEdit--${pageName}").find(".form-date").each(function() { $(this).on("input",function() { @@ -185,7 +185,7 @@ * function **************************************************************************/ // 저장 - function fnSave${pageName}() { + fnSave${pageName} = () => { // validate 확인 if (!customValidate($("#frmEdit--${pageName}").find("input, select, textarea"))) return; diff --git a/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt02080-info.jsp b/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt02080-info.jsp index 671cf08d..c4c0d78f 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt02080-info.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt02080-info.jsp @@ -12,14 +12,14 @@ - - - @@ -154,6 +154,11 @@ // 삭제 callback ${pageName}Control.onRemove = (resp) => { + let btnTitle = $("#btnRemove--${pageName}").attr("title"); + let showMessage = resp.retMessage.replace(/[S]|[F]/g, btnTitle); + + dialog.alert(showMessage); + if (resp.saved) { fnDataRefreshInfo(); // 자료 재조회 } @@ -233,7 +238,7 @@ * function **************************************************************************/ // 민원 상담 내용 등록 - fnCreateCvlcptDscsnCn${pageName} = () => { + fnCreate${pageName} = () => { let crdnId = $("#crdnId--${pageNameMain}").val(); let sggCd = $("#sggCd--${pageNameMain}").val(); let taskSeCd = $("#taskSeCd--${pageNameMain}").val(); @@ -254,7 +259,7 @@ } // 민원 상담 내용 수정 - fnUpdateCvlcptDscsnCn${pageName} = () => { + fnUpdate${pageName} = () => { let crdnId = $("#crdnId--${pageNameMain}").val(); let sggCd = $("#sggCd--${pageNameMain}").val(); let taskSeCd = $("#taskSeCd--${pageNameMain}").val(); @@ -277,7 +282,7 @@ } // 민원 상담 내용 삭제 - fnRemoveCvlcptDscsnCn${pageName} = () => { + fnRemove${pageName} = () => { let crdnId = $("#crdnId--${pageNameMain}").val(); let sggCd = $("#sggCd--${pageNameMain}").val(); let taskSeCd = $("#taskSeCd--${pageNameMain}").val(); diff --git a/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt04020-info.jsp b/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt04020-info.jsp index 89e35453..da511091 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt04020-info.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt04020-info.jsp @@ -40,7 +40,7 @@ - + @@ -78,8 +78,12 @@ **************************************************************************/ // 저장 callback ${pageName}Control.onSave = (resp) => { + let dialogTitle = $("#" + ${pageName}Control.prefix + "Dialog").find("h5.modal-title").html(); + let showMessage = resp.retMessage.replace(/[S]|[F]/g, dialogTitle); + + dialog.alert(showMessage); + if (resp.saved) { - dialog.alert("저장됐습니다."); dialog.close(${pageName}Control.prefix + "Dialog"); } } @@ -88,7 +92,6 @@ ${pageName}Control.save = (info) => { if (!info) return; - let item = ${pageName}Control.getCurrent("item"); let create = isEmpty(info.cvlcptDscsnId); ajax.post({ @@ -102,7 +105,7 @@ * 초기 셋팅 **************************************************************************/ // 검색조건 초기값 셋팅 - function initForm${pageName}() { + initForm${pageName} = () => { let initDataset = ${cvlcptDscsnCn}; $("#cvlcptRcptSeCd--${pageName}").prop("disabled", true); @@ -113,7 +116,7 @@ } // 이벤트 설정 - function setEvent${pageName}() { + setEvent${pageName} = () => { } @@ -121,7 +124,7 @@ * function **************************************************************************/ // 저장 - function fnBtnSave${pageName}() { + fnSave${pageName} = () => { // validate 확인 if (!customValidate($("#frmEdit--${pageName}").find("input, select, textarea"))) return; @@ -132,6 +135,7 @@ } }); } + /************************************************************************** * script 진입 **************************************************************************/