From 21db8deff2ca4db28c4a9011e8b5ab405aa80662 Mon Sep 17 00:00:00 2001 From: minuk926 Date: Fri, 30 Dec 2022 18:34:46 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=99=B8=EB=B6=80=EC=97=B0=EA=B3=84=20?= =?UTF-8?q?=EB=8B=A8=EC=86=8D=20/=20=EC=84=9C=EC=86=90=20=EC=9E=90?= =?UTF-8?q?=EB=A3=8C=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 --- .../biz/ec/mapper/IEcCctvCrackdownMapper.java | 40 ++----- .../fims/biz/ec/model/CctvCrackdownDTO.java | 4 + .../ec/service/EcCctvCrackdownService.java | 58 ++++++++-- .../ec/service/IEcCctvCrackdownService.java | 12 ++- .../biz/ec/service/IEcCtznSttemntService.java | 3 +- .../biz/ec/web/EcCctvCrackdownController.java | 28 +++++ .../biz/ec/web/EcCtznSttemntController.java | 4 +- .../ec/ec-extrl-reglt-cntc-mysql-mapper.xml | 101 ++++++++++++++++++ 8 files changed, 204 insertions(+), 46 deletions(-) diff --git a/src/main/java/kr/xit/fims/biz/ec/mapper/IEcCctvCrackdownMapper.java b/src/main/java/kr/xit/fims/biz/ec/mapper/IEcCctvCrackdownMapper.java index 7705c2c7..56391518 100644 --- a/src/main/java/kr/xit/fims/biz/ec/mapper/IEcCctvCrackdownMapper.java +++ b/src/main/java/kr/xit/fims/biz/ec/mapper/IEcCctvCrackdownMapper.java @@ -12,34 +12,16 @@ import kr.xit.fims.biz.ec.model.CctvCrackdownDTO; public interface IEcCctvCrackdownMapper { List selectEcExtrlRegltCntcs(final Map paraMap, final RowBounds rowBounds); CctvCrackdownDTO.ExtrlRegltCntc selectEcExtrlRegltCntc(final String extrlRegltCntcId); - // List selectEcCtznSttemntDetails(final CtznStmtDTO.Request dto); - // CtznStmtDTO.CtznStmtDtl selectEcCtznSttemntDetail(final CtznStmtDTO.Request dto); - // int insertEcExtrlRegltCntc(final CctvCrackdownDTO.ExtrlRegltCntc dto); - // - // int insertEcCtznSttemntDetail(final CtznStmtDTO.CtznStmtDtl dtl); - // int updateEcCtznSttemntDetail(final CtznStmtDTO.CtznStmtDtl dtl); - // int deleteEcCtznSttemntDetail(final CtznStmtDTO.CtznStmtDtl dtl); - // - // - // List selectCtznSttemnts(final Map paraMap, final RowBounds rowBounds); - // - // - // //----------------------------------------------------- - // // 단속자료 생성 - 단속 처리 - // //----------------------------------------------------- - // void insertRtRegltFromCtznStmt(final CtznStmtDTO.Request dto); - // //----------------------------------------------------- - // // 단속자료 생성 - 서손 처리 - // //----------------------------------------------------- - // void insertRtErppFromCtznStmt(final CtznStmtDTO.Request dto); - // - // void updateStatusAndRegltIdOfEcCtznSttemntDetail(final CtznStmtDTO.Request dto); - // - // int dragAndDropSaveImg(CmmFileDTO.FileDtl vo); - // - // int dragAndDropDeleteImg(CmmFileDTO.FileDtl vo); - // - // - // List dragAndDropIsExists(CmmFileDTO.FileDtl vo); + + //----------------------------------------------------- + // 단속자료 생성 - 단속 처리 + //----------------------------------------------------- + void insertRtRegltFromEcExtrRegltCntc(final CctvCrackdownDTO.Request dto); + //----------------------------------------------------- + // 단속자료 생성 - 서손 처리 + //----------------------------------------------------- + void insertRtErppFromEcExtrRegltCntc(final CctvCrackdownDTO.Request dto); + + void updateStatusAndRegltIdOfEcExtrRegltCntc(final CctvCrackdownDTO.Request dto); } diff --git a/src/main/java/kr/xit/fims/biz/ec/model/CctvCrackdownDTO.java b/src/main/java/kr/xit/fims/biz/ec/model/CctvCrackdownDTO.java index b4578e44..1ae71b6d 100644 --- a/src/main/java/kr/xit/fims/biz/ec/model/CctvCrackdownDTO.java +++ b/src/main/java/kr/xit/fims/biz/ec/model/CctvCrackdownDTO.java @@ -187,7 +187,11 @@ public class CctvCrackdownDTO { private String fileJobId; private String register; + private String updusr; + private String extrlRegltCntcId; + private String regltProcessSttusCode; + private String extrlRegltCntcProcessSttus; /** * 업로드 파일 객체 diff --git a/src/main/java/kr/xit/fims/biz/ec/service/EcCctvCrackdownService.java b/src/main/java/kr/xit/fims/biz/ec/service/EcCctvCrackdownService.java index 878f8058..af823231 100644 --- a/src/main/java/kr/xit/fims/biz/ec/service/EcCctvCrackdownService.java +++ b/src/main/java/kr/xit/fims/biz/ec/service/EcCctvCrackdownService.java @@ -1,5 +1,6 @@ package kr.xit.fims.biz.ec.service; +import java.io.File; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; @@ -10,6 +11,7 @@ import java.util.Objects; import java.util.stream.Collectors; import org.apache.commons.collections4.ListUtils; +import org.apache.commons.io.FileUtils; import org.apache.commons.io.IOUtils; import org.apache.ibatis.session.RowBounds; import org.springframework.beans.factory.annotation.Value; @@ -194,19 +196,53 @@ public class EcCctvCrackdownService implements IEcCctvCrackdownService { // FIXME: src file backup // rollback시 파일이 move 않되도록 모든 데이타 처리후 file move - // dto.getFileInfoList().forEach((fi) -> { - // try { - // FileUtils.moveFile( - // new File(filePath + "/" + fi.getFileNm()) - // , new File(rcvBackupRoot + uploadBusCctvPath + "/" + fi.getFileNm()) - // ); - // - // } catch (IOException ie) { - // ie.printStackTrace(); - // } - // }); + dto.getFileInfoList().forEach((fi) -> { + try { + FileUtils.moveFile( + new File(filePath + "/" + fi.getFileNm()) + , new File(rcvBackupRoot + uploadBusCctvPath + "/" + fi.getFileNm()) + ); + + } catch (IOException ie) { + ie.printStackTrace(); + } + }); + } + + //----------------------------------------------------- + // 단속자료 생성 - 단속 처리 + //----------------------------------------------------- + @Override + @Transactional + public void saveRtReglt(final CctvCrackdownDTO.Request dto) { + dto.setRegister(getUserInfo().getUniqId()); + dto.setRegltProcessSttusCode(FimsConst.RegltProcessSttusCode.CRACKDOWN.getCode()); + mapper.insertRtRegltFromEcExtrRegltCntc(dto); + + dto.setUpdusr(getUserInfo().getUniqId()); + dto.setExtrlRegltCntcProcessSttus(FimsConst.CtznSttemntStatusCode.ACCEPTANCE.getCode()); + mapper.updateStatusAndRegltIdOfEcExtrRegltCntc(dto); } + //----------------------------------------------------- + // 단속자료 생성 - 서손 처리 + //----------------------------------------------------- + @Override + @Transactional + public void saveRtErpp(final CctvCrackdownDTO.Request dto) { + // 단속테이블 + dto.setRegister(getUserInfo().getUniqId()); + dto.setRegltProcessSttusCode(FimsConst.RegltProcessSttusCode.DESTRUCTION.getCode()); + mapper.insertRtRegltFromEcExtrRegltCntc(dto); + + // 서손테이블 + mapper.insertRtErppFromEcExtrRegltCntc(dto); + + // 상태 변경 + dto.setUpdusr(getUserInfo().getUniqId()); + dto.setExtrlRegltCntcProcessSttus(FimsConst.CtznSttemntStatusCode.NOT_ACCEPTABLE.getCode()); + mapper.updateStatusAndRegltIdOfEcExtrRegltCntc(dto); + } // metaFileName : 20101224121055000_014_001_0 // yyyyMMddHHmmssTTT_업체코드_장비코드 diff --git a/src/main/java/kr/xit/fims/biz/ec/service/IEcCctvCrackdownService.java b/src/main/java/kr/xit/fims/biz/ec/service/IEcCctvCrackdownService.java index 5ad99b8a..fe2f9144 100644 --- a/src/main/java/kr/xit/fims/biz/ec/service/IEcCctvCrackdownService.java +++ b/src/main/java/kr/xit/fims/biz/ec/service/IEcCctvCrackdownService.java @@ -18,9 +18,15 @@ public interface IEcCctvCrackdownService { void saveCctvCrackdownDatas(final CctvCrackdownDTO.Request dto); void saveBusCctvCrackdownDatas(FolderReqDTO dto); - - - + //----------------------------------------------------- + // 단속자료 생성 - 단속 처리 + //----------------------------------------------------- + void saveRtReglt(CctvCrackdownDTO.Request dto); + + //----------------------------------------------------- + // 단속자료 생성 - 서손 처리 + //----------------------------------------------------- + void saveRtErpp(CctvCrackdownDTO.Request dto); default XitLoginVO getUserInfo(){ 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 233efdfd..7449cbd0 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 @@ -27,9 +27,10 @@ public interface IEcCtznSttemntService { //----------------------------------------------------- void saveRtErpp(CtznStmtDTO.Request dto); + void dragAndDropSaveImg(MapparaMap); + default String getUserUniqId(){ return XitCmmnUtil.getUserUniqId(); } - void dragAndDropSaveImg(MapparaMap); } diff --git a/src/main/java/kr/xit/fims/biz/ec/web/EcCctvCrackdownController.java b/src/main/java/kr/xit/fims/biz/ec/web/EcCctvCrackdownController.java index 44c97828..6c20641b 100644 --- a/src/main/java/kr/xit/fims/biz/ec/web/EcCctvCrackdownController.java +++ b/src/main/java/kr/xit/fims/biz/ec/web/EcCctvCrackdownController.java @@ -104,6 +104,34 @@ public class EcCctvCrackdownController { return ResultResponse.of(service.findExtrlRegltCntcs(paraMap, MybatisUtils.getPagingInfo(paraMap))); } + /** + * 단속자료 생성 + * @param dto CctvCrackdownDTO.Request + * @return + */ + @PostMapping("/saveExtrRtReglt") + public ModelAndView saveExtrRtReglt(final CctvCrackdownDTO.Request dto) { + ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW); + + service.saveRtReglt(dto); + AjaxMessageMapRenderer.success(mav, MessageKey.CMM_INSERT_SUCCESS); + return mav; + } + + /** + * 서손 자료 생성 + * @param dto CctvCrackdownDTO.Request + * @return + */ + @PostMapping("/saveExtrRtErpp") + public ModelAndView saveExtrRtErpp(final CctvCrackdownDTO.Request dto) { + ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW); + + service.saveRtErpp(dto); + AjaxMessageMapRenderer.success(mav, MessageKey.CMM_INSERT_SUCCESS); + return mav; + } + @RequestMapping("/findExtrlRegltCntcAttchFiles") public ModelAndView findExtrlRegltCntcAttchFiles(final String extrlRegltCntcId, final String regltSeCode) { return ResultResponse.of( 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 12504b01..2d943fed 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 @@ -102,7 +102,7 @@ public class EcCtznSttemntController { } /** - * 단속자료 생성 + * 단속 자료 생성 * @param dto CtznStmtDTO.Request * @return */ @@ -116,7 +116,7 @@ public class EcCtznSttemntController { } /** - * 서손 생성 + * 서손 자료 생성 * @param dto CtznStmtDTO.Request * @return */ diff --git a/src/main/resources/sqlmapper/biz/ec/ec-extrl-reglt-cntc-mysql-mapper.xml b/src/main/resources/sqlmapper/biz/ec/ec-extrl-reglt-cntc-mysql-mapper.xml index 7287984c..e1ced0a3 100644 --- a/src/main/resources/sqlmapper/biz/ec/ec-extrl-reglt-cntc-mysql-mapper.xml +++ b/src/main/resources/sqlmapper/biz/ec/ec-extrl-reglt-cntc-mysql-mapper.xml @@ -108,4 +108,105 @@ ) + + /* ec-extrl-reglt-cntc-mysql-mapper|insertRtRegltFromEcExtrRegltCntc-외부연계 단속 자료 생성|julim */ + + SELECT LPAD(NEXTVAL(seq_rt_reglt), 16, '0') + + INSERT INTO tb_rt_reglt ( + reglt_id + , instt_code + , sys_code + , reglt_se_code + , input_se_code + , reglt_de + , reglt_begin_time + , reglt_end_time + , violt_lrg_code + , violt_dtls_code + , violt_dtls_etc_cn + , reglt_place + , violt_co + , violt_legaldong_code + , gps_x + , gps_y + , towng_at_code + , image_se_code + , mvp_filenm + , image_nmrs + , vhcle_no + , reglt_process_sttus_code + , regist_dt + , register + ) SELECT #{regltId} + , instt_code + , sys_code + , #{regltSeCode} + , #{inputSeCode} -- 입력 구분 코드 + , reglt_de + , reglt_begin_time -- 단속 시작 시간 + , reglt_end_time -- 단속 종료 시간 + , '' -- 위반 법규 코드 + , '' -- FIXME: 매핑테이블 정의후 반영 (위반 내역 코드) + , '' -- 위반 내역 기타 내용 + , '' -- reglt_place + , '1' -- 위반 횟수 + , '' -- 위반 법정동 코드 + , gps_x + , gps_y + , 'N' -- 견인 여부 코드 + , '' -- 이미지 구분 코드 + , '' -- 동영상 파일명 + , (SELECT COUNT(tcfd.file_id) - 1 + FROM tb_cmm_file_mastr tcfm + JOIN tb_cmm_file_detail tcfd + ON tcfm.job_se_code = #{jobSeCode} + AND tcfm.file_job_id = #{extrlRegltCntcId} + AND tcfm.file_mastr_id = tcfd.file_mastr_id) -- 이미지 매수 FIXME: 매핑테이블 정의후 반영 (위반 내역 코드) + , vhcle_no + , #{regltProcessSttusCode} -- 단속:10, 서손:11 + , DATE_FORMAT(NOW(), '%Y%m%d%H%i%s') + , #{register} + FROM tb_ec_extrl_reglt_cntc + WHERE extrl_reglt_cntc_id = #{extrlRegltCntcId} + + + + /* ec-extrl-reglt-cntc-mysql-mapper|insertRtErppFromEcExtrRegltCntc-외부연계 서손 자료 생성|julim */ + + SELECT LPAD(NEXTVAL(seq_rt_erpp), 12, '0') + + INSERT INTO tb_rt_erpp ( + erpp_id + , reglt_id + , signgu_code + , sys_code + , erpp_process_de -- 서손 처리 일자 + , erpp_se_code -- 서손 구분 코드 + , erpp_resn_detail -- 서손 사유 상세 + , regist_dt + , register + ) SELECT #{erppId} + , #{regltId} + , null + , sys_code + , DATE_FORMAT(NOW(), '%Y%m%d') + , '' + , '' + , DATE_FORMAT(NOW(), '%Y%m%d%H%i%s') + , #{register} + FROM tb_ec_extrl_reglt_cntc + WHERE extrl_reglt_cntc_id = #{extrlRegltCntcId} + + + + /* ec-extrl-reglt-cntc-mysql-mapper|EcExtrRegltCntc-외부연계 단속ID set|julim */ + UPDATE tb_ec_extrl_reglt_cntc + SET reglt_id = #{regltId} + , extrl_reglt_cntc_process_sttus = #{extrlRegltCntcProcessSttus} + , updt_dt = DATE_FORMAT(NOW(), '%Y%m%d%H%i%s') + , updusr = #{updusr} + WHERE extrl_reglt_cntc_id = #{extrlRegltCntcId} + +