이지우 - 탭(카테고리) 게시판 기능 추가
This commit is contained in:
parent
50d3e16840
commit
4e57a22bde
@ -3717,6 +3717,102 @@ public class EgovBBSManageController {
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value= {"/web/cop/bbs/selectDataBoardList.do"})
|
||||
public String selectDataBoardListWeb(HttpServletRequest request, @ModelAttribute("searchVO") BoardMasterVO boardMasterVO, ModelMap model ,
|
||||
BoardVO boardVO , RedirectAttributes redirectAttributes) throws Exception {
|
||||
|
||||
|
||||
return "web/cop/bbs/DataBoardList";
|
||||
|
||||
|
||||
}
|
||||
|
||||
@RequestMapping(value= {"/web/cop/bbs/selectDataBoardListAjax.do"})
|
||||
public String selectDataBoardListAjaxWeb(HttpServletRequest request, @ModelAttribute("searchVO") BoardMasterVO boardMasterVO, ModelMap model ,
|
||||
BoardVO boardVO , RedirectAttributes redirectAttributes) throws Exception {
|
||||
|
||||
|
||||
BoardMasterVO bmVO = new BoardMasterVO();
|
||||
bmVO.setBbsId(boardVO.getBbsId());
|
||||
bmVO = bbsAttrbService.selectBBSMasterInf(bmVO);
|
||||
|
||||
if (bmVO == null || ("N").equals(bmVO.getUseAt())) {
|
||||
redirectAttributes.addFlashAttribute("message", egovMessageSource.getMessage("fail.common.imposbl"));
|
||||
return "redirect:/web/main/mainPage.do";
|
||||
}
|
||||
|
||||
boardVO.setPageUnit(Integer.parseInt(bmVO.getListNum()));
|
||||
boardVO.setPageSize(Integer.parseInt(bmVO.getPageNum()));
|
||||
|
||||
PaginationInfo paginationInfo = new PaginationInfo();
|
||||
|
||||
paginationInfo.setCurrentPageNo(boardVO.getPageIndex());
|
||||
paginationInfo.setRecordCountPerPage(boardVO.getPageUnit());
|
||||
paginationInfo.setPageSize(boardVO.getPageSize());
|
||||
|
||||
boardVO.setFirstIndex(paginationInfo.getFirstRecordIndex());
|
||||
boardVO.setLastIndex(paginationInfo.getLastRecordIndex());
|
||||
boardVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage());
|
||||
|
||||
Map<String, Object> map = bbsMngService.selectBoardArticlesWeb(boardVO, null);
|
||||
int totCnt = Integer.parseInt((String) map.get("resultCnt"));
|
||||
paginationInfo.setTotalRecordCount(totCnt);
|
||||
|
||||
|
||||
List<BoardVO> resultList = (List<BoardVO>)map.get("resultList");
|
||||
|
||||
//모바일
|
||||
PaginationInfo paginationInfoMobile = new PaginationInfo();
|
||||
paginationInfoMobile.setCurrentPageNo(paginationInfo.getCurrentPageNo());
|
||||
paginationInfoMobile.setTotalRecordCount(paginationInfo.getTotalRecordCount());
|
||||
paginationInfoMobile.setPageSize(5);
|
||||
paginationInfoMobile.setRecordCountPerPage(paginationInfo.getRecordCountPerPage());
|
||||
|
||||
model.addAttribute("resultList", resultList);
|
||||
model.addAttribute("resultCnt", map.get("resultCnt"));
|
||||
model.addAttribute("boardVO", boardVO);
|
||||
model.addAttribute("brdMstrVO", bmVO);
|
||||
model.addAttribute("paginationInfo", paginationInfo);
|
||||
model.addAttribute("paginationInfoMobile", paginationInfoMobile);
|
||||
|
||||
return "web/cop/bbs/DataBoardListAjax";
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value= {"/web/cop/bbs/selectDataBoardDetail.do"} )
|
||||
public String selectDataBoardArticleWeb(HttpServletRequest request, @ModelAttribute("searchVO") BoardVO boardVO,
|
||||
BoardMasterVO masterVO,
|
||||
ModelMap model ,
|
||||
@RequestParam Map<String, Object> commandMap,
|
||||
RedirectAttributes redirectAttributes) throws Exception {
|
||||
|
||||
BoardMasterVO bmVO = new BoardMasterVO();
|
||||
bmVO.setBbsId(boardVO.getBbsId());
|
||||
bmVO = bbsAttrbService.selectBBSMasterInf(bmVO);
|
||||
BoardVO bdVO = bbsMngService.selectBoardArticleWeb(boardVO);
|
||||
if (bmVO == null || ("N").equals(bmVO.getUseAt())) {
|
||||
redirectAttributes.addFlashAttribute("message", egovMessageSource.getMessage("fail.common.imposbl"));
|
||||
return "redirect:/web/main/mainPage.do";
|
||||
}
|
||||
|
||||
// 조회수 증가 여부 지정
|
||||
boardVO.setPlusCount(true);
|
||||
bbsMngService.updateBoardArticleInqireCo(boardVO);
|
||||
|
||||
//게시판 마스터 옵션 정보
|
||||
BoardMasterVO searchVO = new BoardMasterVO();
|
||||
searchVO.setBbsId(boardVO.getBbsId());
|
||||
BoardMasterVO resultBbsMsInfo = bbsAttrbService.selectBBSMasterInf(searchVO);
|
||||
|
||||
model.addAttribute("result", bdVO);
|
||||
model.addAttribute("brdMstrVO", bmVO);
|
||||
model.addAttribute("resultBbsMsInfo", resultBbsMsInfo);
|
||||
|
||||
return "web/cop/bbs/EgovDataNoticeInqire";
|
||||
}
|
||||
|
||||
public String getDateDay(String date, String dateType) throws Exception {
|
||||
String day = "" ;
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat(dateType) ;
|
||||
|
||||
63
src/main/webapp/WEB-INF/jsp/web/cop/bbs/DataBoardList.jsp
Normal file
63
src/main/webapp/WEB-INF/jsp/web/cop/bbs/DataBoardList.jsp
Normal file
@ -0,0 +1,63 @@
|
||||
<%@ 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"%>
|
||||
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
/* 메뉴 첫 이동 시 교안 게시글 조회 */
|
||||
$("#list1").click();
|
||||
});
|
||||
|
||||
function listLoad(bbsId, pageIndex){
|
||||
$("#bbsId").val(bbsId);
|
||||
$("#pageIndex").val(pageIndex);
|
||||
var sendData = $(document.bbsForm).serializeArray();
|
||||
$("#bbsLoad").load("<c:url value = '/web/cop/bbs/selectDataBoardListAjax.do' />", sendData ,function(response, status, xhr){
|
||||
});
|
||||
}
|
||||
|
||||
function linkPage(pageNo) {
|
||||
|
||||
$("#searchCnd").val($("#subSearch").val());
|
||||
$("#searchWrd").val($("#subsearchTxt").val());
|
||||
listLoad($("#bbsId").val(), pageNo);
|
||||
}
|
||||
|
||||
function fn_egov_inqire_notice(bbsId, nttId) {
|
||||
document.frm.nttId.value = nttId;
|
||||
document.frm.bbsId.value = bbsId;
|
||||
document.frm.method = "get";
|
||||
document.frm.action = "<c:url value='/web/cop/bbs/selectDataBoardDetail.do'/>";
|
||||
document.frm.submit();
|
||||
}
|
||||
|
||||
function enterkey() {
|
||||
if (window.event.keyCode == 13) {
|
||||
alert('1234');
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
<form name="bbsForm" id="bbsForm">
|
||||
<input type="hidden" name="bbsId" id="bbsId" value="">
|
||||
<input type="hidden" name="pageIndex" id="pageIndex" value="">
|
||||
<input type="hidden" name="searchCnd" id="searchCnd" value="">
|
||||
<input type="hidden" name="searchWrd" id="searchWrd" value="">
|
||||
</form>
|
||||
<div class="cont_wrap" id="sub">
|
||||
<div class="cont_tit">
|
||||
<h2>자료실</h2>
|
||||
</div>
|
||||
|
||||
<ul class="tab tab_03">
|
||||
<li class="tab_li"><button type="button" id="list1" class="tab_button" onclick="listLoad('BBSMSTR_000000000020', '1');">교안</button></li>
|
||||
<li class="tab_li"><button type="button" id="list2" class="tab_button" onclick="listLoad('BBSMSTR_000000000021', '1');">콘텐츠</button></li>
|
||||
<li class="tab_li"><button type="button" id="list3" class="tab_button" onclick="listLoad('BBSMSTR_000000000022', '1');">기타</button></li>
|
||||
</ul>
|
||||
|
||||
<div id="bbsLoad">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
174
src/main/webapp/WEB-INF/jsp/web/cop/bbs/DataBoardListAjax.jsp
Normal file
174
src/main/webapp/WEB-INF/jsp/web/cop/bbs/DataBoardListAjax.jsp
Normal file
@ -0,0 +1,174 @@
|
||||
<%--
|
||||
Class Name : EgovNoticeList.jsp
|
||||
Description : (사용자)게시물 목록화면
|
||||
Modification Information
|
||||
|
||||
수정일 수정자 수정내용
|
||||
------- -------- ---------------------------
|
||||
2009.03.19 이삼섭 최초 생성
|
||||
2011.08.31 JJY 경량환경 버전 생성
|
||||
|
||||
author : 공통서비스 개발팀 이삼섭
|
||||
since : 2009.03.19
|
||||
--%>
|
||||
<%@ 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"%>
|
||||
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
//$(".btnSearch").keyup(function(e){if(e.keyCode == 13) linkPage('1');});
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<!-- content -->
|
||||
<form name="frm" action="<c:url value='/web/cop/bbs/selectDataBoardList.do'/>" method="post" onsubmit="return false;">
|
||||
<input type="hidden" name="bbsId" value="<c:out value='${boardVO.bbsId}'/>" />
|
||||
<input type="hidden" name="nttId" value="" />
|
||||
<input name="pageIndex" type="hidden" value="<c:out value='${searchVO.pageIndex}'/>" />
|
||||
|
||||
<div class="list_top">
|
||||
<div class="list_top_left">
|
||||
<label for="subSearch" class="label">검색조건 선택</label>
|
||||
<select id="subSearch" class="selType1">
|
||||
<option value="" <c:if test="${searchVO.searchCnd == ''}">selected="selected"</c:if>>전체</option>
|
||||
<option value="0" <c:if test="${searchVO.searchCnd == '0'}">selected="selected"</c:if>>제목</option>
|
||||
<option value="1" <c:if test="${searchVO.searchCnd == '1'}">selected="selected"</c:if>>내용</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="btn_wrap">
|
||||
<input type="text" id="subsearchTxt" placeholder="검색어를 입력해주세요" title="검색어 입력" size="30" value="<c:out value='${searchVO.searchWrd}'/>" >
|
||||
<button type="button" class="btnType01" onclick="javascript:linkPage('1'); return false;" onkeyup="enterkey()"; >검색</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div class="tb_list01">
|
||||
<table>
|
||||
<colgroup>
|
||||
<col style="width:5%;">
|
||||
<col style="width:auto;">
|
||||
<c:if test="${brdMstrVO.fileAtchPosblAt == 'Y'}">
|
||||
<col style="width:5%;">
|
||||
</c:if>
|
||||
<col style="width:10%;">
|
||||
<col style="width:10%;">
|
||||
<c:if test="${brdMstrVO.viewsYn ne 'N'}">
|
||||
<col style="width:5%;">
|
||||
</c:if>
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scrope="col">번호</th>
|
||||
<th scrope="col">제목</th>
|
||||
<c:if test="${brdMstrVO.fileAtchPosblAt == 'Y'}">
|
||||
<th scope="col">첨부</th>
|
||||
</c:if>
|
||||
<th scope="col">작성일</th>
|
||||
<th scope="col">작성자</th>
|
||||
<c:if test="${brdMstrVO.viewsYn ne 'N'}">
|
||||
<th scope="col">조회수</th>
|
||||
</c:if>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<c:forEach var="result" items="${resultList}" varStatus="status">
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<p><c:out value="${paginationInfo.totalRecordCount+1 - ((searchVO.pageIndex-1) * searchVO.pageUnit + status.count)}" /></p>
|
||||
</th>
|
||||
<td class="t_left">
|
||||
<a href="#none" onclick="javascript:fn_egov_inqire_notice('<c:out value="${result.bbsId}"/>', '<c:out value="${result.nttId}"/>');">
|
||||
<c:out value="${result.nttSj}" />
|
||||
</a>
|
||||
</td>
|
||||
<c:if test="${brdMstrVO.fileAtchPosblAt == 'Y'}"> <!-- 첨부파일 -->
|
||||
<td>
|
||||
<c:if test="${result.atchFileCnt > 0}">
|
||||
<img src="<c:url value='/visitEdu/usr/publish/images/content/file_img.png'/>" alt="첨부파일 있음">
|
||||
</c:if>
|
||||
</td>
|
||||
</c:if>
|
||||
<td><c:out value="${result.frstRegisterPnttm}" /></td>
|
||||
<td><c:out value="${result.frstRegisterNm}" /></td>
|
||||
<c:if test="${brdMstrVO.viewsYn ne 'N'}">
|
||||
<td><c:out value="${result.inqireCo}" /></td>
|
||||
</c:if>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
<c:if test="${empty resultList}">
|
||||
<tr class="row">
|
||||
<td colspan="6">
|
||||
검색된 내용이 없습니다.
|
||||
</td>
|
||||
</tr>
|
||||
</c:if>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="tb_list01_m">
|
||||
<c:forEach var="result" items="${resultList}" varStatus="status">
|
||||
<ul>
|
||||
<li>
|
||||
<span>번호</span>
|
||||
<span>
|
||||
<c:out value="${paginationInfo.totalRecordCount+1 - ((searchVO.pageIndex-1) * searchVO.pageUnit + status.count)}" />
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span>제목</span>
|
||||
<span>
|
||||
<a href="#none" title="현재창 상세이동" onclick="javascript:fn_egov_inqire_notice('<c:out value="${result.bbsId}"/>', '<c:out value="${result.nttId}"/>');">
|
||||
<c:out value="${result.nttSj}" />
|
||||
</a>
|
||||
</span>
|
||||
</li>
|
||||
<c:if test="${brdMstrVO.fileAtchPosblAt == 'Y'}"> <!-- 첨부파일 -->
|
||||
<li>
|
||||
<c:if test="${result.atchFileCnt > 0}">
|
||||
<span>첨부</span>
|
||||
<span><img src="<c:url value='/visitEdu/usr/publish/images/content/file_img.png'/>" alt="첨부파일 있음"></span>
|
||||
</c:if>
|
||||
</li>
|
||||
</c:if>
|
||||
<li>
|
||||
<span>작성일</span>
|
||||
<span><c:out value="${result.frstRegisterPnttm}" /></span>
|
||||
</li>
|
||||
<li>
|
||||
<span>작성자</span>
|
||||
<span><c:out value="${result.frstRegisterNm}" /></span>
|
||||
</li>
|
||||
|
||||
<c:if test="${brdMstrVO.viewsYn ne 'N'}">
|
||||
<li>
|
||||
<span>조회수</span>
|
||||
<span><c:out value="${result.inqireCo}" /></span>
|
||||
</li>
|
||||
</c:if>
|
||||
</ul>
|
||||
</c:forEach>
|
||||
<%-- 게시물이 없을때 --%>
|
||||
<c:if test="${empty resultList}">
|
||||
|
||||
</c:if>
|
||||
</div>
|
||||
|
||||
<div class="btn_wrap btn_layout01">
|
||||
<div class="btn_left">
|
||||
</div>
|
||||
<div class="btn_center">
|
||||
</div>
|
||||
<div class="btn_right">
|
||||
ㅈ </div>
|
||||
</div>
|
||||
<c:if test="${!empty resultList}">
|
||||
<div class="page">
|
||||
<ui:pagination paginationInfo = "${paginationInfo}" type="imageWeb" jsFunction="linkPage" />
|
||||
</div>
|
||||
</c:if>
|
||||
<!--// content -->
|
||||
@ -0,0 +1,91 @@
|
||||
<%--
|
||||
Class Name : EgovNoticeInqire.jsp
|
||||
Description : (사용자)게시물 조회 화면
|
||||
Modification Information
|
||||
|
||||
수정일 수정자 수정내용
|
||||
---------- -------- ---------------------------
|
||||
2009.03.23 이삼섭 최초 생성
|
||||
2009.06.26 한성곤 2단계 기능 추가 (댓글관리, 만족도조사)
|
||||
2011.08.31 JJY 경량환경 버전 생성
|
||||
2013.05.23 이기하 상세보기 오류수정
|
||||
|
||||
author : 공통서비스 개발팀 이삼섭
|
||||
since : 2009.03.23
|
||||
--%>
|
||||
<%@ 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"%>
|
||||
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
|
||||
<%@ taglib prefix="validator" uri="http://www.springmodules.org/tags/commons-validator"%>
|
||||
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
|
||||
<%pageContext.setAttribute("crlf", "\r\n"); %>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
});
|
||||
|
||||
var listPage = $(location).attr('href').split($(location).attr('host'))[1].split('Detail.do')[0]+'List.do'+"?bbsId=<c:out value='${brdMstrVO.bbsId}' />" ;
|
||||
var detailPage = $(location).attr('href').split($(location).attr('host'))[1].split('?')[0] ;
|
||||
function fn_egov_select_noticeList(pageNo) {
|
||||
window.history.back();
|
||||
}
|
||||
|
||||
</script>
|
||||
<!-- contents 영역 -->
|
||||
<form:form commandName="searchForm" name="searchForm" method="get" action="<c:url value='/web/cop/bbsWeb/selectBoardList.do'/>">
|
||||
<input name="pageIndex" type="hidden" value="<c:out value='${searchVO.pageIndex}'/>"/>
|
||||
<input name="searchCnd" type="hidden" value="<c:out value='${searchVO.searchCnd}'/>"/>
|
||||
<input name="searchWrd" type="hidden" value="<c:out value='${searchVO.searchWrd}'/>"/>
|
||||
<input name="bbsId" type="hidden" value="<c:out value='${result.bbsId}'/>" />
|
||||
<input name="nttId" type="hidden" value="<c:out value='${result.nttId}'/>" />
|
||||
</form:form>
|
||||
<!-- cont -->
|
||||
<div class="cont_wrap" id="sub">
|
||||
<div class="cont_tit">
|
||||
<h2><c:out value="${brdMstrVO.bbsNm}"/></h2>
|
||||
<div class="sns_go">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="list_view">
|
||||
<div class="view_top">
|
||||
<p class="view_title"><c:out value="${result.nttSj}" /></p>
|
||||
<div class="view_info">
|
||||
<p>날짜 <span><c:out value="${result.frstRegisterPnttm}" /></span></p>
|
||||
<p>작성자 <span><c:out value="${result.ntcrNm}"/></span></p>
|
||||
<p>조회수 <span><c:out value="${result.inqireCo}" /></span></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="view_cont">
|
||||
<p>
|
||||
<c:if test="${'9620000' eq brdMstrVO.menuNo || '9650000' eq brdMstrVO.menuNo}">
|
||||
<c:out value="${result.nttCn}" />
|
||||
</c:if>
|
||||
<c:if test="${'9620000' ne brdMstrVO.menuNo && '9650000' ne brdMstrVO.menuNo}">
|
||||
<c:out value="${result.nttCn}" escapeXml="false"/>
|
||||
</c:if>
|
||||
</p>
|
||||
</div>
|
||||
<c:if test="${not empty result.atchFileId}">
|
||||
<div class="file_list">
|
||||
<c:import url="/cmm/fms/selectBBSFileInfs.do" charEncoding="utf-8">
|
||||
<c:param name="param_atchFileId" value="${result.atchFileId}" />
|
||||
<c:param name="pdf_view" value="Y" />
|
||||
</c:import>
|
||||
</div>
|
||||
</c:if>
|
||||
</div>
|
||||
<div class="btn_wrap btn_layout01">
|
||||
<div class="btn_left">
|
||||
</div>
|
||||
<div class="btn_center">
|
||||
</div>
|
||||
<div class="btn_right">
|
||||
<button type="button" class="btnType02 m_btn_block" onclick="javascript:fn_egov_select_noticeList(); return false;">목록</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- //cont -->
|
||||
Loading…
Reference in New Issue
Block a user