|
|
|
@ -15,6 +15,7 @@ import java.util.regex.Matcher;
|
|
|
|
|
import java.util.regex.Pattern;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
import org.apache.commons.io.FileExistsException;
|
|
|
|
|
import org.apache.commons.io.FileUtils;
|
|
|
|
|
import org.apache.ibatis.session.RowBounds;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
@ -160,10 +161,23 @@ public class EcNatlNewspaperService implements IEcNatlNewspaperService {
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// FIXME: src file backup
|
|
|
|
|
// FIXME: src file backup - rollback이 필요한 경우 BizException throw 필요
|
|
|
|
|
// rollback시 파일이 move 않되도록 모든 데이타 처리후 file move
|
|
|
|
|
dto.getFileInfoList().forEach((fi) -> {
|
|
|
|
|
processOrgFileBackup(filePath, fi);
|
|
|
|
|
try {
|
|
|
|
|
FileUtils.moveFile(
|
|
|
|
|
new File(filePath + "/" + fi.getFileNm())
|
|
|
|
|
, new File(rcvBackupRoot + uploadNewsPaperPath + "/" + fi.getFileNm())
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
} catch (NullPointerException npe){
|
|
|
|
|
log.error("{}[{}]", "시민신고[국민신문고] 데이타 parsing 에러::처리할 파일이 부정확 합니다.", fi.getFileNm());
|
|
|
|
|
} catch (FileExistsException fee){
|
|
|
|
|
log.error("{}[{}]", "시민신고[국민신문고] 데이타 parsing 에러::처리된 데이타 입니다.", fi.getFileNm());
|
|
|
|
|
} catch (IOException ie){
|
|
|
|
|
log.error("시민신고[국민신문고] 데이타 parsing 에러::{}", ie.getLocalizedMessage());
|
|
|
|
|
ie.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -472,16 +486,4 @@ public class EcNatlNewspaperService implements IEcNatlNewspaperService {
|
|
|
|
|
dateStr = dateStr.substring(0,4) + "/" + dateStr.substring(4);
|
|
|
|
|
return "/" + dateStr;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void processOrgFileBackup(String filePath, FolderReqDTO.FileInfo fi) {
|
|
|
|
|
try {
|
|
|
|
|
FileUtils.moveFile(
|
|
|
|
|
new File(filePath + "/" + fi.getFileNm())
|
|
|
|
|
, new File(rcvBackupRoot + uploadNewsPaperPath + "/" + fi.getFileNm())
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
} catch (IOException fee){
|
|
|
|
|
fee.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|