|
|
|
@ -111,6 +111,11 @@ abstract public class LayoutParser {
|
|
|
|
|
*/
|
|
|
|
|
public void refineValue(DataObject dataObject) {
|
|
|
|
|
|
|
|
|
|
//공백 제거
|
|
|
|
|
for(int i=0; i < allItem.length; i++) {
|
|
|
|
|
dataObject.put(allItem[i],dataObject.string(allItem[i]).trim());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//단속일시 설정
|
|
|
|
|
if(!dataObject.string("CRDN_TIMESTAMP").equals("")) {
|
|
|
|
|
dataObject.put("CRDN_YMD", dataObject.string("CRDN_TIMESTAMP").substring(0, 8));
|
|
|
|
@ -125,6 +130,11 @@ abstract public class LayoutParser {
|
|
|
|
|
dataObject.put("CRDN_TIMESTAMP", dataObject.string("CRDN_YMD")+dataObject.string("CRDN_TM")+"000");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//숫자형 값에서 불필요한 0제거
|
|
|
|
|
String[] numberValues = {"PHOTO_CNT", "GPS_X", "GPS_Y", "MOSC_X", "MOSC_Y", "PLATE_WIDHT", "PLATE_HEIGHT"};
|
|
|
|
|
this.refineNumberValue(dataObject, numberValues);
|
|
|
|
|
|
|
|
|
|
//코드변환
|
|
|
|
|
CodeConverter codeConverter = new CodeConverter(allCode);
|
|
|
|
|
|
|
|
|
|
//위반내용
|
|
|
|
@ -147,6 +157,35 @@ abstract public class LayoutParser {
|
|
|
|
|
codeConverter.fillIfEmpty(dataObject, "CRDN_CN", "CRDN_CN_CD", "CRDN_CN_NM");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** dataObject 내에서 숫자형 데이터 항목을 정제한다.<br />
|
|
|
|
|
* @param dataObject, items 숫자형 데이터 이름
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public void refineNumberValue(DataObject dataObject, String[] items) {
|
|
|
|
|
for(int i=0;i<items.length;i++) {
|
|
|
|
|
String itemValue = dataObject.string(items[i]);
|
|
|
|
|
if(!itemValue.equals("")) {
|
|
|
|
|
//소수부 0제거
|
|
|
|
|
if(itemValue.contains(".")) {
|
|
|
|
|
itemValue = itemValue.replaceAll("0+$", "");
|
|
|
|
|
if(itemValue.endsWith(".")){
|
|
|
|
|
itemValue = itemValue + "0";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//정수부 0제거
|
|
|
|
|
if(itemValue.startsWith("0") && !itemValue.equals("0") && !itemValue.startsWith("0.")) {
|
|
|
|
|
itemValue = itemValue.replaceAll("^0+", "");
|
|
|
|
|
if(itemValue.equals("") || itemValue.startsWith(".")) {
|
|
|
|
|
itemValue = "0" + itemValue;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dataObject.put(items[i], itemValue);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**파일명을 분석한다.<br />
|
|
|
|
|
* @param dataObject
|
|
|
|
|
* @return
|
|
|
|
|