민원상담 내역 등록, 수정, 삭제 처리시 메시지 관련 수정.

main
jjh 1 year ago
parent e9b5811145
commit 822377619d

@ -43,7 +43,7 @@ public interface Sprt04Service {
* <li> false</li> * <li> false</li>
* </ul> * </ul>
*/ */
boolean createCvlcptDscsnCn(CvlcptDscsnCn cvlcptDscsnCn); String createCvlcptDscsnCn(CvlcptDscsnCn cvlcptDscsnCn);
/** . /** .
* @param cvlcptDscsnCn * @param cvlcptDscsnCn
@ -52,7 +52,7 @@ public interface Sprt04Service {
* <li> false</li> * <li> false</li>
* </ul> * </ul>
*/ */
boolean updateCvlcptDscsnCn(CvlcptDscsnCn cvlcptDscsnCn); String updateCvlcptDscsnCn(CvlcptDscsnCn cvlcptDscsnCn);
/** . /** .
* @param cvlcptDscsnCn * @param cvlcptDscsnCn
@ -61,6 +61,6 @@ public interface Sprt04Service {
* <li> false</li> * <li> false</li>
* </ul> * </ul>
*/ */
boolean removeCvlcptDscsnCn(CvlcptDscsnCn cvlcptDscsnCn); String removeCvlcptDscsnCn(CvlcptDscsnCn cvlcptDscsnCn);
} }

