계도문 문구 관리 추가

main
이범준 1 year ago
parent 535d629539
commit 301b8400ec

@ -193,4 +193,14 @@ public class CrdnCvlcpt extends AbstractEntity {
*/
private java.lang.String prcsRsltCn;
/**
*
*/
private java.lang.String mailTtlNm;
/**
*
*/
private java.lang.String mailCn;
}

@ -5,6 +5,7 @@ import java.util.List;
import org.egovframe.rte.psl.dataaccess.mapper.Mapper;
import cokr.xit.fims.crdn.CrdnQuery;
import cokr.xit.fims.cvlc.CrdnCvlcpt;
import cokr.xit.foundation.component.AbstractMapper;
import cokr.xit.foundation.data.DataObject;
@ -18,6 +19,18 @@ public interface WarningWordsMapper extends AbstractMapper {
* @param crdnQuery
* @return
*/
List<DataObject> selectWarningWordsInfo(CrdnQuery crdnQuery);
List<DataObject> selectWarningWordsList(CrdnQuery crdnQuery);
/** .
* @param crdnCvlcpt
* return
*/
int insertWarningWordsInfo(CrdnCvlcpt crdnCvlcpt);
/** .
* @param crdnCvlcpt
* return
*/
int updateWarningWordsInfo(CrdnCvlcpt crdnCvlcpt);
}

@ -101,8 +101,12 @@ public interface CrdnCvlcptService {
* @param crdnQuery
* @return
*/
List<DataObject> getWarningWordsInfo(CrdnQuery crdnQuery);
List<DataObject> getWarningWordsList(CrdnQuery crdnQuery);
/** .
* @param crdnCvlcpt
* @return
*/
boolean saveWarningWordsInfo(CrdnCvlcpt crdnCvlcpt);
}

@ -714,8 +714,13 @@ public class CrdnCvlcptServiceBean extends AbstractServiceBean implements CrdnCv
}
@Override
public List<DataObject> getWarningWordsInfo(CrdnQuery crdnQuery) {
return crdnCvlcptSubBean.selectWarningWordsInfo(crdnQuery);
public List<DataObject> getWarningWordsList(CrdnQuery crdnQuery) {
return crdnCvlcptSubBean.selectWarningWordsList(crdnQuery);
}
@Override
public boolean saveWarningWordsInfo(CrdnCvlcpt crdnCvlcpt) {
return crdnCvlcptSubBean.saveWarningWordsInfo(crdnCvlcpt);
}
}

