diff --git a/src/main/java/cokr/xit/fims/cvlc/CrdnCvlcpt.java b/src/main/java/cokr/xit/fims/cvlc/CrdnCvlcpt.java index 2f7f1a04..3c415bc3 100644 --- a/src/main/java/cokr/xit/fims/cvlc/CrdnCvlcpt.java +++ b/src/main/java/cokr/xit/fims/cvlc/CrdnCvlcpt.java @@ -16,6 +16,8 @@ public class CrdnCvlcpt extends AbstractEntity { public static String MACRO_TELNO = "\\[@전화번호\\]"; + public static String MACRO_PIC_NM = "\\[@담당자성명\\]"; + /** * 민원 연계 ID */ @@ -140,4 +142,55 @@ public class CrdnCvlcpt extends AbstractEntity { * 단속 ID */ private java.lang.String crdnId; + + /** + * 시군구 코드 + */ + private java.lang.String sggCd; + + /** + * 업무 구분 코드 + */ + private java.lang.String taskSeCd; + + /** + * 머리말 내용 + */ + private java.lang.String headerCn; + + /** + * 꼬리말 내용 + */ + private java.lang.String footerCn; + + /** + * 답변 문구 ID + */ + private java.lang.String ansWordsId; + + /** + * 답변 구분 코드 + */ + private java.lang.String ansSeCd; + + /** + * 답변 사유 코드 + */ + private java.lang.String ansRsnCd; + + /** + * 답변 사유 명 + */ + private java.lang.String ansRsnNm; + + /** + * 처리 요약 + */ + private java.lang.String prcsSumry; + + /** + * 처리 결과 내용 + */ + private java.lang.String prcsRsltCn; + } \ No newline at end of file diff --git a/src/main/java/cokr/xit/fims/cvlc/dao/AnswerWordsMapper.java b/src/main/java/cokr/xit/fims/cvlc/dao/AnswerWordsMapper.java index c87b0139..8ec1395f 100644 --- a/src/main/java/cokr/xit/fims/cvlc/dao/AnswerWordsMapper.java +++ b/src/main/java/cokr/xit/fims/cvlc/dao/AnswerWordsMapper.java @@ -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; @@ -44,4 +45,33 @@ public interface AnswerWordsMapper extends AbstractMapper { */ List selectNonlevyCaseWordsList(CrdnQuery crdnQuery); + /** 민원답변 기본문구를 등록한다. + * @param crdnCvlcpt 민원답변 기본문구 + * @return 저장된 정보 수 + */ + int insertAnswerBasicWordsInfo(CrdnCvlcpt crdnCvlcpt); + + /** 민원답변 기본문구를 변경한다. + * @param crdnCvlcpt 민원답변 기본문구 + * @return 저장된 정보 수 + */ + int updateAnswerBasicWordsInfo(CrdnCvlcpt crdnCvlcpt); + + /** 민원답변 본문문구를 등록한다. + * @param crdnCvlcpt 민원답변 본문문구 + * @return 저장된 정보 수 + */ + int insertAnswerBodyWordsInfo(CrdnCvlcpt crdnCvlcpt); + + /** 민원답변 본문문구를 변경한다. + * @param crdnCvlcpt 민원답변 본문문구 + * @return 저장된 정보 수 + */ + int updateAnswerBodyWordsInfo(CrdnCvlcpt crdnCvlcpt); + + /** 미부과처리건 민원답변 본문문구를 삭제한다. + * @param crdnCvlcpt 민원답변 정보 + * @return 저장된 정보 수 + */ + int removeCvlcptAnswerWordsInfo(CrdnCvlcpt crdnCvlcpt); } diff --git a/src/main/java/cokr/xit/fims/cvlc/service/CrdnCvlcptService.java b/src/main/java/cokr/xit/fims/cvlc/service/CrdnCvlcptService.java index 062b7340..1786725e 100644 --- a/src/main/java/cokr/xit/fims/cvlc/service/CrdnCvlcptService.java +++ b/src/main/java/cokr/xit/fims/cvlc/service/CrdnCvlcptService.java @@ -85,10 +85,24 @@ public interface CrdnCvlcptService { */ Map getCvlcptAnswerWordsInfo(CrdnQuery crdnQuery); + /** 민원답변 문구 설정 정보를 저장한다. + * @param saveData 저장 자료 구분, crdnCvlcpt 민원 답변 문구 설정 + * @return 저장여부 + */ + boolean saveAnswerWordsInfo(String saveData, CrdnCvlcpt crdnCvlcpt); + + /** 미부과처리건 답변내용을 삭제한다. + * @param ansWordsId 답변 문구 ID + * @return 저장여부 + */ + boolean removeCvlcptAnswerWordsInfo(String ansWordsId); + /** 계도문 문구 설정 정보를 조회한다. * @param crdnQuery 조회 조건 * @return 계도문 문구 설정 정보 */ List getWarningWordsInfo(CrdnQuery crdnQuery); + + } diff --git a/src/main/java/cokr/xit/fims/cvlc/service/bean/CrdnCvlcptMainBean.java b/src/main/java/cokr/xit/fims/cvlc/service/bean/CrdnCvlcptMainBean.java index 15701aa4..b943be55 100644 --- a/src/main/java/cokr/xit/fims/cvlc/service/bean/CrdnCvlcptMainBean.java +++ b/src/main/java/cokr/xit/fims/cvlc/service/bean/CrdnCvlcptMainBean.java @@ -8,6 +8,8 @@ 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.base.user.ManagedUser; import cokr.xit.base.user.dao.UserMapper; import cokr.xit.fims.crdn.CrdnQuery; @@ -33,6 +35,9 @@ public class CrdnCvlcptMainBean extends AbstractComponent { @Resource(name="smgSenderBean") protected SmgSenderBean smgSenderBean; + @Resource(name = "codeMapper") + private CodeMapper codeMapper; + @Resource(name = "answerWordsMapper") private AnswerWordsMapper answerWordsMapper; @@ -133,7 +138,7 @@ public class CrdnCvlcptMainBean extends AbstractComponent { ManagedUser currentUser = userMapper.getUser(UserInfo.current().getAccount(), UserInfo.current().getInstitute()); - String completeWords = this.replaceMacroString(joinWords , currentUser.getPhoneNo()); + String completeWords = this.replaceMacroString(joinWords , currentUser.getPhoneNo(), currentUser.getName()); return completeWords; } @@ -142,7 +147,7 @@ public class CrdnCvlcptMainBean extends AbstractComponent { * @param joinWords 전체 문구, telNo 담당자 전화번호 * @return 치환된 문구 */ - private String replaceMacroString(String joinWords, String telNo) { + private String replaceMacroString(String joinWords, String telNo, String picNm) { int seq = 1; @@ -156,6 +161,7 @@ public class CrdnCvlcptMainBean extends AbstractComponent { } joinWords = joinWords.replace(CrdnCvlcpt.MACRO_TELNO, telNo); + joinWords = joinWords.replace(CrdnCvlcpt.MACRO_PIC_NM, picNm); return joinWords; } @@ -240,4 +246,75 @@ public class CrdnCvlcptMainBean extends AbstractComponent { } } + + /**민원답변 기본문구를 저장한다. + * @param crdnCvlcpt 민원답변 기본문구 정보 + * @return 저장 여부 + *
  • 저장됐으면 true
  • + *
  • 그렇지 않으면 false
  • + *
+ */ + public boolean saveAnswerBasicWordsInfo(CrdnCvlcpt crdnCvlcpt) { + + CrdnQuery query = new CrdnQuery(); + query.setSggCd(crdnCvlcpt.getSggCd()); + query.setTaskSeCd(crdnCvlcpt.getTaskSeCd()); + + DataObject info = answerWordsMapper.selectCvlcptAnswerBasicWordsInfo(query); + + if(ifEmpty(info, ()-> "").equals("")) { + return answerWordsMapper.insertAnswerBasicWordsInfo(crdnCvlcpt) == 1 ? true : false; + } else { + return answerWordsMapper.updateAnswerBasicWordsInfo(crdnCvlcpt) == 1 ? true : false; + } + + } + + /**민원답변 본문문구를 저장한다. + * @param crdnCvlcpt 민원답변 본문문구 정보 + * @return 저장 여부 + *
  • 저장됐으면 true
  • + *
  • 그렇지 않으면 false
  • + *
+ */ + public boolean saveAnswerBodyWordsInfo(CrdnCvlcpt crdnCvlcpt) { + + if(ifEmpty(crdnCvlcpt.getAnsWordsId(), ()-> "").equals("")) { + String codeGroupId = ""; + String code = ""; + if(crdnCvlcpt.getAnsRsnCd().startsWith("1") || crdnCvlcpt.getAnsRsnCd().startsWith("2")) { + if(crdnCvlcpt.getAnsRsnCd().startsWith("1")) { + crdnCvlcpt.setPrcsSumry("과태료 미부과"); + } + if(crdnCvlcpt.getAnsRsnCd().startsWith("2")) { + crdnCvlcpt.setPrcsSumry("과태료 계고"); + } + + codeGroupId = "FIM022"; + code = crdnCvlcpt.getAnsRsnCd(); + + } else if(crdnCvlcpt.getAnsRsnCd().startsWith("3")) { + crdnCvlcpt.setPrcsSumry("과태료 부과"); + switch(crdnCvlcpt.getTaskSeCd()) { + case "PVS" -> codeGroupId = "WEB002"; + case "BPV" -> codeGroupId = "FIM005"; + case "DPV" -> codeGroupId = "FIM006"; + case "ECA" -> codeGroupId = "FIM061"; + case "TPV" -> codeGroupId = ""; + } + code = crdnCvlcpt.getAnsRsnCd().substring(1); + } + + CodeQuery codeQuery = new CodeQuery(); + codeQuery.setGroupIDs(codeGroupId); + codeQuery.setCodes(code); + List codeList = codeMapper.getCodeList(codeQuery); + crdnCvlcpt.setAnsRsnNm(codeList.get(0).string("CODE_VAL")); + + return answerWordsMapper.insertAnswerBodyWordsInfo(crdnCvlcpt) == 1 ? true : false; + } else { + return answerWordsMapper.updateAnswerBodyWordsInfo(crdnCvlcpt) == 1 ? true : false; + } + + } } diff --git a/src/main/java/cokr/xit/fims/cvlc/service/bean/CrdnCvlcptServiceBean.java b/src/main/java/cokr/xit/fims/cvlc/service/bean/CrdnCvlcptServiceBean.java index c9868053..969e798d 100644 --- a/src/main/java/cokr/xit/fims/cvlc/service/bean/CrdnCvlcptServiceBean.java +++ b/src/main/java/cokr/xit/fims/cvlc/service/bean/CrdnCvlcptServiceBean.java @@ -694,6 +694,25 @@ public class CrdnCvlcptServiceBean extends AbstractServiceBean implements CrdnCv return wordsStngInfo; } + @Override + public boolean saveAnswerWordsInfo(String saveData, CrdnCvlcpt crdnCvlcpt) { + boolean saved = false; + if(saveData.equals("basic")) { + saved = crdnCvlcptMainBean.saveAnswerBasicWordsInfo(crdnCvlcpt); + } + if(saveData.equals("body")) { + saved = crdnCvlcptMainBean.saveAnswerBodyWordsInfo(crdnCvlcpt); + } + return saved; + } + + @Override + public boolean removeCvlcptAnswerWordsInfo(String ansWordsId) { + CrdnCvlcpt crdnCvlcpt = new CrdnCvlcpt(); + crdnCvlcpt.setAnsWordsId(ansWordsId); + return answerWordsMapper.removeCvlcptAnswerWordsInfo(crdnCvlcpt) == 1 ? true : false; + } + @Override public List getWarningWordsInfo(CrdnQuery crdnQuery) { return crdnCvlcptSubBean.selectWarningWordsInfo(crdnQuery); diff --git a/src/main/java/cokr/xit/fims/cvlc/web/Cvlc05Controller.java b/src/main/java/cokr/xit/fims/cvlc/web/Cvlc05Controller.java index 7466505a..e759f6b9 100644 --- a/src/main/java/cokr/xit/fims/cvlc/web/Cvlc05Controller.java +++ b/src/main/java/cokr/xit/fims/cvlc/web/Cvlc05Controller.java @@ -4,6 +4,7 @@ import java.util.List; import java.util.Map; import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.servlet.ModelAndView; @@ -12,6 +13,7 @@ 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; import cokr.xit.foundation.data.DataObject; @@ -74,4 +76,45 @@ public class Cvlc05Controller extends ApplicationController { return mav; } + /** 민원신고 답변 문구 설정을 저장한다. + * @param hReq 저장 요청 + * @return jsonView + *
 {
+	 *     "affected": 저장된 정보수
+	 *     "saved": 저장되었으면 true, 그렇지 않으면 false
+	 * }
+ */ + @RequestMapping(name="민원신고 답변 문구 설정 저장", value="/010/save.do") + public ModelAndView saveCvlcptAnswerWordsInfo(HttpServletRequest hReq, CrdnCvlcpt crdnCvlcpt) { + boolean saved = false; + + String currentSggCd = globalStngMapper.selectSggCdForCurrentUser(); + crdnCvlcpt.setSggCd(currentSggCd); + + String saveData = hReq.getParameter("saveData"); + if(saveData.equals("basic") || saveData.equals("body")) { + saved = crdnCvlcptService.saveAnswerWordsInfo(saveData, crdnCvlcpt); + } + + return new ModelAndView("jsonView") + .addObject("saved", saved); + } + + /** 미부과처리건 답변 문구를 삭제한다. + * @param ansWordsId 답변 문구 ID + * @return jsonView + *
 {
+	 *     "affected": 저장된 정보수
+	 *     "saved": 저장되었으면 true, 그렇지 않으면 false
+	 * }
+ */ + @RequestMapping(name="미부과처리건 답변 문구 삭제", value="/010/remove.do") + public ModelAndView removeCvlcptAnswerWordsInfo(String ansWordsId) { + boolean saved = false; + + saved = crdnCvlcptService.removeCvlcptAnswerWordsInfo(ansWordsId); + + return new ModelAndView("jsonView") + .addObject("saved", saved); + } } diff --git a/src/main/resources/sql/mapper/fims/cvlc/answer-words-mapper.xml b/src/main/resources/sql/mapper/fims/cvlc/answer-words-mapper.xml index c310d2bb..33b0df9b 100644 --- a/src/main/resources/sql/mapper/fims/cvlc/answer-words-mapper.xml +++ b/src/main/resources/sql/mapper/fims/cvlc/answer-words-mapper.xml @@ -46,15 +46,39 @@ SELECT (CASE END) AS VLTN_CASE_NM , B.ANS_WORDS_ID , B.PRCS_RSLT_CN - FROM TB_VLTN_INFO A + FROM ( + ( + SELECT SGG_CD + , TASK_SE_CD + , VLTN_CD + , 'N' AS DSTRBNC_YN + , VLTN_ARTCL + FROM TB_VLTN_INFO + WHERE SGG_CD = #{sggCd} + AND TASK_SE_CD = #{taskSeCd} + ) + + UNION + ( + SELECT SGG_CD + , TASK_SE_CD + , VLTN_CD + , 'Y' AS DSTRBNC_YN + , VLTN_ARTCL + FROM TB_VLTN_INFO + WHERE SGG_CD = #{sggCd} + AND TASK_SE_CD = #{taskSeCd} + AND VLTN_CD = '01' + ) + + ) A LEFT OUTER JOIN TB_CVLCPT_ANS_WORDS B ON (A.SGG_CD = B.SGG_CD AND A.TASK_SE_CD = B.TASK_SE_CD AND CONCAT('3',A.VLTN_CD) = B.ANS_RSN_CD AND B.USE_YN = 'Y' - AND B.ANS_SE_CD = '3') - WHERE A.SGG_CD = #{sggCd} /* 시군구 코드 */ - AND A.TASK_SE_CD = #{taskSeCd} /* 업무 구분 코드 */ + AND B.ANS_SE_CD = '3' + AND A.DSTRBNC_YN = B.DSTRBNC_YN) ORDER BY A.VLTN_CD @@ -97,4 +121,101 @@ SELECT A.CODE AS LEVY_EXCL_RSN_CD ORDER BY A.CODE + +/* 기본 문구 설정 등록(answerWordsMapper.insertAnswerBasicWordsInfo) */ +INSERT + INTO TB_CVLCPT_BSC_WORDS( + SGG_CD + , TASK_SE_CD + , HEADER_CN + , FOOTER_CN + , REG_DT + , RGTR + , MDFCN_DT + , MDFR + ) +VALUES ( + #{sggCd} + , #{taskSeCd} + , #{headerCn} + , #{footerCn} + , + , #{modifiedBy} + , + , #{modifiedBy} + ) + + + +/* 기본 문구 설정 변경(answerWordsMapper.updateAnswerBasicWordsInfo) */ +UPDATE TB_CVLCPT_BSC_WORDS + SET HEADER_CN = #{headerCn} + , FOOTER_CN = #{footerCn} + , MDFCN_DT = + , MDFR = #{modifiedBy} + WHERE SGG_CD = #{sggCd} + AND TASK_SE_CD = #{taskSeCd} + + + +/* 본문 문구 설정 등록(answerWordsMapper.insertAnswerBodyWordsInfo) */ + +SELECT + LPAD(CAST(IFNULL(MAX(ANS_WORDS_ID) + 1, 1) AS INT), 10, '0') + AS NEW_ID +FROM TB_CVLCPT_ANS_WORDS + +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 + , PRCS_RSLT_CN + , USE_YN + , REG_DT + , RGTR + , MDFCN_DT + , MDFR + ) +VALUES ( + #{ansWordsId} + , #{sggCd} + , #{taskSeCd} + , SUBSTR(#{ansRsnCd},1,1) + , NVL(#{dstrbncYn},'N') + , #{ansRsnCd} + , #{ansRsnNm} + , #{prcsSumry} + , #{prcsRsltCn} + , 'Y' + , + , #{modifiedBy} + , + , #{modifiedBy} + ) + + + +/* 본문 문구 설정 변경(answerWordsMapper.updateAnswerBodyWordsInfo) */ +UPDATE TB_CVLCPT_ANS_WORDS + SET PRCS_RSLT_CN = #{prcsRsltCn} + , MDFCN_DT = + , MDFR = #{modifiedBy} + WHERE ANS_WORDS_ID = #{ansWordsId} + + + +/* 본문 문구 설정 삭제(answerWordsMapper.removeCvlcptAnswerWordsInfo) */ +UPDATE TB_CVLCPT_ANS_WORDS + SET USE_YN = 'N' + , MDFCN_DT = + , MDFR = #{modifiedBy} + WHERE ANS_WORDS_ID = #{ansWordsId} + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/jsp/fims/cvlc/cvlc05010-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/cvlc/cvlc05010-main.jsp new file mode 100644 index 00000000..7780cae3 --- /dev/null +++ b/src/main/webapp/WEB-INF/jsp/fims/cvlc/cvlc05010-main.jsp @@ -0,0 +1,730 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%> +<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%> + +
+
+ 민원신고 답변 문구 관리 +
+
+
+
+ +
+ +
+ + + + + + +
+ +
+ + + +
+
+
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ +
+
+
+
+
+
+
+ + + +
+
+ +
+ +
+ + +
+
+
+
+
+ + + + +
+ +
+
+
+
+
+
+ +
+
+ + +
+
+
+
+
+
+
+
+
+ + + +
+
+
+
+ [매크로 문자 삽입] + + + +
+
+
+
+
+ +
+ +
+
+
+
+ + + +
+
+ + + + + \ No newline at end of file diff --git a/src/main/webapp/resources/js/fims/cvlc/answerWords.js b/src/main/webapp/resources/js/fims/cvlc/answerWords.js new file mode 100644 index 00000000..67401c7c --- /dev/null +++ b/src/main/webapp/resources/js/fims/cvlc/answerWords.js @@ -0,0 +1,16 @@ +export class AnswerBodyControl { + constructor(levyCaseConf, warningCaseConf, nonlevyCaseConf) { + this.levy = new DatasetControl(levyCaseConf); + this.warning = new DatasetControl(warningCaseConf); + this.nonlevy = new DatasetControl(nonlevyCaseConf); + } +} + +export function fnMacroStringInsert() { + //TODO : 매크로문자열 삽입 +} + +export function fnMacroWordsReplace() { + //TODO : 매크로문자열치환 + return ""; +} \ No newline at end of file