@ -72,7 +72,11 @@ public class Sprt04Bean extends AbstractComponent {
* <li> false</li> * <li> false</li>
* </ul> * </ul>
*/ */
public boolean createCvlcptDscsnCn(CvlcptDscsnCn cvlcptDscsnCn) { public String createCvlcptDscsnCn(CvlcptDscsnCn cvlcptDscsnCn) {
// 변수 선언
boolean retSuccess = false; // DB 처리 결과
String retMessage = ""; // 처리 결과 메시지
if (cvlcptDscsnCn.getCvlcptRcptSeCd().equals("01")) { if (cvlcptDscsnCn.getCvlcptRcptSeCd().equals("01")) {
cvlcptDscsnCn.setVhrno(null); cvlcptDscsnCn.setVhrno(null);
cvlcptDscsnCn.setRtpyrNo(null); cvlcptDscsnCn.setRtpyrNo(null);
@ -82,7 +86,15 @@ public class Sprt04Bean extends AbstractComponent {
cvlcptDscsnCn.setVhrno(null); 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 {
* <li> false</li> * <li> false</li>
* </ul> * </ul>
*/ */
public boolean updateCvlcptDscsnCn(CvlcptDscsnCn cvlcptDscsnCn) { public String updateCvlcptDscsnCn(CvlcptDscsnCn cvlcptDscsnCn) {
return cvlcptDscsnCnMapper.update(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 {
* <li> false</li> * <li> false</li>
* </ul> * </ul>
*/ */
public boolean removeCvlcptDscsnCn(CvlcptDscsnCn cvlcptDscsnCn) { public String removeCvlcptDscsnCn(CvlcptDscsnCn cvlcptDscsnCn) {
return cvlcptDscsnCnMapper.delete(cvlcptDscsnCn); // 변수 선언
boolean retSuccess = false; // DB 처리 결과
String retMessage = ""; // 처리 결과 메시지
retSuccess = cvlcptDscsnCnMapper.delete(cvlcptDscsnCn);
if (!retSuccess) {
// 예외를 발생시켜서 오류메세지를 보내고 DB Rollback
throw new RuntimeException("민원상담내용 대장 삭제에 실패하였습니다.");
}
retMessage = "[S] 작업이 정상 처리 되었습니다.";
return retMessage;
} }
} }

@ -50,17 +50,17 @@ public class Sprt04ServiceBean extends AbstractServiceBean implements Sprt04Serv
} }
@Override @Override
public boolean createCvlcptDscsnCn(CvlcptDscsnCn cvlcptDscsnCn) { public String createCvlcptDscsnCn(CvlcptDscsnCn cvlcptDscsnCn) {
return sprt04Bean.createCvlcptDscsnCn(cvlcptDscsnCn); return sprt04Bean.createCvlcptDscsnCn(cvlcptDscsnCn);
} }
@Override @Override
public boolean updateCvlcptDscsnCn(CvlcptDscsnCn cvlcptDscsnCn) { public String updateCvlcptDscsnCn(CvlcptDscsnCn cvlcptDscsnCn) {
return sprt04Bean.updateCvlcptDscsnCn(cvlcptDscsnCn); return sprt04Bean.updateCvlcptDscsnCn(cvlcptDscsnCn);
} }
@Override @Override
public boolean removeCvlcptDscsnCn(CvlcptDscsnCn cvlcptDscsnCn) { public String removeCvlcptDscsnCn(CvlcptDscsnCn cvlcptDscsnCn) {
return sprt04Bean.removeCvlcptDscsnCn(cvlcptDscsnCn); return sprt04Bean.removeCvlcptDscsnCn(cvlcptDscsnCn);
} }

@ -96,10 +96,18 @@ public class Sprt04Controller extends ApplicationController {
*/ */
@PostMapping(name = "민원 상담 내용 등록", value = "/020/create.do") @PostMapping(name = "민원 상담 내용 등록", value = "/020/create.do")
public ModelAndView createCvlcptDscsnCn(CvlcptDscsnCn cvlcptDscsnCn) { 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") 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") @PostMapping(name = "민원 상담 내용 수정", value = "/020/update.do")
public ModelAndView updateCvlcptDscsnCn(CvlcptDscsnCn cvlcptDscsnCn) { 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") 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") @PostMapping(name = "민원 상담 내용 제거", value = "/010/remove.do")
public ModelAndView removeCvlcptDscsnCn(CvlcptDscsnCn cvlcptDscsnCn) { 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") return new ModelAndView("jsonView")
.addObject("saved", saved); .addObject("saved", saved)
.addObject("retMessage", retMessage);
} }
} }

@ -141,7 +141,7 @@
* *
**************************************************************************/ **************************************************************************/
// 부과제외 구분에 따른 부과제외 사유 코드 설정 // 부과제외 구분에 따른 부과제외 사유 코드 설정
function setFim021(seCode, rsnCode) { setFim021 = (seCode, rsnCode) => {
let cmnCode = FIM021[seCode]; let cmnCode = FIM021[seCode];
$("#levyExclSeCd--${pageName}").val(cmnCode.code); $("#levyExclSeCd--${pageName}").val(cmnCode.code);
@ -159,14 +159,14 @@
* 초기 셋팅 * 초기 셋팅
**************************************************************************/ **************************************************************************/
// 검색조건 초기값 셋팅 // 검색조건 초기값 셋팅
function initForm${pageName}() { initForm${pageName} = () => {
// 달력 초기화 // 달력 초기화
initDatepicker("frmEdit--${pageName}"); initDatepicker("frmEdit--${pageName}");
$("#levyExclYmd--${pageName}").datepicker("setDate", new Date()); $("#levyExclYmd--${pageName}").datepicker("setDate", new Date());
} }
// 이벤트 설정 // 이벤트 설정
function setEvent${pageName}() { setEvent${pageName} = () => {
// form-date 항목에서 키보드로 입력시 날짜 포맷팅 적용 // form-date 항목에서 키보드로 입력시 날짜 포맷팅 적용
$("#frmEdit--${pageName}").find(".form-date").each(function() { $("#frmEdit--${pageName}").find(".form-date").each(function() {
$(this).on("input",function() { $(this).on("input",function() {
@ -185,7 +185,7 @@
* function * function
**************************************************************************/ **************************************************************************/
// 저장 // 저장
function fnSave${pageName}() { fnSave${pageName} = () => {
// validate 확인 // validate 확인
if (!customValidate($("#frmEdit--${pageName}").find("input, select, textarea"))) return; if (!customValidate($("#frmEdit--${pageName}").find("input, select, textarea"))) return;

@ -12,13 +12,13 @@
<label class="w-px-120 bg-label-danger pe-2 col-form-label text-sm-center">민원상담 정보</label> <label class="w-px-120 bg-label-danger pe-2 col-form-label text-sm-center">민원상담 정보</label>
<!-- 버튼 우측 정렬 --> <!-- 버튼 우측 정렬 -->
<span class="container-window-btn-right"> <span class="container-window-btn-right">
<button type="button" class="btn btn-primary" id="btnCreateCvlcptDscsnCn--${pageName}" title="민원 상담 등록" onclick="fnCreateCvlcptDscsnCn${pageName}();"> <button type="button" class="btn btn-primary" id="btnCreate--${pageName}" title="민원상담 등록" onclick="fnCreate${pageName}();">
민원상담 등록 민원상담 등록
</button> </button>
<button type="button" class="btn btn-primary" id="btnUpdateCvlcptDscsnCn--${pageName}" title="민원 상담 수정" onclick="fnUpdateCvlcptDscsnCn${pageName}();"> <button type="button" class="btn btn-primary" id="btnUpdate--${pageName}" title="민원상담 수정" onclick="fnUpdate${pageName}();">
민원상담 수정 민원상담 수정
</button> </button>
<button type="button" class="btn btn-primary" id="btnRemoveCvlcptDscsnCn--${pageName}" title="민원 상담 삭제" onclick="fnRemoveCvlcptDscsnCn${pageName}();"> <button type="button" class="btn btn-primary" id="btnRemove--${pageName}" title="민원상담 삭제" onclick="fnRemove${pageName}();">
민원상담 삭제 민원상담 삭제
</button> </button>
</span> <!-- <span class="container-window-btn-right"> --> </span> <!-- <span class="container-window-btn-right"> -->
@ -154,6 +154,11 @@
// 삭제 callback // 삭제 callback
${pageName}Control.onRemove = (resp) => { ${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) { if (resp.saved) {
fnDataRefreshInfo(); // 자료 재조회 fnDataRefreshInfo(); // 자료 재조회
} }
@ -233,7 +238,7 @@
* function * function
**************************************************************************/ **************************************************************************/
// 민원 상담 내용 등록 // 민원 상담 내용 등록
fnCreateCvlcptDscsnCn${pageName} = () => { fnCreate${pageName} = () => {
let crdnId = $("#crdnId--${pageNameMain}").val(); let crdnId = $("#crdnId--${pageNameMain}").val();
let sggCd = $("#sggCd--${pageNameMain}").val(); let sggCd = $("#sggCd--${pageNameMain}").val();
let taskSeCd = $("#taskSeCd--${pageNameMain}").val(); let taskSeCd = $("#taskSeCd--${pageNameMain}").val();
@ -254,7 +259,7 @@
} }
// 민원 상담 내용 수정 // 민원 상담 내용 수정
fnUpdateCvlcptDscsnCn${pageName} = () => { fnUpdate${pageName} = () => {
let crdnId = $("#crdnId--${pageNameMain}").val(); let crdnId = $("#crdnId--${pageNameMain}").val();
let sggCd = $("#sggCd--${pageNameMain}").val(); let sggCd = $("#sggCd--${pageNameMain}").val();
let taskSeCd = $("#taskSeCd--${pageNameMain}").val(); let taskSeCd = $("#taskSeCd--${pageNameMain}").val();
@ -277,7 +282,7 @@
} }
// 민원 상담 내용 삭제 // 민원 상담 내용 삭제
fnRemoveCvlcptDscsnCn${pageName} = () => { fnRemove${pageName} = () => {
let crdnId = $("#crdnId--${pageNameMain}").val(); let crdnId = $("#crdnId--${pageNameMain}").val();
let sggCd = $("#sggCd--${pageNameMain}").val(); let sggCd = $("#sggCd--${pageNameMain}").val();
let taskSeCd = $("#taskSeCd--${pageNameMain}").val(); let taskSeCd = $("#taskSeCd--${pageNameMain}").val();

@ -40,7 +40,7 @@
<span class="container-page-btn"> <span class="container-page-btn">
<span class="container-window-btn-right"> <span class="container-window-btn-right">
<!-- 업무 버튼 --> <!-- 업무 버튼 -->
<button type="button" class="btn btn-primary" id="btnSave--${pageName}" title="저장" onclick="fnBtnSave${pageName}()">저장</button> <button type="button" class="btn btn-primary" id="btnSave--${pageName}" title="저장" onclick="fnSave${pageName}()">저장</button>
</span> </span>
</span> </span>
</div> </div>
@ -78,8 +78,12 @@
**************************************************************************/ **************************************************************************/
// 저장 callback // 저장 callback
${pageName}Control.onSave = (resp) => { ${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) { if (resp.saved) {
dialog.alert("저장됐습니다.");
dialog.close(${pageName}Control.prefix + "Dialog"); dialog.close(${pageName}Control.prefix + "Dialog");
} }
} }
@ -88,7 +92,6 @@
${pageName}Control.save = (info) => { ${pageName}Control.save = (info) => {
if (!info) return; if (!info) return;
let item = ${pageName}Control.getCurrent("item");
let create = isEmpty(info.cvlcptDscsnId); let create = isEmpty(info.cvlcptDscsnId);
ajax.post({ ajax.post({
@ -102,7 +105,7 @@
* 초기 셋팅 * 초기 셋팅
**************************************************************************/ **************************************************************************/
// 검색조건 초기값 셋팅 // 검색조건 초기값 셋팅
function initForm${pageName}() { initForm${pageName} = () => {
let initDataset = ${cvlcptDscsnCn}; let initDataset = ${cvlcptDscsnCn};
$("#cvlcptRcptSeCd--${pageName}").prop("disabled", true); $("#cvlcptRcptSeCd--${pageName}").prop("disabled", true);
@ -113,7 +116,7 @@
} }
// 이벤트 설정 // 이벤트 설정
function setEvent${pageName}() { setEvent${pageName} = () => {
} }
@ -121,7 +124,7 @@
* function * function
**************************************************************************/ **************************************************************************/
// 저장 // 저장
function fnBtnSave${pageName}() { fnSave${pageName} = () => {
// validate 확인 // validate 확인
if (!customValidate($("#frmEdit--${pageName}").find("input, select, textarea"))) return; if (!customValidate($("#frmEdit--${pageName}").find("input, select, textarea"))) return;
@ -132,6 +135,7 @@
} }
}); });
} }
/************************************************************************** /**************************************************************************
* script 진입 * script 진입
**************************************************************************/ **************************************************************************/

Loading…
Cancel
Save