From b83d2bf024398c92844b5e25b0f573e89754a138 Mon Sep 17 00:00:00 2001 From: leebeomjun Date: Thu, 12 Oct 2023 10:54:43 +0900 Subject: [PATCH] =?UTF-8?q?=ED=81=B4=EB=9E=98=EC=8A=A4=EB=AA=85=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fims/crdn/parsing/CommonLayoutParser.java | 7 ++++ .../java/cokr/xit/fims/crdn/parsing/Eli.java | 27 ------------- .../cokr/xit/fims/crdn/parsing/Gasan.java | 27 ------------- .../{HiteCom.java => HiteComParser.java} | 2 +- .../crdn/parsing/{Ino.java => InoParser.java} | 2 +- .../java/cokr/xit/fims/crdn/parsing/Knl.java | 27 ------------- .../fims/crdn/parsing/LayoutDescriptor.java | 40 +++++++++++++++++++ ...pmentEnterprise.java => LayoutParser.java} | 2 +- .../{XitRecommend.java => XitParser.java} | 2 +- .../crdn/service/bean/ImportServiceBean.java | 8 ++-- .../xit/fims/crdn/web/Crdn05Controller.java | 39 +++++++++--------- 11 files changed, 74 insertions(+), 109 deletions(-) create mode 100644 src/main/java/cokr/xit/fims/crdn/parsing/CommonLayoutParser.java delete mode 100644 src/main/java/cokr/xit/fims/crdn/parsing/Eli.java delete mode 100644 src/main/java/cokr/xit/fims/crdn/parsing/Gasan.java rename src/main/java/cokr/xit/fims/crdn/parsing/{HiteCom.java => HiteComParser.java} (99%) rename src/main/java/cokr/xit/fims/crdn/parsing/{Ino.java => InoParser.java} (98%) delete mode 100644 src/main/java/cokr/xit/fims/crdn/parsing/Knl.java create mode 100644 src/main/java/cokr/xit/fims/crdn/parsing/LayoutDescriptor.java rename src/main/java/cokr/xit/fims/crdn/parsing/{EquipmentEnterprise.java => LayoutParser.java} (94%) rename src/main/java/cokr/xit/fims/crdn/parsing/{XitRecommend.java => XitParser.java} (98%) diff --git a/src/main/java/cokr/xit/fims/crdn/parsing/CommonLayoutParser.java b/src/main/java/cokr/xit/fims/crdn/parsing/CommonLayoutParser.java new file mode 100644 index 00000000..f816c96f --- /dev/null +++ b/src/main/java/cokr/xit/fims/crdn/parsing/CommonLayoutParser.java @@ -0,0 +1,7 @@ +package cokr.xit.fims.crdn.parsing; + +public class CommonLayoutParser { + + + +} diff --git a/src/main/java/cokr/xit/fims/crdn/parsing/Eli.java b/src/main/java/cokr/xit/fims/crdn/parsing/Eli.java deleted file mode 100644 index 284ed6bf..00000000 --- a/src/main/java/cokr/xit/fims/crdn/parsing/Eli.java +++ /dev/null @@ -1,27 +0,0 @@ -package cokr.xit.fims.crdn.parsing; - -import java.nio.file.Path; -import java.util.List; -import java.util.stream.Stream; - -import cokr.xit.foundation.data.DataObject; - -public class Eli implements EquipmentEnterprise { - - @Override - public List parsing(Stream fileList) { - - //TODO: - - return null; - } - - @Override - public boolean isChangeCrackdown(DataObject currentItem, DataObject beforeItem) { - - //TODO: - - return false; - } - -} diff --git a/src/main/java/cokr/xit/fims/crdn/parsing/Gasan.java b/src/main/java/cokr/xit/fims/crdn/parsing/Gasan.java deleted file mode 100644 index 68ea7dc7..00000000 --- a/src/main/java/cokr/xit/fims/crdn/parsing/Gasan.java +++ /dev/null @@ -1,27 +0,0 @@ -package cokr.xit.fims.crdn.parsing; - -import java.nio.file.Path; -import java.util.List; -import java.util.stream.Stream; - -import cokr.xit.foundation.data.DataObject; - -public class Gasan implements EquipmentEnterprise { - - @Override - public List parsing(Stream fileList) { - - //TODO: - - 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/HiteComParser.java similarity index 99% rename from src/main/java/cokr/xit/fims/crdn/parsing/HiteCom.java rename to src/main/java/cokr/xit/fims/crdn/parsing/HiteComParser.java index 4f0527e8..89b56cdc 100644 --- a/src/main/java/cokr/xit/fims/crdn/parsing/HiteCom.java +++ b/src/main/java/cokr/xit/fims/crdn/parsing/HiteComParser.java @@ -18,7 +18,7 @@ import cokr.xit.base.file.FileInfo; import cokr.xit.fims.cmmn.CmmnUtil; import cokr.xit.foundation.data.DataObject; -public class HiteCom implements EquipmentEnterprise { +public class HiteComParser implements LayoutParser { private int tempGroupSeq = 1; diff --git a/src/main/java/cokr/xit/fims/crdn/parsing/Ino.java b/src/main/java/cokr/xit/fims/crdn/parsing/InoParser.java similarity index 98% rename from src/main/java/cokr/xit/fims/crdn/parsing/Ino.java rename to src/main/java/cokr/xit/fims/crdn/parsing/InoParser.java index 4382178f..23dd931f 100644 --- a/src/main/java/cokr/xit/fims/crdn/parsing/Ino.java +++ b/src/main/java/cokr/xit/fims/crdn/parsing/InoParser.java @@ -15,7 +15,7 @@ import org.apache.commons.io.FilenameUtils; import cokr.xit.foundation.data.DataObject; -public class Ino implements EquipmentEnterprise { +public class InoParser implements LayoutParser { private DataObject before = new DataObject(); private int tempGroupSeq = 1; diff --git a/src/main/java/cokr/xit/fims/crdn/parsing/Knl.java b/src/main/java/cokr/xit/fims/crdn/parsing/Knl.java deleted file mode 100644 index c3eab541..00000000 --- a/src/main/java/cokr/xit/fims/crdn/parsing/Knl.java +++ /dev/null @@ -1,27 +0,0 @@ -package cokr.xit.fims.crdn.parsing; - -import java.nio.file.Path; -import java.util.List; -import java.util.stream.Stream; - -import cokr.xit.foundation.data.DataObject; - -public class Knl implements EquipmentEnterprise { - - @Override - public List parsing(Stream fileList) { - - //TODO: - - return null; - } - - @Override - public boolean isChangeCrackdown(DataObject currentItem, DataObject beforeItem) { - - //TODO : - - return false; - } - -} diff --git a/src/main/java/cokr/xit/fims/crdn/parsing/LayoutDescriptor.java b/src/main/java/cokr/xit/fims/crdn/parsing/LayoutDescriptor.java new file mode 100644 index 00000000..583779af --- /dev/null +++ b/src/main/java/cokr/xit/fims/crdn/parsing/LayoutDescriptor.java @@ -0,0 +1,40 @@ +package cokr.xit.fims.crdn.parsing; + +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +public class LayoutDescriptor { + + private String fileLayoutId; + + private String sggCd; + + private String taskSeCd; + + private String instCd; + + private String deptCd; + + private String linkFileLocation; + + private String fileGroup; + + private String countPerFileGroup; + + private String fileNameLength; + + private String fileNameItmes; + + private String fileNameSeperator; + + private String contentItems; + + private String contentSeperator; + + private String contentSecondSeperator; + + private String secondSeperatorStarterItems; + +} diff --git a/src/main/java/cokr/xit/fims/crdn/parsing/EquipmentEnterprise.java b/src/main/java/cokr/xit/fims/crdn/parsing/LayoutParser.java similarity index 94% rename from src/main/java/cokr/xit/fims/crdn/parsing/EquipmentEnterprise.java rename to src/main/java/cokr/xit/fims/crdn/parsing/LayoutParser.java index 00e40e43..c68fdb8f 100644 --- a/src/main/java/cokr/xit/fims/crdn/parsing/EquipmentEnterprise.java +++ b/src/main/java/cokr/xit/fims/crdn/parsing/LayoutParser.java @@ -6,7 +6,7 @@ import java.util.stream.Stream; import cokr.xit.foundation.data.DataObject; -public interface EquipmentEnterprise { +public interface LayoutParser { /**장비 단속 연계 파일에서 단속정보를 추출한다.
* @param fileList 연계파일리스트 diff --git a/src/main/java/cokr/xit/fims/crdn/parsing/XitRecommend.java b/src/main/java/cokr/xit/fims/crdn/parsing/XitParser.java similarity index 98% rename from src/main/java/cokr/xit/fims/crdn/parsing/XitRecommend.java rename to src/main/java/cokr/xit/fims/crdn/parsing/XitParser.java index 325a5ee0..1868ea0e 100644 --- a/src/main/java/cokr/xit/fims/crdn/parsing/XitRecommend.java +++ b/src/main/java/cokr/xit/fims/crdn/parsing/XitParser.java @@ -16,7 +16,7 @@ import org.apache.commons.io.FilenameUtils; import cokr.xit.foundation.data.DataObject; -public class XitRecommend implements EquipmentEnterprise{ +public class XitParser implements LayoutParser{ private DataObject before = new DataObject(); private int tempGroupSeq = 1; 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 e901bbad..98b4fe7b 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 @@ -19,7 +19,7 @@ import cokr.xit.base.file.service.bean.FileBean; import cokr.xit.base.file.web.FileInfoFactory; import cokr.xit.fims.crdn.Crdn; import cokr.xit.fims.crdn.dao.GlobalStngMapper; -import cokr.xit.fims.crdn.parsing.HiteCom; +import cokr.xit.fims.crdn.parsing.HiteComParser; import cokr.xit.fims.crdn.service.CrdnService; import cokr.xit.fims.crdn.service.ImportService; import cokr.xit.foundation.component.AbstractServiceBean; @@ -222,16 +222,16 @@ public class ImportServiceBean extends AbstractServiceBean implements ImportServ //linkFileInfo.string("PLATE_HEIGHT"); try { - FileInfo FileInfo1 = HiteCom.base64ToFileInfo(linkFileInfo.string("CAR_IMAGE_NM"), linkFileInfo.string("CAR_IMAGE"), 1); + FileInfo FileInfo1 = HiteComParser.base64ToFileInfo(linkFileInfo.string("CAR_IMAGE_NM"), linkFileInfo.string("CAR_IMAGE"), 1); fileInfoList.add(FileInfo1); - FileInfo FileInfo2 = HiteCom.base64ToFileInfo(linkFileInfo.string("PLATE_IMAGE_NM"), linkFileInfo.string("PLATE_IMAGE"), 2); + FileInfo FileInfo2 = HiteComParser.base64ToFileInfo(linkFileInfo.string("PLATE_IMAGE_NM"), linkFileInfo.string("PLATE_IMAGE"), 2); fileInfoList.add(FileInfo2); int otherPhotoCnt = linkFileInfo.number("PHOTO_CNT").intValue() - 2; for(int i=1; i <= otherPhotoCnt; i++){ String fileName = linkFileInfo.string("MOVING_IMAGE"+i+"_NM"); String b64str = linkFileInfo.string("MOVING_IMAGE"+i); - FileInfo FileInfo = HiteCom.base64ToFileInfo(fileName, b64str, i + 2); + FileInfo FileInfo = HiteComParser.base64ToFileInfo(fileName, b64str, i + 2); fileInfoList.add(FileInfo); } 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 b32b5e00..cb217a17 100644 --- a/src/main/java/cokr/xit/fims/crdn/web/Crdn05Controller.java +++ b/src/main/java/cokr/xit/fims/crdn/web/Crdn05Controller.java @@ -27,12 +27,11 @@ import cokr.xit.fims.crdn.Crdn; import cokr.xit.fims.crdn.CrdnQuery; import cokr.xit.fims.crdn.dao.CrdnInstMapper; import cokr.xit.fims.crdn.dao.GlobalStngMapper; -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.Knl; +import cokr.xit.fims.crdn.parsing.LayoutParser; +import cokr.xit.fims.crdn.parsing.HiteComParser; +import cokr.xit.fims.crdn.parsing.InoParser; import cokr.xit.fims.crdn.parsing.ParsingUtil; -import cokr.xit.fims.crdn.parsing.XitRecommend; +import cokr.xit.fims.crdn.parsing.XitParser; import cokr.xit.fims.crdn.service.CrdnService; import cokr.xit.fims.crdn.service.CrdnStngService; import cokr.xit.fims.crdn.service.ImportService; @@ -130,12 +129,12 @@ public class Crdn05Controller extends ApplicationController { boolean saved = false; String entType = hReq.getParameter("entType"); - EquipmentEnterprise enterprise = null; + LayoutParser enterprise = null; switch(entType){ - case "ino": enterprise = new Ino(); break; - case "knl": enterprise = new Knl(); break; - case "hitecom": enterprise = new HiteCom(); break; - case "xit": enterprise = new XitRecommend(); break; + case "ino": enterprise = new InoParser(); break; + //case "knl": break; + case "hitecom": enterprise = new HiteComParser(); break; + case "xit": enterprise = new XitParser(); break; //case "": enterprise = new (); break; } @@ -186,12 +185,12 @@ public class Crdn05Controller extends ApplicationController { boolean saved = false; String entType = hReq.getParameter("entType"); - EquipmentEnterprise enterprise = null; + LayoutParser enterprise = null; switch(entType){ - case "ino": enterprise = new Ino(); break; - case "knl": enterprise = new Knl(); break; - case "hitecom": enterprise = new HiteCom(); break; - case "xit": enterprise = new XitRecommend(); break; + case "ino": enterprise = new InoParser(); break; + //case "knl": break; + case "hitecom": enterprise = new HiteComParser(); break; + case "xit": enterprise = new XitParser(); break; //case "": enterprise = new (); break; } @@ -225,12 +224,12 @@ public class Crdn05Controller extends ApplicationController { ModelAndView mav = new ModelAndView("jsonView"); String entType = hReq.getParameter("entType"); - EquipmentEnterprise enterprise = null; + LayoutParser enterprise = null; switch(entType){ - case "ino": enterprise = new Ino(); break; - case "knl": enterprise = new Knl(); break; - case "hitecom": enterprise = new HiteCom(); break; - case "xit": enterprise = new XitRecommend(); break; + case "ino": enterprise = new InoParser(); break; + //case "knl": break; + case "hitecom": enterprise = new HiteComParser(); break; + case "xit": enterprise = new XitParser(); break; //case "": enterprise = new (); break; }