From 956aadf74eb8ae628d6a5861f2e370d02e0f65d1 Mon Sep 17 00:00:00 2001 From: leebeomjun Date: Fri, 18 Aug 2023 08:51:56 +0900 Subject: [PATCH] =?UTF-8?q?=ED=95=9C=EA=B8=80=ED=8C=8C=EC=9D=BC=20?= =?UTF-8?q?=EC=83=9D=EC=84=B1=20=EA=B2=BD=EB=A1=9C=20=EC=88=98=EC=A0=95(?= =?UTF-8?q?=EC=97=B0=EC=9B=94=EC=9D=BC=20=EC=B6=94=EA=B0=80)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/bean/CrdnCvlcptServiceBean.java | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/main/java/cokr/xit/fims/cvlc/service/bean/CrdnCvlcptServiceBean.java b/src/main/java/cokr/xit/fims/cvlc/service/bean/CrdnCvlcptServiceBean.java index 9f88fcbb..30021a45 100644 --- a/src/main/java/cokr/xit/fims/cvlc/service/bean/CrdnCvlcptServiceBean.java +++ b/src/main/java/cokr/xit/fims/cvlc/service/bean/CrdnCvlcptServiceBean.java @@ -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 result = Map.of( - "filePath", resultPath, + "filePath", resultHwpPath, "fileName", downlaodFileName );