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

main
jjh 1 year ago
parent e9b5811145
commit 822377619d

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

@ -72,7 +72,11 @@ public class Sprt04Bean extends AbstractComponent {
* <li> false</li>
* </ul>
*/
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 {
* <li> false</li>
* </ul>
*/
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 {
* <li> false</li>
* </ul>
*/
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;
}
}

@ -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);
}

@ -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);
}
}

@ -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;

@ -12,14 +12,14 @@
<label class="w-px-120 bg-label-danger pe-2 col-form-label text-sm-center">민원상담 정보</label>
<!-- 버튼 우측 정렬 -->
<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 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 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>
</span> <!-- <span class="container-window-btn-right"> -->
</div> <!-- <div class="container-page-btn"> -->
@ -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();

@ -40,7 +40,7 @@
<span class="container-page-btn">
<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>
</div>
@ -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 진입
**************************************************************************/

Loading…
Cancel
Save