의견제출 심의의결서 출력 수정.

main
jjh 9 months ago
parent e0cd01dcda
commit da1bee74e9

@ -82,6 +82,6 @@ public interface OpnnSbmsnService {
* <li>fileName: </li> * <li>fileName: </li>
* </ul> * </ul>
*/ */
Map<String, String> makeDlbrDecsnFileFromHwpFormat(String formatType, String formatName, PrintOption printOption, LevyExclQuery req); Map<String, Object> makeDlbrDecsnFileFromHwpFormat(String formatType, String formatName, PrintOption printOption, LevyExclQuery req);
} }

@ -1,5 +1,6 @@
package cokr.xit.fims.excl.service.bean; package cokr.xit.fims.excl.service.bean;
import java.io.File;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
@ -78,8 +79,8 @@ public class OpnnSbmsnServiceBean extends AbstractServiceBean implements OpnnSbm
} }
@Override @Override
public Map<String, String> makeDlbrDecsnFileFromHwpFormat(String formatType, String formatName, PrintOption printOption, LevyExclQuery req) { public Map<String, Object> makeDlbrDecsnFileFromHwpFormat(String formatType, String formatName, PrintOption printOption, LevyExclQuery req) {
Map<String, String> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
HWPPrintUtil printUtil = new HWPPrintUtil(); HWPPrintUtil printUtil = new HWPPrintUtil();
HWPFormatWriter hwpFormatWriter = new DlbrDecsnList(); HWPFormatWriter hwpFormatWriter = new DlbrDecsnList();
@ -99,8 +100,8 @@ public class OpnnSbmsnServiceBean extends AbstractServiceBean implements OpnnSbm
try { try {
int dataIndex = 0; int dataIndex = 0;
for(int partFileIndex = 0; partFileIndex < printUtil.getTotalPartFileCount(); partFileIndex++) {
for(int partFileIndex = 0; partFileIndex < printUtil.getTotalPartFileCount(); partFileIndex++) {
// 새 파일 생성 // 새 파일 생성
String resultHwpPath = printUtil.newFileFromFormatFile(); String resultHwpPath = printUtil.newFileFromFormatFile();
HWPFile resultFile = HWPReader.fromFile(resultHwpPath); HWPFile resultFile = HWPReader.fromFile(resultHwpPath);
@ -141,12 +142,18 @@ public class OpnnSbmsnServiceBean extends AbstractServiceBean implements OpnnSbm
} }
HWPWriter.toFile(baseFile, basePath); 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 downlaodFileName = printUtil.getFormatKorName() + "_" + printUtil.getPrintRequestDt() + ".hwp";
String filePath = partFileList.get(0);
result.put("fileName", downlaodFileName); result.put("filename", downlaodFileName);
result.put("filePath", partFileList.get(0)); result.put("filePath", filePath);
result.put("file", new File(filePath));
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
throw new RuntimeException("한글 파일 출력 중 오류가 발생하였습니다."); throw new RuntimeException("한글 파일 출력 중 오류가 발생하였습니다.");

@ -338,12 +338,11 @@ public class Excl02Controller extends ApplicationController {
* }</code></pre> * }</code></pre>
*/ */
public ModelAndView makeDlbrDecsnFileFromHwpFormat(LevyExclQuery req) { public ModelAndView makeDlbrDecsnFileFromHwpFormat(LevyExclQuery req) {
Map<String,String> result = null; //
PrintOption printOption = new PrintOption(); PrintOption printOption = new PrintOption();
result = opnnSbmsnService.makeDlbrDecsnFileFromHwpFormat("info", "dlbrDecsn", printOption, req); Map<String,Object> result = opnnSbmsnService.makeDlbrDecsnFileFromHwpFormat("info", "dlbrDecsn", printOption ,req);
ModelAndView mav = new ModelAndView("downloadView");
ModelAndView mav = new ModelAndView("jsonView");
mav.addAllObjects(result); mav.addAllObjects(result);

@ -354,22 +354,14 @@
$P.makeHwpFileDlbrDecsn = (params) => { $P.makeHwpFileDlbrDecsn = (params) => {
if (!params) return; if (!params) return;
ajax.get({ let url = wctx.url("/" + params.taskSeCd + "/excl/excl02/010/makeHwp.do")
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");
a.href = resp.filePath;
a.download = resp.fileName;
document.getElementById("tempArea--${pageName}").appendChild(a); let parameter = toQuery({
a.click(); opnnIds : params.opnnIds
document.getElementById("tempArea--${pageName}").removeChild(a); , taskSeCd : params.taskSeCd
}
}
}); });
document.location.href = url + "?" + parameter;
} }
/************************************************************************** /**************************************************************************
@ -499,7 +491,7 @@
} }
let params = { let params = {
callPurpose : "view" callPurpose : "download"
, title : title , title : title
, opnnIds : opnnId // 의견제출 ID , opnnIds : opnnId // 의견제출 ID
, sggCd : $P.control.dataset.getValue("SGG_CD") // 시군구 코드 , sggCd : $P.control.dataset.getValue("SGG_CD") // 시군구 코드

Loading…
Cancel
Save