기업회원 첨부파일 뷰어 기능 추가
@c71a33ca2ab630015acfdc49c30898ba5995b446
--- src/main/java/itn/com/cmm/util/PdfUtil.java
+++ src/main/java/itn/com/cmm/util/PdfUtil.java
... | ... | @@ -132,6 +132,7 @@ |
| 132 | 132 |
contents.drawImage(pdImage, pageWidthPosition, pageHeightPosition, imgWidth, imgHeight); |
| 133 | 133 |
contents.close(); |
| 134 | 134 |
doc.save("/usr/local/tomcat/file/sht/pdf/" + uuid + ".pdf");
|
| 135 |
+ //doc.save("C:/TEST/" + uuid + ".pdf");
|
|
| 135 | 136 |
|
| 136 | 137 |
} catch (Exception e) {
|
| 137 | 138 |
System.out.println("Exception! : " + e.getMessage());
|
--- src/main/java/itn/com/cmm/web/EgovFileDownloadController.java
+++ src/main/java/itn/com/cmm/web/EgovFileDownloadController.java
... | ... | @@ -9,10 +9,6 @@ |
| 9 | 9 |
import java.net.URLEncoder; |
| 10 | 10 |
import java.util.Map; |
| 11 | 11 |
|
| 12 |
-import egovframework.rte.fdl.security.userdetails.util.EgovUserDetailsHelper; |
|
| 13 |
-import itn.com.cmm.service.EgovFileMngService; |
|
| 14 |
-import itn.com.cmm.service.FileVO; |
|
| 15 |
- |
|
| 16 | 12 |
import javax.annotation.Resource; |
| 17 | 13 |
import javax.servlet.http.HttpServletRequest; |
| 18 | 14 |
import javax.servlet.http.HttpServletResponse; |
... | ... | @@ -24,6 +20,9 @@ |
| 24 | 20 |
import org.springframework.util.FileCopyUtils; |
| 25 | 21 |
import org.springframework.web.bind.annotation.RequestMapping; |
| 26 | 22 |
import org.springframework.web.bind.annotation.RequestParam; |
| 23 |
+ |
|
| 24 |
+import itn.com.cmm.service.EgovFileMngService; |
|
| 25 |
+import itn.com.cmm.service.FileVO; |
|
| 27 | 26 |
|
| 28 | 27 |
/** |
| 29 | 28 |
* 파일 다운로드를 위한 컨트롤러 클래스 |
... | ... | @@ -468,6 +467,8 @@ |
| 468 | 467 |
|
| 469 | 468 |
|
| 470 | 469 |
File uFile = new File("/usr/local/tomcat/file/sht/pdf/", fileNm);
|
| 470 |
+ //File uFile = new File("C:/TEST/", fileNm);
|
|
| 471 |
+ |
|
| 471 | 472 |
long fSize = uFile.length(); |
| 472 | 473 |
|
| 473 | 474 |
if (fSize > 0) {
|
--- src/main/java/itn/com/cmm/web/EgovFileMngController.java
+++ src/main/java/itn/com/cmm/web/EgovFileMngController.java
... | ... | @@ -227,6 +227,33 @@ |
| 227 | 227 |
* @return |
| 228 | 228 |
* @throws Exception |
| 229 | 229 |
*/ |
| 230 |
+ @RequestMapping("/cmm/fms/selectMberFileInfs.do")
|
|
| 231 |
+ public String selectMberFileInfs(@ModelAttribute("searchVO") FileVO fileVO, @RequestParam Map<String, Object> commandMap, ModelMap model) throws Exception {
|
|
| 232 |
+ String atchFileId = (String) commandMap.get("param_atchFileId");
|
|
| 233 |
+ String pdfView = (String) commandMap.get("pdf_view"); //'Y' 이면 pdf 직접 보여주기
|
|
| 234 |
+ |
|
| 235 |
+ fileVO.setAtchFileId(atchFileId); |
|
| 236 |
+ List<FileVO> result = fileService.selectFileInfs(fileVO); |
|
| 237 |
+ model.addAttribute("fileList", result);
|
|
| 238 |
+ model.addAttribute("updateFlag", "N");
|
|
| 239 |
+ model.addAttribute("fileListCnt", result.size());
|
|
| 240 |
+ model.addAttribute("atchFileId", atchFileId);
|
|
| 241 |
+ if("Y".equals(pdfView)){
|
|
| 242 |
+ model.addAttribute("pdfView", pdfView);
|
|
| 243 |
+ } |
|
| 244 |
+ |
|
| 245 |
+ return "cmm/fms/EgovMberFileList"; |
|
| 246 |
+ } |
|
| 247 |
+ |
|
| 248 |
+ /** |
|
| 249 |
+ * 게시판 첨부파일에 대한 목록을 조회한다. |
|
| 250 |
+ * |
|
| 251 |
+ * @param fileVO |
|
| 252 |
+ * @param commandMap |
|
| 253 |
+ * @param model |
|
| 254 |
+ * @return |
|
| 255 |
+ * @throws Exception |
|
| 256 |
+ */ |
|
| 230 | 257 |
@RequestMapping("/cmm/fms/selectBBSFileInfsMjon.do")
|
| 231 | 258 |
public String selectBBSFileInfsMjon(@ModelAttribute("searchVO") FileVO fileVO, @RequestParam Map<String, Object> commandMap, ModelMap model) throws Exception {
|
| 232 | 259 |
String atchFileId = (String) commandMap.get("param_atchFileId");
|
--- src/main/java/itn/let/mjo/msg/web/MjonMsgController.java
+++ src/main/java/itn/let/mjo/msg/web/MjonMsgController.java
... | ... | @@ -1,6 +1,5 @@ |
| 1 | 1 |
package itn.let.mjo.msg.web; |
| 2 | 2 |
|
| 3 |
-import java.io.File; |
|
| 4 | 3 |
import java.io.OutputStream; |
| 5 | 4 |
import java.net.URL; |
| 6 | 5 |
import java.text.SimpleDateFormat; |
... | ... | @@ -5044,7 +5043,40 @@ |
| 5044 | 5043 |
} |
| 5045 | 5044 |
|
| 5046 | 5045 |
@RequestMapping(value = {"/uss/ion/msg/pdfView.do"})
|
| 5047 |
- public String pdfView(FileVO fileVO, ModelMap model) throws Exception {
|
|
| 5046 |
+ public String pdfView(FileVO fileVO |
|
| 5047 |
+ , ModelMap model |
|
| 5048 |
+ , HttpServletRequest request) throws Exception {
|
|
| 5049 |
+ |
|
| 5050 |
+ FileVO fvo = fileService.selectFileInf(fileVO); |
|
| 5051 |
+ String path = ""; |
|
| 5052 |
+ |
|
| 5053 |
+ if(fvo != null) {
|
|
| 5054 |
+ if("pdf".equals(fvo.getFileExtsn())) {
|
|
| 5055 |
+ path = "/cmm/fms/FileDown.do?atchFileId="+ fvo.getAtchFileId() + "&fileSn=" + fvo.getFileSn(); |
|
| 5056 |
+ }else {
|
|
| 5057 |
+ String storePath = fvo.getFileStreCours() + fvo.getStreFileNm(); |
|
| 5058 |
+ path = "/cmm/fms/FileDowntest.do?fileNm="+ PdfUtil.makeImgPdf(storePath, fvo.getFileExtsn()); |
|
| 5059 |
+ } |
|
| 5060 |
+ } |
|
| 5061 |
+ |
|
| 5062 |
+ String mberNm = request.getParameter("mberNm");
|
|
| 5063 |
+ String bizNo = request.getParameter("bizNo");
|
|
| 5064 |
+ String ceoNm = request.getParameter("ceoNm");
|
|
| 5065 |
+ String hstManagerNm = request.getParameter("hstManagerNm");
|
|
| 5066 |
+ String hstMbtlNum = request.getParameter("hstMbtlNum");
|
|
| 5067 |
+ |
|
| 5068 |
+ model.addAttribute("pdfPath", path);
|
|
| 5069 |
+ model.addAttribute("mberNm", mberNm);
|
|
| 5070 |
+ model.addAttribute("bizNo", bizNo);
|
|
| 5071 |
+ model.addAttribute("ceoNm", ceoNm);
|
|
| 5072 |
+ model.addAttribute("hstManagerNm", hstManagerNm);
|
|
| 5073 |
+ model.addAttribute("hstMbtlNum", hstMbtlNum);
|
|
| 5074 |
+ |
|
| 5075 |
+ return "/uss/ion/msg/pdfView"; |
|
| 5076 |
+ } |
|
| 5077 |
+ |
|
| 5078 |
+ @RequestMapping(value = {"/uss/ion/msg/pdfViewAjax.do"})
|
|
| 5079 |
+ public String pdfViewAjax(FileVO fileVO, ModelMap model) throws Exception {
|
|
| 5048 | 5080 |
|
| 5049 | 5081 |
FileVO fvo = fileService.selectFileInf(fileVO); |
| 5050 | 5082 |
String path = ""; |
... | ... | @@ -5061,8 +5093,6 @@ |
| 5061 | 5093 |
model.addAttribute("pdfPath", path);
|
| 5062 | 5094 |
|
| 5063 | 5095 |
return "/uss/ion/msg/pdfView"; |
| 5064 |
- } |
|
| 5065 |
- |
|
| 5066 |
- |
|
| 5096 |
+ } |
|
| 5067 | 5097 |
|
| 5068 | 5098 |
}(No newline at end of file) |
+++ src/main/webapp/WEB-INF/jsp/cmm/fms/EgovMberFileList.jsp
... | ... | @@ -0,0 +1,40 @@ |
| 1 | +<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%> | |
| 2 | + | |
| 3 | +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> | |
| 4 | +<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui"%> | |
| 5 | +<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> | |
| 6 | +<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%> | |
| 7 | +<% | |
| 8 | + | |
| 9 | +/** | |
| 10 | + * @Class Name : EgovFileList.jsp | |
| 11 | + * @Description : 파일 목록화면 | |
| 12 | + * @Modification Information | |
| 13 | + * @ | |
| 14 | + * @ 수정일 수정자 수정내용 | |
| 15 | + * @ ---------- ------ --------------------------- | |
| 16 | + * @ 2009.03.26 이삼섭 최초 생성 | |
| 17 | + * @ 2011.07.20 옥찬우 <Input> Tag id속성 추가( Line : 68 ) | |
| 18 | + * | |
| 19 | + * @author 공통서비스 개발팀 이삼섭 | |
| 20 | + * @since 2009.03.26 | |
| 21 | + * @version 1.0 | |
| 22 | + * @see | |
| 23 | + * | |
| 24 | + */ | |
| 25 | +%> | |
| 26 | + | |
| 27 | +<script type="text/javascript"> | |
| 28 | + | |
| 29 | + function fn_egov_downFile(atchFileId, fileSn){ | |
| 30 | + window.open("<c:url value='/cmm/fms/FileDown.do?atchFileId="+atchFileId+"&fileSn="+fileSn+"'/>","hiddenframe"); | |
| 31 | + } | |
| 32 | + | |
| 33 | +</script> | |
| 34 | + | |
| 35 | + <c:forEach var="fileVO" items="${fileList}" varStatus="status"> | |
| 36 | + <a href="javascript:fn_egov_downFile('<c:out value="${fileVO.atchFileId}"/>','<c:out value="${fileVO.fileSn}"/>')" class="fileName" title="다운로드"><img src="/publish/images/content/file_img2.png" alt="첨부파일"></a> | |
| 37 | + </c:forEach> | |
| 38 | + | |
| 39 | +<iframe width=0 height=0 name='hiddenframe' style='display:none;'></iframe> | |
| 40 | + |
--- src/main/webapp/WEB-INF/jsp/cmm/uss/umt/EgovMberCmpHstListByType.jsp
+++ src/main/webapp/WEB-INF/jsp/cmm/uss/umt/EgovMberCmpHstListByType.jsp
... | ... | @@ -21,6 +21,38 @@ |
| 21 | 21 |
|
| 22 | 22 |
}); |
| 23 | 23 |
|
| 24 |
+// PdfView |
|
| 25 |
+function pdfViewPop(atchFileId,mberNm,bizNo,ceoNm,hstManagerNm,hstMbtlNum) {
|
|
| 26 |
+ document.pdfForm.atchFileId.value = atchFileId; |
|
| 27 |
+ document.pdfForm.mberNm.value = mberNm; |
|
| 28 |
+ document.pdfForm.bizNo.value = bizNo; |
|
| 29 |
+ document.pdfForm.ceoNm.value = ceoNm; |
|
| 30 |
+ document.pdfForm.hstManagerNm.value = hstManagerNm; |
|
| 31 |
+ document.pdfForm.hstMbtlNum.value = hstMbtlNum; |
|
| 32 |
+ document.pdfForm.fileSn.value = 0; |
|
| 33 |
+ 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');
|
|
| 34 |
+ document.pdfForm.action = "<c:url value='/uss/ion/msg/pdfView.do'/>"; |
|
| 35 |
+ document.pdfForm.target = "taxListPopup"; |
|
| 36 |
+ document.pdfForm.submit(); |
|
| 37 |
+} |
|
| 38 |
+ |
|
| 39 |
+// 첨부파일 PdfView |
|
| 40 |
+function pdfViewPop2(atchFileId) {
|
|
| 41 |
+ $.ajax({
|
|
| 42 |
+ type: "POST", |
|
| 43 |
+ url: "/uss/ion/msg/pdfViewAjax.do", |
|
| 44 |
+ data: {"atchFileId" : atchFileId, "fileSn" : "0"},
|
|
| 45 |
+ dataType:'html', |
|
| 46 |
+ async: true, |
|
| 47 |
+ success: function (data) {
|
|
| 48 |
+ alert(data); |
|
| 49 |
+ }, |
|
| 50 |
+ error: function (e) {
|
|
| 51 |
+ //alert("ERROR : " + JSON.stringify(e));
|
|
| 52 |
+ } |
|
| 53 |
+ }); |
|
| 54 |
+} |
|
| 55 |
+ |
|
| 24 | 56 |
function fnChkAll() {
|
| 25 | 57 |
if($("#chkAll").is(':checked') ){
|
| 26 | 58 |
$("input[name=chkSttusY]").prop("checked", true);
|
... | ... | @@ -268,6 +300,16 @@ |
| 268 | 300 |
</head> |
| 269 | 301 |
<body> |
| 270 | 302 |
|
| 303 |
+<form name="pdfForm" action="<c:url value='/uss/ion/msg/pdfView.do'/>" method="post"> |
|
| 304 |
+ <input type="hidden" name="atchFileId"/> |
|
| 305 |
+ <input type="hidden" name="fileSn"/> |
|
| 306 |
+ <input type="hidden" name="mberNm"/> |
|
| 307 |
+ <input type="hidden" name="bizNo"/> |
|
| 308 |
+ <input type="hidden" name="ceoNm"/> |
|
| 309 |
+ <input type="hidden" name="hstManagerNm"/> |
|
| 310 |
+ <input type="hidden" name="hstMbtlNum"/> |
|
| 311 |
+</form> |
|
| 312 |
+ |
|
| 271 | 313 |
<form name="popupForm" action="<c:url value='/uss/umt/user/EgovMberCmpHstListPop.do'/>" method="post"> |
| 272 | 314 |
<input type="hidden" name="pageIndex" value="1"/> |
| 273 | 315 |
<input type="hidden" name="searchSortCnd" value="<c:out value="${searchVO.searchSortCnd}" />" />
|
... | ... | @@ -427,24 +469,32 @@ |
| 427 | 469 |
<c:if test="${result.bizType == item.code}"><c:out value="${fn:substring(item.codeNm,0,2)}"/></c:if>
|
| 428 | 470 |
</c:forEach> |
| 429 | 471 |
</td> |
| 430 |
- <td><c:out value="${result.mberNm}"/></td>
|
|
| 472 |
+ <td> |
|
| 473 |
+ <c:out value="${result.mberNm}"/>
|
|
| 474 |
+ </td> |
|
| 431 | 475 |
<td><a href="https://www.bizno.net/article/${result.bizNo}" target="_blank"><c:out value="${result.bizNo}"/></a></td>
|
| 432 | 476 |
<td><c:out value="${result.ceoNm}"/></td>
|
| 433 | 477 |
<td><c:out value="${result.hstManagerNm}"/></td>
|
| 434 | 478 |
<td><c:out value="${result.hstMbtlNum}"/></td>
|
| 435 |
- <td class="td_file"> |
|
| 479 |
+ <td class="td_file" style="vertical-align:middle;"> |
|
| 436 | 480 |
<c:if test="${result.atchFileId ne '' || result.atchFileId ne null}">
|
| 437 |
- <c:import url="/cmm/fms/selectAddrAgencyFileInfs.do" charEncoding="utf-8"> |
|
| 481 |
+ <c:import url="/cmm/fms/selectMberFileInfs.do" charEncoding="utf-8"> |
|
| 438 | 482 |
<c:param name="param_atchFileId" value="${result.atchFileId}" />
|
| 439 | 483 |
</c:import> |
| 440 | 484 |
</c:if> |
| 485 |
+ <c:if test="${result.atchFileId ne '' && result.atchFileId ne null}">
|
|
| 486 |
+ <button class="btnType btnType20" onclick="pdfViewPop('${result.atchFileId}','${result.mberNm}','${result.bizNo}','${result.ceoNm}','${result.hstManagerNm}','${result.hstMbtlNum}')" style="height:20px !important; padding:0 2px !important;">V</button>
|
|
| 487 |
+ </c:if> |
|
| 441 | 488 |
</td> |
| 442 | 489 |
<td class="td_file"> |
| 443 | 490 |
<c:if test="${result.workAtchFileId ne '' || result.workAtchFileId ne null}">
|
| 444 |
- <c:import url="/cmm/fms/selectAddrAgencyFileInfs.do" charEncoding="utf-8"> |
|
| 491 |
+ <c:import url="/cmm/fms/selectMberFileInfs.do" charEncoding="utf-8"> |
|
| 445 | 492 |
<c:param name="param_atchFileId" value="${result.workAtchFileId}" />
|
| 446 | 493 |
</c:import> |
| 447 | 494 |
</c:if> |
| 495 |
+ <c:if test="${result.workAtchFileId ne '' && result.workAtchFileId ne null}">
|
|
| 496 |
+ <button class="btnType btnType20" onclick="pdfViewPop('${result.workAtchFileId}','${result.mberNm}','${result.bizNo}','${result.ceoNm}','${result.hstManagerNm}','${result.hstMbtlNum}')" style="height:20px !important; padding:0 2px !important;">V</button>
|
|
| 497 |
+ </c:if> |
|
| 448 | 498 |
</td> |
| 449 | 499 |
<td> |
| 450 | 500 |
<c:forEach var="item" items="${hstTypeList}" varStatus="status">
|
--- src/main/webapp/WEB-INF/jsp/uss/ion/msg/pdfView.jsp
+++ src/main/webapp/WEB-INF/jsp/uss/ion/msg/pdfView.jsp
... | ... | @@ -26,18 +26,59 @@ |
| 26 | 26 |
<html lang="ko"> |
| 27 | 27 |
|
| 28 | 28 |
<head> |
| 29 |
+ <link rel="stylesheet" href="/pb/css/reset.css"> |
|
| 30 |
+ <link rel="stylesheet" href="/pb/css/common.css"> |
|
| 31 |
+ <link rel="stylesheet" href="/pb/css/content.css?date=202301160001"> |
|
| 32 |
+ <link rel="stylesheet" href="/pb/css/popup.css"> |
|
| 33 |
+ |
|
| 29 | 34 |
<script type="text/javascript" src="<c:url value='/js/EgovMultiFile.js'/>"></script> |
| 30 | 35 |
<script src="//mozilla.github.io/pdf.js/build/pdf.js"></script> |
| 31 | 36 |
</head> |
| 32 | 37 |
<body> |
| 33 | 38 |
|
| 34 |
-<div> |
|
| 35 |
- <button id="prev">Previous</button> |
|
| 36 |
- <button id="next">Next</button> |
|
| 37 |
- |
|
| 38 |
- <span>Page: <span id="page_num"></span> / <span id="page_count"></span></span> |
|
| 39 |
-</div> |
|
| 40 |
-<canvas id="the-canvas" name="the-canvas"></canvas> |
|
| 39 |
+ <div class="pageCont" style="text-align: center; width: 1000px;"> |
|
| 40 |
+ <div class="tableWrap"> |
|
| 41 |
+ <table class="tbType1"> |
|
| 42 |
+ <colgroup> |
|
| 43 |
+ <col style="width: *%"> |
|
| 44 |
+ <col style="width: 20%"> |
|
| 45 |
+ <col style="width: 20%"> |
|
| 46 |
+ <col style="width: 20%"> |
|
| 47 |
+ <col style="width: 20%"> |
|
| 48 |
+ </colgroup> |
|
| 49 |
+ <thead> |
|
| 50 |
+ <tr> |
|
| 51 |
+ <th>기업명</th> |
|
| 52 |
+ <th>사업자번호</th> |
|
| 53 |
+ <th>대표자</th> |
|
| 54 |
+ <th>담당자</th> |
|
| 55 |
+ <th>휴대폰</th> |
|
| 56 |
+ </tr> |
|
| 57 |
+ </thead> |
|
| 58 |
+ <tbody> |
|
| 59 |
+ <tr> |
|
| 60 |
+ <td>${mberNm}</td>
|
|
| 61 |
+ <td>${bizNo}</td>
|
|
| 62 |
+ <td>${ceoNm}</td>
|
|
| 63 |
+ <td>${hstManagerNm}</td>
|
|
| 64 |
+ <td>${hstMbtlNum}</td>
|
|
| 65 |
+ </tr> |
|
| 66 |
+ </tbody> |
|
| 67 |
+ </table> |
|
| 68 |
+ </div> |
|
| 69 |
+ |
|
| 70 |
+ <canvas id="the-canvas" name="the-canvas" style="max-width: 1000px; margin-top: 25px; margin-bottom: 25px;"></canvas> |
|
| 71 |
+ |
|
| 72 |
+ <div> |
|
| 73 |
+ <button class="btnType" id="prev">Previous</button> |
|
| 74 |
+ <span>Page: <span id="page_num"></span> / <span id="page_count"></span></span> |
|
| 75 |
+ <button class="btnType" id="next">Next</button> |
|
| 76 |
+ |
|
| 77 |
+ <div style="float: right; margin-right: 10px;"><button onclick="javascript:self.close()" class="btnType">CLOSE</button></div> |
|
| 78 |
+ </div> |
|
| 79 |
+ |
|
| 80 |
+ </div> |
|
| 81 |
+ |
|
| 41 | 82 |
</body> |
| 42 | 83 |
</html> |
| 43 | 84 |
<script type="text/javaScript" language="javascript"> |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?