feat: 외부연계-CCTV고정형/이동형 parsing 반영

main
minuk926 2 years ago
parent f63f22e68d
commit f58fb508e5

@ -21,6 +21,9 @@ public class FimsConst {
@AllArgsConstructor @AllArgsConstructor
public enum FileJobSeCode { public enum FileJobSeCode {
NATL_NEWS_PAPER_RCV("NATL_NEWS_PAPER_RCV", "민원심사-국민신문고") NATL_NEWS_PAPER_RCV("NATL_NEWS_PAPER_RCV", "민원심사-국민신문고")
,BUS_ONLY("BUS_ONLY", "버스전용차로-버스장착형CCTV")
,CCTV_FIX("CCTV_FIX", "cctv-고정형")
,CCTV_DRV("CCTV_DRV", "cctv-주행형")
,CMM_BOARD("CMM_BOARD???", "공지사항???") ,CMM_BOARD("CMM_BOARD???", "공지사항???")
; ;
@ -88,8 +91,11 @@ public class FimsConst {
*/ */
@Getter @Getter
@AllArgsConstructor @AllArgsConstructor
public enum RegltSeCode { public enum PkPrefix {
CTZ("CTZ", "민원-시민신고(국민신문고)") CTZ("CTZ", "민원-시민신고(국민신문고)")
,BOC("BOC", "버스장착형CCTV")
,CFV("CFV", "고정형CCTV(CCTV-FIX)")
,CDV("CDV", "주행형CCTV(CCTV-DRV)")
; ;
private final String code; private final String code;

@ -0,0 +1,45 @@
package kr.xit.fims.biz.ec.mapper;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.RowBounds;
import egovframework.rte.psl.dataaccess.mapper.Mapper;
import kr.xit.fims.biz.ec.model.CctvCrackdownDTO;
@Mapper
public interface IEcCctvCrackdownMapper {
List<CctvCrackdownDTO.ExtrlRegltCntc> selectEcExtrlRegltCntcs(final Map<String, Object> paraMap, final RowBounds rowBounds);
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 insertEcCtznSttemntDetail(final CtznStmtDTO.CtznStmtDtl dtl);
// int updateEcCtznSttemntDetail(final CtznStmtDTO.CtznStmtDtl dtl);
// int deleteEcCtznSttemntDetail(final CtznStmtDTO.CtznStmtDtl dtl);
//
//
// List<CtznStmtDTO> selectCtznSttemnts(final Map<String, Object> 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<CmmFileDTO> dragAndDropIsExists(CmmFileDTO.FileDtl vo);
}

@ -0,0 +1,490 @@
package kr.xit.fims.biz.ec.model;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.io.Serializable;
import java.util.List;
import org.springframework.web.multipart.MultipartFile;
import com.fasterxml.jackson.annotation.JsonIgnore;
import kr.xit.framework.support.util.CommUtils;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
public class CctvCrackdownDTO {
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Builder
public static class BusOnly {
// 텍스트size : 1 ~ 7(7)
private String textSize;
// 단속장비 : 8 ~ 12(5)
private String regltEquip;
// 차량속도 : 13 ~ 15(3)
private String carSpeed;
// 차종 : 16 ~ 16(1) - 미사용
private String carModel;
// 도로코드 : 17 ~ 17(1) - 미사용
private String roadCode;
// 단속일자 : 18 ~ 25(8)
private String regltDe;
// 단속시간 : 26 ~ 31(6)
private String regltTime;
// 차량번호 : 32 ~ 43(12)
private String vhcleNo;
// 번호판 X 좌표 : 44 ~ 47(4)
private String carNumXPos;
// 번호판 Y 좌표 : 48 ~ 51(4)
private String carNumYPos;
// 번호판 Width : 52 ~ 55(4)
private String carNumWidth;
// 번호판 Height : 56 ~ 59(4)
private String carNumHeight;
// (미사용) : 60 ~ 60(1)
private String skipFld;
// 위반구분(미사용) : 61 ~ 61(1)
private String violtDiv;
// 위반종류(미사용) : 62 ~ 62(1)
private String violtKind;
// GPS X 좌표 : 62 ~ 84(23)
private String gpsX;
// GPS Y 좌표 : 85 ~ 107(23)
private String gpsY;
// 사진매수(미사용) : 108 ~ 109(2)
private String imgCnt;
// tlcType(미사용) : 110 ~ 110(1)
private String tlcType;
// movingType(미사용) : 111 ~ 111(1)
private String movingType;
// tlcColor(미사용) : 112 ~ 112(1)
private String tlcColor;
}
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Builder
public static class ExtrlRegltCntc implements Serializable {
private static final long serialVersionUID = 1L;
// 외부 단속 연계 id
private String extrlRegltCntcId;
private String regltId;
private String insttCode;
private String sysCode;
private String regltSeCode;
private String inputSeCode;
private String vhcleNo;
private String regltDe;
private String regltBeginTime;
private String regltEndTime;
private String regltDongNm;
private String regltPlace;
private String regltSpeclZoneNm;
private String regltEntrpsCode;
private String regltEqpmnManageNo;
private String violtDtlsNm;
private String gpsX;
private String gpsY;
private String extrlRegltCntcProcessSttus;
private String cntcFileNm;
private String cntcPhotoFileNm1;
private String cntcPhotoFileNm2;
private String cntcPhotoFileNm3;
private String cntcPhotoFileNm4;
private String registDt;
private String register;
private String updtDt;
private String updusr;
private String deleteAt;
private String deleteResn;
private String deleteDt;
private String dltr;
private String pkPrefix;
}
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Builder
public static class Request {
private String fileMastrId;
/**
* (ex. Board)
*/
private String jobSeCode;
/**
* ID(example = "BOARD001")
* DB pk - + ID
*/
private String fileJobId;
private String register;
private String extrlRegltCntcId;
/**
*
*/
@JsonIgnore
private List<MultipartFile> files;
}
public static void main(String[] args) throws IOException {
//String path = "D:\\project_data\\fims\\01. 연계\\02. CCTV\\CCTV 샘플자료\\버스전용차로\\2017072013474126.F0001";
String path = "D:\\project_data\\fims\\01. 연계\\02. CCTV\\CCTV 샘플자료\\버스전용차로\\2017072013465031.F0002";
RandomAccessFile raf = new RandomAccessFile(path,"r");
long fileSize = raf.length();
System.out.println("fileSize="+fileSize);
long pos = 0; //뒤로 부터
// while(true) {
// raf.seek(pos); //파일 포인터 이동
// if(raf.readByte()=='\n') { //해당 위치의 바이트를 읽어 \n 문자와 같은지 검사
// break; //같으면 멈춤
// }
// pos--; //포인터 위치값 감소 (앞으로)
// }
raf.seek(pos); //\n 문자를 찾은 다음으로 파일 포인터 이동
//String line = raf.readLine();
byte[] buff = new byte[7];
raf.read(buff);
System.out.println(new String(buff));
pos += 7;
raf.seek(pos);
buff = new byte[5];
raf.read(buff);
System.out.println(new String(buff));
pos += 5;
raf.seek(pos);
buff = new byte[3];
raf.read(buff);
System.out.println(new String(buff));
pos += 3;
raf.seek(pos);
buff = new byte[1];
raf.read(buff);
System.out.println(new String(buff, "euc-kr"));
pos += 1;
raf.seek(pos);
buff = new byte[1];
raf.read(buff);
System.out.println(new String(buff));
pos += 1;
raf.seek(pos);
buff = new byte[8];
raf.read(buff);
System.out.println(new String(buff));
pos += 8;
raf.seek(pos);
buff = new byte[6];
raf.read(buff);
System.out.println(new String(buff));
pos += 6;
raf.seek(pos);
buff = new byte[12];
raf.read(buff);
System.out.println(new String(buff, "euc-kr"));
pos += 12;
raf.seek(pos);
buff = new byte[4];
raf.read(buff);
System.out.println(new String(buff));
pos += 4;
raf.seek(pos);
buff = new byte[4];
raf.read(buff);
System.out.println(new String(buff));
pos += 4;
raf.seek(pos);
buff = new byte[4];
raf.read(buff);
System.out.println(new String(buff));
pos += 4;
raf.seek(pos);
buff = new byte[4];
raf.read(buff);
System.out.println(new String(buff));
pos += 4;
raf.seek(pos);
buff = new byte[1];
raf.read(buff);
System.out.println(new String(buff));
pos += 1;
raf.seek(pos);
buff = new byte[1];
raf.read(buff);
System.out.println(new String(buff));
pos += 1;
raf.seek(pos);
buff = new byte[1];
raf.read(buff);
System.out.println(new String(buff));
pos += 1;
raf.seek(pos);
buff = new byte[23];
raf.read(buff);
System.out.println(new String(buff));
pos += 23;
raf.seek(pos);
buff = new byte[23];
raf.read(buff);
System.out.println(new String(buff));
pos += 23;
raf.seek(pos);
buff = new byte[2];
raf.read(buff);
System.out.println(new String(buff));
pos += 2;
raf.seek(pos);
buff = new byte[1];
raf.read(buff);
System.out.println(new String(buff));
pos += 1;
raf.seek(pos);
buff = new byte[1];
raf.read(buff);
System.out.println(new String(buff));
pos += 1;
raf.seek(pos);
buff = new byte[1];
raf.read(buff);
System.out.println(new String(buff));
pos += 1;
// carImageSize
raf.seek(pos);
buff = new byte[7];
raf.read(buff);
int carImageSize = Integer.parseInt(new String(buff));
System.out.println("carImageSize="+carImageSize);
pos += 7;
raf.seek(pos);
buff = new byte[carImageSize];
raf.read(buff);
CommUtils.createMutipartFileFromBytes("car.jpg", "d:/data/fims/upload/bus", buff, false);
pos += carImageSize;
// plateImageSize
raf.seek(pos);
buff = new byte[7];
raf.read(buff);
int plateImageSize = Integer.parseInt(new String(buff));
System.out.println("plateImageSize="+plateImageSize);
pos += 7;
raf.seek(pos);
buff = new byte[plateImageSize];
raf.read(buff);
CommUtils.createMutipartFileFromBytes("carNo.jpg", "d:/data/fims/upload/bus", buff, false);
pos += plateImageSize;
// movingImageSize
raf.seek(pos);
buff = new byte[7];
//
raf.read(buff);
int movingImageSize = Integer.parseInt(new String(buff));
System.out.println("movingImageSize="+movingImageSize);
pos += 7;
raf.seek(pos);
buff = new byte[movingImageSize];
raf.read(buff);
CommUtils.createMutipartFileFromBytes("moving1.jpg", "d:/data/fims/upload/bus", buff, false);
pos += movingImageSize;
if(fileSize <= pos) return;
raf.seek(pos);
buff = new byte[7];
//
raf.read(buff);
movingImageSize = Integer.parseInt(new String(buff));
System.out.println("movingImageSize="+movingImageSize);
pos += 7;
raf.seek(pos);
buff = new byte[movingImageSize];
raf.read(buff);
CommUtils.createMutipartFileFromBytes("moving2.jpg", "d:/data/fims/upload/bus", buff, false);
pos += movingImageSize;
raf.seek(pos);
buff = new byte[7];
//
raf.read(buff);
movingImageSize = Integer.parseInt(new String(buff));
System.out.println("movingImageSize="+movingImageSize);
pos += 7;
raf.seek(pos);
buff = new byte[movingImageSize];
raf.read(buff);
CommUtils.createMutipartFileFromBytes("moving3.jpg", "d:/data/fims/upload/bus", buff, false);
pos += movingImageSize;
raf.seek(pos);
buff = new byte[7];
//
raf.read(buff);
movingImageSize = Integer.parseInt(new String(buff));
System.out.println("movingImageSize="+movingImageSize);
pos += 7;
raf.seek(pos);
buff = new byte[movingImageSize];
raf.read(buff);
CommUtils.createMutipartFileFromBytes("moving4.jpg", "d:/data/fims/upload/bus", buff, false);
pos += movingImageSize;
raf.seek(pos);
buff = new byte[7];
//
raf.read(buff);
movingImageSize = Integer.parseInt(new String(buff));
System.out.println("movingImageSize="+movingImageSize);
pos += 7;
raf.seek(pos);
buff = new byte[movingImageSize];
raf.read(buff);
CommUtils.createMutipartFileFromBytes("moving5.jpg", "d:/data/fims/upload/bus", buff, false);
pos += movingImageSize;
raf.seek(pos);
buff = new byte[7];
//
raf.read(buff);
movingImageSize = Integer.parseInt(new String(buff));
System.out.println("movingImageSize="+movingImageSize);
pos += 7;
raf.seek(pos);
buff = new byte[movingImageSize];
raf.read(buff);
CommUtils.createMutipartFileFromBytes("moving6.jpg", "d:/data/fims/upload/bus", buff, false);
pos += movingImageSize;
raf.seek(pos);
buff = new byte[7];
//
raf.read(buff);
movingImageSize = Integer.parseInt(new String(buff));
System.out.println("movingImageSize="+movingImageSize);
pos += 7;
raf.seek(pos);
buff = new byte[movingImageSize];
raf.read(buff);
CommUtils.createMutipartFileFromBytes("moving7.jpg", "d:/data/fims/upload/bus", buff, false);
pos += movingImageSize;
raf.seek(pos);
buff = new byte[7];
//
raf.read(buff);
movingImageSize = Integer.parseInt(new String(buff));
System.out.println("movingImageSize="+movingImageSize);
pos += 7;
raf.seek(pos);
buff = new byte[movingImageSize];
raf.read(buff);
CommUtils.createMutipartFileFromBytes("moving8.jpg", "d:/data/fims/upload/bus", buff, false);
pos += movingImageSize;
System.out.println("pos="+pos);
}
}

@ -1,223 +0,0 @@
package kr.xit.fims.biz.ec.model;
import java.io.IOException;
import java.io.RandomAccessFile;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.Setter;
public class CctvDTO {
@Getter
@Setter
@AllArgsConstructor
@Builder
public static class BusOnly {
// 텍스트size : 1 ~ 7(7)
private String textSize;
// 단속장비 : 8 ~ 12(5)
private String regltEquip;
// 차량속도 : 13 ~ 15(3)
private String carSpeed;
// 차종 : 16 ~ 16(1) - 미사용
private String carModel;
// 도로코드 : 17 ~ 17(1) - 미사용
private String roadCode;
// 단속일자 : 18 ~ 25(8)
private String regltDeDate;
// 단속시간 : 26 ~ 31(6)
private String regltDeTime;
// 차량번호 : 32 ~ 43(12)
private String carNum;
// 번호판 X 좌표 : 44 ~ 47(4)
private String carNumXPos;
// 번호판 Y 좌표 : 48 ~ 51(4)
private String carNumYPos;
// 번호판 Width : 52 ~ 55(4)
private String carNumWidth;
// 번호판 Height : 56 ~ 59(4)
private String carNumHeight;
// (미사용) : 60 ~ 60(1)
private String skipFld;
// 위반구분(미사용) : 61 ~ 61(1)
private String violtDiv;
// 위반종류(미사용) : 62 ~ 62(1)
private String violtKind;
// GPS X 좌표 : 62 ~ 84(23)
private String gpsX;
// GPS Y 좌표 : 85 ~ 107(23)
private String gpsY;
// 사진매수(미사용) : 108 ~ 109(2)
private String imgCnt;
}
public static void main(String[] args) throws IOException {
String path = "D:\\project_data\\fims\\01. 연계\\02. CCTV\\CCTV 샘플자료\\버스전용차로\\2017072013474126.F0001";
RandomAccessFile file = new RandomAccessFile(path,"r");
long fileSize = file.length();
long pos = 0; //뒤로 부터
// while(true) {
// file.seek(pos); //파일 포인터 이동
// if(file.readByte()=='\n') { //해당 위치의 바이트를 읽어 \n 문자와 같은지 검사
// break; //같으면 멈춤
// }
// pos--; //포인터 위치값 감소 (앞으로)
// }
file.seek(pos); //\n 문자를 찾은 다음으로 파일 포인터 이동
//String line = file.readLine();
byte[] buff = new byte[7];
file.read(buff);
System.out.println(new String(buff));
file.seek(7);
buff = new byte[5];
file.read(buff);
System.out.println(new String(buff));
file.seek(12);
buff = new byte[3];
file.read(buff);
System.out.println(new String(buff));
file.seek(15);
buff = new byte[1];
file.read(buff);
System.out.println(new String(buff, "euc-kr"));
file.seek(16);
buff = new byte[1];
file.read(buff);
System.out.println(new String(buff));
file.seek(17);
buff = new byte[8];
file.read(buff);
System.out.println(new String(buff));
file.seek(25);
buff = new byte[6];
file.read(buff);
System.out.println(new String(buff));
file.seek(31);
buff = new byte[12];
file.read(buff);
System.out.println(new String(buff, "euc-kr"));
file.seek(43);
buff = new byte[4];
file.read(buff);
System.out.println(new String(buff));
file.seek(47);
buff = new byte[4];
file.read(buff);
System.out.println(new String(buff));
file.seek(51);
buff = new byte[4];
file.read(buff);
System.out.println(new String(buff));
file.seek(55);
buff = new byte[4];
file.read(buff);
System.out.println(new String(buff));
file.seek(59);
buff = new byte[1];
file.read(buff);
System.out.println(new String(buff));
file.seek(60);
buff = new byte[1];
file.read(buff);
System.out.println(new String(buff));
file.seek(61);
buff = new byte[1];
file.read(buff);
System.out.println(new String(buff));
file.seek(62);
buff = new byte[23];
file.read(buff);
System.out.println(new String(buff));
file.seek(85);
buff = new byte[23];
file.read(buff);
System.out.println(new String(buff));
file.seek(108);
buff = new byte[2];
file.read(buff);
System.out.println(new String(buff));
// BufferedImage image = null;
// FileInputStream fis = null;
// BufferedInputStream bis = null;
//
// try {
// fis = new FileInputStream(new File(path));
// bis = new BufferedInputStream(fis);
// image = ImageIO.read(bis);
// }catch(Exception e) {
// e.printStackTrace();
// }finally {
// if(bis != null) bis.close();
// if(fis != null) fis.close();
// }
// System.out.println(image);
}
}

@ -224,7 +224,7 @@ public class CtznStmtDTO implements Serializable { //extends ExtlEsbDataType {
// 단속자료 생성을 위한 필드 // 단속자료 생성을 위한 필드
private String register; private String register;
private String regltSeCode = FimsConst.RegltSeCode.CTZ.getCode(); private String pkPrefix = FimsConst.PkPrefix.CTZ.getCode();
private String jobSeCode = FimsConst.FileJobSeCode.NATL_NEWS_PAPER_RCV.getCode(); private String jobSeCode = FimsConst.FileJobSeCode.NATL_NEWS_PAPER_RCV.getCode();
private String inputSeCode = FimsConst.InputSeCode.CITIZEN.getCode(); private String inputSeCode = FimsConst.InputSeCode.CITIZEN.getCode();
private String regltProcessSttusCode; private String regltProcessSttusCode;

@ -0,0 +1,195 @@
package kr.xit.fims.biz.ec.service;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
import org.apache.commons.collections4.ListUtils;
import org.apache.commons.io.IOUtils;
import org.apache.ibatis.session.RowBounds;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import kr.xit.fims.biz.FimsConst;
import kr.xit.fims.biz.ec.mapper.IEcCctvCrackdownMapper;
import kr.xit.fims.biz.ec.mapper.IEcCtznSttemntMapper;
import kr.xit.fims.biz.ec.model.CctvCrackdownDTO;
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.constants.MessageKey;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@Slf4j
@RequiredArgsConstructor
@Service
public class EcCctvCrackdownService implements IEcCctvCrackdownService {
@Value("#{prop['file.upload.root']}")
private String uploadRoot;
@Value("#{prop['file.upload.cctv-fix.path']}")
private String uploadCctvFixPath;
@Value("#{prop['file.upload.cctv-drv.path']}")
private String uploadCctvDrvPath;
// @Value("#{prop['file.rcv.root']}")
// private String rcvRoot;
//
// @Value("#{prop['file.rcv.natl-newspaper.path']}")
// private String rcvNewsPaperPath;
private final IEcCctvCrackdownMapper mapper;
private final IEcCtznSttemntMapper ctznSttemntMapper;
private final ICmmFileService cmmFileService;
@Override
@Transactional(readOnly = true)
public List<CctvCrackdownDTO.ExtrlRegltCntc> findExtrlRegltCntcs(final Map<String, Object> paraMap, final RowBounds rowBounds) {
return mapper.selectEcExtrlRegltCntcs(paraMap, rowBounds);
}
@Override
@Transactional(readOnly = true)
public CctvCrackdownDTO.ExtrlRegltCntc findExtrlRegltCntc(final String extrlRegltCntcId) {
return mapper.selectEcExtrlRegltCntc(extrlRegltCntcId);
}
/**
* <pre>
* xml insert
* 1) ec_esb_interface insert
* 2) tb_ec_ctzn_sttemnt insert
* tb_ex_ctzn_sttemnt_detail insert
* 3) tb_cmm_file_mastr insert
* tb_cmm_file_detail insert
* @param dto
* </pre>
*/
@SuppressWarnings("ConstantConditions")
@Override
@Transactional
public void saveCctvCrackdownDatas(final CctvCrackdownDTO.Request dto) {
// 단속정보메타 1 + 이미지파일 4 = 5개로 구성
if(dto.getFiles().size() % 5 != 0){
throw BizRuntimeException.create(MessageKey.CUSTOM_MSG, "단속정보[파일]가 부정확 합니다\n다시 확인해 주세요.");
}
final Comparator<MultipartFile> comp = (mf1, mf2) -> String.CASE_INSENSITIVE_ORDER.compare(mf1.getOriginalFilename(), mf2.getOriginalFilename());
List<MultipartFile> sortedFileList = dto.getFiles().stream()
.sorted(comp)
.collect(Collectors.toList());
//Arrays.copyOfRange(sortedFileList.toArray(), 0, 4);
List<List<MultipartFile>> listByMd = ListUtils.partition(sortedFileList, 5);
for(int idx = 0; idx < listByMd.size(); idx++){
List<MultipartFile> mfList = listByMd.get(idx);
MultipartFile mf = mfList.get(0);
String[] txtNames = mf.getOriginalFilename().split("[.]");
if(txtNames.length != 2 || !Objects.equals("txt", txtNames[1].toLowerCase()))
throw BizRuntimeException.create(MessageKey.CUSTOM_MSG, String.format("[%s]%s", txtNames[0], "의 단속정보[파일]가 없습니다."));
String[] mdInfos = txtNames[0].split("_");
List<String> records = new ArrayList<>();
try(InputStream inputStream = mf.getInputStream();){
IOUtils.readLines(inputStream, "euc-kr")
.forEach(s -> records.add(s));
} catch (IOException e) {
// handle exception
}
CctvCrackdownDTO.ExtrlRegltCntc extrRegltDTO = getExtrlRegltCntcDTO(txtNames[0], records);
if(records.size() >= 3){
extrRegltDTO.setPkPrefix(FimsConst.PkPrefix.CDV.getCode());
}else{
extrRegltDTO.setPkPrefix(FimsConst.PkPrefix.CFV.getCode());
}
mapper.insertEcExtrlRegltCntc(extrRegltDTO);
List<MultipartFile> cpListMf = new ArrayList<>(mfList);
//List<MultipartFile> cpListMf = new ArrayList<>(mfList.size());
//Collections.copy(cpListMf, mfList);
cpListMf.remove(0);
cmmFileService.saveFiles(getFileMst(extrRegltDTO.getPkPrefix(), extrRegltDTO.getExtrlRegltCntcId()), cpListMf);
// CmmFileDTO.FileDtl fileDtl = CmmFileDTO.FileDtl.builder()
// .fileMastrId(CommUtils.getStringFromUUID())
// .fileCours("/cctv/2022/1227")
// .build();
//
//
// cmmFileService.saveAddFileDtl(fileDtl, cpListMf, false);
//mfList = null;
}
}
// metaFileName : 20101224121055000_014_001_0
// yyyyMMddHHmmssTTT_업체코드_장비코드
//
// 주행형 : 서울11가1111,역삼동,국민은행앞,주정차위반,어린이보호구역,121010,122400
// 127.482432
// 37.362931
// 고정형 : 서울11가1111,역삼동,국민은행앞,주정차위반,어린이보호구역,121010,122400
//
// 차량번호,단속동명,단속장소명,법규,어린이보호구역,단속시작시간,단속종료시간
// gpsX
// gpsY
private CctvCrackdownDTO.ExtrlRegltCntc getExtrlRegltCntcDTO(String metaFileName, List<String> metaFileInfos){
String[] metaFileNames = metaFileName.split("_");
String[] mdInfos = metaFileInfos.get(0).split(",");
return CctvCrackdownDTO.ExtrlRegltCntc.builder()
.vhcleNo(mdInfos[0])
.regltDongNm(mdInfos[1])
.regltPlace(mdInfos[2])
//.법규
//.어린이보호구역
.regltBeginTime(mdInfos[5])
.regltEndTime(mdInfos[6])
.gpsX(metaFileInfos.size() >= 3? metaFileInfos.get(1).trim() : null)
.gpsY(metaFileInfos.size() >= 3? metaFileInfos.get(2).trim() : null)
.regltDe(metaFileNames[0].substring(0,8))
.regltEntrpsCode(metaFileNames[1])
.regltEqpmnManageNo(metaFileNames[2])
.register(getUserUniqId())
.build();
}
private CmmFileDTO.FileMst getFileMst(String pkPrefix, String fileJobId) {
return CmmFileDTO.FileMst.builder()
.jobSeCode(
Objects.equals(pkPrefix, FimsConst.PkPrefix.CDV.getCode())?
FimsConst.FileJobSeCode.CCTV_DRV.getCode()
: FimsConst.FileJobSeCode.CCTV_FIX.getCode())
.fileJobId(fileJobId)
.uploadeJobPath(Objects.equals(pkPrefix, FimsConst.PkPrefix.CDV.getCode())?
uploadCctvDrvPath
: uploadCctvFixPath)
.fileDirPath(FimsConst.FileDirDepth.DAY.getCode())
.cmmFileDtls(new ArrayList<>())
.build();
}
}

@ -0,0 +1,29 @@
package kr.xit.fims.biz.ec.service;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.RowBounds;
import kr.xit.fims.biz.ec.model.CctvCrackdownDTO;
import kr.xit.framework.core.utils.XitCmmnUtil;
public interface IEcCctvCrackdownService {
List<CctvCrackdownDTO.ExtrlRegltCntc> findExtrlRegltCntcs(final Map<String, Object> paraMap, final RowBounds rowBounds);
CctvCrackdownDTO.ExtrlRegltCntc findExtrlRegltCntc(final String extrlRegltCntcId);
void saveCctvCrackdownDatas(final CctvCrackdownDTO.Request dto);
default String getUserUniqId(){
return XitCmmnUtil.getUserUniqId();
}
}

@ -0,0 +1,122 @@
package kr.xit.fims.biz.ec.web;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;
import kr.xit.fims.biz.FimsConst;
import kr.xit.fims.biz.ec.model.CctvCrackdownDTO;
import kr.xit.fims.biz.ec.service.IEcCctvCrackdownService;
import kr.xit.framework.biz.cmm.model.CmmFileDTO;
import kr.xit.framework.biz.cmm.service.ICmmFileService;
import kr.xit.framework.core.constants.FrameworkConstants;
import kr.xit.framework.core.model.ResultResponse;
import kr.xit.framework.core.utils.fileExplorer.XitFileExplorerUtil;
import kr.xit.framework.core.utils.fileExplorer.function.DirectorySearch;
import kr.xit.framework.support.exception.BizRuntimeException;
import kr.xit.framework.support.mybatis.MybatisUtils;
import kr.xit.framework.support.util.AjaxMessageMapRenderer;
import kr.xit.framework.support.util.constants.MessageKey;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@Slf4j
@RequiredArgsConstructor
@Controller
@RequestMapping(value = "/fims/biz/ec")
public class EcCctvCrackdownController {
@Value("#{prop['file.rcv.root']}")
private String fileRcvRoot;
@Value("#{prop['file.rcv.busonly-cctv.path']}")
private String rcvBusonlyCctvPath;
private final IEcCctvCrackdownService service;
private final ICmmFileService fileService;
@RequestMapping(value = "/ecCctvCrackdownMgtForm")
public void ecCctvCrackdownMgtForm(){
}
@RequestMapping(value = "/ecCctvCrackdownFileSelPopup")
public ModelAndView ecCctvCrackdownFileSelPopup(){
ModelAndView mav = new ModelAndView(FimsConst.FIMS_JSP_BASE_PATH +"ec/ecCctvCrackdownFileSelPopup.popup");
//mav.addObject("dirPath", fileRcvRoot + rcvBusonlyCctvPath);
return mav;
}
@RequestMapping(value = "/ecCctvCrackdownPopup")
public ModelAndView ecCctvCrackdownPopup(final String extrlRegltCntcId, final String regltSeCode){
ModelAndView mav = new ModelAndView(FimsConst.FIMS_JSP_BASE_PATH +"ec/ecCctvCrackdownPopup.popup");
String fileJobSeCode = getFileJobSeCode(regltSeCode);
mav.addObject("extrlRegltCntcDTO", service
.findExtrlRegltCntc(extrlRegltCntcId));
mav.addObject("attchFiles", fileService.findFilesByJobSeCodeAndJobId(
CmmFileDTO.FileMst.builder()
.jobSeCode(fileJobSeCode)
.fileJobId(extrlRegltCntcId)
.build()));
return mav;
}
@RequestMapping(value = "/findCctvCrackdownFiles")
public ModelAndView findCctvCrackdownFiles(final String dirPath){
XitFileExplorerUtil explorer = new XitFileExplorerUtil(new DirectorySearch(dirPath));
return ResultResponse.of(
explorer.getList().stream()
.filter(m->"Y".equals(m.get("isFile")))
.collect(Collectors.toList())
);
}
@PostMapping(value = "/saveCctvCrackdownDatas")
public ModelAndView saveCctvCrackdownDatas(final CctvCrackdownDTO.Request dto) {
ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW);
service.saveCctvCrackdownDatas(dto);
AjaxMessageMapRenderer.success(mav, MessageKey.CMM_SUCCESS);
return mav;
}
@GetMapping(value = "/findExtrlRegltCntcs")
public ModelAndView findExtrlRegltCntcs(@RequestParam final Map<String,Object> paraMap) {
return ResultResponse.of(service.findExtrlRegltCntcs(paraMap, MybatisUtils.getPagingInfo(paraMap)));
}
@RequestMapping("/findExtrlRegltCntcAttchFiles")
public ModelAndView findExtrlRegltCntcAttchFiles(final String extrlRegltCntcId, final String regltSeCode) {
return ResultResponse.of(
fileService.findFilesByJobSeCodeAndJobId(
CmmFileDTO.FileMst.builder()
.jobSeCode(getFileJobSeCode(regltSeCode))
.fileJobId(extrlRegltCntcId)
.build()).stream()
.filter(dtl -> !Objects.equals("png", dtl.getFileExtsn()))
.collect(Collectors.toList())
);
}
private static String getFileJobSeCode(String regltSeCode) {
// 01 - 고정형CCTV
if(Objects.equals(regltSeCode, "01"))//FimsConst.FileJobSeCode.CCTV_FIX))
return FimsConst.FileJobSeCode.CCTV_FIX.getCode();
// 02 - 주행형CCTV
if(Objects.equals(regltSeCode, "02"))//FimsConst.FileJobSeCode.CCTV_DRV))
return FimsConst.FileJobSeCode.CCTV_DRV.getCode();
// 03 - 버스장착형CCTV
if(Objects.equals(regltSeCode, "03"))//FimsConst.FileJobSeCode.BUS_ONLY))
return FimsConst.FileJobSeCode.BUS_ONLY.getCode();
throw BizRuntimeException.create(MessageKey.CUSTOM_MSG, "데이타 오류[파일정보를 확인해 주세요");
}
}

@ -230,7 +230,7 @@ public class CmmFileService implements ICmmFileService {
/** /**
* *
* @param dto * @param t
* @return * @return
*/ */
@Override @Override

@ -127,7 +127,11 @@ file.upload.allow.ext=
#file.upload.root=/Users/minuk/data/fims/upload #file.upload.root=/Users/minuk/data/fims/upload
file.upload.root=D:/data/fims/upload file.upload.root=D:/data/fims/upload
file.upload.natl-newspaper.path=/natl-newspaper 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/project_data/fims/01. \uC5F0\uACC4/01. \uAD6D\uBBFC\uC2E0\uBB38\uACE0 #file.rcv.root=/Users/minuk/project_data/fims/01. \uC5F0\uACC4/01. \uAD6D\uBBFC\uC2E0\uBB38\uACE0
file.rcv.root=D:/project_data/fims/01. \uC5F0\uACC4/01. \uAD6D\uBBFC\uC2E0\uBB38\uACE0 file.rcv.root=D:/project_data/fims/01. \uC5F0\uACC4
file.rcv.natl-newspaper.path=/rcv file.rcv.natl-newspaper.path=/01. \uAD6D\uBBFC\uC2E0\uBB38\uACE0/rcv
file.rcv.busonly-cctv.path=/02. CCTV/CCTV \uC0D8\uD50C\uC790\uB8CC/\uBC84\uC2A4\uC804\uC6A9\uCC28\uB85C

@ -202,7 +202,7 @@
<insert id="insertRtRegltFromCtznStmt"> <insert id="insertRtRegltFromCtznStmt">
/* ec-ctzn-sttemnt-mysql-mapper|insertRtRegltFromCtznStmt-시민신고 단속 생성|julim */ /* ec-ctzn-sttemnt-mysql-mapper|insertRtRegltFromCtznStmt-시민신고 단속 생성|julim */
<selectKey resultType="string" keyProperty="regltId" order="BEFORE"> <selectKey resultType="string" keyProperty="regltId" order="BEFORE">
SELECT fn_get_key_seq(#{regltSeCode}, 13) SELECT fn_get_key_seq(#{pkPrefix}, 13)
</selectKey> </selectKey>
INSERT INTO tb_rt_reglt ( INSERT INTO tb_rt_reglt (
reglt_id reglt_id
@ -232,7 +232,7 @@
) SELECT #{regltId} ) SELECT #{regltId}
, ecsd.instt_code , ecsd.instt_code
, ecsd.sys_code , ecsd.sys_code
, (SELECT code FROM xit_cmmn_detail_code WHERE code_id = 'FIM002' AND etc_1 = #{regltSeCode}) , (SELECT code FROM xit_cmmn_detail_code WHERE code_id = 'FIM002' AND etc_1 = #{pkPrefix})
, #{inputSeCode} -- 입력 구분 코드 , #{inputSeCode} -- 입력 구분 코드
, SUBSTR(ecsd.reglt_de_time, 1, 8) , SUBSTR(ecsd.reglt_de_time, 1, 8)
, SUBSTR(ecsd.reglt_de_time, 9) -- 단속 시작 시간 , SUBSTR(ecsd.reglt_de_time, 9) -- 단속 시작 시간
@ -268,7 +268,7 @@
<insert id="insertRtErppFromCtznStmt"> <insert id="insertRtErppFromCtznStmt">
/* ec-ctzn-sttemnt-mysql-mapper|insertRtErppFromCtznStmt-시민신고 서손 생성|julim */ /* ec-ctzn-sttemnt-mysql-mapper|insertRtErppFromCtznStmt-시민신고 서손 생성|julim */
<selectKey resultType="string" keyProperty="erppId" order="BEFORE"> <selectKey resultType="string" keyProperty="erppId" order="BEFORE">
SELECT fn_get_key_seq(#{regltSeCode}, 9) SELECT fn_get_key_seq(#{pkPrefix}, 9)
</selectKey> </selectKey>
INSERT INTO tb_rt_erpp ( INSERT INTO tb_rt_erpp (
erpp_id erpp_id

@ -0,0 +1,111 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="kr.xit.fims.biz.ec.mapper.IEcCctvCrackdownMapper">
<!-- *************************************************************************************************************
* tb_ec_extrl_reglt_cntc : 외부단속연계
************************************************************************************************************** -->
<sql id="sqlEcExtrlRegltCntc">
SELECT extrl_reglt_cntc_id
, reglt_id
, instt_code
, sys_code
, reglt_se_code
, input_se_code
, vhcle_no
, reglt_de
, reglt_begin_time
, reglt_end_time
, reglt_dong_nm
, reglt_place
, reglt_specl_zone_nm
, reglt_entrps_code
, reglt_eqpmn_manage_no
, violt_dtls_nm
, gps_x
, gps_y
, extrl_reglt_cntc_process_sttus
, cntc_file_nm
, cntc_photo_file_nm_1
, cntc_photo_file_nm_2
, cntc_photo_file_nm_3
, cntc_photo_file_nm_4
, delete_at
, delete_resn
, delete_dt
, dltr
, regist_dt
, register
, updt_dt
, updusr
FROM tb_ec_extrl_reglt_cntc
</sql>
<select id="selectEcExtrlRegltCntcs" resultType="kr.xit.fims.biz.ec.model.CctvCrackdownDTO$ExtrlRegltCntc">
/* ec-extrl-reglt-cntc-mysql-mapper|selectEcExtrlRegltCntcs-외부연계 목록 조회|julim */
<include refid="sqlEcExtrlRegltCntc"/>
</select>
<select id="selectEcExtrlRegltCntc" resultType="kr.xit.fims.biz.ec.model.CctvCrackdownDTO$ExtrlRegltCntc">
/* ec-extrl-reglt-cntc-mysql-mapper|selectEcExtrlRegltCntc-외부연계 정보 조회|julim */
<include refid="sqlEcExtrlRegltCntc"/>
WHERE extrl_reglt_cntc_id = #{extrlRegltCntcId}
</select>
<insert id="insertEcExtrlRegltCntc">
/* ec-extrl-reglt-cntc-mysql-mapper|insertEcExtrlRegltCntc-외부연계 정보 등록|julim */
<selectKey resultType="string" keyProperty="extrlRegltCntcId" order="BEFORE">
SELECT fn_get_key_seq(#{pkPrefix}, 9)
</selectKey>
INSERT
INTO tb_ec_extrl_reglt_cntc (
extrl_reglt_cntc_id
, reglt_id
, instt_code
, sys_code
, reglt_se_code
, input_se_code
, vhcle_no
, reglt_de
, reglt_begin_time
, reglt_end_time
, reglt_dong_nm
, reglt_place
, reglt_specl_zone_nm
, reglt_entrps_code
, reglt_eqpmn_manage_no
, violt_dtls_nm
, gps_x
, gps_y
, extrl_reglt_cntc_process_sttus
, delete_at
, regist_dt
, register
) VALUES (
#{extrlRegltCntcId}
, #{regltId}
, #{insttCode}
, #{sysCode}
, (SELECT code FROM xit_cmmn_detail_code WHERE code_id = 'FIM002' AND etc_1 = #{pkPrefix})
, #{inputSeCode}
, #{vhcleNo}
, #{regltDe}
, #{regltBeginTime}
, #{regltEndTime}
, #{regltDongNm}
, #{regltPlace}
, #{regltSpeclZoneNm}
, #{regltEntrpsCode}
, #{regltEqpmnManageNo}
, #{violtDtlsNm}
, #{gpsX}
, #{gpsY}
, #{extrlRegltCntcProcessSttus}
, 'N'
, DATE_FORMAT(NOW(), '%Y%m%d%H%i%s')
, #{register}
)
</insert>
</mapper>

@ -0,0 +1,239 @@
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/framework/taglibs.jsp" %>
<div class="popup" style="min-width: 100%;">
<div class="popup_inner" style="max-width: 800px;">
<p class="pop_title">CCTV 단속 자료 선택</p>
<form name="frmSearch" id="frmSearch">
<div class="search r2">
<table>
<caption>검색조건</caption>
<colgroup>
<col style="width: 600px;"/>
<col>
<col/>
<col/>
<col/>
<col/>
<col/>
</colgroup>
<tbody>
<tr>
<td>
<label for="folder">파일 경로 선택</label>
<%-- <input id="dirPath" name="dirPath" type="text" size="200" value="<c:out value='${dirPath}'/>" title="검색" class="w_fix04"/>--%>
<input id="folder" type="file" webkitdirectory directory multiple="false" style="display:none" />
<h2>Selected Files</h2>
<ul>
</ul>
</td>
<%-- <td colspan="6">--%>
<%-- <input type="button" id="btnSearch" class="btn_search" title="검색" value="검색" />--%>
<%-- </td>--%>
</tr>
</tbody>
</table>
</div>
</form>
<div class="popup_btn">
<span class="fll">
<div class="list clearfix" id="totCnt">전체 ㅣ <span>0</span></div>
</span>
</div>
<div id="grid"></div>
<div class="popup_btn">
<span class="flr p_flr">
<a href="#" class="btn blue" id="btnRegist">파일 처리</a>
<a href="#" class="btn lightgray" id="btnClose" onclick="window.close(); return false;">닫기</a>
</span>
</div>
<!-- //등록버튼 -->
</div>
</div>
<!-- //popup -->
<script type="text/javaScript">
/**************************************************************************
* Global Variable
**************************************************************************/
let GRID = null;
let arrFiles = [];
/* *******************************
* Biz function
******************************* */
const fnBiz = {
fileSelect: (e) => {
const output = document.querySelector("ul");
const files = e.target.files;
const arrFile = [];
for (let i=0; i<files.length; i++) {
const item = document.createElement("li");
item.innerHTML = files[i].webkitRelativePath;
output.appendChild(item);
arrFile.push({
filePath: '',
fileNm: files[i].name,
fileType: files[i].type,
fileSize: files[i].size,
//lastModified: files[i].lastModified
lastModified: files[i].lastModifiedDate
})
arrFiles.push(files[i]);
}
GRID.resetData(arrFile);
}
,search: () => {
GRID.reloadData();
//FIXME : onGridUpdated
GRID.on('onGridUpdated', (ev) => {
console.log('%%%%%%%%%%%%%>>>>>>>',ev)
}) // 그리드 레이아웃 새로고침 (로드가 다 되지 않는 경우 그리드가 흰색 화면으로 출력될 때가 있다.))
}
,add: () => {
const arrChecks = GRID.getCheckedRows();
if(arrChecks.length===0) {
alert("등록[변경]할 목록을 선택하세요.");
return false;
}
const data = {
filePath: $('#dirPath').val()
,xmlFileInfoList: arrChecks.map((row) => {
return {fileNm: row.fileNm, fileType: row.fileType, fileSize: row.fileSize}
})
}
const formData = new FormData();
arrFiles.forEach((f)=> {
formData.append("files", f)
})
//formData.append("files", arrFiles)
if(confirm("등록 하시겠습니까?")) {
$.ajax({
type: 'post'
,enctype: "multipart/form-data"
,url: '<c:url value="/fims/biz/ec/saveCctvCrackdownDatas.do"/>'
,data: formData
,processData: false
,contentType: false
,success: (res) => {
if(res){
alert(res.message);
fnBiz.search();
}
//fnBiz.search();
}
,error: (xhr, status, err) => {
}
})
}
}
}
/**************************************************************************
* event
**************************************************************************/
$(() => {
$('#folder').on('change', function(e) {
fnBiz.fileSelect(e)
});
$('#btnSearch').on('click', () => fnBiz.search());
$('#btnRegist').on('click', () => {
fnBiz.add();
});
});
/* *******************************
* Grid
******************************* */
const initGrid = () => {
const gridColumns = [
{
header: '경로',
name: 'filePath',
hidden: true
},
{
header: '이름',
name: 'fileNm',
width: 420,
//minWidth: 250,
sortingType: 'desc',
sortable: true,
filter: 'select' //fiter 옵션(select/text/number/date/.. 등이 있으며 설정방법은 상이하므로 사이트 참조)
},
{
header: '타입',
name: 'fileType',
width: 30,
align: 'center',
sortable: true,
},
{
header: '크기',
name: 'fileSize',
width: 80,
sortable: true,
align: 'right',
formatter({value}){
return new Intl.NumberFormat('ko').format(value);
}
},
{
header: '생성일시',
name: 'lastModified',
width: 120,
sortable: true,
align: 'center',
formatter({value}){
//return setDateTimeFmt(value);
return value;
}
}
];
const gridOptions = {
el: 'grid',
rowHeaders: ['rowNum', 'checkbox'],
columns: gridColumns,
//FIXME : 페이징 미사용시
//페이지처리 hide
pagination: false,
pageOptions: null,
// pageOptions: {
// useClient: true,
// perPage: 100
// },
columnOptions: {
frozenCount: 1
},
bodyHeight: 400
};
const gridDatasource = { //DataSource
initialRequest: false
};
GRID = TuiGrid.of(gridOptions, gridDatasource, (ev) => {
});
}
/**************************************************************************
* initialize
**************************************************************************/
$(document).ready(function(){
initGrid();
});
</script>

@ -0,0 +1,204 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="/WEB-INF/jsp/framework/taglibs.jsp" %>
<form id="frmSearch" name="frmSearch">
<div class="search r2">
<table>
<caption>검색조건</caption>
<colgroup>
<col style="width: 400px;"/>
<col/>
<col/>
<col/>
<col/>
<col/>
<col/>
</colgroup>
<tbody>
<tr>
<td colspan="5">
<label for="sysCode">시스템 구분</label>
<code:select codeId="FIM001" defaultSelect="PVS" id="sysCode" name="sysCode" title="시스템구분" cls="selectBox" alt="selectBox tag" disabled="true"/>
</td>
<td colspan="6">
<input type="button" id="btnSearch" class="btn_search" title="검색" value="검색"/>
</td>
</tr>
</tbody>
</table>
</div>
</form>
<!-- //검색 -->
<div class="page_btn">
<span class="fll">
<div class="list clearfix" id="totCnt">전체 ㅣ <span></span></div>
</span>
<span class="flr">
<a href="#" class="btn darkgray" id="btnRegist" title="템플릿 등록">등록</a>
</span>
</div>
<!-- //버튼 및 페이지정보 -->
<!-- 데이터 출력 -->
<div id="grid"></div>
<script type="text/javaScript">
/**************************************************************************
* Global Variable
**************************************************************************/
let GRID = null;
var callbackSearch = () => fnBiz.search();
/* *******************************
* Biz function
******************************* */
const fnBiz = {
search: () => {
GRID.reloadData();
}
,pagePopup: function(flag, params){
let url;
let popTitle;
let popOption;
switch (flag) {
case "detail":
url = '<c:url value="/fims/biz/ec/ecCctvCrackdownPopup.do"/>';
popOption = {width: 1000, height:900};
popTitle = "외부연계 데이타 상세";
break;
case "file":
url = '<c:url value="/fims/biz/ec/ecCctvCrackdownFileSelPopup.do"/>';
popOption = {width: 900, height:750};
popTitle = "외부연계 데이타 선택";
break;
default:
break;
}
CmmPopup.open(url, params, popOption, popTitle);
}
,onClickGrid: function(props){
const rowData = props.grid.getRow(props.rowKey);
fnBiz.pagePopup('detail', {extrlRegltCntcId: rowData.extrlRegltCntcId, regltSeCode: rowData.regltSeCode});
}
// ,onSearchChange: () => {
// if($('#searchCondition').val() === 'tmplatSeCode'){
// $('select[name="searchKeyword"]')
// .css('display', 'inline-block')
// .attr('disabled', false);
// $('input[name="searchKeyword"]')
// .css('display', 'none')
// .attr('disabled', true);
// }else{
// $('select[name="searchKeyword"]')
// .css('display', 'none')
// .attr('disabled', true);
// $('input[name="searchKeyword"]')
// .css('display', 'inline-block')
// .attr('disabled', false);
// }
// }
}
/**************************************************************************
* event
**************************************************************************/
$(() => {
$('#btnSearch').on('click', () => fnBiz.search());
$('#btnRegist').on('click', () => {
fnBiz.pagePopup('file');
});
});
/* *******************************
* Grid
******************************* */
const initGrid = () => {
const gridColumns = [
{
header: '단속구분코드',
name: 'regltSeCode',
minWidth: 80,
sortable: false,
align: 'center'
},
{
header: '외부연계키',
name: 'extrlRegltCntcId',
minWidth: 100,
sortable: true,
sortingType: 'desc',
align: 'center',
renderer: {
type: CustomButtonRenderer,
options: {
formatter: (props)=>{
return {
formatter: props.grid.getRow(props.rowKey).extrlRegltCntcId
,element: "text"
}
}
,eventFunction: fnBiz.onClickGrid
,eventType: "click"
}
}
},
{
header: '차량번호',
name: 'vhcleNo',
minWidth: 200,
sortable: false,
//align: 'left'
},
{
header: '단속일자',
name: 'regltDe',
width: 80,
sortable: false,
align: 'center',
formatter({value}){
return setDateFmt(value);
}
},
{
header: '등록일자',
name: 'registDt',
width: 160,
sortable: false,
align: 'center',
formatter({value}){
return setDateTimeFmt(value);
}
}
];
const gridOptions = {
el: 'grid',
rowHeaders: ['rowNum'],
columns: gridColumns
};
const gridDatasource = {
initialRequest: true, // 화면 load시 조회 안함 - default
api: {
readData: {
url: '<c:url value="/fims/biz/ec/findExtrlRegltCntcs.do"/>'
,serializer: (params) => fnAddPageInfo(document.frmSearch, params)
}
}
};
GRID = TuiGrid.of(gridOptions, gridDatasource, (res) => {
});
}
/**************************************************************************
* initialize
**************************************************************************/
$(document).ready(function(){
initGrid();
});
</script>

@ -0,0 +1,277 @@
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/framework/taglibs.jsp" %>
<%--rcvXmlDTO--%>
<c:set var="files" value="${attchFiles}"/>
<c:set var="bizName" value="외부연계 데이타"/>
<div class="popup" style="min-width: 100px;">
<div class="popup_inner" style="max-width: 1000px;">
<p class="pop_title">
<c:out value="${bizName}"/>(<c:out value="${extrlRegltCntcDTO.extrlRegltCntcId}"/>) 상세
</p>
<%--@elvariable id="boardMaster" type="validator"--%>
<form>
<table class="tbl03">
<caption><c:out value="${bizName}"/> 상세</caption>
<colgroup>
<col style="width: 13%;"/>
<col style="width: 20%;"/>
<col style="width: 13%;"/>
<col style="width: 20%;"/>
<col style="width: 13%;"/>
<col style="width: 20%;"/>
</colgroup>
<tbody>
<tr>
<th>시스템구분</th>
<td>
<input type="text" name="sysGubunC" value="<c:out value="${extrlRegltCntcId.sysGubunC}"/>" readonly>
</td>
<th>송신기관</th>
<td>
<input type="text" name="ancCodeV" value="<c:out value="${extrlRegltCntcId.ancCodeV}"/>" readonly>
</td>
<th>민원구분</th>
<td>
<input type="text" name="petiGubunC" value="<c:out value="${extrlRegltCntcId.petiGubunC}"/>" readonly>
</td>
</tr>
<tr>
<th>민원기관</th>
<td>
<input type="text" name="petiAncCodeV" value="<c:out value="${extrlRegltCntcId.petiAncCodeV}"/>" readonly>
</td>
<th>민원신청번호</th>
<td>
<input type="text" name="petiNoC" value="<c:out value="${rcvXmlDTO.petiNoC}"/>" readonly>
</td>
<th>민원접수번호</th>
<td>
<input type="text" name="civilNoC" value="<c:out value="${rcvXmlDTO.civilNoC}"/>" readonly>
</td>
</tr>
<tr>
<th>민원신청인</th>
<td>
<input type="text" name="peterNameV" value="<c:out value="${rcvXmlDTO.peterNameV}"/>" readonly>
</td>
<th>신청인우편번호</th>
<td>
<input type="text" name="zipCodeC" value="<c:out value="${rcvXmlDTO.zipCodeC}"/>" readonly>
</td>
<th>신청인주소</th>
<td>
<input type="text" name="addressV" value="<c:out value="${rcvXmlDTO.addressV}"/>" readonly>
</td>
</tr>
<tr>
<th>신청인메일</th>
<td>
<input type="text" name="emailV" value="<c:out value="${rcvXmlDTO.emailV}"/>" readonly>
</td>
<th>신청인핸드폰</th>
<td>
<input type="text" name="celNoV" value="<c:out value="${rcvXmlDTO.celNoV}"/>" readonly>
</td>
<th>신청인전화</th>
<td>
<input type="text" name="telNoV" value="<c:out value="${rcvXmlDTO.telNoV}"/>" readonly>
</td>
</tr>
<tr>
<th>민원신청제목</th>
<td colspan="5">
<input type="text" name="petiTitleV" value="<c:out value="${rcvXmlDTO.petiTitleV}"/>" readonly>
</td>
</tr>
<tr>
<th>민원신청내용</th>
<td colspan="5">
<textarea name="petiReasonL" rows="10" readonly><c:out value="${rcvXmlDTO.petiReasonL}" /></textarea>
<%-- <textarea name="petiReasonL" rows="10" readonly><c:out value="${rcvXmlDTO.petiReasonL}" escapeXml="true"/></textarea>--%>
</td>
</tr>
<tr>
<th>공개여부</th>
<td>
<input type="text" name="openYnC" value="<c:out value="${rcvXmlDTO.openYnC}"/>" readonly>
</td>
<th>민원신청일시</th>
<td>
<fmt:parseDate value="${rcvXmlDTO.petiRegD}" var="petiRegD" pattern="yyyyMMddHHmmss"/>
<input type="text" name="petiRegD" value="<fmt:formatDate value="${petiRegD}" pattern="yyyy-MM-dd HH:mm:ss"/>" readonly>
</td>
<th>파일첨부여부</th>
<td>
<input type="text" name="petiReasonAttachYnC" value="<c:out value="${rcvXmlDTO.petiReasonAttachYnC}"/>" readonly>
</td>
</tr>
<%--
<tr>
<th>첨부파일크기</th>
<td>
<input type="text" name="petiFileSizeN" value='<fmt:formatNumber value="${rcvXmlDTO.petiFileSizeN}" pattern="#,###"/>' readonly>
</td>
<th>첨부파일명1</th>
<td>
<input type="text" name="petiFilePath1V" value="<c:out value="${rcvXmlDTO.petiFilePath1V}"/>" readonly>
</td>
<th>첨부파일명2</th>
<td>
<input type="text" name="petiFilePath2V" value="<c:out value="${rcvXmlDTO.petiFilePath2V}"/>" readonly>
</td>
</tr>
<tr>
<th>첨부파일명3</th>
<td>
<input type="text" name="petiFilePath3V" value="<c:out value="${rcvXmlDTO.petiFilePath3V}"/>" readonly>
</td>
<th>첨부파일명4</th>
<td>
<input type="text" name="petiFilePath4V" value="<c:out value="${rcvXmlDTO.petiFilePath4V}"/>" readonly>
</td>
<th>첨부파일명5</th>
<td>
<input type="text" name="petiFilePath5V" value="<c:out value="${rcvXmlDTO.petiFilePath5V}"/>" readonly>
</td>
</tr>
--%>
<tr>
<th>등록일시</th>
<td>
<fmt:parseDate value="${rcvXmlDTO.regD}" var="regD" pattern="yyyyMMddHHmmss"/>
<input type="text" name="petiRegD" value="<fmt:formatDate value="${regD}" pattern="yyyy-MM-dd HH:mm:ss"/>" readonly>
</td>
<th>송신여부</th>
<td>
<input type="text" name="sendYnC" value="<c:out value="${rcvXmlDTO.sendYnC}"/>" readonly>
</td>
<th>송신일시</th>
<td>
<fmt:parseDate value="${rcvXmlDTO.sendD}" var="sendD" pattern="yyyyMMddHHmmss"/>
<input type="text" name="petiRegD" value="<fmt:formatDate value="${sendD}" pattern="yyyy-MM-dd HH:mm:ss"/>" readonly>
</td>
</tr>
<tr>
<th>적용일시</th>
<td>
<fmt:parseDate value="${rcvXmlDTO.applyD}" var="applyD" pattern="yyyyMMddHHmmss"/>
<input type="text" name="applyD" value="<fmt:formatDate value="${applyD}" pattern="yyyy-MM-dd HH:mm:ss"/>" readonly>
</td>
<th>완료구분</th>
<td>
<input type="text" name="applyGubunC" value="<c:out value="${rcvXmlDTO.applyGubunC}"/>" readonly>
</td>
<th>처리구분1</th>
<td>
<input type="text" name="pcdGubunV" value="<c:out value="${rcvXmlDTO.pcdGubunV}"/>" readonly>
</td>
</tr>
<%--
<tr>
<th>처리구분2</th>
<td>
<input type="text" name="pcdGubun2V" value="<c:out value="${rcvXmlDTO.pcdGubun2V}"/>" readonly>
</td>
<th>처리구분3</th>
<td>
<input type="text" name="pcdGubun3V" value="<c:out value="${rcvXmlDTO.pcdGubun3V}"/>" readonly>
</td>
<th>인터페이스ID</th>
<td>
<input type="text" name="ifid" value="<c:out value="${rcvXmlDTO.ifid}"/>" readonly>
</td>
</tr>
<tr>
<th>소스기관코드</th>
<td>
<input type="text" name="srcorgcd" value="<c:out value="${rcvXmlDTO.srcorgcd}"/>" readonly>
</td>
<th>타겟기관코드</th>
<td>
<input type="text" name="tgtorgcd" value="<c:out value="${rcvXmlDTO.tgtorgcd}"/>" readonly>
</td>
<th>인터페이스ID</th>
<td>
<input type="text" name="ifid" value="<c:out value="${rcvXmlDTO.ifid}"/>" readonly>
</td>
</tr>
--%>
</tbody>
</table>
</form>
<div class="draggable" id="imgList" style="display: flex; flex-direction: column; align-items: center"></div>
<div class="popup_btn">
<span class="flr p_flr">
<a href="#" class="btn lightgray" onclick="window.close()">닫기</a>
</span>
</div>
<!-- //등록버튼 -->
</div>
</div>
<!-- //popup -->
<script type="text/javascript" src="${pageContext.request.contextPath}/resources/framework/js/cmm/cmmDownloadImg.js" defer></script>
<script type="text/javascript">
/**************************************************************************
* Global Variable
**************************************************************************/
// let orgData;
/* *******************************
* Biz function
******************************* */
const fnBiz = {
downloadImg: () => {
cmmAjax({
showSuccessMsg: false
,url: '<c:url value="/fims/biz/ec/findExtrlRegltCntcAttchFiles.do"/>'
,data: {extrlRegltCntcId: '${extrlRegltCntcDTO.extrlRegltCntcId}', regltSeCode: '${extrlRegltCntcDTO.regltSeCode}'}
,success: (res) => {
sttemntImgDownload(res.data?.contents, '#ctznImg');
}
})
}
,pagePopup: function(flag, params) {
let url;
let popTitle;
let popOption;
switch (flag) {
case "imageView":
url = '<c:url value="/framework/biz/cmm/file/cmmImageViewPopup.do"/>';
popOption = {width: 1000, height: 800, resizable:false,scrollbars:'no'};
popTitle = "이미지 보기";
break;
default:
break;
}
window.opener.popup = CmmPopup.open(url, params, popOption, popTitle);
//var w = window.open("/imageEditor.do", "", "width=800,height=650,top=0px,left=200px,status=,resizable=false,scrollbars=no");
},
viewImg: () => {
}
};
/**************************************************************************
* event
**************************************************************************/
$(() => {
$('img').on('click', () => {
fnBiz.viewImg()
});
});
/**************************************************************************
* initialize
**************************************************************************/
$(document).ready(function () {
// orgData = $('form').serialize();
fnBiz.downloadImg();
});
</script>
Loading…
Cancel
Save