diff --git a/src/main/java/kr/xit/fims/biz/ec/mapper/IEcCtznSttemntMapper.java b/src/main/java/kr/xit/fims/biz/ec/mapper/IEcCtznSttemntMapper.java index 5a83bcee..a3abe176 100644 --- a/src/main/java/kr/xit/fims/biz/ec/mapper/IEcCtznSttemntMapper.java +++ b/src/main/java/kr/xit/fims/biz/ec/mapper/IEcCtznSttemntMapper.java @@ -39,6 +39,10 @@ public interface IEcCtznSttemntMapper { void updateStatusAndRegltIdOfEcCtznSttemntDetail(final CtznStmtDTO.Request dto); + + void saveEcCtznSttemntAnswer(final CtznStmtDTO.CtznStmtAns dto); + + int dragAndDropSaveImg(CmmFileDTO.FileDtl vo); int dragAndDropDeleteImg(CmmFileDTO.FileDtl vo); diff --git a/src/main/java/kr/xit/fims/biz/ec/model/CtznStmtDTO.java b/src/main/java/kr/xit/fims/biz/ec/model/CtznStmtDTO.java index 12127adc..1489dfc0 100644 --- a/src/main/java/kr/xit/fims/biz/ec/model/CtznStmtDTO.java +++ b/src/main/java/kr/xit/fims/biz/ec/model/CtznStmtDTO.java @@ -289,6 +289,24 @@ public class CtznStmtDTO implements Serializable { //extends ExtlEsbDataType { */ private String register; + public static NatlNewspaperSendXmlDTO getCtznStmtAnsDTO(CtznStmtDTO.CtznStmtAns dto) { + return NatlNewspaperSendXmlDTO.builder() + .interfaceSeqN(dto.getInterfaceSeqN()) + .sysGubunC(dto.getSysCode()) + .ancCodeV(dto.getInsttCode()) + .petiGubunC(dto.getCvplSe()) + .petiNoC(dto.getCvplReqstNo()) + .civilNoC(dto.getCvplRceptNo()) + .civilGistV(dto.getCvplOutline()) + .civilAbstractL(dto.getCvplProcessSumry()) + .pcdDeptV(dto.getProcessDeptCode()) + .pcdDeptNmV(dto.getCvplProcessDeptnm()) + .dutyIdV(dto.getChargerNm()) + .pcdEmailV(dto.getChargerEmail()) + .pcdTelV(dto.getChargerTlphonNo()) + .pcdRstContL(dto.getCvplProcessResult()) + .build(); + } } @Getter diff --git a/src/main/java/kr/xit/fims/biz/ec/service/EcCtznSttemntService.java b/src/main/java/kr/xit/fims/biz/ec/service/EcCtznSttemntService.java index c2d4fe2a..19ddb9be 100644 --- a/src/main/java/kr/xit/fims/biz/ec/service/EcCtznSttemntService.java +++ b/src/main/java/kr/xit/fims/biz/ec/service/EcCtznSttemntService.java @@ -22,8 +22,6 @@ import kr.xit.fims.biz.ec.model.NatlNewspaperSendXmlDTO; import kr.xit.framework.biz.cmm.model.CmmFileDTO; import kr.xit.framework.biz.cmm.service.ICmmFileService; import kr.xit.framework.support.exception.BizRuntimeException; -import kr.xit.framework.support.util.Checks; -import kr.xit.framework.support.util.CmmFileUtils; import kr.xit.framework.support.util.constants.MessageKey; import kr.xit.framework.support.util.xml.XmlParseUtils; import lombok.RequiredArgsConstructor; @@ -75,7 +73,7 @@ public class EcCtznSttemntService implements IEcCtznSttemntService { @Override @Transactional public void modifyEcCtznSttemntDetail(final CtznStmtDTO.CtznStmtDtl dto) { - dto.setUpdusr(getUserUniqId()); + dto.setUpdusr(getUserInfo().getUniqId()); mapper.updateEcCtznSttemntDetail(dto); } @@ -101,11 +99,11 @@ public class EcCtznSttemntService implements IEcCtznSttemntService { @Override @Transactional public void saveRtReglt(final CtznStmtDTO.Request dto) { - dto.setRegister(getUserUniqId()); + dto.setRegister(getUserInfo().getUniqId()); dto.setRegltProcessSttusCode(FimsConst.RegltProcessSttusCode.CRACKDOWN.getCode()); mapper.insertRtRegltFromCtznStmt(dto); - dto.setUpdusr(getUserUniqId()); + dto.setUpdusr(getUserInfo().getUniqId()); dto.setCtznSttemntStatusCode(FimsConst.CtznSttemntStatusCode.ACCEPTANCE.getCode()); mapper.updateStatusAndRegltIdOfEcCtznSttemntDetail(dto); } @@ -117,7 +115,7 @@ public class EcCtznSttemntService implements IEcCtznSttemntService { @Transactional public void saveRtErpp(final CtznStmtDTO.Request dto) { // 단속테이블 - dto.setRegister(getUserUniqId()); + dto.setRegister(getUserInfo().getUniqId()); dto.setRegltProcessSttusCode(FimsConst.RegltProcessSttusCode.DESTRUCTION.getCode()); mapper.insertRtRegltFromCtznStmt(dto); @@ -125,7 +123,7 @@ public class EcCtznSttemntService implements IEcCtznSttemntService { mapper.insertRtErppFromCtznStmt(dto); // 상태 변경 - dto.setUpdusr(getUserUniqId()); + dto.setUpdusr(getUserInfo().getUniqId()); dto.setCtznSttemntStatusCode(FimsConst.CtznSttemntStatusCode.NOT_ACCEPTABLE.getCode()); mapper.updateStatusAndRegltIdOfEcCtznSttemntDetail(dto); } @@ -139,6 +137,81 @@ public class EcCtznSttemntService implements IEcCtznSttemntService { } @Override + @Transactional + public String saveCtznStmtAns(CtznStmtDTO.CtznStmtAns dto) { + // 답변 xml 파일 생성 + List fileDtlList = cmmFileService.findFilesByJobSeCodeAndJobId( + CmmFileDTO.FileMst.builder() + .jobSeCode(FimsConst.FileJobSeCode.NATL_NEWS_PAPER_RCV.getCode()) + .fileJobId(dto.getInterfaceSeqN()+"01") + .build()); + + String tgtPath = uploadResPath + fileDtlList.get(0).getFileCours(); + final String fileName = dto.getInterfaceSeqN() + ".xml"; + + String xmlStr = XmlParseUtils.writeObjectToXml(CtznStmtDTO.CtznStmtAns.getCtznStmtAnsDTO(dto), NatlNewspaperSendXmlDTO.class); + + byte[] bytes = xmlStr.getBytes(); + Path path = Paths.get(tgtPath + "/" + fileName); + + try { + // 대상폴더 미 존재시 생성 + File f = FileUtils.getFile(tgtPath); + if(!f.exists()) f.mkdirs(); + Files.write(path, bytes); + } catch (IOException e) { + String msg = "시민 신고 답변 파일 생성 오류"; + e.printStackTrace(); + log.error("{}", msg); + throw BizRuntimeException.create(MessageKey.CUSTOM_MSG, msg); + } + + // 답변 테이블 insert(save) + dto.setSysCode(getUserInfo().getOrgnztId()); + dto.setInsttCode(getUserInfo().getPstinstCode()); + dto.setRegister(getUserInfo().getUniqId()); + mapper.saveEcCtznSttemntAnswer(dto); + + return tgtPath + "/" + fileName; + } + + @Override + @Transactional + public void dragAndDropSaveImg(Map paraMap) { + + paraMap.forEach((strKey, obj)->{ + //Obj 형변환 + List listaa = new ArrayList<>(); + listaa = (List) obj; + + for(int i=0; i " + selectExist); + + if(selectExist.isEmpty()){ + vo.setFileMastrId(strKey); + //insert + mapper.dragAndDropSaveImg(vo); + //delete + mapper.dragAndDropDeleteImg(vo); + } + } + }); + } + + + /* + // TODO: zip file create public String sendCtznSttemntRespons(CtznStmtDTO.CtznStmtDtl dto) { final String fileName = dto.getInterfaceSeqN()+dto.getCtznSttemntDetailSn(); @@ -170,7 +243,7 @@ public class EcCtznSttemntService implements IEcCtznSttemntService { } } - // TODO: format 정의후 반영 + NatlNewspaperSendXmlDTO sendDto = NatlNewspaperSendXmlDTO.builder() .interfaceSeqN(dto.getInterfaceSeqN()) .pcdRstContL("1. 교통질서 확립에 힘써주신 점에 대해 감사드립니다.\n" @@ -207,38 +280,5 @@ public class EcCtznSttemntService implements IEcCtznSttemntService { }); return zipFullFileName; } - - @Override - @Transactional - public void dragAndDropSaveImg(Map paraMap) { - - paraMap.forEach((strKey, obj)->{ - //Obj 형변환 - List listaa = new ArrayList<>(); - listaa = (List) obj; - - for(int i=0; i " + selectExist); - - if(selectExist.isEmpty()){ - vo.setFileMastrId(strKey); - //insert - mapper.dragAndDropSaveImg(vo); - //delete - mapper.dragAndDropDeleteImg(vo); - } - } - }); - } +*/ } diff --git a/src/main/java/kr/xit/fims/biz/ec/service/EcNatlNewspaperService.java b/src/main/java/kr/xit/fims/biz/ec/service/EcNatlNewspaperService.java index 3f542151..d46c0e03 100644 --- a/src/main/java/kr/xit/fims/biz/ec/service/EcNatlNewspaperService.java +++ b/src/main/java/kr/xit/fims/biz/ec/service/EcNatlNewspaperService.java @@ -105,6 +105,8 @@ public class EcNatlNewspaperService implements IEcNatlNewspaperService { //------------------------------------------------------------- // interface table save //------------------------------------------------------------- + xmlDto.setPetiNoC(xmlDto.getPetiNoC().replaceAll("[-: ]", "")); + xmlDto.setCivilNoC(xmlDto.getCivilNoC().replaceAll("[-: ]", "")); xmlDto.setPetiRegD(xmlDto.getPetiRegD().replaceAll("[-: ]", "")); xmlDto.setPetiEndD(xmlDto.getPetiEndD().replaceAll("[-: ]", "")); xmlDto.setAncRegD(xmlDto.getAncRegD().replaceAll("[-: ]", "")); diff --git a/src/main/java/kr/xit/fims/biz/ec/service/IEcCtznSttemntService.java b/src/main/java/kr/xit/fims/biz/ec/service/IEcCtznSttemntService.java index a86c816e..17823878 100644 --- a/src/main/java/kr/xit/fims/biz/ec/service/IEcCtznSttemntService.java +++ b/src/main/java/kr/xit/fims/biz/ec/service/IEcCtznSttemntService.java @@ -6,6 +6,7 @@ import java.util.Map; import org.apache.ibatis.session.RowBounds; import kr.xit.fims.biz.ec.model.CtznStmtDTO; +import kr.xit.framework.biz.cmm.model.XitLoginVO; import kr.xit.framework.core.utils.XitCmmnUtil; public interface IEcCtznSttemntService { @@ -33,11 +34,12 @@ public interface IEcCtznSttemntService { //시민신고 답변 데이타 생성 기초데이타 조회 CtznStmtDTO.CtznStmtAns findCtznStmtAnswer(CtznStmtDTO.Request reqDTO); - String sendCtznSttemntRespons(final CtznStmtDTO.CtznStmtDtl dto); + //String sendCtznSttemntRespons(final CtznStmtDTO.CtznStmtDtl dto); + String saveCtznStmtAns(final CtznStmtDTO.CtznStmtAns dto); void dragAndDropSaveImg(final MapparaMap); - default String getUserUniqId(){ - return XitCmmnUtil.getUserUniqId(); + default XitLoginVO getUserInfo(){ + return XitCmmnUtil.getUserInfo(); } } diff --git a/src/main/java/kr/xit/fims/biz/ec/web/EcCtznSttemntController.java b/src/main/java/kr/xit/fims/biz/ec/web/EcCtznSttemntController.java index ea23cf7b..2910bffc 100644 --- a/src/main/java/kr/xit/fims/biz/ec/web/EcCtznSttemntController.java +++ b/src/main/java/kr/xit/fims/biz/ec/web/EcCtznSttemntController.java @@ -143,7 +143,7 @@ public class EcCtznSttemntController { @RequestMapping("/saveImg") - public ModelAndView saveImg (@RequestBody Map paraMap) { + public ModelAndView saveImg (@RequestBody final Map paraMap) { ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW); service.dragAndDropSaveImg(paraMap); @@ -152,14 +152,8 @@ public class EcCtznSttemntController { return mav; } - @RequestMapping("/sendCtznSttemntRespons") - public ModelAndView sendCtznSttemntRespons(final CtznStmtDTO.CtznStmtDtl dto) { -// ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW); -// log.debug(dto.toString()); -// String rtnFileFullPath = service.sendCtznSttemntRespons(dto); -// AjaxMessageMapRenderer.success(mav, MessageKey.CMM_SUCCESS); -// return mav; - - return ResultResponse.of(service.sendCtznSttemntRespons(dto)); + @RequestMapping("/saveCtznStmtAns") + public ModelAndView saveCtznStmtAns(final CtznStmtDTO.CtznStmtAns dto) { + return ResultResponse.of(service.saveCtznStmtAns(dto)); } } diff --git a/src/main/resources/props/local/globals.properties b/src/main/resources/props/local/globals.properties index b9b27878..57fa9a5b 100644 --- a/src/main/resources/props/local/globals.properties +++ b/src/main/resources/props/local/globals.properties @@ -124,19 +124,20 @@ exception.log.trace=true # k byte file.upload.allow.max-size: 2048 file.upload.allow.ext= -file.upload.root=/Users/minuk/data/fims/upload -#file.upload.root=D:/data/fims/upload + +#file.upload.root=/Users/minuk/data/fims/upload +file.upload.root=D:/data/fims/upload file.upload.temp.path=/temp file.upload.natl-newspaper.path=/natl-newspaper file.upload.busonly-cctv.path=/busonly file.upload.cctv-fix.path=/cctv-fix file.upload.cctv-drv.path=/cctv-drv -file.rcv.root=/Users/minuk/data/fims/extnl/rcv -file.rcv.backup.root=/Users/minuk/data/fims/extnl/backup -file.res.root=/Users/minuk/data/fims/extnl/res -#file.rcv.root=D:/data/fims/extnl/rcv -#file.rcv.backup.root=D:/data/fims/extnl/backup -#file.res.root=D:/data/fims/extnl/res +#file.rcv.root=/Users/minuk/data/fims/extnl/rcv +#file.rcv.backup.root=/Users/minuk/data/fims/extnl/backup +#file.res.root=/Users/minuk/data/fims/extnl/res +file.rcv.root=D:/data/fims/extnl/rcv +file.rcv.backup.root=D:/data/fims/extnl/backup +file.res.root=D:/data/fims/extnl/res file.rcv.natl-newspaper.path=/natl-newspaper file.rcv.busonly-cctv.path=/busonly diff --git a/src/main/resources/sqlmapper/biz/ec/ec-ctzn-sttemnt-mysql-mapper.xml b/src/main/resources/sqlmapper/biz/ec/ec-ctzn-sttemnt-mysql-mapper.xml index 20c86af6..457ab4d1 100644 --- a/src/main/resources/sqlmapper/biz/ec/ec-ctzn-sttemnt-mysql-mapper.xml +++ b/src/main/resources/sqlmapper/biz/ec/ec-ctzn-sttemnt-mysql-mapper.xml @@ -315,18 +315,78 @@ , teei.peti_gubun_c AS cvplSe -- 민원구분 , teei.peti_no_c AS cvplReqstNo -- 민원신청번호 , teei.civil_no_c AS cvplRceptNo -- 민원접수번호 - , teei.civil_gist_v AS cvplOutline -- 민원요지 - , teei.civil_abstract_l AS cvplProcessSumry -- 민원처리요약 + -- , teei.civil_gist_v AS cvplOutline -- 민원요지 + , '불법주정차구역위반' AS cvplOutline -- 민원요지 + -- , teei.civil_abstract_l AS cvplProcessSumry -- 민원처리요약 + , '과태료부과' AS cvplProcessSumry -- 민원처리요약 , teei.pcd_dept_v AS processDeptCode -- 처리부서코드 , teei.pcd_dept_nm_v AS cvplProcessDeptnm -- 민원처리부서명 , teei.duty_id_v AS chargerNm -- 담당자명 , teei.pcd_email_v AS chargerEmail -- 담당자이메일 , teei.pcd_tel_v AS chargerTlphonNo -- 담당자전화번호 - , teei.pcd_rst_cont_l AS cvplProcessResult -- 민원처리결과 + -- , teei.pcd_rst_cont_l AS cvplProcessResult -- 민원처리결과 + , '1. 교통질서 확립에 힘써주신 점에 대해 감사드립니다. + +2. 귀하께서 안전신문고를 통해 신청하신 민원에 대한 검토 결과를 다음과 같이 알려드립니다. + +3. 귀하의 민원내용은 불법 주정차 신고에 관한 것으로 판단됩니다. + +4. 귀하의 신고에 대해 검토한 결과는 다음과 같습니다. + 가. 해당 차량은 도로교통법 제32조, 제33조, 제34조, 제35조에 의거한 불법 주정차 차량으로 판단됩니다. + 나. 따라서, 위반 차량에 대해 주정차 위반 과태료 부과 처분이 이루어졌음을 알려드립니다. + +5. 안전을 위한 시민 정신에 감사드리며, 답변 내용에 대한 추가 설명이 필요한 경우 군포시청 차량관리과 주차단속팀 박효주 주무관(☏031-390-0291)에게 연락 주시면 친절히 안내해 드리도록 하겠습니다. 감사합니다.' AS cvplProcessResult -- 민원처리결과 FROM tb_ec_esb_interface teei WHERE teei.interface_seq_n = #{interfaceSeqN} + + /* ec-ctzn-sttemnt-mysql-mapper|saveEcCtznSttemntAnswer-시민신고답변 생성 및 변경|cjm */ + INSERT + INTO tb_ec_ctzn_sttemnt_answer ( + interface_seq_n + , instt_code + , sys_code + , cvpl_se + , cvpl_reqst_no + , cvpl_rcept_no + , cvpl_outline + , cvpl_process_sumry + , process_dept_code + , cvpl_process_deptnm + , charger_nm + , charger_email + , charger_tlphon_no + , cvpl_process_result + , cvpl_process_compt_dt + , regist_dt + , register + ) VALUES ( + #{interfaceSeqN} + , #{insttCode} + , #{sysCode} + , #{cvplSe} + , #{cvplReqstNo} + , #{cvplRceptNo} + , #{cvplOutline} + , #{cvplProcessSumry} + , #{processDeptCode} + , #{cvplProcessDeptnm} + , #{chargerNm} + , #{chargerEmail} + , #{chargerTlphonNo} + , #{cvplProcessResult} + , DATE_FORMAT(NOW(), '%Y%m%d%H%i%s') + , DATE_FORMAT(NOW(), '%Y%m%d%H%i%s') + , #{register} + ) + ON DUPLICATE KEY + UPDATE cvpl_outline = #{cvplOutline} + , cvpl_process_sumry = #{cvplProcessSumry} + , cvpl_process_result = #{cvplProcessResult} + + +