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 a2c8fd80..fd0e0215 100644 --- a/src/main/java/cokr/xit/fims/crdn/parsing/Ino.java +++ b/src/main/java/cokr/xit/fims/crdn/parsing/Ino.java @@ -102,11 +102,11 @@ public class Ino implements EquipmentEnterprise { @Override public boolean isChangeCrackdown(DataObject currentItem, DataObject beforeItem) { - if(!currentItem.string("DEVICE_ID").equals(beforeItem.string("DEVICE_ID"))) { + if(!currentItem.string("VHRNO").equals(beforeItem.string("VHRNO"))) { return true; } - if(!currentItem.string("VHRNO").equals(beforeItem.string("VHRNO"))) { + if(!currentItem.string("PHOTO_CNT").equals(beforeItem.string("PHOTO_CNT"))) { return true; } @@ -114,21 +114,6 @@ public class Ino implements EquipmentEnterprise { 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/XitRecommend.java b/src/main/java/cokr/xit/fims/crdn/parsing/XitRecommend.java index abbd1226..695ece43 100644 --- a/src/main/java/cokr/xit/fims/crdn/parsing/XitRecommend.java +++ b/src/main/java/cokr/xit/fims/crdn/parsing/XitRecommend.java @@ -1,12 +1,20 @@ package cokr.xit.fims.crdn.parsing; +import java.io.BufferedReader; import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.InputStreamReader; +import java.nio.charset.Charset; import java.nio.file.Path; import java.util.ArrayList; import java.util.List; +import java.util.regex.Matcher; import java.util.stream.Collectors; import java.util.stream.Stream; +import org.apache.commons.io.FilenameUtils; + import cokr.xit.foundation.data.DataObject; public class XitRecommend implements EquipmentEnterprise{ @@ -31,6 +39,30 @@ public class XitRecommend implements EquipmentEnterprise{ //TODO: + String[] fileNameSplit = fileName.split(Matcher.quoteReplacement("_")); + + + //dataObject.put("", ); + //dataObject.put("", ); + //dataObject.put("", ); + //dataObject.put("", ); + //dataObject.put("", ); + + boolean isMetaData = FilenameUtils.getExtension(fileName).toUpperCase().equals("TXT"); + if(isMetaData) { + + BufferedReader br = null; + try { + br = new BufferedReader(new InputStreamReader(new FileInputStream(file),Charset.forName("EUC-KR"))); + } catch (FileNotFoundException e) { + + } + + //파일내용.split(Matcher.quoteReplacement(",")); + + } else { + + } dataObjectList.add(dataObject); }); 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 f0319199..808078ae 100644 --- a/src/main/java/cokr/xit/fims/crdn/web/Crdn05Controller.java +++ b/src/main/java/cokr/xit/fims/crdn/web/Crdn05Controller.java @@ -9,6 +9,7 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; import java.util.stream.Stream; import javax.annotation.Resource; @@ -47,6 +48,7 @@ public class Crdn05Controller extends ApplicationController { getFileRegistrationScreen = "/020/info.do", getCrdnFileListFromEquipmentEnterprise = "/020/list.do", + removeLinkFile = "/020/remove.do", getManualRegistrationScreen = "/030/info.do", createCrdnDataByManual = "/030/create.do" @@ -79,6 +81,18 @@ public class Crdn05Controller extends ApplicationController { return mav; } + /**당일 등록한 단속자료 목록을 조회한다. + * {@link CrdnService#getCrackdownList(CrdnQuery)} 참고 + * @param query 단속자료 목록 조회 조건 + * @return jsonView + */ + public ModelAndView getTodayCrdnDataList(CrdnQuery query) { + setFetchSize(query); + query.setGridType("todayInsert"); + query.setCurrentUserId(currentUser().getId()); + return setCollectionInfo(new ModelAndView("jsonView"),crdnService.getCrackdownList(query),""); + } + /**단속자료 파일 등록 팝업화면을 반환한다. * @param * @return fims/crdn/crdn05020-info @@ -166,16 +180,46 @@ public class Crdn05Controller extends ApplicationController { return mav; } - /**당일 등록한 단속자료 목록을 조회한다. - * {@link CrdnService#getCrackdownList(CrdnQuery)} 참고 - * @param query 단속자료 목록 조회 조건 + /**단속 연계 파일을 삭제한다. + * @param hReq 삭제 요청 * @return jsonView + *
{
+ * "saved": 등록되었으면 true, 그렇지 않으면 false
+ * }
*/
- public ModelAndView getTodayCrdnDataList(CrdnQuery query) {
- setFetchSize(query);
- query.setGridType("todayInsert");
- query.setCurrentUserId(currentUser().getId());
- return setCollectionInfo(new ModelAndView("jsonView"),crdnService.getCrackdownList(query),"");
+ public ModelAndView removeLinkFile(HttpServletRequest hReq) {
+ ModelAndView mav = new ModelAndView("jsonView");
+ boolean saved = false;
+
+ String entType = hReq.getParameter("entType");
+ String fileName = hReq.getParameter("fileName");
+
+
+
+ if(entType.equals("이노")) {
+
+ try {
+ Stream