From b8e3d219b4924bc0ab594173c2ed787358c0e8ab Mon Sep 17 00:00:00 2001 From: leebeomjun Date: Tue, 19 Sep 2023 18:16:50 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9E=A5=EB=B9=84=EC=97=85=EC=B2=B4(=EC=9D=B4?= =?UTF-8?q?=EB=85=B8)=20=EB=8B=A8=EC=86=8D=ED=8C=8C=EC=9D=BC=EC=A0=95?= =?UTF-8?q?=EB=B3=B4=20=ED=8C=8C=EC=8B=B1=20=EB=B0=8F=20=EC=A1=B0=ED=9A=8C?= =?UTF-8?q?=20=EA=B8=B0=EB=8A=A5=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xit/fims/crdn/web/Crdn05Controller.java | 80 ++++ .../WEB-INF/jsp/fims/crdn/crdn05020-info.jsp | 399 +++++++++++------- 2 files changed, 326 insertions(+), 153 deletions(-) diff --git a/src/main/java/cokr/xit/fims/crdn/web/Crdn05Controller.java b/src/main/java/cokr/xit/fims/crdn/web/Crdn05Controller.java index 21dc324b..92ef6eac 100644 --- a/src/main/java/cokr/xit/fims/crdn/web/Crdn05Controller.java +++ b/src/main/java/cokr/xit/fims/crdn/web/Crdn05Controller.java @@ -1,13 +1,21 @@ package cokr.xit.fims.crdn.web; +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.text.SimpleDateFormat; import java.util.ArrayList; +import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.regex.Matcher; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; +import org.apache.commons.io.FilenameUtils; import org.springframework.web.multipart.MultipartFile; import org.springframework.web.servlet.ModelAndView; @@ -98,10 +106,82 @@ public class Crdn05Controller extends ApplicationController { List dataObjectList = new ArrayList<>(); + String downloadRoot = ""; + if(entType.equals("이노")) { + try { + + //TODO : FTP접속정보 설정 + + downloadRoot = "files"+File.separator+"tempForIno"; + //TODO : FTP접속 및 다운로드 + + } catch (Exception e) { + e.printStackTrace(); + } + try { + Files.walk(Paths.get(downloadRoot)) + .filter(Files::isRegularFile) + .forEach(item -> { + DataObject dataObject = new DataObject(); + File file = item.toFile(); + String filePath = file.getPath(); + dataObject.put("FILE_PATH", filePath); + String fileName = file.getName(); + dataObject.put("FILE_NAME", fileName); + + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd / HH:mm:ss"); + dataObject.put("TIMESTAMP", sdf.format(new Date(file.lastModified()))); + dataObject.put("FILE_SIZE", file.length()+" byte"); + + String extension = FilenameUtils.getExtension(fileName); + dataObject.put("EXTENSION", extension); + + String[] fileNameSplit = FilenameUtils.removeExtension(fileName).split(Matcher.quoteReplacement("_")); + + dataObject.put("DEVICE_ID", fileNameSplit[0]); + dataObject.put("CRDN_YMD_TM", fileNameSplit[1]); + dataObject.put("VHRNO", fileNameSplit[2]); + dataObject.put("PHOTO_CNT", fileNameSplit[3]); + + String photoSeq = fileNameSplit[4]; + if(photoSeq.equals("1")) photoSeq = "입차사진"; + else if(photoSeq.equals("2")) photoSeq = "주차사진"; + else if(photoSeq.equals("3")) photoSeq = "위반사진"; + else if(photoSeq.equals("4")) photoSeq = "출차사진"; + + dataObject.put("PHOTO_SEQ", photoSeq); + + dataObject.put("LOCATION_X", fileNameSplit[5]); + dataObject.put("LOCATION_Y", fileNameSplit[6]); + + String inputSe = fileNameSplit[7]; + if(inputSe.equals("S")) inputSe = "정상등록자료"; + else if(inputSe.equals("E")) inputSe = "삭제자료"; + + dataObject.put("INPUT_SE", inputSe); + dataObject.put("CRDN_PLC", fileNameSplit[8]); + dataObject.put("CRDN_ADDRESS", fileNameSplit[9]); + dataObject.put("CRDN_STDG_NM", fileNameSplit[10]); + + if(fileNameSplit.length >= 12) { + String crdnCn = fileNameSplit[11]; + if(crdnCn.equals("00")) crdnCn = "사용안함"; + else if(crdnCn.equals("01")) crdnCn = "일반차량(전기차)"; + else if(crdnCn.equals("02")) crdnCn = "장기주차(전기차)"; + dataObject.put("CRDN_CN", crdnCn); + } + + dataObjectList.add(dataObject); + }); + } catch (IOException e) { + e.printStackTrace(); + } + + mav = setCollectionInfo(mav, dataObjectList, ""); } return mav; diff --git a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn05020-info.jsp b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn05020-info.jsp index 7e49e2e0..4c6ebb0f 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn05020-info.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn05020-info.jsp @@ -2,184 +2,277 @@ <%@ include file="/WEB-INF/jsp/include/taglib.jsp"%> 단속 파일 등록
-
-
-
-
- - -
-
- - -
-
- - - + + + >${item.value} + - -
- +
- - + +
- -
- -
-
-
-
- - - - - - +
+ + + + +
+ +
+ + +
+
+
+ +
+
+
+
+ + + + + + +
-
- - + +
-
-
-
- +
\ No newline at end of file