From 22c60fdef90d8d9174d4efdf646dc4606f032806 Mon Sep 17 00:00:00 2001 From: minuk926 Date: Fri, 10 Feb 2023 12:58:02 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EB=AF=BC=EC=9B=90=EC=8B=A0=EA=B3=A0?= =?UTF-8?q?=EB=8B=B5=EB=B3=80=20=EC=83=9D=EC=84=B1=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cmm/service/FimsCrackdownMgtService.java | 23 +++++++---- .../cmm/service/IFimsCrackdownMgtService.java | 4 +- .../cmm/web/FimsCrackDownMgtController.java | 14 +++++-- .../exception/JSONExceptionMessageWriter.java | 3 ++ .../resources/spring/mvc/mvc-converter.xml | 4 +- .../fims/biz/rt/rtCrackdownMgtMainForm.jsp | 40 +++++++------------ .../resources/biz/common/js/fimsApiURL.js | 7 ++-- 7 files changed, 52 insertions(+), 43 deletions(-) diff --git a/src/main/java/kr/xit/fims/biz/cmm/service/FimsCrackdownMgtService.java b/src/main/java/kr/xit/fims/biz/cmm/service/FimsCrackdownMgtService.java index 2ec03e4d..bb93d7b8 100644 --- a/src/main/java/kr/xit/fims/biz/cmm/service/FimsCrackdownMgtService.java +++ b/src/main/java/kr/xit/fims/biz/cmm/service/FimsCrackdownMgtService.java @@ -282,20 +282,25 @@ public class FimsCrackdownMgtService implements IFimsCrackdownMgtService { ecCtznSttemntMapper.updateCvplProcessResultOfEcCtznSttemntAnswer(dto); } + @Override + public void addCtznStmtAnswers(List interfaceSeqList) { + interfaceSeqList.forEach(this::addCtznStmtAnswer); + } + @Override @Transactional - public String addCtznStmtAnswer(final CtznStmtDTO.Ans dto) { + public String addCtznStmtAnswer(final String interfaceSeqN) { // 답변 xml 파일 생성 List fileDtlList = cmmFileService.findFilesByJobSeCodeAndJobId( CmmFileDTO.FileMst.builder() .jobSeCode(FimsConst.FileJobSeCode.NATL_NEWS_PAPER_RCV.getCode()) - .fileJobId(dto.getInterfaceSeqN()+"01") + .fileJobId(interfaceSeqN+"01") .build()); String tgtPath = uploadResPath + fileDtlList.get(0).getFileCours(); - final String fileName = dto.getInterfaceSeqN() + ".xml"; + final String fileName = interfaceSeqN + ".xml"; - CtznStmtDTO.Ans ansDTO = mapper.selectEcCtznSttemntAnswer(dto.getInterfaceSeqN()); + CtznStmtDTO.Ans ansDTO = mapper.selectEcCtznSttemntAnswer(interfaceSeqN); CtznStmtAnsSendDTO sendDto = CtznStmtDTO.Ans.getCtznStmtAnsDTO(ansDTO); String xmlStr = XmlParseUtils.writeObjectToXml(sendDto, kr.xit.fims.biz.ec.model.CtznStmtAnsSendDTO.class); @@ -318,9 +323,13 @@ public class FimsCrackdownMgtService implements IFimsCrackdownMgtService { // // 시민신고 상태 - 답변완료 update - dto.setUpdusr(getUserInfo().getUniqId()); - dto.setCtznSttemntStatusCode(FimsConst.CtznStmtStsCode.ANS_COMPLETE.getCode()); - ecCtznSttemntMapper.updateStmtProcessStsOfEcCtznSttemnt(dto); + ecCtznSttemntMapper.updateStmtProcessStsOfEcCtznSttemnt( + CtznStmtDTO.Ans.builder() + .interfaceSeqN(interfaceSeqN) + .ctznSttemntStatusCode(FimsConst.CtznStmtStsCode.ANS_COMPLETE.getCode()) + .updusr(getUserInfo().getUniqId()) + .build() + ); return tgtPath + "/" + fileName; } diff --git a/src/main/java/kr/xit/fims/biz/cmm/service/IFimsCrackdownMgtService.java b/src/main/java/kr/xit/fims/biz/cmm/service/IFimsCrackdownMgtService.java index 3de0d857..0fda3fcf 100644 --- a/src/main/java/kr/xit/fims/biz/cmm/service/IFimsCrackdownMgtService.java +++ b/src/main/java/kr/xit/fims/biz/cmm/service/IFimsCrackdownMgtService.java @@ -27,11 +27,11 @@ public interface IFimsCrackdownMgtService { CmmAnsTmplDTO.Dtl findCtznAnswerTmplInfo(final FimsCrackdownDTO.AnsRequest dto); CtznStmtDTO.Ans findCtznStmtAnswer(final FimsCrackdownDTO.AnsRequest dto); void modifyCtznStmtAnswer(final CtznStmtDTO.Ans dto); - String addCtznStmtAnswer(final CtznStmtDTO.Ans dto); + String addCtznStmtAnswer(final String interfaceSeqN); + void addCtznStmtAnswers(final List interfaceSeqList); default XitLoginVO getUserInfo(){ return XitCmmnUtil.getUserInfo(); } - } diff --git a/src/main/java/kr/xit/fims/biz/cmm/web/FimsCrackDownMgtController.java b/src/main/java/kr/xit/fims/biz/cmm/web/FimsCrackDownMgtController.java index ac3fa5ca..54679b4b 100644 --- a/src/main/java/kr/xit/fims/biz/cmm/web/FimsCrackDownMgtController.java +++ b/src/main/java/kr/xit/fims/biz/cmm/web/FimsCrackDownMgtController.java @@ -1,5 +1,6 @@ package kr.xit.fims.biz.cmm.web; +import java.util.List; import java.util.Map; import java.util.Objects; @@ -183,7 +184,6 @@ public class FimsCrackDownMgtController { return mav; } - @RequestMapping(value = "/findCtznStmtAnswer") public ModelAndView findCtznStmtAnswer(final FimsCrackdownDTO.AnsRequest dto){ return ResultResponse.of(service.findCtznStmtAnswer(dto)); @@ -199,8 +199,16 @@ public class FimsCrackDownMgtController { } @RequestMapping("/addCtznStmtAnswer") - public ModelAndView addCtznStmtAnswer(final CtznStmtDTO.Ans dto) { - return ResultResponse.of(service.addCtznStmtAnswer(dto)); + public ModelAndView addCtznStmtAnswer(final String interfaceSeqN) { + return ResultResponse.of(service.addCtznStmtAnswer(interfaceSeqN)); + } + + @RequestMapping("/addCtznStmtAnswers") + public ModelAndView addCtznStmtAnswers(@RequestBody final List interfaceSeqList) { + ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW); + service.addCtznStmtAnswers(interfaceSeqList); + AjaxMessageMapRenderer.success(mav, MessageKey.CMM_SUCCESS); + return mav; } @RequestMapping(value = "/findCtznAnswerTmplInfo") diff --git a/src/main/java/kr/xit/framework/support/exception/JSONExceptionMessageWriter.java b/src/main/java/kr/xit/framework/support/exception/JSONExceptionMessageWriter.java index c08ecf6d..bce508a4 100644 --- a/src/main/java/kr/xit/framework/support/exception/JSONExceptionMessageWriter.java +++ b/src/main/java/kr/xit/framework/support/exception/JSONExceptionMessageWriter.java @@ -11,6 +11,7 @@ import org.slf4j.LoggerFactory; import com.fasterxml.jackson.core.JsonEncoding; import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; import kr.xit.framework.support.util.AjaxMessageMapRenderer; @@ -36,6 +37,8 @@ public abstract class JSONExceptionMessageWriter { JsonGenerator generator = null; try { + //objectMapper.enable(JsonReadFeature.ALLOW_NON_NUMERIC_NUMBERS); + objectMapper.configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, true); generator = objectMapper.getFactory().createGenerator(response.getOutputStream(), JsonEncoding.UTF8); } catch (IOException e) { e.printStackTrace(); diff --git a/src/main/resources/spring/mvc/mvc-converter.xml b/src/main/resources/spring/mvc/mvc-converter.xml index 5a8e5ca9..48055e03 100644 --- a/src/main/resources/spring/mvc/mvc-converter.xml +++ b/src/main/resources/spring/mvc/mvc-converter.xml @@ -42,9 +42,9 @@ --> - + - + diff --git a/src/main/webapp/WEB-INF/jsp/fims/biz/rt/rtCrackdownMgtMainForm.jsp b/src/main/webapp/WEB-INF/jsp/fims/biz/rt/rtCrackdownMgtMainForm.jsp index e17e2226..af773a65 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/biz/rt/rtCrackdownMgtMainForm.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/biz/rt/rtCrackdownMgtMainForm.jsp @@ -92,10 +92,10 @@ Date Author Description 부과처리 @@ -206,14 +206,6 @@ Date Author Description ,onClickGrid: function(props){ const selColumn = props.columnInfo.name; switch (selColumn){ - // case 'vhcleNo': - // const gridDatas = ARR_GRID[CUR_TAB_IDX].store.data.rawData.map(d => { - // return {regltSeCode: d.regltSeCode, regltId: d.regltId, regltProcessSttusCode: d.regltProcessSttusCode} - // }) - // ARR_NAV[CUR_TAB_IDX] = new PageNavigation(ARR_GRID[CUR_TAB_IDX], gridDatas, props.rowKey); - // fnBiz.pagePopup('total', ARR_NAV[CUR_TAB_IDX].gridInfo.curRowData); - // break; - case 'cvplRceptNo': popupDiv = 'edit'; const rowDatas = ARR_GRID[CUR_TAB_IDX].store.data.rawData.map(d => { @@ -224,7 +216,6 @@ Date Author Description break; default: - popupDiv = ''; break; } } @@ -288,11 +279,6 @@ Date Author Description } return answerSeCode; } - }; - const fnTab0Biz = { - - - }; /************************************************************************** @@ -340,9 +326,6 @@ Date Author Description let rowKey; if(arrChecks.length > 0){ rowKey = arrChecks[0].rowKey; - <%--rowDatas = arrChecks.map(d => {--%> - <%-- return {tmplatId: '${ctznTmplatId}', answerSeCode: fnBiz.getAnswerSeCode(d.regltProcessSttusCode), resnCode: d.erppSeCode, interfaceSeqN: d.interfaceSeqN, vhcleNo: d.vhcleNo}--%> - <%--})--%> } else { rowKey = ARR_GRID[CUR_TAB_IDX].store.data.rawData[0]?.rowKey; } @@ -367,13 +350,22 @@ Date Author Description } }) + // 중복제거 const datas = arrData.reduce(function(acc, current) { if (acc.findIndex(({ interfaceSeqN }) => interfaceSeqN === current.interfaceSeqN) === -1) { - acc.push(current); + acc.push(current.interfaceSeqN); } return acc; }, []); - alert(JSON.stringify(datas)) + + cmmAjax({ + url: fimsApiUrl.ADD_CTZN_ANS_LIST + ,contentType: 'application/json' + ,data: JSON.stringify(datas) + ,success: (res) => { + + } + }); }); }); @@ -612,14 +604,10 @@ Date Author Description return {regltId: d.regltId, regltSeCode: d.regltSeCode, regltProcessSttusCode: d.regltProcessSttusCode} }); } - // const datas = res.data?.contents.map(d => { - // return {regltId: d.regltId, regltSeCode: d.regltSeCode, regltProcessSttusCode: d.regltProcessSttusCode} - // }); + ARR_NAV[idx].resetGrid(res, datas, (pagiNavigation)=>{ ARR_NAV[idx] = pagiNavigation; fnBiz.pagePopup(popupDiv, ARR_NAV[idx].gridInfo.curRowData); - //if(popupDiv === 'cvplRceptNo') fnBiz.pagePopup('edit', ARR_NAV[idx].gridInfo.curRowData); - //else fnBiz.pagePopup('total', ARR_NAV[idx].gridInfo.curRowData); }) } fnBiz.setDblClickEvent(idx); diff --git a/src/main/webapp/resources/biz/common/js/fimsApiURL.js b/src/main/webapp/resources/biz/common/js/fimsApiURL.js index 1bbd9aa3..ee9cb737 100644 --- a/src/main/webapp/resources/biz/common/js/fimsApiURL.js +++ b/src/main/webapp/resources/biz/common/js/fimsApiURL.js @@ -12,10 +12,11 @@ const fimsApiUrl = { ,POPUP_CTZN_ANS_PREVIEW: '/fims/biz/cmm/cmmCtznAnswerPreviewPopup.do' //시민신고 답변 미리보기 팝업 //과태료시스템등록 popup ,FIND_CRACKDOWNS: '/fims/biz/cmm/findCrackdownInfos.do' //단속현황-외부연계자료목록 ,FIND_CRACKDOWN_INFO: '/fims/biz/cmm/findCrackdownInfoAndAttchFiles.do' //단속현황-개별총정보 위반정보탭 조회 + ,FIND_CTZN_ANS_INFO: '/fims/biz/cmm/findCtznStmtAnswer.do' //시민신고 답변 정보 조회 + ,MODIFY_CTZN_ANS_TXT: '/fims/biz/cmm/modifyCtznStmtAnswer.do' //시민신고 답변 내용 변경 + ,ADD_CTZN_ANS: '/fims/biz/cmm/addCtznStmtAnswer.do' //시민신고 답변 생성 + ,ADD_CTZN_ANS_LIST: '/fims/biz/cmm/addCtznStmtAnswers.do' //시민신고 목록 답변 생성 ,FIND_CTZN_ANS_TMPL_INFO: '/fims/biz/cmm/findCtznAnswerTmplInfo.do' //시민신고 답변 템플릿 조회 - ,FIND_CTZN_ANS_INFO: '/fims/biz/cmm/findCtznStmtAnswer.do' //시민신고 답변 템플릿 조회 - ,MODIFY_CTZN_ANS_TXT: '/fims/biz/cmm/modifyCtznStmtAnswer.do' //시민신고 답변 템플릿 조회 - ,ADD_CTZN_ANS: '/fims/biz/cmm/addCtznStmtAnswer.do' //시민신고 답변 템플릿 조회 /** * fims API URL