From f15db78964ff332c4da55313b75d702d2ca9edb1 Mon Sep 17 00:00:00 2001 From: leebeomjun Date: Fri, 13 Oct 2023 14:07:11 +0900 Subject: [PATCH] =?UTF-8?q?=EC=86=8C=EC=8A=A4=20=EC=A0=95=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fims/crdn/parsing/AttachedTxtParser.java | 10 +++++---- .../fims/crdn/parsing/OnlyImageParser.java | 22 ++++++++++--------- .../fims/crdn/parsing/SingleFileParser.java | 2 +- .../crdn/service/bean/ImportServiceBean.java | 6 ++--- .../WEB-INF/jsp/fims/crdn/crdn05020-info.jsp | 10 ++++----- 5 files changed, 27 insertions(+), 23 deletions(-) diff --git a/src/main/java/cokr/xit/fims/crdn/parsing/AttachedTxtParser.java b/src/main/java/cokr/xit/fims/crdn/parsing/AttachedTxtParser.java index e1159eea..ff623e06 100644 --- a/src/main/java/cokr/xit/fims/crdn/parsing/AttachedTxtParser.java +++ b/src/main/java/cokr/xit/fims/crdn/parsing/AttachedTxtParser.java @@ -54,17 +54,19 @@ public class AttachedTxtParser extends LayoutParser{ dataObject.put("LINK_ENT_NM", descriptor.getLinkEnterpriseName()); } - boolean isMetaData = fileExtension.toUpperCase().equals("TXT"); - String[] fileNameSplit = FilenameUtils.removeExtension(fileName).split(Matcher.quoteReplacement("_")); + String noExtensionName = FilenameUtils.removeExtension(fileName); + + String[] fileNameSplit = noExtensionName.split(Matcher.quoteReplacement(descriptor.getFileNameSeperator())); String crdnTiemstamp = fileNameSplit[0]; dataObject.put("CRDN_YMD", crdnTiemstamp.substring(0, 8)); dataObject.put("CRDN_TM", crdnTiemstamp.substring(8, 14)); dataObject.put("ENT_CD", fileNameSplit[1]); - dataObject.put("DEVICE_ID", fileNameSplit[2]); - dataObject.put("FILE_SN", fileNameSplit[3]); + dataObject.put("EQPMNT_CD", fileNameSplit[2]); + dataObject.put("FILE_SEQ", fileNameSplit[3]); + boolean isMetaData = fileExtension.toUpperCase().equals("TXT"); if(isMetaData) { BufferedReader br = null; diff --git a/src/main/java/cokr/xit/fims/crdn/parsing/OnlyImageParser.java b/src/main/java/cokr/xit/fims/crdn/parsing/OnlyImageParser.java index 668ac80a..4d4df579 100644 --- a/src/main/java/cokr/xit/fims/crdn/parsing/OnlyImageParser.java +++ b/src/main/java/cokr/xit/fims/crdn/parsing/OnlyImageParser.java @@ -51,9 +51,11 @@ public class OnlyImageParser extends LayoutParser { dataObject.put("LINK_ENT_NM", descriptor.getLinkEnterpriseName()); } - String[] fileNameSplit = FilenameUtils.removeExtension(fileName).split(Matcher.quoteReplacement("_")); + String noExtensionName = FilenameUtils.removeExtension(fileName); - dataObject.put("DEVICE_ID", fileNameSplit[0]); + String[] fileNameSplit = noExtensionName.split(Matcher.quoteReplacement(descriptor.getFileNameSeperator())); + + dataObject.put("EQPMNT_CD", fileNameSplit[0]); dataObject.put("CRDN_TIMESTAMP", fileNameSplit[1]); dataObject.put("CRDN_YMD", fileNameSplit[1].substring(0,8)); @@ -62,15 +64,15 @@ public class OnlyImageParser extends LayoutParser { dataObject.put("VHRNO", fileNameSplit[2]); dataObject.put("PHOTO_CNT", fileNameSplit[3]); - String photoSeq = fileNameSplit[4]; - dataObject.put("PHOTO_SEQ", photoSeq); + String photoType = fileNameSplit[4]; + dataObject.put("PHOTO_TYPE", photoType); String photoSeqNm = ""; - if(photoSeq.equals("1")) photoSeqNm = "입차사진"; - else if(photoSeq.equals("2")) photoSeqNm = "주차사진"; - else if(photoSeq.equals("3")) photoSeqNm = "위반사진"; - else if(photoSeq.equals("4")) photoSeqNm = "출차사진"; - dataObject.put("PHOTO_SEQ_NM", photoSeqNm); + if(photoType.equals("1")) photoSeqNm = "입차사진"; + else if(photoType.equals("2")) photoSeqNm = "주차사진"; + else if(photoType.equals("3")) photoSeqNm = "위반사진"; + else if(photoType.equals("4")) photoSeqNm = "출차사진"; + dataObject.put("PHOTO_TYPE_NM", photoSeqNm); dataObject.put("GPS_X", fileNameSplit[5]); @@ -120,7 +122,7 @@ public class OnlyImageParser extends LayoutParser { return true; } - if(currentItem.number("PHOTO_SEQ").intValue() <= beforeItem.number("PHOTO_SEQ").intValue()) { + if(currentItem.number("PHOTO_TYPE").intValue() <= beforeItem.number("PHOTO_TYPE").intValue()) { return true; } diff --git a/src/main/java/cokr/xit/fims/crdn/parsing/SingleFileParser.java b/src/main/java/cokr/xit/fims/crdn/parsing/SingleFileParser.java index 7e0ae21b..b7c10883 100644 --- a/src/main/java/cokr/xit/fims/crdn/parsing/SingleFileParser.java +++ b/src/main/java/cokr/xit/fims/crdn/parsing/SingleFileParser.java @@ -66,7 +66,7 @@ public class SingleFileParser extends LayoutParser { } dataObject.put("TEXT_SIZE", CmmnUtil.substringByBytes(fileCn, 0, 7)); - dataObject.put("DEVICE_ID", CmmnUtil.substringByBytes(fileCn, 8, 12)); + dataObject.put("EQPMNT_CD", CmmnUtil.substringByBytes(fileCn, 8, 12)); dataObject.put("CAR_VELOCITY", CmmnUtil.substringByBytes(fileCn, 13, 15).replaceAll("^0+", "")); //차량속도 dataObject.put("CAR_TYPE", CmmnUtil.substringByBytes(fileCn, 16, 16)); //차종(미사용) dataObject.put("ROAD_CD", CmmnUtil.substringByBytes(fileCn, 17, 17)); //도로코드(미사용) diff --git a/src/main/java/cokr/xit/fims/crdn/service/bean/ImportServiceBean.java b/src/main/java/cokr/xit/fims/crdn/service/bean/ImportServiceBean.java index f1df383f..3c8d95a1 100644 --- a/src/main/java/cokr/xit/fims/crdn/service/bean/ImportServiceBean.java +++ b/src/main/java/cokr/xit/fims/crdn/service/bean/ImportServiceBean.java @@ -126,7 +126,7 @@ public class ImportServiceBean extends AbstractServiceBean implements ImportServ crdn.setCrdnStdgNm(linkFileInfo.string("CRDN_STDG_NM")); crdn.setCrdnPlc(linkFileInfo.string("CRDN_PLC")); - //linkFileInfo.string("DEVICE_ID"); + //linkFileInfo.string("EQPMNT_CD"); //linkFileInfo.string("CRDN_ADDRESS"); List files = new ArrayList<>(); @@ -180,7 +180,7 @@ public class ImportServiceBean extends AbstractServiceBean implements ImportServ crdn.setCrdnStdgNm(metaFileInfo.string("CRDN_STDG_NM")); //metaFileInfo.string("LAW"); - //metaFileInfo.string("DEVICE_ID"); + //metaFileInfo.string("EQPMNT_CD"); List files = new ArrayList<>(); for (DataObject linkFileInfo0 : linkFileInfoList) { @@ -226,7 +226,7 @@ public class ImportServiceBean extends AbstractServiceBean implements ImportServ crdn.setMoscX(linkFileInfo.string("MOSC_X")); crdn.setMoscY(linkFileInfo.string("MOSC_Y")); - //linkFileInfo.string("DEVICE_ID"); + //linkFileInfo.string("EQPMNT_CD"); //linkFileInfo.string("PLATE_WIDTH"); //linkFileInfo.string("PLATE_HEIGHT"); 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 aa72afc4..9c100385 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 @@ -71,9 +71,9 @@ 파일상태 총사진갯수 파일순번 - 디바이스ID + 장비코드 차량번호 - 사진시퀀스명 + 사진구분명 업체코드 법규 차량속도 @@ -105,10 +105,10 @@ {FILE_EXTENSION} {FILE_STATUS} {PHOTO_CNT} - {FILE_SN} - {DEVICE_ID} + {FILE_SEQ} + {EQPMNT_CD} {VHRNO} - {PHOTO_SEQ_NM} + {PHOTO_TYPE_NM} {ENT_CD} {LAW} {CAR_VELOCITY}