|
|
|
@ -90,201 +90,234 @@ public class ImportServiceBean extends AbstractServiceBean implements ImportServ
|
|
|
|
|
Crdn crdn = new Crdn();
|
|
|
|
|
crdn.setCrdnRegSeCd("07");
|
|
|
|
|
crdn.setTaskSeCd(taskSeCd);
|
|
|
|
|
crdn.setSggCd(globalStngMapper.selectSggCdForCurrentUser());
|
|
|
|
|
|
|
|
|
|
List<FileInfo> fileInfoList = new ArrayList<FileInfo>();
|
|
|
|
|
Map<String, Object> dividedInfo = this.divideInformation(linkFileInfoList, fileGroupType);
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
if(fileGroupType.equals("JPG")) {
|
|
|
|
|
DataObject metaFileInfo = (DataObject) dividedInfo.get("metaInfo");
|
|
|
|
|
List<DataObject> imageFileInfoList = (List<DataObject>) dividedInfo.get("imageInfo");
|
|
|
|
|
DataObject bgngData = (DataObject) dividedInfo.get("bgngData");
|
|
|
|
|
DataObject endData = (DataObject) dividedInfo.get("endData");
|
|
|
|
|
|
|
|
|
|
//1. 연계파일정보를 단속 엔티티로 변환
|
|
|
|
|
DataObject bgngData = linkFileInfoList.stream()
|
|
|
|
|
.min(Comparator.comparing(item -> new BigInteger(item.string("CRDN_TIMESTAMP"))))
|
|
|
|
|
.orElseThrow();
|
|
|
|
|
|
|
|
|
|
DataObject endData = linkFileInfoList.stream()
|
|
|
|
|
.max(Comparator.comparing(item -> new BigInteger(item.string("CRDN_TIMESTAMP"))))
|
|
|
|
|
.orElseThrow();
|
|
|
|
|
|
|
|
|
|
crdn.setCrdnBgngTm(bgngData.string("CRDN_TM"));
|
|
|
|
|
crdn.setCrdnEndTm(endData.string("CRDN_TM"));
|
|
|
|
|
this.crdnTimeRangeSet(crdn, bgngData, endData);
|
|
|
|
|
|
|
|
|
|
DataObject linkFileInfo = endData;
|
|
|
|
|
|
|
|
|
|
String entType = linkFileInfo.string("LINK_ENT_NM");
|
|
|
|
|
String entType = metaFileInfo.string("LINK_ENT_NM");
|
|
|
|
|
if(entType.equals("ino")) crdn.setCrdnInptSeCd("11");
|
|
|
|
|
else if(entType.equals("knl")) crdn.setCrdnInptSeCd("12");
|
|
|
|
|
else crdn.setCrdnInptSeCd("15");
|
|
|
|
|
|
|
|
|
|
crdn.setCrdnInptSeCd("11");
|
|
|
|
|
|
|
|
|
|
if(metaFileInfo.string("VLTN_CD").equals("")) {
|
|
|
|
|
crdn.setVltnCd("01");
|
|
|
|
|
crdn.setSggCd(globalStngMapper.selectSggCdForCurrentUser());
|
|
|
|
|
crdn.setVhrno(linkFileInfo.string("VHRNO"));
|
|
|
|
|
crdn.setCrdnYmd(linkFileInfo.string("CRDN_YMD"));
|
|
|
|
|
crdn.setCrdnTm(linkFileInfo.string("CRDN_TM"));
|
|
|
|
|
crdn.setGpsX(linkFileInfo.string("GPS_X"));
|
|
|
|
|
crdn.setGpsY(linkFileInfo.string("GPS_Y"));
|
|
|
|
|
crdn.setCrdnStdgNm(linkFileInfo.string("CRDN_STDG_NM"));
|
|
|
|
|
crdn.setCrdnPlc(linkFileInfo.string("CRDN_PLC"));
|
|
|
|
|
crdn.setCrdnRoadNm(linkFileInfo.string("CRDN_ROAD_NM"));
|
|
|
|
|
} else {
|
|
|
|
|
crdn.setVltnCd(metaFileInfo.string("VLTN_CD"));
|
|
|
|
|
}
|
|
|
|
|
if(metaFileInfo.string("CRDN_SPAREA_CD").equals("")) {
|
|
|
|
|
crdn.setCrdnSpareaCd("00");
|
|
|
|
|
} else {
|
|
|
|
|
crdn.setCrdnSpareaCd(metaFileInfo.string("CRDN_SPAREA_CD"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//linkFileInfo.string("EQPMNT_CD");
|
|
|
|
|
|
|
|
|
|
List<File> files = new ArrayList<>();
|
|
|
|
|
for (DataObject linkFileInfo0 : linkFileInfoList) {
|
|
|
|
|
files.add(new File(linkFileInfo0.string("FILE_PATH")));
|
|
|
|
|
crdn.setVhrno(metaFileInfo.string("VHRNO"));
|
|
|
|
|
crdn.setCrdnYmd(metaFileInfo.string("CRDN_YMD"));
|
|
|
|
|
crdn.setCrdnTm(metaFileInfo.string("CRDN_TM"));
|
|
|
|
|
if(crdn.getCrdnBgngTm() == null) {
|
|
|
|
|
crdn.setCrdnBgngTm(metaFileInfo.string("CRDN_BGNG_TM"));
|
|
|
|
|
crdn.setCrdnEndTm(metaFileInfo.string("CRDN_END_TM"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fileInfoList = new FileInfoFactory().createFileInfos(null, files);
|
|
|
|
|
for (int iLoop = 0; iLoop < fileInfoList.size(); iLoop++) {
|
|
|
|
|
fileInfoList.get(iLoop).setName("image"+iLoop+"."+FilenameUtils.getExtension(fileInfoList.get(iLoop).getName()));
|
|
|
|
|
}
|
|
|
|
|
crdn.setGpsX(metaFileInfo.string("GPS_X"));
|
|
|
|
|
crdn.setGpsY(metaFileInfo.string("GPS_Y"));
|
|
|
|
|
crdn.setCrdnPlc(metaFileInfo.string("CRDN_PLC"));
|
|
|
|
|
crdn.setCrdnRoadNm(metaFileInfo.string("CRDN_ROAD_NM"));
|
|
|
|
|
crdn.setCrdnStdgNm(metaFileInfo.string("CRDN_STDG_NM"));
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
crdn.setCrdnSeCd(metaFileInfo.string("CRDN_SE_CD"));
|
|
|
|
|
crdn.setMoscX(metaFileInfo.string("MOSC_X"));
|
|
|
|
|
crdn.setMoscY(metaFileInfo.string("MOSC_Y"));
|
|
|
|
|
|
|
|
|
|
//metaFileInfo.string("EQPMNT_CD");
|
|
|
|
|
//metaFileInfo.string("PLATE_WIDTH");
|
|
|
|
|
//metaFileInfo.string("PLATE_HEIGHT");
|
|
|
|
|
|
|
|
|
|
//XIT권장포맷
|
|
|
|
|
if(fileGroupType.equals("TXT")) {
|
|
|
|
|
List<FileInfo> fileInfoList = this.parsedDataInfoToFileInfo(imageFileInfoList, fileGroupType);
|
|
|
|
|
|
|
|
|
|
//1. 연계파일정보를 단속 엔티티로 변환
|
|
|
|
|
crdn.setSggCd(globalStngMapper.selectSggCdForCurrentUser());
|
|
|
|
|
|
|
|
|
|
DataObject metaFileInfo = null;
|
|
|
|
|
for (DataObject linkFileInfo0 : linkFileInfoList) {
|
|
|
|
|
if(linkFileInfo0.string("FILE_EXTENSION").toUpperCase().equals("TXT")) {
|
|
|
|
|
metaFileInfo = linkFileInfo0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//2. 차적 조회
|
|
|
|
|
List<Crdn> crdns = new ArrayList<Crdn>();
|
|
|
|
|
crdns.add(crdn);
|
|
|
|
|
importBean.setVehicleInfo(crdns);
|
|
|
|
|
|
|
|
|
|
String entType = metaFileInfo.string("LINK_ENT_NM");
|
|
|
|
|
if(entType.equals("ino")) crdn.setCrdnInptSeCd("11");
|
|
|
|
|
else if(entType.equals("knl")) crdn.setCrdnInptSeCd("12");
|
|
|
|
|
else crdn.setCrdnInptSeCd("15");
|
|
|
|
|
|
|
|
|
|
crdn.setVltnCd("01");
|
|
|
|
|
//3.등록
|
|
|
|
|
saved = crdnBean.create(null, crdn, fileInfoList);
|
|
|
|
|
|
|
|
|
|
crdn.setCrdnSeCd(metaFileInfo.string("CRDN_SE_CD"));
|
|
|
|
|
crdn.setCrdnYmd(metaFileInfo.string("CRDN_YMD"));
|
|
|
|
|
crdn.setCrdnTm(metaFileInfo.string("CRDN_TM"));
|
|
|
|
|
crdn.setVhrno(metaFileInfo.string("VHRNO"));
|
|
|
|
|
crdn.setGpsX(metaFileInfo.string("GPS_X"));
|
|
|
|
|
crdn.setGpsY(metaFileInfo.string("GPS_Y"));
|
|
|
|
|
crdn.setCrdnBgngTm(metaFileInfo.string("CRDN_BGNG_TM"));
|
|
|
|
|
crdn.setCrdnEndTm(metaFileInfo.string("CRDN_END_TM"));
|
|
|
|
|
crdn.setCrdnPlc(metaFileInfo.string("CRDN_PLC"));
|
|
|
|
|
resultMap.put("saved", saved);
|
|
|
|
|
|
|
|
|
|
if(metaFileInfo.string("CRDN_SPAREA_NM").equals("어린이보호구역")) {
|
|
|
|
|
crdn.setCrdnSpareaCd("01");
|
|
|
|
|
} else {
|
|
|
|
|
crdn.setCrdnSpareaCd("00");
|
|
|
|
|
if(saved) {
|
|
|
|
|
for(DataObject delInfo : linkFileInfoList) {
|
|
|
|
|
crdnBean.removeEquipmentLinkFile(workPath, delInfo.string("FILE_NAME"));
|
|
|
|
|
}
|
|
|
|
|
crdn.setCrdnStdgNm(metaFileInfo.string("CRDN_STDG_NM"));
|
|
|
|
|
|
|
|
|
|
//metaFileInfo.string("VLTN_NM");
|
|
|
|
|
//metaFileInfo.string("EQPMNT_CD");
|
|
|
|
|
if(!ifEmpty(crdn.getErsrRegYmd(), () -> "").equals("")) {
|
|
|
|
|
String vhrno = crdn.getVhrno();
|
|
|
|
|
String ersrRegYmd = crdn.getErsrRegYmd();
|
|
|
|
|
String ersrYear = ersrRegYmd.substring(0, 4);
|
|
|
|
|
String ersrMonth = ersrRegYmd.substring(4, 6);
|
|
|
|
|
String ersrDay = ersrRegYmd.substring(6, 8);
|
|
|
|
|
|
|
|
|
|
List<File> files = new ArrayList<>();
|
|
|
|
|
for (DataObject linkFileInfo0 : linkFileInfoList) {
|
|
|
|
|
if(!linkFileInfo0.string("FILE_EXTENSION").toUpperCase().equals("TXT")) {
|
|
|
|
|
files.add(new File(linkFileInfo0.string("FILE_PATH")));
|
|
|
|
|
}
|
|
|
|
|
String alertMessage = vhrno + " : " + ersrYear + "년" + ersrMonth + "월" + ersrDay + "일로 말소된 차량입니다.";
|
|
|
|
|
resultMap.put("alertMessage", alertMessage);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fileInfoList = new FileInfoFactory().createFileInfos(null, files);
|
|
|
|
|
for (int iLoop = 0; iLoop < fileInfoList.size(); iLoop++) {
|
|
|
|
|
fileInfoList.get(iLoop).setName("image"+iLoop+"."+FilenameUtils.getExtension(fileInfoList.get(iLoop).getName()));
|
|
|
|
|
} else {
|
|
|
|
|
resultMap.put("failReason", "기타 오류");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return resultMap;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
if(fileGroupType.equals("BIN")) {
|
|
|
|
|
|
|
|
|
|
//1. 연계파일정보를 단속 엔티티로 변환
|
|
|
|
|
if(linkFileInfoList.size() != 1) {
|
|
|
|
|
resultMap.put("saved", false);
|
|
|
|
|
resultMap.put("failReason", "그룹핑 오류");
|
|
|
|
|
return resultMap;
|
|
|
|
|
/**파싱된 데이터 목록을 메타정보, 이미지정보목록, 최초단속자료, 최종단속자료로 분리한다. <br />
|
|
|
|
|
* @param linkFileInfoList 연계파일정보목록, fileGroupType 연계파일그룹형식
|
|
|
|
|
* @return 메타정보, 이미지정보목록, 최초단속자료, 최종단속자료
|
|
|
|
|
*/
|
|
|
|
|
public Map<String,Object> divideInformation(List<DataObject> linkFileInfoList, String fileGroupType) {
|
|
|
|
|
Map<String, Object> result = new HashMap<String, Object>();
|
|
|
|
|
|
|
|
|
|
DataObject metaFileInfo = null;
|
|
|
|
|
List<DataObject> imageFileInfoList = new ArrayList<DataObject>();
|
|
|
|
|
DataObject[] bgngAndEnd = {null, null};
|
|
|
|
|
|
|
|
|
|
if(fileGroupType.equals("TXT")) {
|
|
|
|
|
|
|
|
|
|
for (DataObject linkFileInfo : linkFileInfoList) {
|
|
|
|
|
if(linkFileInfo.string("FILE_EXTENSION").toUpperCase().equals("TXT")) {
|
|
|
|
|
metaFileInfo = linkFileInfo;
|
|
|
|
|
} else {
|
|
|
|
|
imageFileInfoList.add(linkFileInfo);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
DataObject linkFileInfo = linkFileInfoList.get(0);
|
|
|
|
|
|
|
|
|
|
String entType = linkFileInfo.string("LINK_ENT_NM");
|
|
|
|
|
if(entType.equals("ino")) crdn.setCrdnInptSeCd("11");
|
|
|
|
|
else if(entType.equals("knl")) crdn.setCrdnInptSeCd("12");
|
|
|
|
|
else crdn.setCrdnInptSeCd("15");
|
|
|
|
|
bgngAndEnd = getBgngDataAndEndData(imageFileInfoList);
|
|
|
|
|
|
|
|
|
|
} else if(fileGroupType.equals("JPG")){
|
|
|
|
|
|
|
|
|
|
crdn.setVltnCd("01");
|
|
|
|
|
imageFileInfoList = linkFileInfoList;
|
|
|
|
|
|
|
|
|
|
crdn.setCrdnSeCd("07");
|
|
|
|
|
bgngAndEnd = getBgngDataAndEndData(linkFileInfoList);
|
|
|
|
|
|
|
|
|
|
crdn.setSggCd(globalStngMapper.selectSggCdForCurrentUser());
|
|
|
|
|
crdn.setVhrno(linkFileInfo.string("VHRNO"));
|
|
|
|
|
crdn.setCrdnYmd(linkFileInfo.string("CRDN_YMD"));
|
|
|
|
|
crdn.setCrdnTm(linkFileInfo.string("CRDN_TM"));
|
|
|
|
|
crdn.setGpsX(linkFileInfo.string("GPS_X"));
|
|
|
|
|
crdn.setGpsY(linkFileInfo.string("GPS_Y"));
|
|
|
|
|
crdn.setMoscX(linkFileInfo.string("MOSC_X"));
|
|
|
|
|
crdn.setMoscY(linkFileInfo.string("MOSC_Y"));
|
|
|
|
|
|
|
|
|
|
//linkFileInfo.string("EQPMNT_CD");
|
|
|
|
|
//linkFileInfo.string("PLATE_WIDTH");
|
|
|
|
|
//linkFileInfo.string("PLATE_HEIGHT");
|
|
|
|
|
if(bgngAndEnd[1] == null) {
|
|
|
|
|
metaFileInfo = linkFileInfoList.get(0);
|
|
|
|
|
} else {
|
|
|
|
|
metaFileInfo = bgngAndEnd[1];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
FileInfo FileInfo1 = SingleFileParser.base64ToFileInfo(linkFileInfo.string("CAR_IMAGE_NM"), linkFileInfo.string("CAR_IMAGE"), 1);
|
|
|
|
|
fileInfoList.add(FileInfo1);
|
|
|
|
|
FileInfo FileInfo2 = SingleFileParser.base64ToFileInfo(linkFileInfo.string("PLATE_IMAGE_NM"), linkFileInfo.string("PLATE_IMAGE"), 2);
|
|
|
|
|
fileInfoList.add(FileInfo2);
|
|
|
|
|
} else if(fileGroupType.equals("BIN")) {
|
|
|
|
|
|
|
|
|
|
metaFileInfo = linkFileInfoList.get(0);
|
|
|
|
|
|
|
|
|
|
int otherPhotoCnt = linkFileInfo.number("PHOTO_CNT").intValue() - 2;
|
|
|
|
|
int otherPhotoCnt = metaFileInfo.number("PHOTO_CNT").intValue();
|
|
|
|
|
for(int i=1; i <= otherPhotoCnt; i++){
|
|
|
|
|
String fileName = linkFileInfo.string("MOVING_IMAGE"+i+"_NM");
|
|
|
|
|
String b64str = linkFileInfo.string("MOVING_IMAGE"+i);
|
|
|
|
|
FileInfo FileInfo = SingleFileParser.base64ToFileInfo(fileName, b64str, i + 2);
|
|
|
|
|
fileInfoList.add(FileInfo);
|
|
|
|
|
String fileName = metaFileInfo.string("B64IMAGE"+i+"_NM");
|
|
|
|
|
String b64str = metaFileInfo.string("B64IMAGE"+i);
|
|
|
|
|
DataObject dataObject = new DataObject();
|
|
|
|
|
dataObject.put("B64IMAGE_NM", fileName);
|
|
|
|
|
dataObject.put("B64IMAGE", b64str);
|
|
|
|
|
imageFileInfoList.add(dataObject);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
throw new RuntimeException(e);
|
|
|
|
|
} else {
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
result.put("metaInfo", metaFileInfo);
|
|
|
|
|
result.put("imageInfo", imageFileInfoList);
|
|
|
|
|
result.put("bgngData", bgngAndEnd[0]);
|
|
|
|
|
result.put("endData", bgngAndEnd[1]);
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**단속이미지정보 목록 내에서 최초단속자료와 최종단속자료를 반환한다. 단속일시 정보가 없을 경우 null을 반환한다. <br />
|
|
|
|
|
* @param imageDataList 단속이미지정보 목록
|
|
|
|
|
* @return 최초단속자료, 최종단속자료
|
|
|
|
|
*/
|
|
|
|
|
public DataObject[] getBgngDataAndEndData(List<DataObject> imageDataList) {
|
|
|
|
|
DataObject[] bgngAndEnd = {null, null};
|
|
|
|
|
|
|
|
|
|
if(!imageDataList.get(0).get("CRDN_TIMESTAMP").equals("")) {
|
|
|
|
|
|
|
|
|
|
//2. 차적 조회
|
|
|
|
|
List<Crdn> crdns = new ArrayList<Crdn>();
|
|
|
|
|
crdns.add(crdn);
|
|
|
|
|
importBean.setVehicleInfo(crdns);
|
|
|
|
|
DataObject bgngData = imageDataList.stream()
|
|
|
|
|
.min(Comparator.comparing(item -> new BigInteger(item.string("CRDN_TIMESTAMP"))))
|
|
|
|
|
.orElseThrow();
|
|
|
|
|
|
|
|
|
|
DataObject endData = imageDataList.stream()
|
|
|
|
|
.max(Comparator.comparing(item -> new BigInteger(item.string("CRDN_TIMESTAMP"))))
|
|
|
|
|
.orElseThrow();
|
|
|
|
|
|
|
|
|
|
//3.등록
|
|
|
|
|
saved = crdnBean.create(null, crdn, fileInfoList);
|
|
|
|
|
bgngAndEnd[0] = bgngData;
|
|
|
|
|
bgngAndEnd[1] = endData;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
resultMap.put("saved", saved);
|
|
|
|
|
return bgngAndEnd;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(saved) {
|
|
|
|
|
for(DataObject delInfo : linkFileInfoList) {
|
|
|
|
|
crdnBean.removeEquipmentLinkFile(workPath, delInfo.string("FILE_NAME"));
|
|
|
|
|
/**최초단속정보와 최종단속정보를 기준으로 단속대장의 최초단속시간과 최종단속시간을 설정한다. <br />
|
|
|
|
|
* @param crdn 단속대장, bgngData 최초단속자료, endData 최종단속자료
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public void crdnTimeRangeSet(Crdn crdn, DataObject bgngData, DataObject endData) {
|
|
|
|
|
if(bgngData != null && endData != null) {
|
|
|
|
|
if(!endData.string("CRDN_BGNG_TM").equals("")) {
|
|
|
|
|
crdn.setCrdnBgngTm(endData.string("CRDN_BGNG_TM"));
|
|
|
|
|
crdn.setCrdnEndTm(endData.string("CRDN_END_TM"));
|
|
|
|
|
} else if(!endData.string("CRDN_TM").equals("")){
|
|
|
|
|
crdn.setCrdnBgngTm(bgngData.string("CRDN_TM"));
|
|
|
|
|
crdn.setCrdnEndTm(endData.string("CRDN_TM"));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(!ifEmpty(crdn.getErsrRegYmd(), () -> "").equals("")) {
|
|
|
|
|
String vhrno = crdn.getVhrno();
|
|
|
|
|
String ersrRegYmd = crdn.getErsrRegYmd();
|
|
|
|
|
String ersrYear = ersrRegYmd.substring(0, 4);
|
|
|
|
|
String ersrMonth = ersrRegYmd.substring(4, 6);
|
|
|
|
|
String ersrDay = ersrRegYmd.substring(6, 8);
|
|
|
|
|
/**단속이미지정보를 List<FileInfo>로 변환한다. <br />
|
|
|
|
|
* @param imageFileInfoList 단속이미지정보 목록, fileGroupType 연계파일그룹형식
|
|
|
|
|
* @return fileInfo리스트
|
|
|
|
|
*/
|
|
|
|
|
public List<FileInfo> parsedDataInfoToFileInfo(List<DataObject> imageFileInfoList, String fileGroupType){
|
|
|
|
|
List<FileInfo> fileInfoList = new ArrayList<FileInfo>();
|
|
|
|
|
|
|
|
|
|
String alertMessage = vhrno + " : " + ersrYear + "년" + ersrMonth + "월" + ersrDay + "일로 말소된 차량입니다.";
|
|
|
|
|
resultMap.put("alertMessage", alertMessage);
|
|
|
|
|
try {
|
|
|
|
|
//이미지, 이미지및텍스트
|
|
|
|
|
if(fileGroupType.equals("JPG") || fileGroupType.equals("TXT")) {
|
|
|
|
|
|
|
|
|
|
List<File> files = new ArrayList<>();
|
|
|
|
|
for (DataObject imageFileInfo : imageFileInfoList) {
|
|
|
|
|
files.add(new File(imageFileInfo.string("FILE_PATH")));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
resultMap.put("failReason", "기타 오류");
|
|
|
|
|
fileInfoList = new FileInfoFactory().createFileInfos(null, files);
|
|
|
|
|
for (int iLoop = 0; iLoop < fileInfoList.size(); iLoop++) {
|
|
|
|
|
fileInfoList.get(iLoop).setName("image"+iLoop+"."+FilenameUtils.getExtension(fileInfoList.get(iLoop).getName()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return resultMap;
|
|
|
|
|
} else if(fileGroupType.equals("BIN")) {
|
|
|
|
|
|
|
|
|
|
for(int i=0; i < imageFileInfoList.size(); i++){
|
|
|
|
|
String fileName = imageFileInfoList.get(i).string("B64IMAGE_NM");
|
|
|
|
|
String b64str = imageFileInfoList.get(i).string("B64IMAGE");
|
|
|
|
|
FileInfo FileInfo = SingleFileParser.base64ToFileInfo(fileName, b64str, (i+1));
|
|
|
|
|
fileInfoList.add(FileInfo);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
throw new RuntimeException(e);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return fileInfoList;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|