|
|
|
@ -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<DataObject> parsing(Stream<Path> 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;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|