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 1709a502..b6ec892a 100644 --- a/src/main/java/cokr/xit/fims/cvlc/dao/CrdnCvlcptMapper.java +++ b/src/main/java/cokr/xit/fims/cvlc/dao/CrdnCvlcptMapper.java @@ -121,4 +121,16 @@ public interface CrdnCvlcptMapper extends AbstractMapper { */ int updateAnswerContent(CrdnCvlcpt crdnCvlcpt); + /**답변대상목록을 단속ID목록으로 조회한다. + * @param crdnIDs 단속ID 목록 + * @return 단속민원정보 + */ + List selectAnswerTargetList(String[] crdnIDs); + + /**답변대상의 민원전송 상태를 변경한다. + * @param crdnCvlcpt 단속민원정보 + * @return 저장된 정보 수 + */ + int updateAnswerTargetTransmitStatus(CrdnCvlcpt crdnCvlcpt); + } 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 3178930d..b99ea0d9 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 @@ -26,6 +26,7 @@ import cokr.xit.fims.cmmn.dao.CrdnPayerHstryMapper; import cokr.xit.fims.cmmn.dao.CrdnSttsHstryMapper; import cokr.xit.fims.cmmn.hwp.AddingParagraphBetweenHWPFile; import cokr.xit.fims.cmmn.hwp.InsertingImageCell; +import cokr.xit.fims.cmmn.service.bean.CrdnSttsHstryBean; import cokr.xit.fims.crdn.Crdn; import cokr.xit.fims.crdn.CrdnQuery; import cokr.xit.fims.crdn.dao.CrdnInfoMapper; @@ -68,6 +69,9 @@ public class CrdnCvlcptServiceBean extends AbstractServiceBean implements CrdnCv @Resource(name = "crdnSttsHstryMapper") private CrdnSttsHstryMapper crdnSttsHstryMapper; + @Resource(name = "crdnSttsHstryBean") + private CrdnSttsHstryBean crdnSttsHstryBean; + @Resource(name = "crdnPayerHstryMapper") private CrdnPayerHstryMapper crdnPayerHstryMapper; @@ -423,8 +427,6 @@ public class CrdnCvlcptServiceBean extends AbstractServiceBean implements CrdnCv } - - //단속정보변경 saved = crdnCvlcptBean.updateCrdn(nonQueryRequest, crdn); if(!saved) { @@ -558,12 +560,44 @@ public class CrdnCvlcptServiceBean extends AbstractServiceBean implements CrdnCv @Override public boolean updateAnswerTargetProcessStatus(String processType, String[] crdnIDs) { - if(processType.equals("answerExecute")) { - // TODO : 답변완료실행 - } else if(processType.equals("answerComplete")) { - // TODO : 답변완료 - } else { - return false; + List targetDataList = crdnCvlcptMapper.selectAnswerTargetList(crdnIDs); + + for(int i=0; i < targetDataList.size(); i++) { + + CrdnCvlcpt crdnCvlcpt = new CrdnCvlcpt(); + crdnCvlcpt.setCvlcptLinkId(targetDataList.get(i).string("CVLCPT_LINK_ID")); + 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")); + crdnCvlcpt.setCvlcptPrcsRsltCn(answerWords); + } + } else if(processType.equals("answerComplete")){ + crdnCvlcpt.setCvlcptTrsmCd("09"); + } else { + return false; + } + + int effected = crdnCvlcptMapper.updateAnswerTargetTransmitStatus(crdnCvlcpt); + if(effected != 1) { + throw new RuntimeException("민원 전송 상태 변경 중 오류가 발생하였습니다."); + } + + + if(targetDataList.get(i).string("CRDN_STTS_CD").equals("21")) { + CrdnSttsHstry crdnSttsHstry = new CrdnSttsHstry(); + crdnSttsHstry.setCrdnId(targetDataList.get(i).string("CRDN_ID")); + crdnSttsHstry.setBfrSttsCd(targetDataList.get(i).string("CRDN_STTS_CD")); + crdnSttsHstry.setBfrSttsChgDt(targetDataList.get(i).string("CRDN_STTS_CHG_DT")); + crdnSttsHstry.setCrdnSttsCd("22"); + crdnSttsHstry.setTaskDtlId(targetDataList.get(i).string("CRDN_ID")); + crdnSttsHstry.setEtcCn("민원답변등록"); + boolean retSuccess = crdnSttsHstryBean.createHstryUpdateCrdnSttsCd(crdnSttsHstry); + if (!retSuccess) { + throw new RuntimeException("민원 전송 상태 변경 중 단속상태코드 변경에 실패하였습니다."); + } + } + } return true; 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 4e3c7117..3356e5bd 100644 --- a/src/main/resources/sql/mapper/fims/cvlc/crdnCvlcpt-mapper.xml +++ b/src/main/resources/sql/mapper/fims/cvlc/crdnCvlcpt-mapper.xml @@ -571,6 +571,7 @@ SELECT C.CRDN_ID AND C.CRDN_STTS_CD IN ('21','81','83') AND C.CRDN_REG_SE_CD = '02' AND CC.CVLCPT_PRCS_CD IN ('02','03','04') + AND CC.CVLCPT_TRSM_CD = '01' @@ -655,4 +656,33 @@ UPDATE TB_CRDN_CVLCPT WHERE CVLCPT_LINK_ID = #{cvlcptLinkId}; + + + +/* 민원 전송코드 변경(crdnCvlcptMapper.updateAnswerTargetTransmitStatus) */ +UPDATE TB_CRDN_CVLCPT + SET CVLCPT_TRSM_CD = #{cvlcptTrsmCd} /* 민원 전송 코드 */ + + , CVLCPT_PRCS_RSLT_CN = #{cvlcptPrcsRsltCn} /* 민원 처리 결과 내용 */ + + , MDFCN_DT = /* 수정일시 */ + , MDFR = #{modifiedBy} /* 수정자 */ + WHERE CVLCPT_LINK_ID = #{cvlcptLinkId} + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/jsp/fims/cvlc/cvlc01030-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/cvlc/cvlc01030-main.jsp index 6b123689..e109303d 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/cvlc/cvlc01030-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/cvlc/cvlc01030-main.jsp @@ -198,14 +198,12 @@ $(document).ready(function(){ $P.crdnControl.tableRenderComplete = false; $P.crdnControl.save = (processType) => { - - var keyArr = $P.crdnControl.dataset.getKeys("selected"); ajax.post({ url : $P.crdnControl.urls.update, data : { "processType" : processType, - "crdnIDs" : $P.crdnControl.dataset.getKeys("selected") + "crdnIDs" : $P.crdnControl.dataset.getKeys("selected").join(",") }, success : resp => { if(resp.saved){ @@ -477,14 +475,14 @@ $(document).ready(function(){ }); } - $P.fnAnswerExcute = () => { + $P.fnAnswerExecute = () => { var count = $P.crdnControl.dataset.getKeys("selected").length; dialog.alert({ content : "선택된 "+count+"건의 자료를 답변등록을 실행하시겠습니까?" , onOK : () => { - $P.crdnControl.save('answerExcute'); + $P.crdnControl.save('answerExecute'); } }); } @@ -540,7 +538,7 @@ $(document).ready(function(){ $('#btnSearch--${pageName}').on('click', () => $P.searchCrdnList()); $("#btnOpenCvlcptOrgnl--${pageName}").on("click", () => $P.fnOpenCvlcptOrgnl()); $("#btnOpenAnswerPreview--${pageName}").on("click", () => $P.fnOpenAnswerPreview()); - $("#btnAnswerExecute--${pageName}").on("click", () => $P.fnAnswerExcute()); + $("#btnAnswerExecute--${pageName}").on("click", () => $P.fnAnswerExecute()); $("#btnAnswerComplete--${pageName}").on("click", () => $P.fnAnswerComplete()); $("#table-responsive--${pageName}").scroll(function(){ $P.scrollEnd(this); });