diff --git a/src/main/java/cokr/xit/fims/excl/service/OpnnSbmsnService.java b/src/main/java/cokr/xit/fims/excl/service/OpnnSbmsnService.java index c6674f6e..014cb530 100644 --- a/src/main/java/cokr/xit/fims/excl/service/OpnnSbmsnService.java +++ b/src/main/java/cokr/xit/fims/excl/service/OpnnSbmsnService.java @@ -82,6 +82,6 @@ public interface OpnnSbmsnService { *
  • fileName: 다운로드 파일명
  • * */ - Map makeDlbrDecsnFileFromHwpFormat(String formatType, String formatName, PrintOption printOption, LevyExclQuery req); + Map makeDlbrDecsnFileFromHwpFormat(String formatType, String formatName, PrintOption printOption, LevyExclQuery req); } diff --git a/src/main/java/cokr/xit/fims/excl/service/bean/OpnnSbmsnServiceBean.java b/src/main/java/cokr/xit/fims/excl/service/bean/OpnnSbmsnServiceBean.java index 70c617a9..2443182b 100644 --- a/src/main/java/cokr/xit/fims/excl/service/bean/OpnnSbmsnServiceBean.java +++ b/src/main/java/cokr/xit/fims/excl/service/bean/OpnnSbmsnServiceBean.java @@ -1,5 +1,6 @@ package cokr.xit.fims.excl.service.bean; +import java.io.File; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -78,8 +79,8 @@ public class OpnnSbmsnServiceBean extends AbstractServiceBean implements OpnnSbm } @Override - public Map makeDlbrDecsnFileFromHwpFormat(String formatType, String formatName, PrintOption printOption, LevyExclQuery req) { - Map result = new HashMap<>(); + public Map makeDlbrDecsnFileFromHwpFormat(String formatType, String formatName, PrintOption printOption, LevyExclQuery req) { + Map result = new HashMap<>(); HWPPrintUtil printUtil = new HWPPrintUtil(); HWPFormatWriter hwpFormatWriter = new DlbrDecsnList(); @@ -99,8 +100,8 @@ public class OpnnSbmsnServiceBean extends AbstractServiceBean implements OpnnSbm try { int dataIndex = 0; - for(int partFileIndex = 0; partFileIndex < printUtil.getTotalPartFileCount(); partFileIndex++) { + for(int partFileIndex = 0; partFileIndex < printUtil.getTotalPartFileCount(); partFileIndex++) { // 새 파일 생성 String resultHwpPath = printUtil.newFileFromFormatFile(); HWPFile resultFile = HWPReader.fromFile(resultHwpPath); @@ -141,12 +142,18 @@ public class OpnnSbmsnServiceBean extends AbstractServiceBean implements OpnnSbm } HWPWriter.toFile(baseFile, basePath); + + for (int i = 2; i <= partFileList.size(); i++) { + (new File(partFileList.get(i-1))).delete(); + } } String downlaodFileName = printUtil.getFormatKorName() + "_" + printUtil.getPrintRequestDt() + ".hwp"; + String filePath = partFileList.get(0); - result.put("fileName", downlaodFileName); - result.put("filePath", partFileList.get(0)); + result.put("filename", downlaodFileName); + result.put("filePath", filePath); + result.put("file", new File(filePath)); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("한글 파일 출력 중 오류가 발생하였습니다."); diff --git a/src/main/java/cokr/xit/fims/excl/web/Excl02Controller.java b/src/main/java/cokr/xit/fims/excl/web/Excl02Controller.java index 5f21e5cb..ead432cc 100644 --- a/src/main/java/cokr/xit/fims/excl/web/Excl02Controller.java +++ b/src/main/java/cokr/xit/fims/excl/web/Excl02Controller.java @@ -338,12 +338,11 @@ public class Excl02Controller extends ApplicationController { * } */ public ModelAndView makeDlbrDecsnFileFromHwpFormat(LevyExclQuery req) { - Map result = null; + // PrintOption printOption = new PrintOption(); - result = opnnSbmsnService.makeDlbrDecsnFileFromHwpFormat("info", "dlbrDecsn", printOption, req); - - ModelAndView mav = new ModelAndView("jsonView"); + Map result = opnnSbmsnService.makeDlbrDecsnFileFromHwpFormat("info", "dlbrDecsn", printOption ,req); + ModelAndView mav = new ModelAndView("downloadView"); mav.addAllObjects(result); diff --git a/src/main/resources/template/hwp/opnnDlbrDecsnForm.hwp b/src/main/resources/template/hwp/opnnDlbrDecsnForm.hwp index a68b745b..7777ba00 100644 Binary files a/src/main/resources/template/hwp/opnnDlbrDecsnForm.hwp and b/src/main/resources/template/hwp/opnnDlbrDecsnForm.hwp differ diff --git a/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt02030-info.jsp b/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt02030-info.jsp index c4b75bf0..1726d1e1 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt02030-info.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt02030-info.jsp @@ -354,22 +354,14 @@ $P.makeHwpFileDlbrDecsn = (params) => { if (!params) return; - ajax.get({ - url : wctx.url("/" + params.taskSeCd + "/excl/excl02/010/makeHwp.do") - , data : params || {} - , success : resp => { - if (resp.filePath != null && resp.filePath != "") { - let a = document.createElement("a"); + let url = wctx.url("/" + params.taskSeCd + "/excl/excl02/010/makeHwp.do") - a.href = resp.filePath; - a.download = resp.fileName; - - document.getElementById("tempArea--${pageName}").appendChild(a); - a.click(); - document.getElementById("tempArea--${pageName}").removeChild(a); - } - } + let parameter = toQuery({ + opnnIds : params.opnnIds + , taskSeCd : params.taskSeCd }); + + document.location.href = url + "?" + parameter; } /************************************************************************** @@ -499,7 +491,7 @@ } let params = { - callPurpose : "view" + callPurpose : "download" , title : title , opnnIds : opnnId // 의견제출 ID , sggCd : $P.control.dataset.getValue("SGG_CD") // 시군구 코드