버스장착형cctv 연계 파일정보 조회 기능 추가

main
이범준 1 year ago
parent f7c9378afd
commit 5605d7236f

@ -18,6 +18,87 @@ public class CmmnUtil {
return str; return str;
} }
/**
* substring
*
* new String(str.getBytes(), 0, endBytes)
* .
*
* UTF-8 3, 1 .
*
* @param str
* @param beginBytes
* @param endBytes
* @return
*/
public static String substringByBytes(String str, int beginBytes, int endBytes) {
if (str == null || str.length() == 0) {
return "";
}
if (beginBytes < 0) {
beginBytes = 0;
}
if (endBytes < 1) {
return "";
}
int len = str.length();
int beginIndex = -1;
int endIndex = 0;
int curBytes = 0;
String ch = null;
for (int i = 0; i < len; i++) {
ch = str.substring(i, i + 1);
curBytes += ch.getBytes().length;
if (beginIndex == -1 && curBytes >= beginBytes) {
beginIndex = i;
}
if (curBytes > endBytes) {
break;
} else {
endIndex = i + 1;
}
}
return str.substring(beginIndex, endIndex);
}
public static String substringByBytes(String str, int beginBytes) {
if (str == null || str.length() == 0) {
return "";
}
if (beginBytes < 0) {
beginBytes = 0;
}
int len = str.length();
int beginIndex = -1;
int curBytes = 0;
String ch = null;
for (int i = 0; i < len; i++) {
ch = str.substring(i, i + 1);
curBytes += ch.getBytes().length;
if (beginIndex == -1 && curBytes >= beginBytes) {
beginIndex = i;
}
}
return str.substring(beginIndex);
}
/** /**
* . * .
* @param file , removeSelf * @param file , removeSelf

@ -1,15 +1,24 @@
package cokr.xit.fims.crdn.parsing; package cokr.xit.fims.crdn.parsing;
import java.io.File; import java.io.File;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Path; import java.nio.file.Path;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Base64;
import java.util.Base64.Encoder;
import java.util.List; import java.util.List;
import java.util.stream.Stream; import java.util.stream.Stream;
import cokr.xit.fims.cmmn.CmmnUtil;
import cokr.xit.foundation.data.DataObject; import cokr.xit.foundation.data.DataObject;
public class HiteCom implements EquipmentEnterprise { public class HiteCom implements EquipmentEnterprise {
private int tempGroupSeq = 1;
@Override @Override
public List<DataObject> parsing(Stream<Path> fileList) { public List<DataObject> parsing(Stream<Path> fileList) {
@ -23,38 +32,99 @@ public class HiteCom implements EquipmentEnterprise {
String fileName = file.getName(); String fileName = file.getName();
dataObject.put("FILE_NAME", fileName); dataObject.put("FILE_NAME", fileName);
//TODO: //파일내용
String fileCn0 = "";
dataObject.put("text부사이즈", ""); try {
dataObject.put("장비번호", "");
dataObject.put("속도", ""); fileCn0 = Files.readString(item, Charset.forName("ISO-8859-1"));
dataObject.put("차종", ""); } catch (IOException e) {
dataObject.put("차로", ""); e.printStackTrace();
dataObject.put("위반날짜", ""); }
dataObject.put("위반시간", "");
dataObject.put("차량번호", ""); String fileCn = "";
dataObject.put("번호판시작X", ""); try {
dataObject.put("번호판시작Y", ""); fileCn = new String(fileCn0.getBytes("ISO-8859-1"), "EUC-KR");
dataObject.put("번호판크기W", ""); } catch (UnsupportedEncodingException e) {
dataObject.put("번호판크기H", ""); e.printStackTrace();
dataObject.put("번호판유무", ""); }
dataObject.put("위반코드", "");
dataObject.put("위반종류", ""); System.out.println("substring....");
dataObject.put("정지선통과시", ""); dataObject.put("TEXT_SIZE", CmmnUtil.substringByBytes(fileCn, 0, 7));
dataObject.put("교차로선통과시", ""); dataObject.put("EQUIPMENT", CmmnUtil.substringByBytes(fileCn, 8, 12));
dataObject.put("영상프레임수", ""); dataObject.put("CAR_VELOCITY", CmmnUtil.substringByBytes(fileCn, 13, 15).replaceAll("^0+", "")); //차량속도
dataObject.put("신호등형태", ""); dataObject.put("CAR_TYPE", CmmnUtil.substringByBytes(fileCn, 16, 16)); //차종(미사용)
dataObject.put("진행형태", ""); dataObject.put("ROAD_CD", CmmnUtil.substringByBytes(fileCn, 17, 17)); //도로코드(미사용)
dataObject.put("신호등종류", ""); dataObject.put("CRDN_YMD", CmmnUtil.substringByBytes(fileCn, 18, 25));
dataObject.put("사진매수", ""); dataObject.put("CRDN_TM", CmmnUtil.substringByBytes(fileCn, 26, 31));
dataObject.put("plate", ""); dataObject.put("VHRNO", CmmnUtil.substringByBytes(fileCn, 32, 43).trim());
dataObject.put("carNo", ""); dataObject.put("MOSC_X", CmmnUtil.substringByBytes(fileCn, 44, 47).replaceAll("^0+", ""));
dataObject.put("movingImage1", ""); dataObject.put("MOSC_Y", CmmnUtil.substringByBytes(fileCn, 48, 51).replaceAll("^0+", ""));
dataObject.put("movingImage1", ""); dataObject.put("PLATE_WIDTH", CmmnUtil.substringByBytes(fileCn, 52, 55).replaceAll("^0+", "")); //번호판width
dataObject.put("movingImage1", ""); dataObject.put("PLATE_HEIGHT", CmmnUtil.substringByBytes(fileCn, 56, 59).replaceAll("^0+", "")); //번호판height
dataObject.put("movingImage1", ""); dataObject.put("PLATE_YN", CmmnUtil.substringByBytes(fileCn, 60, 60)); //번호판유무(미사용)
dataObject.put("movingImage1", ""); dataObject.put("CRDN_SE", CmmnUtil.substringByBytes(fileCn, 61, 61)); //위반구분(미사용)
dataObject.put("movingImage1", ""); dataObject.put("CRDN_TYPE", CmmnUtil.substringByBytes(fileCn, 62, 62)); //위반종류(미사용)
String gpsX = CmmnUtil.substringByBytes(fileCn, 63, 85).replaceAll("^0+", "").replaceAll("0+$", "");
String gpsY = CmmnUtil.substringByBytes(fileCn, 86, 108).replaceAll("^0+", "").replaceAll("0+$", "");
dataObject.put("GPS_X", gpsX.endsWith(".") ? gpsX + "0" : gpsX);
dataObject.put("GPS_Y", gpsY.endsWith(".") ? gpsY + "0" : gpsY);
String photoCnt = CmmnUtil.substringByBytes(fileCn, 109, 110);
dataObject.put("PHOTO_CNT", photoCnt.startsWith("0") ? photoCnt.substring(1,2) : photoCnt);
dataObject.put("TRAFFIC_LIGHT_FORM", CmmnUtil.substringByBytes(fileCn, 111, 111)); //신호등형태(미사용)
dataObject.put("PROGRESS_FORM", CmmnUtil.substringByBytes(fileCn, 112, 112)); //진행형태(미사용)
dataObject.put("TRAFFIC_LIGHT_TYPE", CmmnUtil.substringByBytes(fileCn, 113, 113)); //신호등종류(미사용)
dataObject.put("SOME", CmmnUtil.substringByBytes(fileCn, 113, 113)); //?(미사용)
String fileAreaText = fileCn0.substring(114);
Encoder encoder = Base64.getEncoder();
String jpgString = "";
String jpgName = "";
boolean jpgIn = false;
int jpgNum = 0;
for (int i = 0; i < fileAreaText.length(); i++) {
boolean jpgStart = (i != fileAreaText.length()-1) && (fileAreaText.charAt(i) == 0xFF && fileAreaText.charAt(i+1) == 0xD8);
boolean jpgEnd = (i != 0) && (fileAreaText.charAt(i-1) == 0xFF && fileAreaText.charAt(i) == 0xD9);
if(jpgStart) {
jpgName = "" + fileAreaText.charAt(i-6)+fileAreaText.charAt(i-5)+fileAreaText.charAt(i-4)
+ fileAreaText.charAt(i-3)+fileAreaText.charAt(i-2)+fileAreaText.charAt(i-1);
jpgIn = true;
}
if(jpgIn) {
jpgString += fileAreaText.charAt(i);
}
if(jpgIn && jpgEnd) {
jpgNum++;
jpgString = new String(encoder.encode(jpgString.getBytes(Charset.forName("ISO-8859-1"))));
if(jpgNum == 1){
dataObject.put("CAR_IMAGE", jpgString);
dataObject.put("CAR_IMAGE_NM", jpgName);
} else if(jpgNum == 2){
dataObject.put("PLATE_IMAGE", jpgString);
dataObject.put("PLATE_IMAGE_NM", jpgName);
} else {
dataObject.put("MOVING_IMAGE"+(jpgNum-2), jpgString);
dataObject.put("MOVING_IMAGE"+(jpgNum-2)+"_NM", jpgName);
}
jpgString = "";
jpgIn = false;
}
}
tempGroupSeq++;
dataObject.put("TEMP_GROUP_ID", tempGroupSeq);
dataObject.put("ENT_TYPE", "HITECOM");
dataObjectList.add(dataObject); dataObjectList.add(dataObject);
}); });

@ -91,7 +91,7 @@ public class Ino implements EquipmentEnterprise {
} }
dataObject.put("TEMP_GROUP_ID", tempGroupSeq); dataObject.put("TEMP_GROUP_ID", tempGroupSeq);
dataObject.put("ENT_TYPE", "INO");
dataObjectList.add(dataObject); dataObjectList.add(dataObject);
before = dataObject; before = dataObject;
}); });

@ -43,7 +43,7 @@ public class XitRecommend implements EquipmentEnterprise{
String crdnTiemstamp = fileNameSplit[0]; String crdnTiemstamp = fileNameSplit[0];
dataObject.put("CRDN_YMD", crdnTiemstamp.substring(0, 8)); dataObject.put("CRDN_YMD", crdnTiemstamp.substring(0, 8));
dataObject.put("CRDN_HM", crdnTiemstamp.substring(8, 14)); dataObject.put("CRDN_TM", crdnTiemstamp.substring(8, 14));
dataObject.put("ENT_CD", fileNameSplit[1]); dataObject.put("ENT_CD", fileNameSplit[1]);
dataObject.put("EQM_CD", fileNameSplit[2]); dataObject.put("EQM_CD", fileNameSplit[2]);

@ -26,6 +26,7 @@ import cokr.xit.fims.crdn.CrdnQuery;
import cokr.xit.fims.crdn.dao.CrdnInstMapper; import cokr.xit.fims.crdn.dao.CrdnInstMapper;
import cokr.xit.fims.crdn.dao.GlobalStngMapper; import cokr.xit.fims.crdn.dao.GlobalStngMapper;
import cokr.xit.fims.crdn.parsing.EquipmentEnterprise; import cokr.xit.fims.crdn.parsing.EquipmentEnterprise;
import cokr.xit.fims.crdn.parsing.HiteCom;
import cokr.xit.fims.crdn.parsing.Ino; import cokr.xit.fims.crdn.parsing.Ino;
import cokr.xit.fims.crdn.parsing.Knl; import cokr.xit.fims.crdn.parsing.Knl;
import cokr.xit.fims.crdn.service.CrdnService; import cokr.xit.fims.crdn.service.CrdnService;
@ -43,16 +44,18 @@ public class Crdn05Controller extends ApplicationController {
public class METHOD_URL { public class METHOD_URL {
public static final String public static final String
crackdownDataRegistrationMain = "/010/main.do", crackdownDataRegistrationMain = "/010/main.do",
getTodayCrdnDataList = "/010/list.do", getTodayCrdnDataList = "/010/list.do",
getFileRegistrationScreen = "/020/info.do", getFileRegistrationScreen = "/020/info.do",
getCrdnFileListFromEquipmentEnterprise = "/020/list.do", importFileFromServer = "/020/importFileFromServer",
removeLinkFile = "/020/remove.do", importFileFromClient = "/020/importFileFromClient",
createCrdnByLinkFile = "/020/create.do", getEquipmentFileInfoList = "/020/list.do",
removeLinkFile = "/020/remove.do",
getManualRegistrationScreen = "/030/info.do", createCrdnByLinkFile = "/020/create.do",
createCrdnDataByManual = "/030/create.do"
getManualRegistrationScreen = "/030/info.do",
createCrdnDataByManual = "/030/create.do"
; ;
} }
@ -114,19 +117,20 @@ public class Crdn05Controller extends ApplicationController {
return mav; return mav;
} }
/** . /** FTP .
* @param * @param
* @return * @return
*/ */
public ModelAndView getCrdnFileListFromEquipmentEnterprise(HttpServletRequest hReq) { public ModelAndView importFileFromServer(HttpServletRequest hReq) {
ModelAndView mav = new ModelAndView("jsonView"); ModelAndView mav = new ModelAndView("jsonView");
boolean saved = false;
String entType = hReq.getParameter("entType"); String entType = hReq.getParameter("entType");
EquipmentEnterprise enterprise = null; EquipmentEnterprise enterprise = null;
switch(entType){ switch(entType){
case "INO": enterprise = new Ino(); break; case "INO": enterprise = new Ino(); break;
case "KNL": enterprise = new Knl(); break; case "KNL": enterprise = new Knl(); break;
//case "": enterprise = new (); break; case "HITECOM": enterprise = new HiteCom(); break;
//case "": enterprise = new (); break; //case "": enterprise = new (); break;
//case "": enterprise = new (); break; //case "": enterprise = new (); break;
} }
@ -137,39 +141,115 @@ public class Crdn05Controller extends ApplicationController {
String downloadRoot = ""; //ftp나 usb에서 다운받는 파일 경로 String downloadRoot = ""; //ftp나 usb에서 다운받는 파일 경로
if(entType.equals("INO") || entType.equals("KNL")) { //ftp G클라우드
//ftp G클라우드 if(entType.equals("INO")) {
//RemoteSystemInfo rs = new RemoteSystemInfo();
//rs.setIp("211.119.124.9");
//rs.setId("xituser");
//rs.setPw("xituser!@");
//rs.setOsType("linux");
//String remoteWorkPath = File.separator + "applications"
// + File.separator + "tempForFTPTest"
// + File.separator + "ino"
// + File.separator;
downloadRoot = "files"+File.separator+"tempForIno";
}
if(entType.equals("KNL")) {
downloadRoot = "files"+File.separator+"tempForKnl";
}
if(entType.equals("HITECOM")) {
downloadRoot = "files"+File.separator+"tempForHitecom";
}
try {
//boolean result = FTPUtil.fileDown(rs, remoteWorkPath, downloadRoot);
} catch (Exception e) {
e.printStackTrace();
}
saved = true;
mav.addObject("saved", saved);
return mav;
}
/** () .
* @param
* @return
*/
public ModelAndView importFileFromClient(HttpServletRequest hReq, MultipartFile[] uploadFiles) {
ModelAndView mav = new ModelAndView("jsonView");
boolean saved = false;
String entType = hReq.getParameter("entType");
EquipmentEnterprise enterprise = null;
switch(entType){
case "INO": enterprise = new Ino(); break;
case "KNL": enterprise = new Knl(); break;
case "HITECOM": enterprise = new HiteCom(); break;
//case "": enterprise = new (); break;
//case "": enterprise = new (); break;
}
try {
if(entType.equals("INO")) { Stream<Path> fileList = null;
List<DataObject> dataObjectList = new ArrayList<>();
//RemoteSystemInfo rs = new RemoteSystemInfo(); String downloadRoot = ""; //ftp나 usb에서 다운받는 파일 경로
//rs.setIp("211.119.124.9");
//rs.setId("xituser");
//rs.setPw("xituser!@");
//rs.setOsType("linux");
//String remoteWorkPath = File.separator + "applications" if(entType.equals("INO")) {
// + File.separator + "tempForFTPTest" downloadRoot = "files"+File.separator+"tempForIno";
// + File.separator + "ino" }
// + File.separator; if(entType.equals("KNL")) {
downloadRoot = "files"+File.separator+"tempForKnl";
}
if(entType.equals("HITECOM")) {
downloadRoot = "files"+File.separator+"tempForHitecom";
}
downloadRoot = "files"+File.separator+"tempForIno";
}
if(entType.equals("KNL")) {
//TODO :
mav.addObject("saved", saved);
return mav;
}
downloadRoot = "files"+File.separator+"tempForKnl"; /**, .
} * @param
* @return
*/
public ModelAndView getEquipmentFileInfoList(HttpServletRequest hReq) {
ModelAndView mav = new ModelAndView("jsonView");
String entType = hReq.getParameter("entType");
EquipmentEnterprise enterprise = null;
switch(entType){
case "INO": enterprise = new Ino(); break;
case "KNL": enterprise = new Knl(); break;
case "HITECOM": enterprise = new HiteCom(); break;
//case "": enterprise = new (); break;
//case "": enterprise = new (); break;
}
//boolean result = FTPUtil.fileDown(rs, remoteWorkPath, downloadRoot);
} catch (Exception e) { Stream<Path> fileList = null;
e.printStackTrace(); List<DataObject> dataObjectList = new ArrayList<>();
String downloadRoot = "";
if(entType.equals("INO") || entType.equals("KNL")) {
if(entType.equals("INO")) {
downloadRoot = "files"+File.separator+"tempForIno";
}
if(entType.equals("KNL")) {
downloadRoot = "files"+File.separator+"tempForKnl";
} }
}
if(entType.equals("HITECOM")) {
downloadRoot = "files"+File.separator+"tempForHitecom";
} }
try { try {

@ -216,6 +216,30 @@ public class BpvController {
return super.getFileRegistrationScreen(hReq); return super.getFileRegistrationScreen(hReq);
} }
@Override
@RequestMapping(name="전용차로과태료업무 단속연계파일 가져오기(FTP)", value=METHOD_URL.importFileFromServer)
public ModelAndView importFileFromServer(HttpServletRequest hReq) {
return super.importFileFromServer(hReq);
}
@Override
@RequestMapping(name="전용차로과태료업무 단속연계파일 가져오기(파일업로드)", value=METHOD_URL.importFileFromClient)
public ModelAndView importFileFromClient(HttpServletRequest hReq, MultipartFile[] uploadFiles) {
return super.importFileFromClient(hReq, uploadFiles);
}
@Override
@RequestMapping(name="전용차로과태료업무 장비업체 단속파일 목록 조회", value=METHOD_URL.getEquipmentFileInfoList)
public ModelAndView getEquipmentFileInfoList(HttpServletRequest hReq) {
return super.getEquipmentFileInfoList(hReq);
}
@Override
@RequestMapping(name="전용차로과태료업무 장비업체 단속파일 삭제", value=METHOD_URL.removeLinkFile)
public ModelAndView removeLinkFile(HttpServletRequest hReq) {
return super.removeLinkFile(hReq);
}
@Override @Override
@RequestMapping(name="전용차로과태료업무 단속자료 수기 등록 화면", value=METHOD_URL.getManualRegistrationScreen) @RequestMapping(name="전용차로과태료업무 단속자료 수기 등록 화면", value=METHOD_URL.getManualRegistrationScreen)
public ModelAndView getManualRegistrationScreen(HttpServletRequest hReq) { public ModelAndView getManualRegistrationScreen(HttpServletRequest hReq) {

@ -3,7 +3,6 @@ package cokr.xit.fims.task.web;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
@ -243,9 +242,21 @@ public class DpvController {
} }
@Override @Override
@RequestMapping(name="장애인과태료업무 장비업체 단속파일 목록 조회", value=METHOD_URL.getCrdnFileListFromEquipmentEnterprise) @RequestMapping(name="장애인과태료업무 단속연계파일 가져오기(FTP)", value=METHOD_URL.importFileFromServer)
public ModelAndView getCrdnFileListFromEquipmentEnterprise(HttpServletRequest hReq) { public ModelAndView importFileFromServer(HttpServletRequest hReq) {
return super.getCrdnFileListFromEquipmentEnterprise(hReq); return super.importFileFromServer(hReq);
}
@Override
@RequestMapping(name="전용차로과태료업무 단속연계파일 가져오기(파일업로드)", value=METHOD_URL.importFileFromClient)
public ModelAndView importFileFromClient(HttpServletRequest hReq, MultipartFile[] uploadFiles) {
return super.importFileFromClient(hReq, uploadFiles);
}
@Override
@RequestMapping(name="장애인과태료업무 장비업체 단속파일 목록 조회", value=METHOD_URL.getEquipmentFileInfoList)
public ModelAndView getEquipmentFileInfoList(HttpServletRequest hReq) {
return super.getEquipmentFileInfoList(hReq);
} }
@Override @Override
@ -255,7 +266,7 @@ public class DpvController {
} }
@Override @Override
@PostMapping(name="장애인과태료업무 장비업체 단속파일로 단속자료 생성", value=METHOD_URL.createCrdnByLinkFile) @RequestMapping(name="장애인과태료업무 장비업체 단속파일로 단속자료 생성", value=METHOD_URL.createCrdnByLinkFile)
public ModelAndView createCrdnByLinkFile(String taskSeCd, String entType, String[] linkFileInfos) { public ModelAndView createCrdnByLinkFile(String taskSeCd, String entType, String[] linkFileInfos) {
return super.createCrdnByLinkFile(taskSeCd, entType, linkFileInfos); return super.createCrdnByLinkFile(taskSeCd, entType, linkFileInfos);
} }
@ -483,7 +494,7 @@ public class DpvController {
} }
@Controller @Controller
@RequestMapping(name="장애인과태료업무 발송,반송 관리_계고장 발송", value=CLASS_URL+Sndb01Controller.CLASS_URL) @RequestMapping(name="장애인과태료업무 발송, 반송 관리", value=CLASS_URL+Sndb01Controller.CLASS_URL)
class Sndb01Controller extends cokr.xit.fims.sndb.web.Sndb01Controller { class Sndb01Controller extends cokr.xit.fims.sndb.web.Sndb01Controller {
@Override @Override
@ -492,24 +503,12 @@ public class DpvController {
return super.getWrngSndngTrgtList(req); return super.getWrngSndngTrgtList(req);
} }
@Override
@RequestMapping(name="장애인과태료업무 계고장 발송 대상 등록", value=METHOD_URL.getWrngSndngTrgtInfo)
public ModelAndView getWrngSndngTrgtInfo(SndbQuery req) {
return super.getWrngSndngTrgtInfo(req);
}
@Override @Override
@RequestMapping(name="장애인과태료업무 계고장 발송 현황 목록 조회", value=METHOD_URL.getWrngSndngList) @RequestMapping(name="장애인과태료업무 계고장 발송 현황 목록 조회", value=METHOD_URL.getWrngSndngList)
public ModelAndView getWrngSndngList(SndbQuery req) { public ModelAndView getWrngSndngList(SndbQuery req) {
return super.getWrngSndngList(req); return super.getWrngSndngList(req);
} }
}
@Controller
@RequestMapping(name="장애인과태료업무 발송,반송 관리_사전통보 발송", value=CLASS_URL+Sndb02Controller.CLASS_URL)
class Sndb02Controller extends cokr.xit.fims.sndb.web.Sndb02Controller {
@Override @Override
@RequestMapping(name="장애인과태료업무 사전통보 발송 대상 목록 조회", value=METHOD_URL.getAdvntceSndngTrgtList) @RequestMapping(name="장애인과태료업무 사전통보 발송 대상 목록 조회", value=METHOD_URL.getAdvntceSndngTrgtList)
public ModelAndView getAdvntceSndngTrgtList(SndbQuery req) { public ModelAndView getAdvntceSndngTrgtList(SndbQuery req) {
@ -522,12 +521,6 @@ public class DpvController {
return super.getAdvntceSndngList(req); return super.getAdvntceSndngList(req);
} }
}
@Controller
@RequestMapping(name="장애인과태료업무 발송,반송 관리_고지서 발송", value=CLASS_URL+Sndb03Controller.CLASS_URL)
class Sndb03Controller extends cokr.xit.fims.sndb.web.Sndb03Controller {
@Override @Override
@RequestMapping(name="장애인과태료업무 고지서 발송 현황 목록 조회", value=METHOD_URL.getNhtSndngList) @RequestMapping(name="장애인과태료업무 고지서 발송 현황 목록 조회", value=METHOD_URL.getNhtSndngList)
public ModelAndView getNhtSndngList(SndbQuery req) { public ModelAndView getNhtSndngList(SndbQuery req) {
@ -536,12 +529,6 @@ public class DpvController {
} }
@Controller
@RequestMapping(name="장애인과태료업무 발송,반송 관리_반송, 공시송달", value=CLASS_URL+Sndb04Controller.CLASS_URL)
class Sndb04Controller extends cokr.xit.fims.sndb.web.Sndb04Controller {
}
@Controller @Controller
@RequestMapping(name="장애인과태료업무 업무지원_통합조회", value=CLASS_URL+"/sprt/sprt01") @RequestMapping(name="장애인과태료업무 업무지원_통합조회", value=CLASS_URL+"/sprt/sprt01")
class Sprt01Controller extends cokr.xit.fims.sprt.web.Sprt01Controller {} class Sprt01Controller extends cokr.xit.fims.sprt.web.Sprt01Controller {}

@ -3,7 +3,6 @@ package cokr.xit.fims.task.web;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
@ -219,9 +218,21 @@ public class EcaController {
} }
@Override @Override
@RequestMapping(name="전기차과태료업무 장비업체 단속파일 목록 조회", value=METHOD_URL.getCrdnFileListFromEquipmentEnterprise) @RequestMapping(name="전기차과태료업무 단속연계파일 가져오기(FTP)", value=METHOD_URL.importFileFromServer)
public ModelAndView getCrdnFileListFromEquipmentEnterprise(HttpServletRequest hReq) { public ModelAndView importFileFromServer(HttpServletRequest hReq) {
return super.getCrdnFileListFromEquipmentEnterprise(hReq); return super.importFileFromServer(hReq);
}
@Override
@RequestMapping(name="전용차로과태료업무 단속연계파일 가져오기(파일업로드)", value=METHOD_URL.importFileFromClient)
public ModelAndView importFileFromClient(HttpServletRequest hReq, MultipartFile[] uploadFiles) {
return super.importFileFromClient(hReq, uploadFiles);
}
@Override
@RequestMapping(name="전기차과태료업무 장비업체 단속파일 목록 조회", value=METHOD_URL.getEquipmentFileInfoList)
public ModelAndView getEquipmentFileInfoList(HttpServletRequest hReq) {
return super.getEquipmentFileInfoList(hReq);
} }
@Override @Override
@ -231,7 +242,7 @@ public class EcaController {
} }
@Override @Override
@PostMapping(name="전기차과태료업무 장비업체 단속파일로 단속자료 생성", value=METHOD_URL.createCrdnByLinkFile) @RequestMapping(name="전기차과태료업무 장비업체 단속파일로 단속자료 생성", value=METHOD_URL.createCrdnByLinkFile)
public ModelAndView createCrdnByLinkFile(String taskSeCd, String entType, String[] linkFileInfos) { public ModelAndView createCrdnByLinkFile(String taskSeCd, String entType, String[] linkFileInfos) {
return super.createCrdnByLinkFile(taskSeCd, entType, linkFileInfos); return super.createCrdnByLinkFile(taskSeCd, entType, linkFileInfos);
} }

@ -229,6 +229,30 @@ public class PvsController {
return super.getFileRegistrationScreen(hReq); return super.getFileRegistrationScreen(hReq);
} }
@Override
@RequestMapping(name="주정차과태료업무 단속연계파일 가져오기(FTP)", value=METHOD_URL.importFileFromServer)
public ModelAndView importFileFromServer(HttpServletRequest hReq) {
return super.importFileFromServer(hReq);
}
@Override
@RequestMapping(name="전용차로과태료업무 단속연계파일 가져오기(파일업로드)", value=METHOD_URL.importFileFromClient)
public ModelAndView importFileFromClient(HttpServletRequest hReq, MultipartFile[] uploadFiles) {
return super.importFileFromClient(hReq, uploadFiles);
}
@Override
@RequestMapping(name="주정차과태료업무 장비업체 단속파일 목록 조회", value=METHOD_URL.getEquipmentFileInfoList)
public ModelAndView getEquipmentFileInfoList(HttpServletRequest hReq) {
return super.getEquipmentFileInfoList(hReq);
}
@Override
@RequestMapping(name="주정차과태료업무 장비업체 단속파일 삭제", value=METHOD_URL.removeLinkFile)
public ModelAndView removeLinkFile(HttpServletRequest hReq) {
return super.removeLinkFile(hReq);
}
@Override @Override
@RequestMapping(name="주정차과태료업무 단속자료 수기 등록 화면", value=METHOD_URL.getManualRegistrationScreen) @RequestMapping(name="주정차과태료업무 단속자료 수기 등록 화면", value=METHOD_URL.getManualRegistrationScreen)
public ModelAndView getManualRegistrationScreen(HttpServletRequest hReq) { public ModelAndView getManualRegistrationScreen(HttpServletRequest hReq) {

@ -51,9 +51,9 @@
<input type="file" id="localFile--${pageName}" name="localFile" /> <input type="file" id="localFile--${pageName}" name="localFile" />
</c:if> </c:if>
<span class="justify-content-end float-end me-4"> <span class="justify-content-end float-end me-4">
<c:if test="${taskSeCd == 'ECA' or taskSeCd == 'DPV'}">
<button type="button" id="btnSearch--${pageName}" class="btn btn-primary">조회</button> <button type="button" id="btnSearch--${pageName}" class="btn btn-primary">조회</button>
</c:if>
<c:if test="${taskSeCd == 'PVS' or taskSeCd == 'BPV' or taskSeCd == '미세먼지'}"> <c:if test="${taskSeCd == 'PVS' or taskSeCd == 'BPV' or taskSeCd == '미세먼지'}">
<button type="button" id="btnFileUpload--${pageName}" class="btn btn-primary">등록</button> <button type="button" id="btnFileUpload--${pageName}" class="btn btn-primary">등록</button>
</c:if> </c:if>
@ -65,13 +65,13 @@
</div> </div>
</div> </div>
<div class="d-flex flex-row justify-content-evenly"> <div class="d-flex flex-row justify-content-evenly">
<div class="card my-4 px-4" style="max-width:700px;height:600px;"> <div class="card my-4 px-4" style="min-width:700px;max-width:700px;height:600px;">
<form id="frmGrid--${pageName}"> <form id="frmGrid--${pageName}">
<div> <div>
<span class="container-page-btn"> <span class="container-page-btn">
<div class="d-flex flex-row justify-content-between"> <div class="d-flex flex-row justify-content-between">
<label id="crdnPaging--${pageName}PagingInfo" class="dataTables_info" role="status" aria-live="polite"></label> <label id="parsedInfoPaging--${pageName}PagingInfo" class="dataTables_info" role="status" aria-live="polite"></label>
<ul id="crdnPaging--${pageName}" class="pagination pagination-primary"> <ul id="parsedInfoPaging--${pageName}" class="pagination pagination-primary">
</ul> </ul>
</div> </div>
<span class="container-window-btn-right"> <span class="container-window-btn-right">
@ -82,67 +82,120 @@
<div id="DataTables_Table_0_wrapper--${pageName}" class="dataTables_wrapper dt-bootstrap5 no-footer"> <div id="DataTables_Table_0_wrapper--${pageName}" class="dataTables_wrapper dt-bootstrap5 no-footer">
<div id="table-responsive--${pageName}" class="table-responsive" <div id="table-responsive--${pageName}" class="table-responsive"
style="overflow-x: scroll;height:560px;overflow-y: scroll;"> style="overflow-x: scroll;height:560px;overflow-y: scroll;">
<table id="DataTables_Table_0--${pageName}" <span class="ino" hidden>
class="datatables-ajax table table-bordered dataTable no-footer"> <table
<thead class="sticky-thead"> class="datatables-ajax table table-bordered dataTable no-footer">
<tr id="crdnTheadTr--${pageName}"> <thead class="sticky-thead">
<th style="min-width: 80px;" title="더블클릭시 축소/확대 됩니다." <tr id="parsedInfoTheadTr--${pageName}">
class="downsize" ondblclick="fnDownsizeToggle(this);" href="#"> <th style="min-width: 80px;">단속자료</th>
파일명 <i class='bx bx-expand'></i> <th style="min-width: 80px;" title="더블클릭시 축소/확대 됩니다."
</th> class="downsize" ondblclick="fnDownsizeToggle(this);" href="#">
<th style="min-width: 80px;">타임스탬프</th> 파일명 <i class='bx bx-expand'></i>
<th style="min-width: 80px;">사이즈</th> </th>
<th style="min-width: 80px;">단속자료</th> <th style="min-width: 80px;">타임스탬프</th>
<th style="min-width: 80px;">디바이스ID</th> <th style="min-width: 80px;">사이즈</th>
<th style="min-width: 80px;">날짜/시간</th> <th style="min-width: 80px;">디바이스ID</th>
<th style="min-width: 80px;">차량번호</th> <th style="min-width: 80px;">날짜/시간</th>
<th style="min-width: 80px;">총사진갯수</th> <th style="min-width: 80px;">차량번호</th>
<th style="min-width: 80px;">사진시퀀스</th> <th style="min-width: 80px;">총사진갯수</th>
<th style="min-width: 80px;">위치좌표x</th> <th style="min-width: 80px;">사진시퀀스</th>
<th style="min-width: 80px;">위치좌표y</th> <th style="min-width: 80px;">위치좌표x</th>
<th style="min-width: 80px;">입력구분</th> <th style="min-width: 80px;">위치좌표y</th>
<th style="min-width: 80px;">위반장소</th> <th style="min-width: 80px;">입력구분</th>
<th style="min-width: 80px;">위반장소(주소)</th> <th style="min-width: 80px;">위반장소</th>
<th style="min-width: 80px;">법정동</th> <th style="min-width: 80px;">위반장소(주소)</th>
<th style="min-width: 80px;">파일확장자</th> <th style="min-width: 80px;">법정동</th>
</tr> <th style="min-width: 80px;">파일확장자</th>
</thead> </tr>
<tbody id="crdnTbody--${pageName}"></tbody> </thead>
<template id="crdnRow--${pageName}"> <tbody></tbody>
<tr data-key="{FILE_NAME}"> <template class="found">
<td onclick="{onclick}" ondblclick="{ondblclick}" <tr data-key="{FILE_NAME}">
title="{FILE_NAME}" <td onclick="{onclick}" ondblclick="{ondblclick}" class="text-center">{TEMP_GROUP_ID}</td>
class="text-start text-truncate max-w-th">{FILE_NAME}</td> <td onclick="{onclick}" ondblclick="{ondblclick}"
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-center">{TIMESTAMP}</td> title="{FILE_NAME}"
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-center">{FILE_SIZE}</td> class="text-start text-truncate max-w-th">{FILE_NAME}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-center">{TEMP_GROUP_ID}</td> <td onclick="{onclick}" ondblclick="{ondblclick}" class="text-center">{TIMESTAMP}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-center">{DEVICE_ID}</td> <td onclick="{onclick}" ondblclick="{ondblclick}" class="text-center">{FILE_SIZE}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-start">{CRDN_YMD_TM}</td> <td onclick="{onclick}" ondblclick="{ondblclick}" class="text-center">{DEVICE_ID}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-start">{VHRNO}</td> <td onclick="{onclick}" ondblclick="{ondblclick}" class="text-start">{CRDN_YMD_TM}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-start">{PHOTO_CNT}</td> <td onclick="{onclick}" ondblclick="{ondblclick}" class="text-start">{VHRNO}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-start">{PHOTO_SEQ_NM}</td> <td onclick="{onclick}" ondblclick="{ondblclick}" class="text-end">{PHOTO_CNT}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-start">{LOCATION_X}</td> <td onclick="{onclick}" ondblclick="{ondblclick}" class="text-start">{PHOTO_SEQ_NM}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-start">{LOCATION_Y}</td> <td onclick="{onclick}" ondblclick="{ondblclick}" class="text-end">{LOCATION_X}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-start">{INPUT_SE}</td> <td onclick="{onclick}" ondblclick="{ondblclick}" class="text-end">{LOCATION_Y}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-start">{CRDN_PLC}</td> <td onclick="{onclick}" ondblclick="{ondblclick}" class="text-start">{INPUT_SE}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-start">{CRDN_ADDRESS}</td> <td onclick="{onclick}" ondblclick="{ondblclick}" class="text-start">{CRDN_PLC}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-start">{CRDN_STDG_NM}</td> <td onclick="{onclick}" ondblclick="{ondblclick}" class="text-start">{CRDN_ADDRESS}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-start">{EXTENSION}</td> <td onclick="{onclick}" ondblclick="{ondblclick}" class="text-start">{CRDN_STDG_NM}</td>
</tr> <td onclick="{onclick}" ondblclick="{ondblclick}" class="text-start">{EXTENSION}</td>
</template> </tr>
<template id="crdnNotFound--${pageName}"> </template>
<tr> <template class="notFound">
<td valign="top" colspan="17" class="dataTables_empty text-center">정보를 찾지 못했습니다.</td> <tr>
</tr> <td valign="top" colspan="17" class="dataTables_empty text-center">정보를 찾지 못했습니다.</td>
</template> </tr>
</table> </template>
</table>
</span>
<span class="hitecom" hidden>
<table
class="datatables-ajax table table-bordered dataTable no-footer">
<thead class="sticky-thead">
<tr id="parsedInfoTheadTr--${pageName}">
<th style="min-width: 80px;">단속자료</th>
<th style="min-width: 80px;" title="더블클릭시 축소/확대 됩니다."
class="downsize" ondblclick="fnDownsizeToggle(this);" href="#">
파일명 <i class='bx bx-expand'></i>
</th>
<th style="min-width: 80px;">장비번호</th>
<th style="min-width: 80px;">차량속도</th>
<th style="min-width: 80px;">날짜</th>
<th style="min-width: 80px;">시간</th>
<th style="min-width: 80px;">차량번호</th>
<th style="min-width: 80px;">번호판위치x</th>
<th style="min-width: 80px;">번호판위치y</th>
<th style="min-width: 80px;">번호판width</th>
<th style="min-width: 80px;">번호판height</th>
<th style="min-width: 80px;">위치좌표x</th>
<th style="min-width: 80px;">위치좌표y</th>
<th style="min-width: 80px;">총사진갯수</th>
</tr>
</thead>
<tbody></tbody>
<template class="found">
<tr data-key="{FILE_NAME}">
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-center">{TEMP_GROUP_ID}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}"
title="{FILE_NAME}"
class="text-start text-truncate max-w-th">{FILE_NAME}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-center">{EQUIPMENT}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-center">{CAR_VELOCITY}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-start">{CRDN_YMD}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-start">{CRDN_TM}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-start">{VHRNO}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-end">{MOSC_X}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-end">{MOSC_Y}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-end">{PLATE_WIDTH}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-end">{PLATE_HEIGHT}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-end">{GPS_X}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-end">{GPS_Y}</td>
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-end">{PHOTO_CNT}</td>
</tr>
</template>
<template class="notFound">
<tr>
<td valign="top" colspan="17" class="dataTables_empty text-center">정보를 찾지 못했습니다.</td>
</tr>
</template>
</table>
</span>
</div> </div>
</div> </div>
</div> </div>
</form> </form>
</div> </div>
<div class="card my-4 px-4 justify-content-center" style="width:600px;height:600px;"> <div id="imageArea--${pageName}" class="card my-4 px-4 justify-content-center" style="width:600px;height:600px;">
<img id="img--${pageName}" src="" style="object-fit:contain;" />
</div> </div>
<div class="card my-4 px-2" style="width:120px;height:600px;min-width:120px;"> <div class="card my-4 px-2" style="width:120px;height:600px;min-width:120px;">
@ -163,30 +216,34 @@ pageObject["${pageName}"] = {};
$(document).ready(function(){ $(document).ready(function(){
var $P = pageObject["${pageName}"]; var $P = pageObject["${pageName}"];
$P.entType = "";
$P.tempGroup = {}; $P.tempGroup = {};
/************************************************************************** /**************************************************************************
* DatasetControl * DatasetControl
**************************************************************************/ **************************************************************************/
$P.crdnControl = new DatasetControl({ $P.parsedInfoControl = new DatasetControl({
urls : { }, urls : { },
keymapper : info => info ? info.FILE_NAME : "", keymapper : info => info ? info.FILE_NAME : "",
dataGetter : obj => obj["List"], dataGetter : obj => obj["List"],
formats: { formats: {
CRDN_YMD_TM : datetimeFormat CRDN_YMD_TM : datetimeFormat,
CRDN_YMD : dateFormat,
CRDN_TM : timeFormat
} }
}); });
/************************************************************************** /**************************************************************************
* DatasetControl.on * DatasetControl.on
**************************************************************************/ **************************************************************************/
$P.crdnControl.onDatasetChange = (obj) => { $P.parsedInfoControl.onDatasetChange = (obj) => {
$P.renderCrdnList(obj["Total"]);
$P.renderParsedInfoList(obj["Total"], $P.entType);
$("#crdnPaging--${pageName}").setPagingInfo({ $("#parsedInfoPaging--${pageName}").setPagingInfo({
list: $P.crdnControl.dataset, list: $P.parsedInfoControl.dataset,
prefix: "crdnPaging--${pageName}", prefix: "parsedInfoPaging--${pageName}",
start: obj["Start"], start: obj["Start"],
totalSize: obj["Total"], totalSize: obj["Total"],
fetchSize: obj["Fetch"], fetchSize: obj["Fetch"],
@ -194,15 +251,32 @@ $(document).ready(function(){
}); });
}; };
$P.crdnControl.onCurrentChange = (item) => { $P.parsedInfoControl.onCurrentChange = (item) => {
$("#imageArea--${pageName}").html("");
if(item && item.data){ if(item && item.data){
var dataKey = item.data.FILE_NAME; var dataKey = item.data.FILE_NAME;
$("#crdnTbody--${pageName}").setCurrentRow(dataKey);
var url = item.data.FILE_PATH; if($P.entType != ""){
$("#img--${pageName}").attr("src",url); $("#table-responsive--${pageName}").find("."+$P.entType).find("tbody").setCurrentRow(dataKey);
} else { }
$("#img--${pageName}").attr("src","");
if(item.data.ENT_TYPE == "INO"){
var src = item.data.FILE_PATH;
$P.renderImage(src);
} else if(item.data.ENT_TYPE == "HITECOM"){
var srcArr = [
"data:image/jpg;base64,"+item.data.CAR_IMAGE,
"data:image/jpg;base64,"+item.data.PLATE_IMAGE
];
for(var i=1; i <= item.data.PHOTO_CNT-2; i++){
srcArr.push("data:image/jpg;base64," + item.data["MOVING_IMAGE"+i])
}
$P.renderImage(srcArr);
}
} }
}; };
@ -210,8 +284,9 @@ $(document).ready(function(){
* pageObject.function * pageObject.function
**************************************************************************/ **************************************************************************/
$P.searchFileList = () => { //ftp체크
if($("#entType--${pageName}").val() == ""){ $P.checkFTP() = () => {
if($("#entType--${pageName}").val() == ""){
dialog.alert("장비업체를 선택하세요."); dialog.alert("장비업체를 선택하세요.");
return; return;
} }
@ -227,24 +302,27 @@ $(document).ready(function(){
} }
ajax.post({ ajax.post({
url : wctx.url("/${taskSeCd}/crdn/crdn05/020/list.do"), url : wctx.url("/${taskSeCd}/crdn/crdn05/020/importFileFromServer.do"),
data : { entType : $("#entType--${pageName}").val() }, data : { entType : $("#entType--${pageName}").val() },
success : (resp) => { success : (resp) => {
$("#img--${pageName}").attr("src",""); if(resp.saved){
$P.crdnControl.setData(resp); $P.searchFileList();
}
} }
}); });
}
}
//로컬파일업로드
$P.uploadLocalFile = () => { $P.uploadLocalFile = () => {
if($("#entType--${pageName}").val() == ""){ if($("#entType--${pageName}").val() == ""){
dialog.alert("장비업체를 선택하세요."); dialog.alert("장비업체를 선택하세요.");
return; return;
} }
if($("#entType--${pageName}").val() != "가산정보통신" if($("#entType--${pageName}").val() != "GASAN"
&& $("#entType--${pageName}").val() != "엘리소프트" && $("#entType--${pageName}").val() != "ELISOFT"
&& $("#entType--${pageName}").val() != "하이테콤" && $("#entType--${pageName}").val() != "HITECOM"
&& $("#entType--${pageName}").val() != "XIT" && $("#entType--${pageName}").val() != "XIT"
){ ){
dialog.alert("해당 과태료 업무와 관련된 장비업체가 아닙니다."); dialog.alert("해당 과태료 업무와 관련된 장비업체가 아닙니다.");
@ -258,31 +336,103 @@ $(document).ready(function(){
dialog.alert("주정차,전용차로,미세먼지 과태료 파일 등록 기능은 서비스 준비 중입니다."); dialog.alert("주정차,전용차로,미세먼지 과태료 파일 등록 기능은 서비스 준비 중입니다.");
return; return;
ajax.post({
url : wctx.url("/${taskSeCd}/crdn/crdn05/020/importFileFromClient.do"),
data : { entType : $("#entType--${pageName}").val() },
success : (resp) => {
if(resp.saved){
$P.searchFileList();
}
}
});
}
//서버에 등록된 파일 조회
$P.searchFileList = () => {
$P.parsedInfoControl.setData([]);
if($("#entType--${pageName}").val() == "INO"){
$P.entType = "ino";
} else if($("#entType--${pageName}").val() == "HITECOM"){
$P.entType = "hitecom";
} else {
$P.entType = "";
}
$("#table-responsive--${pageName}").find("span").attr("hidden","hidden");
$("#table-responsive--${pageName}").find("."+$P.entType).removeAttr("hidden");
ajax.post({
url : wctx.url("/${taskSeCd}/crdn/crdn05/020/list.do"),
data : { entType : $("#entType--${pageName}").val() },
success : (resp) => {
$P.parsedInfoControl.setData(resp);
}
});
} }
$P.renderCrdnList = (total) => { //테이블 렌더링
var crdnList = $P.crdnControl.dataset; $P.renderParsedInfoList = (total, entType) => {
var empty = crdnList.empty; if(entType != ""){
var notFound = [document.getElementById("crdnNotFound--${pageName}").innerHTML]; var parsedInfoList = $P.parsedInfoControl.dataset;
var found = document.getElementById("crdnRow--${pageName}").innerHTML; var empty = parsedInfoList.empty;
var replacer = (str, dataItem) => str var notFound = [$("#table-responsive--${pageName}").find("."+entType).find("template.notFound")[0].innerHTML];
.replace(/{onclick}/gi, "pageObject['${pageName}'].clickCrdnList('" + dataItem.getValue("FILE_NAME") + "');"); var found = $("#table-responsive--${pageName}").find("."+entType).find("template.found")[0].innerHTML;
var replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].clickParsedInfoList('" + dataItem.getValue("FILE_NAME") + "');");
var trs = empty ? notFound : crdnList.inStrings(found,replacer); var trs = empty ? notFound : parsedInfoList.inStrings(found,replacer);
$("#crdnTbody--${pageName}").html(trs.join()); $("#table-responsive--${pageName}").find("."+entType).find("tbody").html(trs.join());
if(!empty){ if(!empty){
fnDownsizeCheck(document.getElementById("DataTables_Table_0--${pageName}")); fnDownsizeCheck($("#table-responsive--${pageName}").find("."+entType).find("table")[0]);
}
} }
} }
$P.clickCrdnList = (dataKey) => { //사진 표시
$P.renderImage = (src) => {
if(Array.isArray(src)){
var div = document.createElement("div");
div.style["margin-top"] = "20px";
div.style["margin-bottom"] = "20px";
div.style["overflow-y"] = "scroll";
for(var i=0; i < src.length; i++){
var span = document.createElement("span");
span.style["max-width"] = "260px";
span.style["max-height"] = "260px";
var img = document.createElement("img");
img.style["object-fit"] = "contain";
img.style["max-width"] = "inherit";
img.style["max-height"] = "inherit";
img.src = src[i];
span.appendChild(img);
div.appendChild(span);
}
$("#imageArea--${pageName}").append(div);
} else {
var img = document.createElement("img");
img.style["object-fit"] = "contain";
img.src = src;
$("#imageArea--${pageName}").append(img);
}
}
$P.clickParsedInfoList = (dataKey) => {
if(dataKey == ""){ if(dataKey == ""){
return; return;
} }
$P.crdnControl.setCurrent(dataKey); $P.parsedInfoControl.setCurrent(dataKey);
}; };
$P.createCrdn = () => { $P.createCrdn = () => {
@ -295,7 +445,7 @@ $(document).ready(function(){
var firstGroupKey = Object.keys($P.tempGroup)[0]; var firstGroupKey = Object.keys($P.tempGroup)[0];
var formData = new FormData(document.getElementById("frmMultipart--${pageName}")); var formData = new FormData(document.getElementById("frmMultipart--${pageName}"));
formData.append("taskSeCd", "${taskSeCd}"); formData.append("taskSeCd", "${taskSeCd}");
formData.append("entType", $("#entType--${pageName}").val()); formData.append("entType", $P.entType);
for(var i=0; i<$P.tempGroup[firstGroupKey].length; i++){ for(var i=0; i<$P.tempGroup[firstGroupKey].length; i++){
formData.append("linkFileInfos", JSON.stringify($P.tempGroup[firstGroupKey][i])); formData.append("linkFileInfos", JSON.stringify($P.tempGroup[firstGroupKey][i]));
} }
@ -328,7 +478,7 @@ $(document).ready(function(){
}; };
$P.deleteFile = () => { $P.deleteFile = () => {
var current = $P.crdnControl.getCurrent(); var current = $P.parsedInfoControl.getCurrent();
if(current == null) return; if(current == null) return;
var fileName = current.FILE_NAME; var fileName = current.FILE_NAME;
@ -336,7 +486,7 @@ $(document).ready(function(){
ajax.get({ ajax.get({
url : wctx.url("/${taskSeCd}/crdn/crdn05/020/remove.do"), url : wctx.url("/${taskSeCd}/crdn/crdn05/020/remove.do"),
data : { data : {
entType : $("#entType--${pageName}").val(), entType : $P.entType,
fileName : fileName fileName : fileName
}, },
success : (resp) => { success : (resp) => {
@ -348,44 +498,52 @@ $(document).ready(function(){
} }
$P.removeCallback = (removedFileName) => { $P.removeCallback = (removedFileName) => {
$P.crdnControl.dataset.remove(removedFileName); $P.parsedInfoControl.dataset.remove(removedFileName);
$P.removeTableRow(removedFileName); $P.removeTableRow(removedFileName);
} }
$P.removeTableRow = (removedFileName) => { $P.removeTableRow = (removedFileName) => {
var fileListTable = document.getElementById("DataTables_Table_0--${pageName}"); if($P.entType != ""){
var fileListTable = $("#table-responsive--${pageName}").find("."+$P.entType).find("table");
var targetArr = [];
if(Array.isArray(removedFileName)){ var targetArr = [];
targetArr = removedFileName; if(Array.isArray(removedFileName)){
} else { targetArr = removedFileName;
targetArr = [removedFileName]; } else {
} targetArr = [removedFileName];
}
for(var i = 0; i < targetArr.length; i++){ for(var i = 0; i < targetArr.length; i++){
var target = targetArr[i]; var target = targetArr[i];
var tr = $(fileListTable).find("tbody").find("tr[data-key='"+target+"']"); var tr = $(fileListTable).find("tbody").find("tr[data-key='"+target+"']");
var trIndex = $(fileListTable).find("tbody tr").index(tr); var trIndex = $(fileListTable).find("tbody tr").index(tr);
fileListTable.deleteRow(trIndex+1); fileListTable.deleteRow(trIndex+1);
}
} }
} }
/************************************************************************** /**************************************************************************
* element.on * element.on
**************************************************************************/ **************************************************************************/
$("#btnSearch--${pageName}").on("click", function(){ $P.searchFileList(); }); $("#btnSearch--${pageName}").on("click", function(){ $P.checkFTP(); });
$("#btnFileUpload--${pageName}").on("click", function(){ $P.uploadLocalFile(); }); $("#btnFileUpload--${pageName}").on("click", function(){ $P.uploadLocalFile(); });
$("#btnInsertCrdn--${pageName}").on("click", function(){ $("#btnInsertCrdn--${pageName}").on("click", function(){
$P.tempGroup = Object.groupBy($P.crdnControl.dataset.getDataset(), ({ TEMP_GROUP_ID }) => "temp"+TEMP_GROUP_ID); $P.tempGroup = Object.groupBy($P.parsedInfoControl.dataset.getDataset(), ({ TEMP_GROUP_ID }) => "temp"+TEMP_GROUP_ID);
if($.isEmptyObject($P.tempGroup)){
alert("처리할 자료가 없습니다.");
return;
}
$P.createCrdn(); $P.createCrdn();
}); });
$("#btnDelete--${pageName}").on("click", function(){ $P.deleteFile(); }); $("#btnDelete--${pageName}").on("click", function(){ $P.deleteFile(); });
$P.crdnControl.setData([]); $P.parsedInfoControl.setData([]);
}); });
</script> </script>
Loading…
Cancel
Save