feat: 외부연계 단속 / 서손 자료 생성 반영

main
minuk926 2 years ago
parent 18b80cdb4d
commit 21db8deff2

@ -12,34 +12,16 @@ import kr.xit.fims.biz.ec.model.CctvCrackdownDTO;
public interface IEcCctvCrackdownMapper { public interface IEcCctvCrackdownMapper {
List<CctvCrackdownDTO.ExtrlRegltCntc> selectEcExtrlRegltCntcs(final Map<String, Object> paraMap, final RowBounds rowBounds); List<CctvCrackdownDTO.ExtrlRegltCntc> selectEcExtrlRegltCntcs(final Map<String, Object> paraMap, final RowBounds rowBounds);
CctvCrackdownDTO.ExtrlRegltCntc selectEcExtrlRegltCntc(final String extrlRegltCntcId); CctvCrackdownDTO.ExtrlRegltCntc selectEcExtrlRegltCntc(final String extrlRegltCntcId);
// List<CtznStmtDTO.CtznStmtDtl> selectEcCtznSttemntDetails(final CtznStmtDTO.Request dto);
// CtznStmtDTO.CtznStmtDtl selectEcCtznSttemntDetail(final CtznStmtDTO.Request dto);
//
int insertEcExtrlRegltCntc(final CctvCrackdownDTO.ExtrlRegltCntc 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); //-----------------------------------------------------
// void insertRtRegltFromEcExtrRegltCntc(final CctvCrackdownDTO.Request dto);
// //-----------------------------------------------------
// List<CtznStmtDTO> selectCtznSttemnts(final Map<String, Object> paraMap, final RowBounds rowBounds); // 단속자료 생성 - 서손 처리
// //-----------------------------------------------------
// void insertRtErppFromEcExtrRegltCntc(final CctvCrackdownDTO.Request dto);
// //-----------------------------------------------------
// // 단속자료 생성 - 단속 처리 void updateStatusAndRegltIdOfEcExtrRegltCntc(final CctvCrackdownDTO.Request dto);
// //-----------------------------------------------------
// 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<CmmFileDTO> dragAndDropIsExists(CmmFileDTO.FileDtl vo);
} }

@ -187,7 +187,11 @@ public class CctvCrackdownDTO {
private String fileJobId; private String fileJobId;
private String register; private String register;
private String updusr;
private String extrlRegltCntcId; private String extrlRegltCntcId;
private String regltProcessSttusCode;
private String extrlRegltCntcProcessSttus;
/** /**
* *

@ -1,5 +1,6 @@
package kr.xit.fims.biz.ec.service; package kr.xit.fims.biz.ec.service;
import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.util.ArrayList; import java.util.ArrayList;
@ -10,6 +11,7 @@ import java.util.Objects;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import org.apache.commons.collections4.ListUtils; import org.apache.commons.collections4.ListUtils;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.apache.ibatis.session.RowBounds; import org.apache.ibatis.session.RowBounds;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
@ -194,19 +196,53 @@ public class EcCctvCrackdownService implements IEcCctvCrackdownService {
// FIXME: src file backup // FIXME: src file backup
// rollback시 파일이 move 않되도록 모든 데이타 처리후 file move // rollback시 파일이 move 않되도록 모든 데이타 처리후 file move
// dto.getFileInfoList().forEach((fi) -> { dto.getFileInfoList().forEach((fi) -> {
// try { try {
// FileUtils.moveFile( FileUtils.moveFile(
// new File(filePath + "/" + fi.getFileNm()) new File(filePath + "/" + fi.getFileNm())
// , new File(rcvBackupRoot + uploadBusCctvPath + "/" + fi.getFileNm()) , new File(rcvBackupRoot + uploadBusCctvPath + "/" + fi.getFileNm())
// ); );
//
// } catch (IOException ie) { } catch (IOException ie) {
// ie.printStackTrace(); 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 // metaFileName : 20101224121055000_014_001_0
// yyyyMMddHHmmssTTT_업체코드_장비코드 // yyyyMMddHHmmssTTT_업체코드_장비코드

@ -18,9 +18,15 @@ public interface IEcCctvCrackdownService {
void saveCctvCrackdownDatas(final CctvCrackdownDTO.Request dto); void saveCctvCrackdownDatas(final CctvCrackdownDTO.Request dto);
void saveBusCctvCrackdownDatas(FolderReqDTO dto); void saveBusCctvCrackdownDatas(FolderReqDTO dto);
//-----------------------------------------------------
// 단속자료 생성 - 단속 처리
//-----------------------------------------------------
void saveRtReglt(CctvCrackdownDTO.Request dto);
//-----------------------------------------------------
// 단속자료 생성 - 서손 처리
//-----------------------------------------------------
void saveRtErpp(CctvCrackdownDTO.Request dto);
default XitLoginVO getUserInfo(){ default XitLoginVO getUserInfo(){

@ -27,9 +27,10 @@ public interface IEcCtznSttemntService {
//----------------------------------------------------- //-----------------------------------------------------
void saveRtErpp(CtznStmtDTO.Request dto); void saveRtErpp(CtznStmtDTO.Request dto);
void dragAndDropSaveImg(Map<String, Object>paraMap);
default String getUserUniqId(){ default String getUserUniqId(){
return XitCmmnUtil.getUserUniqId(); return XitCmmnUtil.getUserUniqId();
} }
void dragAndDropSaveImg(Map<String, Object>paraMap);
} }

@ -104,6 +104,34 @@ public class EcCctvCrackdownController {
return ResultResponse.of(service.findExtrlRegltCntcs(paraMap, MybatisUtils.getPagingInfo(paraMap))); 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") @RequestMapping("/findExtrlRegltCntcAttchFiles")
public ModelAndView findExtrlRegltCntcAttchFiles(final String extrlRegltCntcId, final String regltSeCode) { public ModelAndView findExtrlRegltCntcAttchFiles(final String extrlRegltCntcId, final String regltSeCode) {
return ResultResponse.of( return ResultResponse.of(

@ -116,7 +116,7 @@ public class EcCtznSttemntController {
} }
/** /**
* *
* @param dto CtznStmtDTO.Request * @param dto CtznStmtDTO.Request
* @return * @return
*/ */

@ -108,4 +108,105 @@
) )
</insert> </insert>
<insert id="insertRtRegltFromEcExtrRegltCntc">
/* ec-extrl-reglt-cntc-mysql-mapper|insertRtRegltFromEcExtrRegltCntc-외부연계 단속 자료 생성|julim */
<selectKey resultType="string" keyProperty="regltId" order="BEFORE">
SELECT LPAD(NEXTVAL(seq_rt_reglt), 16, '0')
</selectKey>
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}
</insert>
<insert id="insertRtErppFromEcExtrRegltCntc">
/* ec-extrl-reglt-cntc-mysql-mapper|insertRtErppFromEcExtrRegltCntc-외부연계 서손 자료 생성|julim */
<selectKey resultType="string" keyProperty="erppId" order="BEFORE">
SELECT LPAD(NEXTVAL(seq_rt_erpp), 12, '0')
</selectKey>
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}
</insert>
<update id="updateStatusAndRegltIdOfEcExtrRegltCntc">
/* 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}
</update>
</mapper> </mapper>

Loading…
Cancel
Save