From f22861f65f7963bc8432d9f1cc6055848be3c049 Mon Sep 17 00:00:00 2001 From: leebeomjun Date: Fri, 25 Aug 2023 17:49:36 +0900 Subject: [PATCH] =?UTF-8?q?1.=20=EB=AF=BC=EC=9B=90Bean(CrdnCvlcptBean)?= =?UTF-8?q?=ED=8C=8C=EC=9D=BC=20=EC=88=98=EC=A0=95(MainBean,=20SubBean?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C=20=EB=B6=84=ED=95=A0)=202.=20=EB=8B=B5?= =?UTF-8?q?=EB=B3=80=EB=AC=B8=EA=B5=AC=EA=B4=80=EB=A6=ACmapper=EC=B6=94?= =?UTF-8?q?=EA=B0=80,=20=EA=B3=84=EB=8F=84=EB=AC=B8=EB=AC=B8=EA=B5=AC?= =?UTF-8?q?=EA=B4=80=EB=A6=ACmapper=EC=B6=94=EA=B0=80=203.=20=EB=8B=B5?= =?UTF-8?q?=EB=B3=80=EB=AC=B8=EA=B5=AC=EC=84=A4=EC=A0=95=20=EC=A1=B0?= =?UTF-8?q?=ED=9A=8C=20=EC=BF=BC=EB=A6=AC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../crdn/service/bean/CrdnServiceBean.java | 6 +- .../xit/fims/cvlc/dao/AnswerWordsMapper.java | 47 +++++++++ .../xit/fims/cvlc/dao/CrdnCvlcptMapper.java | 18 +--- .../xit/fims/cvlc/dao/WarningWordsMapper.java | 23 +++++ .../fims/cvlc/service/CrdnCvlcptService.java | 25 ++++- ...vlcptBean.java => CrdnCvlcptMainBean.java} | 87 +++++++--------- .../service/bean/CrdnCvlcptServiceBean.java | 59 ++++++++--- .../cvlc/service/bean/CrdnCvlcptSubBean.java | 82 +++++++++++++++ .../xit/fims/cvlc/web/Cvlc05Controller.java | 40 ++++++++ .../mapper/fims/cvlc/answer-words-mapper.xml | 99 +++++++++++++++++++ .../mapper/fims/cvlc/crdnCvlcpt-mapper.xml | 31 +----- .../mapper/fims/cvlc/warning-words-mapper.xml | 5 + 12 files changed, 404 insertions(+), 118 deletions(-) create mode 100644 src/main/java/cokr/xit/fims/cvlc/dao/AnswerWordsMapper.java create mode 100644 src/main/java/cokr/xit/fims/cvlc/dao/WarningWordsMapper.java rename src/main/java/cokr/xit/fims/cvlc/service/bean/{CrdnCvlcptBean.java => CrdnCvlcptMainBean.java} (81%) create mode 100644 src/main/java/cokr/xit/fims/cvlc/service/bean/CrdnCvlcptSubBean.java create mode 100644 src/main/resources/sql/mapper/fims/cvlc/answer-words-mapper.xml create mode 100644 src/main/resources/sql/mapper/fims/cvlc/warning-words-mapper.xml diff --git a/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnServiceBean.java b/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnServiceBean.java index caa49502..3523ad2c 100644 --- a/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnServiceBean.java +++ b/src/main/java/cokr/xit/fims/crdn/service/bean/CrdnServiceBean.java @@ -26,7 +26,7 @@ import cokr.xit.fims.crdn.dao.CrdnUpdtMapper; import cokr.xit.fims.crdn.dao.GlobalStngMapper; import cokr.xit.fims.crdn.service.CrdnService; import cokr.xit.fims.cvlc.dao.CrdnCvlcptMapper; -import cokr.xit.fims.cvlc.service.bean.CrdnCvlcptBean; +import cokr.xit.fims.cvlc.service.bean.CrdnCvlcptMainBean; import cokr.xit.fims.excl.LevyExcl; import cokr.xit.fims.excl.service.bean.Excl01Bean; import cokr.xit.foundation.component.AbstractServiceBean; @@ -59,8 +59,8 @@ public class CrdnServiceBean extends AbstractServiceBean implements CrdnService @Resource(name="crdnStngBean") protected CrdnStngBean crdnStngBean; - @Resource(name="crdnCvlcptBean") - protected CrdnCvlcptBean crdnCvlcptBean; + @Resource(name="crdnCvlcptMainBean") + protected CrdnCvlcptMainBean crdnCvlcptMainBean; @Resource(name="crdnBean") protected CrdnBean crdnBean; diff --git a/src/main/java/cokr/xit/fims/cvlc/dao/AnswerWordsMapper.java b/src/main/java/cokr/xit/fims/cvlc/dao/AnswerWordsMapper.java new file mode 100644 index 00000000..c87b0139 --- /dev/null +++ b/src/main/java/cokr/xit/fims/cvlc/dao/AnswerWordsMapper.java @@ -0,0 +1,47 @@ +package cokr.xit.fims.cvlc.dao; + +import java.util.List; + +import org.egovframe.rte.psl.dataaccess.mapper.Mapper; + +import cokr.xit.fims.crdn.CrdnQuery; +import cokr.xit.foundation.component.AbstractMapper; +import cokr.xit.foundation.data.DataObject; + +/**민원 답변 문구 관리 DAO + * @author leebj + */ +@Mapper("answerWordsMapper") +public interface AnswerWordsMapper extends AbstractMapper { + + /**지정한 조건에 따라 민원 답변 기본문구를 조회하여 반환한다. + * @param crdnQuery 답변 기본문구 설정 조회조건 + * @return 답변문구 정보 + */ + DataObject selectCvlcptAnswerBasicWordsInfo(CrdnQuery crdnQuery); + + /**지정한 조건에 따라 민원 답변 본문문구를 조회하여 반환한다. + * @param crdnQuery 답변 본문문구 설정 조회조건 + * @return 답변문구 정보 + */ + DataObject selectCvlcptAnswerWordsInfo(CrdnQuery crdnQuery); + + /**지정한 조건에 따라 부과처리일 경우의 민원 답변 본문문구 목록을 조회한다. + * @param crdnQuery 답변 본문 문구 조회조건 + * @return 답변문구 목록 + */ + List selectLevyCaseWordsList(CrdnQuery crdnQuery); + + /**지정한 조건에 따라 계도처리일 경우의 민원 답변 본문문구 목록을 조회한다. + * @param crdnQuery 답변 본문 문구 조회조건 + * @return 답변문구 목록 + */ + List selectWarningCaseWordsList(CrdnQuery crdnQuery); + + /**지정한 조건에 따라 미부과처리일 경우의 민원 답변 본문문구 목록을 조회한다. + * @param crdnQuery 답변 본문 문구 조회조건 + * @return 답변문구 목록 + */ + List selectNonlevyCaseWordsList(CrdnQuery crdnQuery); + +} diff --git a/src/main/java/cokr/xit/fims/cvlc/dao/CrdnCvlcptMapper.java b/src/main/java/cokr/xit/fims/cvlc/dao/CrdnCvlcptMapper.java index 54efa925..f3e5e720 100644 --- a/src/main/java/cokr/xit/fims/cvlc/dao/CrdnCvlcptMapper.java +++ b/src/main/java/cokr/xit/fims/cvlc/dao/CrdnCvlcptMapper.java @@ -97,23 +97,11 @@ public interface CrdnCvlcptMapper extends AbstractMapper { */ List selectCivilComplaintList(CrdnQuery query); - /** 민원 예정 답변을 조회한다. - * @param query 민원원본 조회 조건 + /**지정한 민원 자료의 예정 답변을 조회한다. + * @param crdnId 단속 ID * @return 민원 예정 답변 */ - DataObject selectAnswerPreview(CrdnQuery query); - - /**지정한 조건에 따라 민원답변문구 대장을 조회하여 반환한다. - * @param params 답변문구 조회 파라미터 - * @return 답변문구 대장 정보 - */ - DataObject selectCvlcptAnswerWordsInfo(CrdnQuery crdnQuery); - - /**지정한 조건에 따라 민원 답변 문구 대장을 조회하여 반환한다. - * @param params 답변문구 조회 파라미터 - * @return 답변문구 대장 정보 - */ - DataObject selectCvlcptAnswerBasicWordsInfo(CrdnQuery crdnQuery); + DataObject selectAnswerPreview(String crdnId); /**지정한 민원자료의 민원 답변 내용을 변경한다. * @param crdnCvlcpt 단속민원 정보 diff --git a/src/main/java/cokr/xit/fims/cvlc/dao/WarningWordsMapper.java b/src/main/java/cokr/xit/fims/cvlc/dao/WarningWordsMapper.java new file mode 100644 index 00000000..65d0e72e --- /dev/null +++ b/src/main/java/cokr/xit/fims/cvlc/dao/WarningWordsMapper.java @@ -0,0 +1,23 @@ +package cokr.xit.fims.cvlc.dao; + +import java.util.List; + +import org.egovframe.rte.psl.dataaccess.mapper.Mapper; + +import cokr.xit.fims.crdn.CrdnQuery; +import cokr.xit.foundation.component.AbstractMapper; +import cokr.xit.foundation.data.DataObject; + +/**계도문 문구 관리 DAO + * @author leebj + */ +@Mapper("warningWordsMapper") +public interface WarningWordsMapper extends AbstractMapper { + + /**지정한 조건에 따라 계도문 문구 대장을 조회하여 반환한다. + * @param crdnQuery 계도문 문구 조회 파라미터 + * @return 계도문 문구 설정 정보 + */ + List selectWarningWordsInfo(CrdnQuery crdnQuery); + +} 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 9a7cefd1..062b7340 100644 --- a/src/main/java/cokr/xit/fims/cvlc/service/CrdnCvlcptService.java +++ b/src/main/java/cokr/xit/fims/cvlc/service/CrdnCvlcptService.java @@ -23,13 +23,13 @@ public interface CrdnCvlcptService { */ DataObject getCivilComplaintReceiptInitialDataInfo(CrdnQuery query); - /** 민원 원본 상세정보를 조회한다. + /** 지정한 민원자료의 원본 상세정보를 조회한다. * @param query 조회 요청 * @return 민원원본정보 */ DataObject getCivilComplaintOriginalInfo(CrdnQuery query); - /** 민원 답변 미리보기 정보를 조회한다. + /** 지정한 민원자료의 답변 미리보기 정보를 조회한다. * @param query 조회 요청 * @return 민원 답변 정보 */ @@ -44,13 +44,13 @@ public interface CrdnCvlcptService { */ Map makeFileFromHwpFormat(CrdnQuery query); - /** 단속민원 자료의 반송(회수)처리한다. + /** 민원 자료에 대해 반송(회수)처리한다. * @param crdnID 단속ID * @return 저장여부 */ boolean sendBackCivilComplaintInfo(String crdnId); - /** 단속민원 부과요청에 대한 수용 처리구분을 변경한다. + /** 부과요청 민원에 대한 수용 처리구분을 변경한다. * @param nonQueryRequest 처리 요청, crdnCvlcpt 단속민원정보, crdn 단속정보, newFileInfoList 업로드 파일 목록 * @return 저장여부 */ @@ -74,4 +74,21 @@ public interface CrdnCvlcptService { */ boolean updateAnswerTargetProcessStatus(String processType, String[] crdnIDs); + /** 민원답변 문구 설정 정보를 조회한다. + * @param crdnQuery 조회 조건 + * @return map 민원답변 문구 설정 정보 + *
  • basic: 기본 문구
  • + *
  • levyCaseList:
  • + *
  • warningCaseList:
  • + *
  • nonlevyCaseList:
  • + *
+ */ + Map getCvlcptAnswerWordsInfo(CrdnQuery crdnQuery); + + /** 계도문 문구 설정 정보를 조회한다. + * @param crdnQuery 조회 조건 + * @return 계도문 문구 설정 정보 + */ + List getWarningWordsInfo(CrdnQuery crdnQuery); + } diff --git a/src/main/java/cokr/xit/fims/cvlc/service/bean/CrdnCvlcptBean.java b/src/main/java/cokr/xit/fims/cvlc/service/bean/CrdnCvlcptMainBean.java similarity index 81% rename from src/main/java/cokr/xit/fims/cvlc/service/bean/CrdnCvlcptBean.java rename to src/main/java/cokr/xit/fims/cvlc/service/bean/CrdnCvlcptMainBean.java index 5848236b..15701aa4 100644 --- a/src/main/java/cokr/xit/fims/cvlc/service/bean/CrdnCvlcptBean.java +++ b/src/main/java/cokr/xit/fims/cvlc/service/bean/CrdnCvlcptMainBean.java @@ -2,7 +2,7 @@ package cokr.xit.fims.cvlc.service.bean; import java.text.SimpleDateFormat; import java.util.Date; -import java.util.Map; +import java.util.List; import javax.annotation.Resource; @@ -10,13 +10,13 @@ import org.springframework.stereotype.Component; import cokr.xit.base.user.ManagedUser; import cokr.xit.base.user.dao.UserMapper; -import cokr.xit.fims.crdn.Crdn; import cokr.xit.fims.crdn.CrdnQuery; import cokr.xit.fims.crdn.dao.CrdnInfoMapper; import cokr.xit.fims.crdn.dao.CrdnInstMapper; import cokr.xit.fims.crdn.dao.CrdnUpdtMapper; import cokr.xit.fims.crdn.dao.GlobalStngMapper; import cokr.xit.fims.cvlc.CrdnCvlcpt; +import cokr.xit.fims.cvlc.dao.AnswerWordsMapper; import cokr.xit.fims.cvlc.dao.CrdnCvlcptMapper; import cokr.xit.foundation.AbstractComponent; import cokr.xit.foundation.UserInfo; @@ -24,15 +24,18 @@ import cokr.xit.foundation.data.DataObject; import cokr.xit.interfaces.smg.Petition; import cokr.xit.interfaces.smg.service.bean.SmgSenderBean; -/** 민원 관리 Bean +/** 민원 주 기능 Bean * @author leebj */ -@Component("crdnCvlcptBean") -public class CrdnCvlcptBean extends AbstractComponent { +@Component("crdnCvlcptMainBean") +public class CrdnCvlcptMainBean extends AbstractComponent { @Resource(name="smgSenderBean") protected SmgSenderBean smgSenderBean; + @Resource(name = "answerWordsMapper") + private AnswerWordsMapper answerWordsMapper; + @Resource(name = "crdnCvlcptMapper") private CrdnCvlcptMapper crdnCvlcptMapper; @@ -73,28 +76,6 @@ public class CrdnCvlcptBean extends AbstractComponent { return crdnCvlcptMapper.updateCvlcptPrcsSe(cvlcpt) == 1 ? true : false; } - /**단속 대장 정보를 수정한다. - * @param nonQueryRequest 수정 요청, crdn 단속 대장 - * @return 저장 여부 - *
  • 저장됐으면 true
  • - *
  • 그렇지 않으면 false
  • - *
- */ - public boolean updateCrdn(Map nonQueryRequest, Crdn crdn) { - DataObject params = new DataObject(); - UserInfo userInfo = currentUser(); - params.set("currentUser", userInfo); - params.set("crdn", crdn); - for(String key : nonQueryRequest.keySet()){ - params.set(key, nonQueryRequest.get(key)); - } - - if(crdnCvlcptMapper.updateCrdn(params) != 1) { - return false; - } - return crdnCvlcptMapper.updateCrdnAddition(params) == 1 ? true : false; - } - /**답변 내용을 초기화한다. * @param cvlcptLinkId 민원 연계 아이디 * @return 저장 여부 @@ -109,28 +90,6 @@ public class CrdnCvlcptBean extends AbstractComponent { return crdnCvlcptMapper.initCvlcptPrcsRsltCn(crdnCvlcpt) == 1 ? true : false; } - /**지정한 단속자료로 복사 등록 처리한다. - * @param crdnId 단속 ID - * @return 복사자료의 단속 ID - */ - public String insertCrdnFromSelect(String crdnId) { - - DataObject params = new DataObject(); - UserInfo userInfo = currentUser(); - params.set("currentUser", userInfo); - params.set("crdnId", crdnId); - - if(crdnCvlcptMapper.insertCrdnFromSelect(params) != 1) { - throw new RuntimeException("단속민원 복사 등록 중 단속대장 등록에 실패하였습니다."); - } - - if(crdnCvlcptMapper.insertCrdnAdditionFromSelect(params) != 1) { - throw new RuntimeException("단속민원 복사 등록 중 단속대장 등록에 실패하였습니다."); - } - - return (String)params.get("newCrdnId"); - } - /**지정한 민원 자료의 답변 예정 문구를 반환한다. * @param crdnId 단속 ID * @return 답변 예정 문구 @@ -159,8 +118,8 @@ public class CrdnCvlcptBean extends AbstractComponent { return ""; } - DataObject bodyWordsInfo = crdnCvlcptMapper.selectCvlcptAnswerWordsInfo(crdnQuery); - DataObject basicWordsInfo = crdnCvlcptMapper.selectCvlcptAnswerBasicWordsInfo(crdnQuery); + DataObject bodyWordsInfo = answerWordsMapper.selectCvlcptAnswerWordsInfo(crdnQuery); + DataObject basicWordsInfo = answerWordsMapper.selectCvlcptAnswerBasicWordsInfo(crdnQuery); String body = bodyWordsInfo.string("PRCS_RSLT_CN"); String head = basicWordsInfo.string("HEADER_CN"); @@ -255,4 +214,30 @@ public class CrdnCvlcptBean extends AbstractComponent { return smgSenderBean.createReply(petition); } + + /**민원 답변 기본 문구 설정을 조회한다. + * @param query 조회 요청 + * @return 민원 답변 기본 문구 + */ + public DataObject selectCvlcptAnswerBasicWordsInfo(CrdnQuery crdnQuery) { + return answerWordsMapper.selectCvlcptAnswerBasicWordsInfo(crdnQuery); + } + + /**민원 답변 본문 문구 목록을 조회한다. + * @param query 조회 요청, ansSeCd 답변구분코드 + * @return 민원 답변 본문 문구 목록 + */ + public List selectAnswerBodyWordsList(CrdnQuery crdnQuery, String ansSeCd) { + + if("3".equals(ansSeCd)) { + return answerWordsMapper.selectLevyCaseWordsList(crdnQuery); + } else if("2".equals(ansSeCd)) { + return answerWordsMapper.selectWarningCaseWordsList(crdnQuery); + } else if("1".equals(ansSeCd)) { + return answerWordsMapper.selectNonlevyCaseWordsList(crdnQuery); + } else { + return null; + } + + } } 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 61a3db20..c9868053 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 @@ -5,6 +5,7 @@ import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Arrays; import java.util.Date; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.stream.Collectors; @@ -35,6 +36,7 @@ import cokr.xit.fims.crdn.dao.CrdnUpdtMapper; import cokr.xit.fims.crdn.dao.GlobalStngMapper; import cokr.xit.fims.crdn.service.bean.CrdnStngBean; import cokr.xit.fims.cvlc.CrdnCvlcpt; +import cokr.xit.fims.cvlc.dao.AnswerWordsMapper; import cokr.xit.fims.cvlc.dao.CrdnCvlcptMapper; import cokr.xit.fims.cvlc.service.CrdnCvlcptService; import cokr.xit.fims.excl.LevyExcl; @@ -53,8 +55,11 @@ public class CrdnCvlcptServiceBean extends AbstractServiceBean implements CrdnCv @Resource(name="fileBean") private FileBean fileBean; - @Resource(name="crdnCvlcptBean") - protected CrdnCvlcptBean crdnCvlcptBean; + @Resource(name="crdnCvlcptMainBean") + protected CrdnCvlcptMainBean crdnCvlcptMainBean; + + @Resource(name="crdnCvlcptSubBean") + protected CrdnCvlcptSubBean crdnCvlcptSubBean; @Resource(name="crdnStngBean") private CrdnStngBean crdnStngBean; @@ -62,6 +67,9 @@ public class CrdnCvlcptServiceBean extends AbstractServiceBean implements CrdnCv @Resource(name="excl01Bean") private Excl01Bean excl01Bean; + @Resource(name = "answerWordsMapper") + private AnswerWordsMapper answerWordsMapper; + @Resource(name = "crdnCvlcptMapper") private CrdnCvlcptMapper crdnCvlcptMapper; @@ -111,7 +119,7 @@ public class CrdnCvlcptServiceBean extends AbstractServiceBean implements CrdnCv String attachFormatFilePath = ("classpath:format/cvlcptOrgnl_photo.hwp"); query.setViewType("hwp"); - DataObject dataObject = crdnCvlcptBean.getCivilComplaintOriginalInfo(query); + DataObject dataObject = crdnCvlcptMainBean.getCivilComplaintOriginalInfo(query); SimpleDateFormat ymdhmsFormat = new SimpleDateFormat("yyyyMMddHHmmss"); SimpleDateFormat ymdFormat = new SimpleDateFormat("yyyyMMdd"); SimpleDateFormat ymdHypenFormat = new SimpleDateFormat("yyyy-MM-dd"); @@ -225,16 +233,16 @@ public class CrdnCvlcptServiceBean extends AbstractServiceBean implements CrdnCv @Override public DataObject getCivilComplaintOriginalInfo(CrdnQuery query) { - return crdnCvlcptBean.getCivilComplaintOriginalInfo(query); + return crdnCvlcptMainBean.getCivilComplaintOriginalInfo(query); } @Override public DataObject getAnswerPreview(CrdnQuery query) { - DataObject dataObject = crdnCvlcptMapper.selectAnswerPreview(query); + DataObject dataObject = crdnCvlcptMapper.selectAnswerPreview(query.getCrdnId()); //저장된 답변이 없으면 if(ifEmpty(dataObject.string("CVLCPT_PRCS_RSLT_CN"), () -> "").equals("")) { - String resultWords = crdnCvlcptBean.mappingAnswerWords(query.getCrdnId()); + String resultWords = crdnCvlcptMainBean.mappingAnswerWords(query.getCrdnId()); dataObject.set("CVLCPT_PRCS_RSLT_CN", resultWords); } @@ -298,13 +306,13 @@ public class CrdnCvlcptServiceBean extends AbstractServiceBean implements CrdnCv CrdnCvlcpt crdnCvlcpt = new CrdnCvlcpt(); crdnCvlcpt.setCvlcptLinkId(crdnInfo.string("CVLCPT_LINK_ID")); crdnCvlcpt.setCvlcptPrcsCd("01"); - boolean retSuccess = crdnCvlcptBean.updateCvlcptPrcsSe(crdnCvlcpt); + boolean retSuccess = crdnCvlcptMainBean.updateCvlcptPrcsSe(crdnCvlcpt); if (!retSuccess) { throw new RuntimeException("반송 처리 중 단속민원답변 수정에 실패하였습니다."); } - boolean result = crdnCvlcptBean.insertTransmitInfo(true, crdnInfo.string("CVLCPT_LINK_ID")); + boolean result = crdnCvlcptMainBean.insertTransmitInfo(true, crdnInfo.string("CVLCPT_LINK_ID")); if (!result) { throw new RuntimeException("반송 처리 중 전송자료 등록에 실패하였습니다."); } @@ -370,7 +378,7 @@ public class CrdnCvlcptServiceBean extends AbstractServiceBean implements CrdnCv boolean retSuccess = false; // 답변내용 초기화 - retSuccess = crdnCvlcptBean.initCvlcptPrcsRsltCn(crdnCvlcpt.getCvlcptLinkId()); + retSuccess = crdnCvlcptMainBean.initCvlcptPrcsRsltCn(crdnCvlcpt.getCvlcptLinkId()); if (!retSuccess) { throw new RuntimeException("민원자료 저장 중 단속민원 대장의 민원처리결과내용 초기화에 실패하였습니다."); } @@ -394,7 +402,7 @@ public class CrdnCvlcptServiceBean extends AbstractServiceBean implements CrdnCv } // 민원 답변 문구(TB_CVLCPT_ANS_WORDS) 대장 조회 - DataObject infoCvlcptAnsWords = crdnCvlcptMapper.selectCvlcptAnswerWordsInfo(crdnQuery); + DataObject infoCvlcptAnsWords = answerWordsMapper.selectCvlcptAnswerWordsInfo(crdnQuery); if(acceptType.equals("someAccept") || acceptType.equals("nonAccept")) { //일부수용,불수용 // 비부과(서손)사유가 민원 답변대상인가? 민원 답변 문구(TB_CVLCPT_ANS_WORDS) 대장에 답변 사유 코드가 존재한다면.. @@ -423,7 +431,7 @@ public class CrdnCvlcptServiceBean extends AbstractServiceBean implements CrdnCv crdnCvlcpt.setCvlcptTrsmCd(newCvlcptTrsmCd); // 민원 전송 코드 //민원처리정보 변경 - retSuccess = crdnCvlcptBean.updateCvlcptPrcsSe(crdnCvlcpt); + retSuccess = crdnCvlcptMainBean.updateCvlcptPrcsSe(crdnCvlcpt); if (!retSuccess) { throw new RuntimeException("민원자료 저장 중 단속민원답변 수정에 실패하였습니다."); @@ -487,7 +495,7 @@ public class CrdnCvlcptServiceBean extends AbstractServiceBean implements CrdnCv //단속정보변경 - saved = crdnCvlcptBean.updateCrdn(nonQueryRequest, crdn); + saved = crdnCvlcptSubBean.updateCrdn(nonQueryRequest, crdn); if(!saved) { throw new RuntimeException("단속민원답변 수정 중 단속정보변경에 실패하였습니다."); } @@ -574,7 +582,7 @@ public class CrdnCvlcptServiceBean extends AbstractServiceBean implements CrdnCv List orgnlCrdnFileList = fileBean.getFileList(fileQuery); - String newCrdnId = crdnCvlcptBean.insertCrdnFromSelect(crdnId); + String newCrdnId = crdnCvlcptSubBean.insertCrdnFromSelect(crdnId); if(ifEmpty(newCrdnId, () -> "").equals("")) { throw new RuntimeException("단속민원 복사 등록 중 단속대장 등록에 실패하였습니다."); } @@ -628,7 +636,7 @@ public class CrdnCvlcptServiceBean extends AbstractServiceBean implements CrdnCv if(processType.equals("answerExecute")) { crdnCvlcpt.setCvlcptTrsmCd("04"); if(ifEmpty(targetDataList.get(i).string("CVLCPT_PRCS_RSLT_CN"), () -> "").equals("")) { - String answerWords = crdnCvlcptBean.mappingAnswerWords(targetDataList.get(i).string("CRDN_ID")); + String answerWords = crdnCvlcptMainBean.mappingAnswerWords(targetDataList.get(i).string("CRDN_ID")); crdnCvlcpt.setCvlcptPrcsRsltCn(answerWords); } } else if(processType.equals("answerComplete")){ @@ -659,7 +667,7 @@ public class CrdnCvlcptServiceBean extends AbstractServiceBean implements CrdnCv if(processType.equals("answerExecute")) { - boolean result = crdnCvlcptBean.insertTransmitInfo(false, targetDataList.get(i).string("CVLCPT_LINK_ID")); + boolean result = crdnCvlcptMainBean.insertTransmitInfo(false, targetDataList.get(i).string("CVLCPT_LINK_ID")); if (!result) { throw new RuntimeException("민원 전송 상태 변경 중 전송자료 등록에 실패하였습니다."); } @@ -669,5 +677,26 @@ public class CrdnCvlcptServiceBean extends AbstractServiceBean implements CrdnCv return true; } + @Override + public Map getCvlcptAnswerWordsInfo(CrdnQuery crdnQuery) { + Map wordsStngInfo = new HashMap(); + + DataObject basic = crdnCvlcptMainBean.selectCvlcptAnswerBasicWordsInfo(crdnQuery); + List levyCaseList = crdnCvlcptMainBean.selectAnswerBodyWordsList(crdnQuery,"3"); + List warningCaseList = crdnCvlcptMainBean.selectAnswerBodyWordsList(crdnQuery,"2"); + List nonlevyCaseList = crdnCvlcptMainBean.selectAnswerBodyWordsList(crdnQuery,"1"); + + wordsStngInfo.put("basic", basic); + wordsStngInfo.put("levyCaseList", levyCaseList); + wordsStngInfo.put("warningCaseList", warningCaseList); + wordsStngInfo.put("nonlevyCaseList", nonlevyCaseList); + + return wordsStngInfo; + } + + @Override + public List getWarningWordsInfo(CrdnQuery crdnQuery) { + return crdnCvlcptSubBean.selectWarningWordsInfo(crdnQuery); + } } diff --git a/src/main/java/cokr/xit/fims/cvlc/service/bean/CrdnCvlcptSubBean.java b/src/main/java/cokr/xit/fims/cvlc/service/bean/CrdnCvlcptSubBean.java new file mode 100644 index 00000000..6b93865b --- /dev/null +++ b/src/main/java/cokr/xit/fims/cvlc/service/bean/CrdnCvlcptSubBean.java @@ -0,0 +1,82 @@ +package cokr.xit.fims.cvlc.service.bean; + +import java.util.List; +import java.util.Map; + +import javax.annotation.Resource; + +import org.springframework.stereotype.Component; + +import cokr.xit.fims.crdn.Crdn; +import cokr.xit.fims.crdn.CrdnQuery; +import cokr.xit.fims.cvlc.dao.CrdnCvlcptMapper; +import cokr.xit.fims.cvlc.dao.WarningWordsMapper; +import cokr.xit.foundation.AbstractComponent; +import cokr.xit.foundation.UserInfo; +import cokr.xit.foundation.data.DataObject; + +/** 민원 부 기능 Bean + * @author leebj + */ +@Component("crdnCvlcptSubBean") +public class CrdnCvlcptSubBean extends AbstractComponent { + + @Resource(name = "crdnCvlcptMapper") + private CrdnCvlcptMapper crdnCvlcptMapper; + + @Resource(name = "warningWordsMapper") + private WarningWordsMapper warningWordsMapper; + + /**단속 대장 정보를 수정한다. + * @param nonQueryRequest 수정 요청, crdn 단속 대장 + * @return 저장 여부 + *
  • 저장됐으면 true
  • + *
  • 그렇지 않으면 false
  • + *
+ */ + public boolean updateCrdn(Map nonQueryRequest, Crdn crdn) { + DataObject params = new DataObject(); + UserInfo userInfo = currentUser(); + params.set("currentUser", userInfo); + params.set("crdn", crdn); + for(String key : nonQueryRequest.keySet()){ + params.set(key, nonQueryRequest.get(key)); + } + + if(crdnCvlcptMapper.updateCrdn(params) != 1) { + return false; + } + return crdnCvlcptMapper.updateCrdnAddition(params) == 1 ? true : false; + } + + /**지정한 단속자료를 복사 등록 처리한다. + * @param crdnId 단속 ID + * @return 복사자료의 단속 ID + */ + public String insertCrdnFromSelect(String crdnId) { + + DataObject params = new DataObject(); + UserInfo userInfo = currentUser(); + params.set("currentUser", userInfo); + params.set("crdnId", crdnId); + + if(crdnCvlcptMapper.insertCrdnFromSelect(params) != 1) { + throw new RuntimeException("단속자료 복사 등록 중 단속대장 등록에 실패하였습니다."); + } + + if(crdnCvlcptMapper.insertCrdnAdditionFromSelect(params) != 1) { + throw new RuntimeException("단속자료 복사 등록 중 단속대장 등록에 실패하였습니다."); + } + + return (String)params.get("newCrdnId"); + } + + /** 계도문 문구 설정 정보를 조회한다. + * @param crdnQuery 조회조건 + * @return 계도문 문구 설정 + */ + public List selectWarningWordsInfo(CrdnQuery crdnQuery) { + //TODO : warningWordsMapper.selectWarningWordsInfo(crdnQuery) + return null; + } +} 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 f6312d71..7466505a 100644 --- a/src/main/java/cokr/xit/fims/cvlc/web/Cvlc05Controller.java +++ b/src/main/java/cokr/xit/fims/cvlc/web/Cvlc05Controller.java @@ -5,11 +5,15 @@ 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.service.CrdnCvlcptService; +import cokr.xit.foundation.data.DataObject; /**민원신고답변 문구 관리 서비스 웹 컨트롤러.
* {웹 컨텍스트}/cvlc/cvlc05 로 접근할 수 있다. @@ -20,6 +24,9 @@ public class Cvlc05Controller extends ApplicationController { @Resource(name="crdnCvlcptService") private CrdnCvlcptService crdnCvlcptService; + @Resource(name="globalStngMapper") + private GlobalStngMapper globalStngMapper; + /** 민원신고 답변 문구 관리 메인화면을 연다. * @return fims/cvlc/cvlc05010-main */ @@ -27,6 +34,7 @@ public class Cvlc05Controller extends ApplicationController { ModelAndView mav = new ModelAndView(); mav.setViewName("fims/cvlc/cvlc05010-main"); mav.addObject("pageName", "cvlc05010-main"); + mav.addObject("module", "type='module'"); Map> commonCodes = getCodesOf("FIM054"); mav.addObject("FIM054List", commonCodes.get("FIM054")); @@ -34,4 +42,36 @@ public class Cvlc05Controller extends ApplicationController { return mav; } + /** 민원신고 답변 문구 설정을 조회한다. + * @return fims/cvlc/cvlc05010-info + */ + @RequestMapping(name="민원신고 답변 문구 설정 조회", value="/010/info.do") + public ModelAndView getCvlcptAnswerWordsInfo(CrdnQuery crdnQuery) { + ModelAndView mav = new ModelAndView(); + mav.setViewName("jsonView"); + + String currentSggCd = globalStngMapper.selectSggCdForCurrentUser(); + crdnQuery.setSggCd(currentSggCd); + Map info = crdnCvlcptService.getCvlcptAnswerWordsInfo(crdnQuery); + + DataObject basicInfo = (DataObject) info.get("basic"); + List levyCaseList = (List) info.get("levyCaseList"); + List warningCaseList = (List) info.get("warningCaseList"); + List nonlevyCaseList = (List) info.get("nonlevyCaseList"); + + if(basicInfo == null){ + mav.addObject("headerCn", ""); + mav.addObject("footerCn", ""); + } else { + mav.addObject("headerCn", basicInfo.string("HEADER_CN")); + mav.addObject("footerCn", basicInfo.string("FOOTER_CN")); + } + + mav.addObject("levyCaseList", levyCaseList); + mav.addObject("warningCaseList", warningCaseList); + mav.addObject("nonlevyCaseList", nonlevyCaseList); + + return mav; + } + } 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 new file mode 100644 index 00000000..086ec9c1 --- /dev/null +++ b/src/main/resources/sql/mapper/fims/cvlc/answer-words-mapper.xml @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/sql/mapper/fims/cvlc/crdnCvlcpt-mapper.xml b/src/main/resources/sql/mapper/fims/cvlc/crdnCvlcpt-mapper.xml index 66cb6c29..befe183c 100644 --- a/src/main/resources/sql/mapper/fims/cvlc/crdnCvlcpt-mapper.xml +++ b/src/main/resources/sql/mapper/fims/cvlc/crdnCvlcpt-mapper.xml @@ -618,37 +618,8 @@ AND (SELECT VLTN_ARTCL FROM TB_VLTN_INFO WHERE VLTN_ID = C.VLTN_ID) LIKE CONCAT( - - - - /* 민원답변 미리보기(crdnCvlcptMapper.selectAnswerPreview) */ SELECT C.CRDN_ID , CC.CVLCPT_LINK_ID diff --git a/src/main/resources/sql/mapper/fims/cvlc/warning-words-mapper.xml b/src/main/resources/sql/mapper/fims/cvlc/warning-words-mapper.xml new file mode 100644 index 00000000..f3c99082 --- /dev/null +++ b/src/main/resources/sql/mapper/fims/cvlc/warning-words-mapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file