@ -7,8 +7,11 @@ import javax.annotation.Resource;
import org.springframework.stereotype.Component;
import cokr.xit.base.code.dao.CodeMapper;
import cokr.xit.base.code.service.CodeQuery;
import cokr.xit.fims.crdn.Crdn;
import cokr.xit.fims.crdn.CrdnQuery;
import cokr.xit.fims.cvlc.CrdnCvlcpt;
import cokr.xit.fims.cvlc.dao.CrdnCvlcptMapper;
import cokr.xit.fims.cvlc.dao.WarningWordsMapper;
import cokr.xit.foundation.AbstractComponent;
@ -24,6 +27,9 @@ public class CrdnCvlcptSubBean extends AbstractComponent {
@Resource(name = "crdnCvlcptMapper")
private CrdnCvlcptMapper crdnCvlcptMapper;
@Resource(name = "codeMapper")
private CodeMapper codeMapper;
@Resource(name = "warningWordsMapper")
private WarningWordsMapper warningWordsMapper;
@ -75,8 +81,30 @@ public class CrdnCvlcptSubBean extends AbstractComponent {
* @param crdnQuery
* @return
*/
public List<DataObject> selectWarningWordsInfo(CrdnQuery crdnQuery) {
//TODO : warningWordsMapper.selectWarningWordsInfo(crdnQuery)
return null;
public List<DataObject> selectWarningWordsList(CrdnQuery crdnQuery) {
return warningWordsMapper.selectWarningWordsList(crdnQuery);
}
/** .
* @param crdnCvlcpt
* @return
* <ul><li> true</li>
* <li> false</li>
* </ul>
*/
public boolean saveWarningWordsInfo(CrdnCvlcpt crdnCvlcpt) {
if(ifEmpty(crdnCvlcpt.getAnsWordsId(), ()-> "").equals("")) {
CodeQuery codeQuery = new CodeQuery();
codeQuery.setGroupIDs("FIM022");
codeQuery.setCodes(crdnCvlcpt.getAnsRsnCd());
List<DataObject> codeList = codeMapper.getCodeList(codeQuery);
crdnCvlcpt.setAnsRsnNm(codeList.get(0).string("CODE_VAL"));
return warningWordsMapper.insertWarningWordsInfo(crdnCvlcpt) == 1 ? true : false;
} else {
return warningWordsMapper.updateWarningWordsInfo(crdnCvlcpt) == 1 ? true : false;
}
}
}

@ -5,10 +5,14 @@ import java.util.Map;
import javax.annotation.Resource;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import cokr.xit.base.code.CommonCode;
import cokr.xit.base.web.ApplicationController;
import cokr.xit.fims.crdn.CrdnQuery;
import cokr.xit.fims.crdn.dao.GlobalStngMapper;
import cokr.xit.fims.cvlc.CrdnCvlcpt;
import cokr.xit.fims.cvlc.service.CrdnCvlcptService;
/** .<br />
@ -20,10 +24,14 @@ public class Cvlc06Controller extends ApplicationController {
@Resource(name="crdnCvlcptService")
private CrdnCvlcptService crdnCvlcptService;
@Resource(name="globalStngMapper")
private GlobalStngMapper globalStngMapper;
/** .
* @return fims/cvlc/cvlc06010-main
*/
public ModelAndView warningWordsManageMain() {
ModelAndView mav = new ModelAndView();
mav.setViewName("fims/cvlc/cvlc06010-main");
mav.addObject("pageName", "cvlc06010-main");
@ -33,4 +41,36 @@ public class Cvlc06Controller extends ApplicationController {
return mav;
}
/** .
* @return fims/cvlc/cvlc06010-info
*/
@RequestMapping(name="계도문 문구 설정 목록", value="/010/list.do")
public ModelAndView getWarningWordsList(CrdnQuery crdnQuery) {
String currentSggCd = globalStngMapper.selectSggCdForCurrentUser();
crdnQuery.setSggCd(currentSggCd);
return setCollectionInfo(new ModelAndView("jsonView"), crdnCvlcptService.getWarningWordsList(crdnQuery),"");
}
/** .
* @param crdnCvlcpt
* @return jsonView
* <pre><code> {
* "affected":
* "saved": true, false
* }</code></pre>
*/
@RequestMapping(name="민원신고 답변 문구 설정 저장", value="/010/save.do")
public ModelAndView saveCvlcptAnswerWordsInfo(CrdnCvlcpt crdnCvlcpt) {
boolean saved = false;
String currentSggCd = globalStngMapper.selectSggCdForCurrentUser();
crdnCvlcpt.setSggCd(currentSggCd);
saved = crdnCvlcptService.saveWarningWordsInfo(crdnCvlcpt);
return new ModelAndView("jsonView")
.addObject("saved", saved);
}
}

@ -157,7 +157,7 @@ UPDATE TB_CVLCPT_BSC_WORDS
AND TASK_SE_CD = #{taskSeCd}
</update>
<update id="insertAnswerBodyWordsInfo" parameterType="cokr.xit.fims.cvlc.CrdnCvlcpt">
<insert id="insertAnswerBodyWordsInfo" parameterType="cokr.xit.fims.cvlc.CrdnCvlcpt">
/* 본문 문구 설정 등록(answerWordsMapper.insertAnswerBodyWordsInfo) */
<selectKey resultType="string" keyProperty="ansWordsId" keyColumn="NEW_ID" order="BEFORE">
SELECT
@ -198,7 +198,7 @@ VALUES (
, <include refid="utility.now" />
, #{modifiedBy}
)
</update>
</insert>
<update id="updateAnswerBodyWordsInfo" parameterType="cokr.xit.fims.cvlc.CrdnCvlcpt">
/* 본문 문구 설정 변경(answerWordsMapper.updateAnswerBodyWordsInfo) */

@ -2,4 +2,79 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cokr.xit.fims.cvlc.dao.WarningWordsMapper">
<select id="selectWarningWordsList" parameterType="cokr.xit.fims.crdn.CrdnQuery" resultType="dataobject">
/* 계도문 문구 설정 목록 가져오기(warningWordsMapper.selectWarningWordsList) */
SELECT A.CODE AS LEVY_EXCL_RSN_CD
, A.CODE_VAL AS LEVY_EXCL_RSN_NM
, B.ANS_WORDS_ID
, B.MAIL_TTL_NM
, B.MAIL_CN
FROM TB_CMN_CODE A
LEFT OUTER JOIN TB_CVLCPT_ANS_WORDS B
ON (A.CODE = B.ANS_RSN_CD
AND B.USE_YN = 'Y'
AND B.ANS_SE_CD = '2'
AND B.SGG_CD = #{sggCd}
AND B.TASK_SE_CD = #{taskSeCd}
)
WHERE A.GRP_ID = 'FIM022'
AND A.CODE LIKE '2%'
ORDER BY A.CODE
</select>
<insert id="insertWarningWordsInfo" parameterType="cokr.xit.fims.cvlc.CrdnCvlcpt">
/* 계도문 문구 설정 등록(warningWordsMapper.insertWarningWordsInfo) */
<selectKey resultType="string" keyProperty="ansWordsId" keyColumn="NEW_ID" order="BEFORE">
SELECT
LPAD(CAST(IFNULL(MAX(ANS_WORDS_ID) + 1, 1) AS INT), 10, '0')
AS NEW_ID
FROM TB_CVLCPT_ANS_WORDS
</selectKey>
INSERT
INTO TB_CVLCPT_ANS_WORDS(
ANS_WORDS_ID
, SGG_CD
, TASK_SE_CD
, ANS_SE_CD
, DSTRBNC_YN
, ANS_RSN_CD
, ANS_RSN_NM
, PRCS_SUMRY
, MAIL_TTL_NM
, MAIL_CN
, USE_YN
, REG_DT
, RGTR
, MDFCN_DT
, MDFR
)
VALUES (
#{ansWordsId}
, #{sggCd}
, #{taskSeCd}
, '2'
, 'N'
, #{ansRsnCd}
, #{ansRsnNm}
, '과태료 계고'
, #{mailTtlNm}
, #{mailCn}
, 'Y'
, <include refid="utility.now" />
, #{modifiedBy}
, <include refid="utility.now" />
, #{modifiedBy}
)
</insert>
<update id="updateWarningWordsInfo" parameterType="cokr.xit.fims.cvlc.CrdnCvlcpt">
/* 계도문 문구 설정 변경(warningWordsMapper.updateWarningWordsInfo) */
UPDATE TB_CVLCPT_ANS_WORDS
SET MAIL_TTL_NM = #{mailTtlNm}
, MAIL_CN = #{mailCn}
, MDFCN_DT = <include refid="utility.now" />
, MDFR = #{modifiedBy}
WHERE ANS_WORDS_ID = #{ansWordsId}
</update>
</mapper>

@ -203,7 +203,8 @@
<label for="prcsRsltCn--${pageName}"
class="w-px-130 bg-lighter pe-2 col-form-label text-sm-center">답변내용</label>
<br/>
<textarea id="prcsRsltCn--${pageName}" name="prcsRsltCn" required
<textarea id="prcsRsltCn--${pageName}" name="prcsRsltCn"
class="form-control" required
style="width:100%;" rows="15"
></textarea>
</form>
@ -443,7 +444,6 @@ $(document).ready(function(){
$P.ansBodyControl[gridType].setCurrent(dataKey);
var tbodyId = "";
var radioName = "";
if(gridType == "levy"){
tbodyId = "vltnTbody--${pageName}";
} else if(gridType == "warning"){

@ -0,0 +1,318 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%>
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>
<!-- inner page html -->
<div class="content-wrapper" id="wrapper--${pageName}">
<div class="container-xxl flex-grow-1 px-0">
<c:set var="pageKorName" scope="request">계도문 문구 관리</c:set>
<div class="card">
<div class="wrapper-list">
<div>
<form id="frmSearch--${pageName}" name="frmSearch">
<div class="container-search">
<div class="row g-1">
<div class="col-12">
<label class="form-label fw-bold form-search-title">업무구분</label>
<span class="form-search-linebox">
<c:forEach items="${FIM054List}" var="item">
<label>
<input name="taskSeCd" type="radio" value="${item.code}"
class="form-check-input" alt="업무구분"
onchange="pageObject['${pageName}'].fnResetAndChangeBiz(this.value);">
${item.value}
</label>
</c:forEach>
</span>
</div>
</div>
</div>
</form>
<div class="container-page-btn mt-3">
<button type="button" id="btnReset--${pageName}" class="btn btn-outline-dark"
title="초기화">초기화</button>
</div>
<div class="h-px-500 mt-4">
<div class="d-flex flex-row justify-content-center" style="height:100%">
<div class="card p-4 d-flex flex-row w-px-1300">
<!-- 그리드 영역 -->
<div class="card-datatable text-nowrap d-inline-flex"
style="border: #D9DEE3 1px solid;">
<div class="dataTables_wrapper dt-bootstrap5 no-footer">
<div class="table-responsive"
style="height:100%;width:470px;overflow-y: auto;">
<table class="datatables-ajax table table-bordered dataTable no-footer">
<thead>
<tr>
<th style="width:50px;"></th>
<th style="min-width: 300px;">계도사유</th>
</tr>
</thead>
<tbody id="warningWordsTbody--${pageName}"></tbody>
<template id="warningWordsRow--${pageName}">
<tr data-key="{LEVY_EXCL_RSN_CD}">
<td class="text-center" style="min-width:50px;max-width: 50px;">
<input type="radio" name="gridRadio" value="{LEVY_EXCL_RSN_CD}"
onchange="{onchange}" />
</td>
<td onclick="{onclick}" class="text-center">{LEVY_EXCL_RSN_NM}</td>
</tr>
</template>
<template id="warningWordsNotFound--${pageName}">
<tr>
<td valign="top" colspan="2"
class="dataTables_empty text-center">정보를 찾지 못했습니다.</td>
</tr>
</template>
</table>
</div>
</div>
</div>
<!-- 제목,내용 표시영역 -->
<div class="w-px-800 d-inline-flex">
<div class="container-md"
style="display: flex;justify-content: space-between;flex-flow: column;">
<div class="row g-1 h-px-400"
style="overflow-y:auto;border-bottom:#D9DEE3 1px solid">
<div class="col-12">
<form id="frmEditWarningWords--${pageName}">
<input type="hidden" id="ansRsnCd--${pageName}" name="ansRsnCd" />
<input type="hidden" id="ansWordsId--${pageName}" name="ansWordsId" />
<label for="mailTtlNm--${pageName}"
class="w-px-130 bg-lighter pe-2 col-form-label text-sm-center">제목</label>
<input type="text" id="mailTtlNm--${pageName}" name="mailTtlNm" required
class="form-control w-px-500" />
<br/>
<label for="mailCn--${pageName}"
class="w-px-130 bg-lighter pe-2 col-form-label text-sm-center" hidden>내용</label>
<textarea id="mailCn--${pageName}" name="mailCn" class="form-control" required
style="width:100%;" rows="15"
></textarea>
</form>
</div>
</div>
<div class="row g-1 py-2">
<div class="col-12">
<div class="btns float-end">
<button type="button" id="btnSave--${pageName}"
class="btn btn-primary" title="적용">적용</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="toast-container position-fixed bottom-0 end-0 p-3">
<div id="divToast--${pageName}" class="toast" role="alert" aria-live="assertive" aria-atomic="true">
<div class="toast-body bg-black text-white">
저장 되었습니다.
</div>
</div>
</div>
</div>
</div>
</div>
<jsp:include page="/WEB-INF/jsp/include/bottom.jsp" />
<div class="content-backdrop fade"></div>
</div>
<script>
/**************************************************************************
* Global Variable
**************************************************************************/
pageObject["${pageName}"] = {};
$(document).ready(function(){
var $P = pageObject["${pageName}"];
$P.toast = new bootstrap.Toast(document.getElementById('divToast--${pageName}'), {
animation: true,
autohide: true,
delay: 2000
});
/**************************************************************************
* DatasetControl
**************************************************************************/
$P.warningWordsControl = new DatasetControl({
dataGetter : obj => obj["List"],
urls : {},
formats : {},
keymapper : info => info ? info.LEVY_EXCL_RSN_CD : ""
});
/**************************************************************************
* pageObject.function
**************************************************************************/
$P.fnResetAndChangeBiz = (taskSeCd) => {
$P.warningWordsControl.urls = {};
$P.warningWordsControl.urls.load = wctx.url("/"+taskSeCd+"/cvlc/cvlc06/010/list.do");
$P.warningWordsControl.urls.update = wctx.url("/"+taskSeCd+"/cvlc/cvlc06/010/save.do");
$P.fnReset();
}
$P.fnReset = () => {
$P.warningWordsControl.setData([]);
$P.renderWarningWordsList(0);
$("#frmEditWarningWords--${pageName}").find("input, textarea").val("");
$P.searchWordsStng();
}
$P.getParams = () => {
var formFields = new FimsFormFields("#frmSearch--${pageName}");
var data = formFields.get();
return data;
}
$P.searchWordsStng = () => {
var taskSeCd = $("#frmSearch--${pageName}").find("input[name='taskSeCd']:checked").val();
ajax.get({
url : $P.warningWordsControl.urls.load,
data : {"taskSeCd" : taskSeCd},
success : resp => {
$P.warningWordsControl.setData(resp.List);
$P.renderWarningWordsList(resp.List.length);
if(resp.List.length > 0){
var current = $P.warningWordsControl.getCurrent()["LEVY_EXCL_RSN_CD"];
$P.clickWarningWordsList(current);
}
}
});
}
$P.renderWarningWordsList = (total) => {
var warningWordsList = $P.warningWordsControl.dataset;
var empty = warningWordsList.empty;
var notFound = [document.getElementById("warningWordsNotFound--${pageName}").innerHTML];
var found = document.getElementById("warningWordsRow--${pageName}").innerHTML;
var replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].clickWarningWordsList('" + dataItem.getValue("LEVY_EXCL_RSN_CD") + "');")
.replace(/{onchange}/gi, "pageObject['${pageName}'].radioClickWarningWordsList('" + dataItem.getValue("LEVY_EXCL_RSN_CD") + "');");
var trs = empty ? notFound : warningWordsList.inStrings(found, replacer);
$("#warningWordsTbody--${pageName}").html(trs.join());
}
$P.radioClickWarningWordsList = (dataKey, gridType) => {
$P.warningWordsControl.setCurrent(dataKey);
$("#warningWordsTbody--${pageName}").setCurrentRow(dataKey);
$P.changeTextarea();
}
$P.clickWarningWordsList = (dataKey, gridType) => {
$("#wrapper--${pageName}").find(":radio[name='gridRadio'][value='"+dataKey+"']").prop("checked",true);
$("#wrapper--${pageName}").find(":radio[name='gridRadio'][value='"+dataKey+"']").focus();
$P.radioClickWarningWordsList(dataKey, gridType);
}
$P.changeTextarea = () => {
var curData = $P.warningWordsControl.getCurrent();
if(curData == null){
$("#ansRsnCd--${pageName}").val("");
$("#ansWordsId--${pageName}").val("");
$("#mailTtlNm--${pageName}").val("");
$("#mailCn--${pageName}").val("");
return;
}
$("#ansRsnCd--${pageName}").val(curData["LEVY_EXCL_RSN_CD"]);
$("#ansWordsId--${pageName}").val(curData["ANS_WORDS_ID"]);
$("#mailTtlNm--${pageName}").val(curData["MAIL_TTL_NM"]);
$("#mailCn--${pageName}").val(curData["MAIL_CN"]);
}
$P.refreshWarningWordsInfo = () => {
var cursor = $P.warningWordsControl.getCurrent()["LEVY_EXCL_RSN_CD"];
var taskSeCd = $("#frmSearch--${pageName}").find("input[name='taskSeCd']:checked").val();
ajax.get({
url : $P.warningWordsControl.urls.load,
data : {"taskSeCd" : taskSeCd},
success : resp => {
$P.warningWordsControl.setData(resp.List);
$P.renderWarningWordsList(resp.List.length);
if(resp.List.length > 0){
$P.warningWordsControl.setCurrent(cursor);
var current = $P.warningWordsControl.getCurrent()["LEVY_EXCL_RSN_CD"];
$P.clickWarningWordsList(current,'warning');
}
}
});
}
//적용
$P.fnSave = () => {
if(!customValidate($("#frmEditWarningWords--${pageName}").find("input, select, textarea"))) return;
var info = (new FimsFormFields("#frmEditWarningWords--${pageName}")).get();
info.taskSeCd = $("#frmSearch--${pageName}").find("input[name='taskSeCd']:checked").val();
dialog.alert({
content : "저장하시겠습니까?",
onOK: () => {
ajax.get({
url : $P.warningWordsControl.urls.update,
data : info,
success : resp => {
if(resp.saved){
$P.toast.show();
$P.refreshWarningWordsInfo();
}
}
});
}
});
}
/**************************************************************************
* element.on
**************************************************************************/
$('#btnReset--${pageName}').on('click', () => $P.fnReset());
//업무처리 버튼
$("#btnSave--${pageName}").on("click", () => $P.fnSave());
/**************************************************************************
* 초기화
**************************************************************************/
var defaultBizValue = $("#layout-navbar input[name='taskSeCd']:checked").val();
$("#frmSearch--${pageName} input[name='taskSeCd'][value='" + defaultBizValue + "']").prop("checked",true);
$P.fnResetAndChangeBiz(defaultBizValue);
});
</script>
Loading…
Cancel
Save