From c71a33ca2ab630015acfdc49c30898ba5995b446 Mon Sep 17 00:00:00 2001 From: itn Date: Tue, 1 Aug 2023 15:04:33 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B8=B0=EC=97=85=ED=9A=8C=EC=9B=90=20?= =?UTF-8?q?=EC=B2=A8=EB=B6=80=ED=8C=8C=EC=9D=BC=20=EB=B7=B0=EC=96=B4=20?= =?UTF-8?q?=EA=B8=B0=EB=8A=A5=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/itn/com/cmm/util/PdfUtil.java | 1 + .../cmm/web/EgovFileDownloadController.java | 9 +-- .../com/cmm/web/EgovFileMngController.java | 27 +++++++++ .../let/mjo/msg/web/MjonMsgController.java | 40 +++++++++++-- .../WEB-INF/jsp/cmm/fms/EgovMberFileList.jsp | 40 +++++++++++++ .../cmm/uss/umt/EgovMberCmpHstListByType.jsp | 58 +++++++++++++++++-- .../WEB-INF/jsp/uss/ion/msg/pdfView.jsp | 55 +++++++++++++++--- 7 files changed, 210 insertions(+), 20 deletions(-) create mode 100644 src/main/webapp/WEB-INF/jsp/cmm/fms/EgovMberFileList.jsp diff --git a/src/main/java/itn/com/cmm/util/PdfUtil.java b/src/main/java/itn/com/cmm/util/PdfUtil.java index a93216c0..97014445 100644 --- a/src/main/java/itn/com/cmm/util/PdfUtil.java +++ b/src/main/java/itn/com/cmm/util/PdfUtil.java @@ -132,6 +132,7 @@ public final class PdfUtil { contents.drawImage(pdImage, pageWidthPosition, pageHeightPosition, imgWidth, imgHeight); contents.close(); doc.save("/usr/local/tomcat/file/sht/pdf/" + uuid + ".pdf"); + //doc.save("C:/TEST/" + uuid + ".pdf"); } catch (Exception e) { System.out.println("Exception! : " + e.getMessage()); diff --git a/src/main/java/itn/com/cmm/web/EgovFileDownloadController.java b/src/main/java/itn/com/cmm/web/EgovFileDownloadController.java index 2c9f7e60..36bc34e8 100644 --- a/src/main/java/itn/com/cmm/web/EgovFileDownloadController.java +++ b/src/main/java/itn/com/cmm/web/EgovFileDownloadController.java @@ -9,10 +9,6 @@ import java.io.PrintWriter; import java.net.URLEncoder; import java.util.Map; -import egovframework.rte.fdl.security.userdetails.util.EgovUserDetailsHelper; -import itn.com.cmm.service.EgovFileMngService; -import itn.com.cmm.service.FileVO; - import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -25,6 +21,9 @@ import org.springframework.util.FileCopyUtils; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; +import itn.com.cmm.service.EgovFileMngService; +import itn.com.cmm.service.FileVO; + /** * 파일 다운로드를 위한 컨트롤러 클래스 * @author 공통서비스개발팀 이삼섭 @@ -468,6 +467,8 @@ public class EgovFileDownloadController { File uFile = new File("/usr/local/tomcat/file/sht/pdf/", fileNm); + //File uFile = new File("C:/TEST/", fileNm); + long fSize = uFile.length(); if (fSize > 0) { diff --git a/src/main/java/itn/com/cmm/web/EgovFileMngController.java b/src/main/java/itn/com/cmm/web/EgovFileMngController.java index fd106d72..0939e859 100644 --- a/src/main/java/itn/com/cmm/web/EgovFileMngController.java +++ b/src/main/java/itn/com/cmm/web/EgovFileMngController.java @@ -218,6 +218,33 @@ public class EgovFileMngController { return "cmm/fms/EgovAddrAgencyFileList"; } + /** + * 게시판 첨부파일에 대한 목록을 조회한다. + * + * @param fileVO + * @param commandMap + * @param model + * @return + * @throws Exception + */ + @RequestMapping("/cmm/fms/selectMberFileInfs.do") + public String selectMberFileInfs(@ModelAttribute("searchVO") FileVO fileVO, @RequestParam Map commandMap, ModelMap model) throws Exception { + String atchFileId = (String) commandMap.get("param_atchFileId"); + String pdfView = (String) commandMap.get("pdf_view"); //'Y' 이면 pdf 직접 보여주기 + + fileVO.setAtchFileId(atchFileId); + List result = fileService.selectFileInfs(fileVO); + model.addAttribute("fileList", result); + model.addAttribute("updateFlag", "N"); + model.addAttribute("fileListCnt", result.size()); + model.addAttribute("atchFileId", atchFileId); + if("Y".equals(pdfView)){ + model.addAttribute("pdfView", pdfView); + } + + return "cmm/fms/EgovMberFileList"; + } + /** * 게시판 첨부파일에 대한 목록을 조회한다. * diff --git a/src/main/java/itn/let/mjo/msg/web/MjonMsgController.java b/src/main/java/itn/let/mjo/msg/web/MjonMsgController.java index b0d2169f..c6c23fac 100644 --- a/src/main/java/itn/let/mjo/msg/web/MjonMsgController.java +++ b/src/main/java/itn/let/mjo/msg/web/MjonMsgController.java @@ -1,6 +1,5 @@ package itn.let.mjo.msg.web; -import java.io.File; import java.io.OutputStream; import java.net.URL; import java.text.SimpleDateFormat; @@ -5044,7 +5043,40 @@ public class MjonMsgController { } @RequestMapping(value = {"/uss/ion/msg/pdfView.do"}) - public String pdfView(FileVO fileVO, ModelMap model) throws Exception { + public String pdfView(FileVO fileVO + , ModelMap model + , HttpServletRequest request) throws Exception { + + FileVO fvo = fileService.selectFileInf(fileVO); + String path = ""; + + if(fvo != null) { + if("pdf".equals(fvo.getFileExtsn())) { + path = "/cmm/fms/FileDown.do?atchFileId="+ fvo.getAtchFileId() + "&fileSn=" + fvo.getFileSn(); + }else { + String storePath = fvo.getFileStreCours() + fvo.getStreFileNm(); + path = "/cmm/fms/FileDowntest.do?fileNm="+ PdfUtil.makeImgPdf(storePath, fvo.getFileExtsn()); + } + } + + String mberNm = request.getParameter("mberNm"); + String bizNo = request.getParameter("bizNo"); + String ceoNm = request.getParameter("ceoNm"); + String hstManagerNm = request.getParameter("hstManagerNm"); + String hstMbtlNum = request.getParameter("hstMbtlNum"); + + model.addAttribute("pdfPath", path); + model.addAttribute("mberNm", mberNm); + model.addAttribute("bizNo", bizNo); + model.addAttribute("ceoNm", ceoNm); + model.addAttribute("hstManagerNm", hstManagerNm); + model.addAttribute("hstMbtlNum", hstMbtlNum); + + return "/uss/ion/msg/pdfView"; + } + + @RequestMapping(value = {"/uss/ion/msg/pdfViewAjax.do"}) + public String pdfViewAjax(FileVO fileVO, ModelMap model) throws Exception { FileVO fvo = fileService.selectFileInf(fileVO); String path = ""; @@ -5061,8 +5093,6 @@ public class MjonMsgController { model.addAttribute("pdfPath", path); return "/uss/ion/msg/pdfView"; - } - - + } } \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/jsp/cmm/fms/EgovMberFileList.jsp b/src/main/webapp/WEB-INF/jsp/cmm/fms/EgovMberFileList.jsp new file mode 100644 index 00000000..af8d75bb --- /dev/null +++ b/src/main/webapp/WEB-INF/jsp/cmm/fms/EgovMberFileList.jsp @@ -0,0 +1,40 @@ +<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%> + +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> +<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%> +<% + +/** + * @Class Name : EgovFileList.jsp + * @Description : 파일 목록화면 + * @Modification Information + * @ + * @ 수정일 수정자 수정내용 + * @ ---------- ------ --------------------------- + * @ 2009.03.26 이삼섭 최초 생성 + * @ 2011.07.20 옥찬우 Tag id속성 추가( Line : 68 ) + * + * @author 공통서비스 개발팀 이삼섭 + * @since 2009.03.26 + * @version 1.0 + * @see + * + */ +%> + + + + + ','')" class="fileName" title="다운로드">첨부파일 + + + + diff --git a/src/main/webapp/WEB-INF/jsp/cmm/uss/umt/EgovMberCmpHstListByType.jsp b/src/main/webapp/WEB-INF/jsp/cmm/uss/umt/EgovMberCmpHstListByType.jsp index bc0fc7c1..cb41d843 100644 --- a/src/main/webapp/WEB-INF/jsp/cmm/uss/umt/EgovMberCmpHstListByType.jsp +++ b/src/main/webapp/WEB-INF/jsp/cmm/uss/umt/EgovMberCmpHstListByType.jsp @@ -21,6 +21,38 @@ $( document ).ready(function() { }); +// PdfView +function pdfViewPop(atchFileId,mberNm,bizNo,ceoNm,hstManagerNm,hstMbtlNum) { + document.pdfForm.atchFileId.value = atchFileId; + document.pdfForm.mberNm.value = mberNm; + document.pdfForm.bizNo.value = bizNo; + document.pdfForm.ceoNm.value = ceoNm; + document.pdfForm.hstManagerNm.value = hstManagerNm; + document.pdfForm.hstMbtlNum.value = hstMbtlNum; + document.pdfForm.fileSn.value = 0; + window.open("about:blank", 'taxListPopup', 'width=1020, height=800, top=100, left=0, fullscreen=no, menubar=no, status=no, toolbar=no, titlebar=no, location=no, scrollbar=no'); + document.pdfForm.action = ""; + document.pdfForm.target = "taxListPopup"; + document.pdfForm.submit(); +} + +// 첨부파일 PdfView +function pdfViewPop2(atchFileId) { + $.ajax({ + type: "POST", + url: "/uss/ion/msg/pdfViewAjax.do", + data: {"atchFileId" : atchFileId, "fileSn" : "0"}, + dataType:'html', + async: true, + success: function (data) { + alert(data); + }, + error: function (e) { + //alert("ERROR : " + JSON.stringify(e)); + } + }); +} + function fnChkAll() { if($("#chkAll").is(':checked') ){ $("input[name=chkSttusY]").prop("checked", true); @@ -268,6 +300,16 @@ function fnSetCalMonth(val) { +
+ + + + + + + +
+
" /> @@ -427,24 +469,32 @@ function fnSetCalMonth(val) { - + + + - + - + + + + - + + + + diff --git a/src/main/webapp/WEB-INF/jsp/uss/ion/msg/pdfView.jsp b/src/main/webapp/WEB-INF/jsp/uss/ion/msg/pdfView.jsp index da7e1206..19a260d1 100644 --- a/src/main/webapp/WEB-INF/jsp/uss/ion/msg/pdfView.jsp +++ b/src/main/webapp/WEB-INF/jsp/uss/ion/msg/pdfView.jsp @@ -26,18 +26,59 @@ + + + + + -
- - -     - Page: / -
- +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
기업명사업자번호대표자담당자휴대폰
${mberNm}${bizNo}${ceoNm}${hstManagerNm}${hstMbtlNum}
+
+ + + +
+ +  Page: /   + + +
+
+ +
+