From 909a44755dbb858d7cc131aab5c220dea4dc3055 Mon Sep 17 00:00:00 2001 From: leebeomjun Date: Thu, 21 Sep 2023 10:08:33 +0900 Subject: [PATCH] =?UTF-8?q?=EB=8B=A8=EC=86=8D=EC=9E=A5=EB=B9=84=20?= =?UTF-8?q?=EC=97=B0=EA=B3=84=20=ED=8C=8C=EC=9D=BC=EB=AA=A9=EB=A1=9D?= =?UTF-8?q?=EC=97=90=EC=84=9C=20=EB=8B=A8=EC=86=8D=20=EA=B1=B4=20=EB=B3=84?= =?UTF-8?q?=EB=A1=9C=20=EA=B5=AC=EB=B6=84=ED=95=98=EB=8A=94=20=EA=B8=B0?= =?UTF-8?q?=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 --- .../java/cokr/xit/fims/crdn/parsing/Eli.java | 8 +++ .../crdn/parsing/EquipmentEnterprise.java | 2 + .../cokr/xit/fims/crdn/parsing/Gasan.java | 8 +++ .../cokr/xit/fims/crdn/parsing/HiteCom.java | 5 ++ .../java/cokr/xit/fims/crdn/parsing/Ino.java | 59 +++++++++++++++++-- .../java/cokr/xit/fims/crdn/parsing/Knl.java | 8 +++ .../xit/fims/crdn/parsing/XitRecommend.java | 7 +++ .../WEB-INF/jsp/fims/crdn/crdn05020-info.jsp | 8 ++- 8 files changed, 97 insertions(+), 8 deletions(-) diff --git a/src/main/java/cokr/xit/fims/crdn/parsing/Eli.java b/src/main/java/cokr/xit/fims/crdn/parsing/Eli.java index 508b36c9..284ed6bf 100644 --- a/src/main/java/cokr/xit/fims/crdn/parsing/Eli.java +++ b/src/main/java/cokr/xit/fims/crdn/parsing/Eli.java @@ -16,4 +16,12 @@ public class Eli implements EquipmentEnterprise { return null; } + @Override + public boolean isChangeCrackdown(DataObject currentItem, DataObject beforeItem) { + + //TODO: + + return false; + } + } diff --git a/src/main/java/cokr/xit/fims/crdn/parsing/EquipmentEnterprise.java b/src/main/java/cokr/xit/fims/crdn/parsing/EquipmentEnterprise.java index c80dccc2..3b97dd23 100644 --- a/src/main/java/cokr/xit/fims/crdn/parsing/EquipmentEnterprise.java +++ b/src/main/java/cokr/xit/fims/crdn/parsing/EquipmentEnterprise.java @@ -10,4 +10,6 @@ public interface EquipmentEnterprise { public List parsing(Stream fileList); + public boolean isChangeCrackdown(DataObject currentItem, DataObject beforeItem); + } diff --git a/src/main/java/cokr/xit/fims/crdn/parsing/Gasan.java b/src/main/java/cokr/xit/fims/crdn/parsing/Gasan.java index 23493d40..68ea7dc7 100644 --- a/src/main/java/cokr/xit/fims/crdn/parsing/Gasan.java +++ b/src/main/java/cokr/xit/fims/crdn/parsing/Gasan.java @@ -16,4 +16,12 @@ public class Gasan implements EquipmentEnterprise { return null; } + @Override + public boolean isChangeCrackdown(DataObject currentItem, DataObject beforeItem) { + + //TODO : + + return false; + } + } diff --git a/src/main/java/cokr/xit/fims/crdn/parsing/HiteCom.java b/src/main/java/cokr/xit/fims/crdn/parsing/HiteCom.java index 806e8333..f81fc8a4 100644 --- a/src/main/java/cokr/xit/fims/crdn/parsing/HiteCom.java +++ b/src/main/java/cokr/xit/fims/crdn/parsing/HiteCom.java @@ -62,4 +62,9 @@ public class HiteCom implements EquipmentEnterprise { return dataObjectList; } + @Override + public boolean isChangeCrackdown(DataObject currentItem, DataObject beforeItem) { + return true; + } + } diff --git a/src/main/java/cokr/xit/fims/crdn/parsing/Ino.java b/src/main/java/cokr/xit/fims/crdn/parsing/Ino.java index eda8a90c..a2c8fd80 100644 --- a/src/main/java/cokr/xit/fims/crdn/parsing/Ino.java +++ b/src/main/java/cokr/xit/fims/crdn/parsing/Ino.java @@ -14,8 +14,12 @@ import org.apache.commons.io.FilenameUtils; import cokr.xit.foundation.data.DataObject; + public class Ino implements EquipmentEnterprise { + private DataObject before = new DataObject(); + private int tempGroupSeq = 1; + @Override public List parsing(Stream fileList) { @@ -49,13 +53,16 @@ public class Ino implements EquipmentEnterprise { 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); + 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); + + dataObject.put("LOCATION_X", fileNameSplit[5]); dataObject.put("LOCATION_Y", fileNameSplit[6]); @@ -76,10 +83,52 @@ public class Ino implements EquipmentEnterprise { dataObject.put("CRDN_CN", crdnCn); } + if(!before.isEmpty()) { + boolean isChangeTempGroup = this.isChangeCrackdown(dataObject, before); + if(isChangeTempGroup) { + tempGroupSeq++; + } + } + + dataObject.put("TEMP_GROUP_ID", tempGroupSeq); + dataObjectList.add(dataObject); + before = dataObject; }); return dataObjectList; } + @Override + public boolean isChangeCrackdown(DataObject currentItem, DataObject beforeItem) { + + if(!currentItem.string("DEVICE_ID").equals(beforeItem.string("DEVICE_ID"))) { + return true; + } + + if(!currentItem.string("VHRNO").equals(beforeItem.string("VHRNO"))) { + return true; + } + + if(currentItem.number("PHOTO_SEQ").intValue() <= beforeItem.number("PHOTO_SEQ").intValue()) { + return true; + } + + SimpleDateFormat ymdTm = new SimpleDateFormat("yyyyMMddHHmmss"); + + try { + Date cDate = ymdTm.parse(currentItem.string("CRDN_YMD_TM")); + Date bDate = ymdTm.parse(beforeItem.string("CRDN_YMD_TM")); + + long diff = Math.abs(cDate.getTime() - bDate.getTime()); + + if(diff >= (1000 * 60 * 60 * 24)) { + return true; + } + } catch (Exception e) { + throw new RuntimeException(); + } + + return false; + } } diff --git a/src/main/java/cokr/xit/fims/crdn/parsing/Knl.java b/src/main/java/cokr/xit/fims/crdn/parsing/Knl.java index 683e985b..c3eab541 100644 --- a/src/main/java/cokr/xit/fims/crdn/parsing/Knl.java +++ b/src/main/java/cokr/xit/fims/crdn/parsing/Knl.java @@ -16,4 +16,12 @@ public class Knl implements EquipmentEnterprise { return null; } + @Override + public boolean isChangeCrackdown(DataObject currentItem, DataObject beforeItem) { + + //TODO : + + return false; + } + } diff --git a/src/main/java/cokr/xit/fims/crdn/parsing/XitRecommend.java b/src/main/java/cokr/xit/fims/crdn/parsing/XitRecommend.java index e555b50b..abbd1226 100644 --- a/src/main/java/cokr/xit/fims/crdn/parsing/XitRecommend.java +++ b/src/main/java/cokr/xit/fims/crdn/parsing/XitRecommend.java @@ -80,4 +80,11 @@ public class XitRecommend implements EquipmentEnterprise{ */ } + @Override + public boolean isChangeCrackdown(DataObject currentItem, DataObject beforeItem) { + //TODO: + + return false; + } + } 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 ca579141..998dbbec 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 @@ -90,6 +90,7 @@ 타임스탬프 사이즈 + 단속자료 디바이스ID 날짜/시간 차량번호 @@ -112,11 +113,12 @@ class="text-start text-truncate max-w-th">{FILE_NAME} {TIMESTAMP} {FILE_SIZE} + {TEMP_GROUP_ID} {DEVICE_ID} {CRDN_YMD_TM} {VHRNO} {PHOTO_CNT} - {PHOTO_SEQ} + {PHOTO_SEQ_NM} {LOCATION_X} {LOCATION_Y} {INPUT_SE} @@ -128,7 +130,7 @@ @@ -141,7 +143,7 @@ -
+