한글파일 생성 경로 수정(연월일 추가)

main
이범준 1 year ago
parent 6e82c29613
commit 956aadf74e

@ -144,17 +144,23 @@ public class CrdnCvlcptServiceBean extends AbstractServiceBean implements CrdnCv
FieldFinder.setClickHereText(baseFormatFile, "민원내용", strings);
String currentTime = ymdhmsFormat.format(new Date());
String year = currentTime.substring(0, 4);
String month = currentTime.substring(4, 6);
String day = currentTime.substring(6, 8);
String formatFileResultRootPath = "files" + File.separator + "result";
File formatFileResultRootFolder = new File(formatFileResultRootPath);
if(!formatFileResultRootFolder.exists()) {
formatFileResultRootFolder.mkdirs();
String formatFileResultRootPath = "files" + File.separator + "result" + File.separator + "print";
String formatFileResultFolderPath = formatFileResultRootPath
+ File.separator + year + File.separator + month + File.separator + day;
File formatFileResultFolder = new File(formatFileResultFolderPath);
if(!formatFileResultFolder.exists()) {
formatFileResultFolder.mkdirs();
}
String resultPath = formatFileResultRootPath + File.separator + currentTime + ".hwp";
String resultHwpPath = formatFileResultFolderPath + File.separator + currentTime + ".hwp";
HWPWriter.toFile(baseFormatFile, resultPath);
HWPWriter.toFile(baseFormatFile, resultHwpPath);
HWPFile resultFile = HWPReader.fromFile(resultPath);
HWPFile resultFile = HWPReader.fromFile(resultHwpPath);
String linkTblNm = dataObject.string("LINK_TBL_NM");
if(!linkTblNm.equals("")) {
@ -193,13 +199,13 @@ public class CrdnCvlcptServiceBean extends AbstractServiceBean implements CrdnCv
AddingParagraphBetweenHWPFile.fileMerge(attachFormatFile, resultFile);
}
HWPWriter.toFile(resultFile, resultPath);
HWPWriter.toFile(resultFile, resultHwpPath);
}
}
String downlaodFileName = "민원내역원본_" + currentTime + ".hwp";
Map<String, String> result = Map.of(
"filePath", resultPath,
"filePath", resultHwpPath,
"fileName", downlaodFileName
);

Loading…
Cancel
Save