공지사항, 상세조회 : DB 연동 적용

This commit is contained in:
KNKIM 2021-09-14 16:43:53 +09:00
parent 32335a2ae5
commit 7bb4bab799
7 changed files with 455 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

View File

@ -0,0 +1,167 @@
package nlib.bbs.service;
/**
* <pre>
* @Class Name : AttachFileVO.java
*
* @Description : 첨부파일 정보 VO
*
*
* @프로젝트명: 지방문화원 통합자료관리시스템 구축사업 (2021)
*
* </pre>
*
* @ ------------ -------- ---------------------------
* @ 수정일 수정자 수정내용
* @ ------------ -------- ---------------------------
* @ 2021. 9. 14. KNKIM 최초 생성
*
*
* @author 이씨플라자 * DIGITALSHIP KNKIM
* @since 2021. 9. 14.
* @version 1.0
*
*/
public class AttachFileVO {
private String subPathKey; /* 첨부파일서브경로 */
private String fileMask; /* 첨부파일아이디 */
private String fileId; /* 업무 아이디 */
private int fileSeq; /* 파일 번호 */
private String fileName; /* 파일 이름 */
private int fileSize; /* 파일 사이즈 */
private String fileTypeCd; /* 파일 유형(디지털화사용) */
private int downloadCount; /* 파일 다운로드 횟수 */
private String downloadExpireDate; /* 파일 만료 날짜 */
private int downloadLimitCount; /* 파일 다운로드 제한 횟수 */
private String deleteYn; /* 삭제 여부 */
private String streamingUrl; /* 스트리밍URL */
private String content; /* 내용주기 */
private String atchTypeCd; /* 첨부파일유형 */
private String regDd; /* 등록 날짜 */
public String getFileMask() {
return fileMask;
}
public void setFileMask(String fileMask) {
this.fileMask = fileMask;
}
public String getFileId() {
return fileId;
}
public void setFileId(String fileId) {
this.fileId = fileId;
}
public String getFileName() {
return fileName;
}
public void setFileName(String fileName) {
this.fileName = fileName;
}
public String getFileTypeCd() {
return fileTypeCd;
}
public void setFileTypeCd(String fileTypeCd) {
this.fileTypeCd = fileTypeCd;
}
public String getDownloadExpireDate() {
return downloadExpireDate;
}
public void setDownloadExpireDate(String downloadExpireDate) {
this.downloadExpireDate = downloadExpireDate;
}
public String getDeleteYn() {
return deleteYn;
}
public void setDeleteYn(String deleteYn) {
this.deleteYn = deleteYn;
}
public String getStreamingUrl() {
return streamingUrl;
}
public void setStreamingUrl(String streamingUrl) {
this.streamingUrl = streamingUrl;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getAtchTypeCd() {
return atchTypeCd;
}
public void setAtchTypeCd(String atchTypeCd) {
this.atchTypeCd = atchTypeCd;
}
public String getRegDd() {
return regDd;
}
public void setRegDd(String regDd) {
this.regDd = regDd;
}
public int getFileSeq() {
return fileSeq;
}
public void setFileSeq(int fileSeq) {
this.fileSeq = fileSeq;
}
public int getFileSize() {
return fileSize;
}
public void setFileSize(int fileSize) {
this.fileSize = fileSize;
}
public int getDownloadCount() {
return downloadCount;
}
public void setDownloadCount(int downloadCount) {
this.downloadCount = downloadCount;
}
public int getDownloadLimitCount() {
return downloadLimitCount;
}
public void setDownloadLimitCount(int downloadLimitCount) {
this.downloadLimitCount = downloadLimitCount;
}
public String getSubPathKey() {
return subPathKey;
}
public void setSubPathKey(String subPathKey) {
this.subPathKey = subPathKey;
}
}

View File

@ -0,0 +1,68 @@
package nlib.bbs.service.impl;
import java.util.List;
import javax.annotation.Resource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import nlib.bbs.service.ArticleVO;
import nlib.bbs.service.BoardService;
import nlib.util.StringUtil;
public abstract class BoardServiceImpl implements BoardService
{
static Logger log = LoggerFactory.getLogger(BoardServiceImpl.class);
public abstract BoardDAO getBoardDAO();
/*
* 게시글 목록을 조회한다.
*/
public List<ArticleVO> listArticles(ArticleVO articleVO) throws Exception {
return getBoardDAO().listArticles(articleVO);
}
/**
* 게시글 건수를 조회한다.
*/
public int countArticles(ArticleVO articleVO) throws Exception {
return getBoardDAO().countArticles(articleVO);
}
/**
* 조회수를 증가시킨다.
*
* @param
* @return
* @throws Exception
*/
public int updateRead(ArticleVO articleVO) throws Exception {
return getBoardDAO().updateRead(articleVO);
}
/**
* 게시글 상세 내용을 조회한다.
*
* @param
* @return
* @throws Exception
*/
public ArticleVO selectArticle(ArticleVO articleVO) throws Exception {
// 게시글 조회
ArticleVO retVO = getBoardDAO().selectArticle(articleVO);
// 첨부파일 조회
if(StringUtil.isNotEmpty(retVO.getBdAttachFileId())) retVO.setAttachFiles(getBoardDAO().listAttachFiles(retVO.getBdAttachFileId()));
// 조회수 증가
updateRead(articleVO);
return retVO;
}
}

View File

@ -0,0 +1,64 @@
package nlib.cmm.fileupload;
/**
* <pre>
* @Class Name : AttachFileVO.java
*
* @Description : 첨부파일 정보 VO
*
*
* @프로젝트명: 지방문화원 통합자료관리시스템 구축사업 (2021)
*
* </pre>
*
* @ ------------ -------- ---------------------------
* @ 수정일 수정자 수정내용
* @ ------------ -------- ---------------------------
* @ 2021. 9. 14. KNKIM 최초 생성
*
*
* @author 이씨플라자 * DIGITALSHIP KNKIM
* @since 2021. 9. 14.
* @version 1.0
*
*/
public class FileVO {
private String subPathKey; /* 첨부파일서브경로 */
private String fileMask; /* 첨부파일아이디 */
private String fileId; /* 업무 아이디 */
private int fileSeq; /* 파일 번호 */
private String fileName; /* 파일 이름 */
public String getSubPathKey() {
return subPathKey;
}
public void setSubPathKey(String subPathKey) {
this.subPathKey = subPathKey;
}
public String getFileMask() {
return fileMask;
}
public void setFileMask(String fileMask) {
this.fileMask = fileMask;
}
public String getFileId() {
return fileId;
}
public void setFileId(String fileId) {
this.fileId = fileId;
}
public int getFileSeq() {
return fileSeq;
}
public void setFileSeq(int fileSeq) {
this.fileSeq = fileSeq;
}
public String getFileName() {
return fileName;
}
public void setFileName(String fileName) {
this.fileName = fileName;
}
}

View File

@ -0,0 +1,155 @@
<%
/**
* <pre>
* @Class Name : selectAncmntArticle.jsp
*
* @Description : 공지사항 상세내용을 조회한다.
*
*
* @프로젝트명: 지방문화원 통합자료관리시스템 구축사업 (2021)
*
* </pre>
*
* @ ------------ -------- ---------------------------
* @ 수정일 수정자 수정내용
* @ ------------ -------- ---------------------------
* @ 2021. 9. 14. KNKIM 최초 생성
*
*
* @author 이씨플라자 * DIGITALSHIP KNKIM
* @since 2021. 9. 14.
* @version 1.0
*
*/
%>
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="validator" uri="http://www.springmodules.org/tags/commons-validator" %>
<c:set var="pageTitle">공지사항 - 상세조회</c:set>
<!DOCTYPE html>
<html lang="ko">
<head>
<title>${pageTitle}</title>
<script type="text/javaScript" language="javascript">
// 목록으로 이동
function fn_list() {
$("#articleForm").attr("action", "${pageContext.request.contextPath}/bbs/listAncmnts.do");
$("#articleForm").submit();
}
// 파일 다운로드
function fn_downloadFile(fileId, fileSeq, fileName) {
if(fileId == null || fileId.trim().length < 1) {
alert("파일정보를 확인해 주시기 바랍니다.[1]");
return;
}
if(fileSeq < 1) {
alert("파일정보를 확인해 주시기 바랍니다.[2]");
return;
}
if(fileName == null || fileName.trim().length < 1) {
alert("파일정보를 확인해 주시기 바랍니다.[3]");
return;
}
$("#fileId").val(fileId);
$("#fileSeq").val(fileSeq);
$("#fileName").val(fileName);
$("#downloadFileForm").submit();
}
</script>
</head>
<body>
<h1>${pageTitle }</h1>
메시지 : <span style="color:red;">${message }</span>
<br />
<form name="articleForm" id="articleForm"
action="${pageContext.request.contextPath}/board/listNotices.do"
method="post">
<!-- HIDDEN 영역 : 시작 -->
<input type="text" name="pageIndex" id="pageIndex" title="페이지번호" value="${searchArticle.pageIndex}" readonly />
<input type="text" name="pageSize" id="pageSize" title="목록에 보여줄 글개수" value="${searchArticle.pageSize}" readonly />
<input type="text" name="searchType" id="searchType" title="검색구분" value="${searchArticle.searchType}" readonly />
<input type="text" name="searchKeyword" id="searchKeyword" title="검색어" value="${searchArticle.searchKeyword}" readonly />
<input type="text" name="articleId" id="articleId" title="선택글번호" value="${searchArticle.articleId}" readonly />
<!-- HIDDEN 영역 : 종료 -->
<table class="table_content" style="width:100% !important; margin-top: 20px;">
<tr>
<th>유형</th>
<td>
<c:if test='${article.notiYn == "Y"}'>공지</c:if>
<c:if test='${article.notiYn != "Y"}'>일반</c:if>
</td>
<th>작성일</th>
<td>${article.regDd }</td>
</tr>
<tr>
<th rowspan="1">제목</th>
<td colspan="3">${article.title}</td>
</tr>
<tr>
<th rowspan="1">질문내용</th>
<td colspan="3">${article.content}</td>
</tr>
<c:if test="${article.attachFileCnt > 0}">
<tr>
<td colspan="4">
<%
// 파일정보 : 저장파일ID=원파일명
%>
<c:forEach var="attachFile" items="${article.attachFiles }">
<a href="javascript:void(0);" onclick="fn_downloadFile('${attachFile.fileId}', ${attachFile.fileSeq}, '${attachFile.fileName}')">${attachFile.fileName} (${attachFile.fileSize} byte(s))</a><br/>
</c:forEach>
</td>
</tr>
</c:if>
<c:if test="${article.attachFileCnt < 1}">
<td colspan="4">첨부파일 없음
</td>
</c:if>
</table>
<br/>
<!-- 관련 작업 버튼 -->
<button type="button" name="btnList" id="btnList" class="float"
onclick="fn_list()">목록</button>
</form>
<br />
<!-- 첨부파일 다운로드용 폼 -->
<form name="downloadFileForm" id="downloadFileForm"
action="${pageContext.request.contextPath}/fileupload/downloadAttachFile.do"
method="post">
<input type="text" name="subPathKey" id="subPathKey" value="fileupload.bbs.ancmnt.subpath" readonly />
<input type="text" name="fileId" id="fileId" value="" readonly />
<input type="text" name="fileSeq" id="fileSeq" value="" readonly />
<input type="text" name="fileName" id="fileName" value="" readonly />
</form>
</body>
</html>

View File

@ -0,0 +1 @@
Tue Sep 14 2021 08:25:17 GMT+0900 (대한민국 표준시)

View File