공용게시판 테이블 수정, 직급 표현.

강석 최 2022-11-01 14:47:16 +09:00
parent de0d83439a
commit d62012e8ae
12 changed files with 246 additions and 201 deletions

View File

@ -49,10 +49,8 @@ public class PublicBoardController {
ModelAndView mav = new ModelAndView("publicBoard/board/boardPage"); ModelAndView mav = new ModelAndView("publicBoard/board/boardPage");
publicBoard.setQueryInfo(); publicBoard.setQueryInfo();
publicBoard.setPublicType("PLB002"); publicBoard.setPublicType("PLB002");
if (loginUser.getUserRole().contains(Role.SUB_ADMIN.getValue())) { publicBoard.setDownOrganCdList(loginUser.getDownOrganCdList());
publicBoard.setDownOrganCdList(loginUser.getDownOrganCdList()); mav.addObject("mgtOrganList", loginUser.getDownOrganCdList());
mav.addObject("mgtOrganList", loginUser.getDownOrganCdList());
}
publicBoard.setUpOrganCdList(loginUser.getUpOrganCdList()); publicBoard.setUpOrganCdList(loginUser.getUpOrganCdList());
mav.addObject("boardList", publicBoardService.selectContentList(publicBoard)); mav.addObject("boardList", publicBoardService.selectContentList(publicBoard));
publicBoard.setContentCnt(publicBoardService.selectContentListCnt(publicBoard)); publicBoard.setContentCnt(publicBoardService.selectContentListCnt(publicBoard));
@ -67,10 +65,8 @@ public class PublicBoardController {
ModelAndView mav = new ModelAndView("publicBoard/reference/referencePage"); ModelAndView mav = new ModelAndView("publicBoard/reference/referencePage");
publicBoard.setQueryInfo(); publicBoard.setQueryInfo();
publicBoard.setPublicType("PLB003"); publicBoard.setPublicType("PLB003");
if (loginUser.getUserRole().contains(Role.SUB_ADMIN.getValue())) { publicBoard.setDownOrganCdList(loginUser.getDownOrganCdList());
publicBoard.setDownOrganCdList(loginUser.getDownOrganCdList()); mav.addObject("mgtOrganList", loginUser.getDownOrganCdList());
mav.addObject("mgtOrganList", loginUser.getDownOrganCdList());
}
publicBoard.setUpOrganCdList(loginUser.getUpOrganCdList()); publicBoard.setUpOrganCdList(loginUser.getUpOrganCdList());
mav.addObject("referenceList", publicBoardService.selectContentList(publicBoard)); mav.addObject("referenceList", publicBoardService.selectContentList(publicBoard));
publicBoard.setContentCnt(publicBoardService.selectContentListCnt(publicBoard)); publicBoard.setContentCnt(publicBoardService.selectContentListCnt(publicBoard));
@ -86,10 +82,8 @@ public class PublicBoardController {
ModelAndView mav = new ModelAndView("publicBoard/qna/qnaPage"); ModelAndView mav = new ModelAndView("publicBoard/qna/qnaPage");
publicBoard.setQueryInfo(); publicBoard.setQueryInfo();
publicBoard.setPublicType("PLB004"); publicBoard.setPublicType("PLB004");
if (loginUser.getUserRole().contains(Role.SUB_ADMIN.getValue())) { publicBoard.setDownOrganCdList(loginUser.getDownOrganCdList());
publicBoard.setDownOrganCdList(loginUser.getDownOrganCdList()); mav.addObject("mgtOrganList", loginUser.getDownOrganCdList());
mav.addObject("mgtOrganList", loginUser.getDownOrganCdList());
}
mav.addObject("qnaList", publicBoardService.selectContentList(publicBoard)); mav.addObject("qnaList", publicBoardService.selectContentList(publicBoard));
publicBoard.setContentCnt(publicBoardService.selectContentListCnt(publicBoard)); publicBoard.setContentCnt(publicBoardService.selectContentListCnt(publicBoard));
publicBoard.setPaginationInfo(); publicBoard.setPaginationInfo();
@ -104,91 +98,79 @@ public class PublicBoardController {
switch (publicBoard.getPublicType()) { switch (publicBoard.getPublicType()) {
case "PLB001": // 공지사항 case "PLB001": // 공지사항
mav = new ModelAndView("publicBoard/notice/noticeEditModal"); mav = new ModelAndView("publicBoard/notice/noticeEditModal");
if (publicBoard.getPublicKey() != null) {
publicBoard = publicBoardService.selectPublicBoard(publicBoard.getPublicKey());
}
break; break;
case "PLB002": // 공용게시판 case "PLB002": // 공용게시판
mav = new ModelAndView("publicBoard/board/boardEditModal"); mav = new ModelAndView("publicBoard/board/boardEditModal");
if (publicBoard.getPublicKey() != null) {
publicBoard = publicBoardService.selectPublicBoard(publicBoard.getPublicKey());
}
break; break;
case "PLB003": // 자료실 case "PLB003": // 자료실
mav = new ModelAndView("publicBoard/reference/referenceEditModal"); mav = new ModelAndView("publicBoard/reference/referenceEditModal");
if (publicBoard.getPublicKey() != null) {
publicBoard = publicBoardService.selectPublicBoard(publicBoard.getPublicKey());
}
break; break;
case "PLB004": // Q&A case "PLB004": // Q&A
mav = new ModelAndView("publicBoard/qna/qnaEditModal"); mav = new ModelAndView("publicBoard/qna/qnaEditModal");
if (publicBoard.getPublicKey() != null) {
publicBoard = publicBoardService.selectPublicBoard(publicBoard.getPublicKey());
break;
}
} }
if (publicBoard.getPublicKey() != null) {
if (publicBoard.getPublicKey() == null) {
publicBoard.setWrtOrgan(loginUser.getOgCd());
publicBoard.setWrtPart(loginUser.getOfcCd());
publicBoard.setWrtUserSeq(loginUser.getUserSeq());
publicBoard.setWrtUserGrd(loginUser.getTitleCd());
publicBoard.setWrtUserNm(loginUser.getUserNm());
publicBoard.setWrtDt(LocalDateTime.now());
}
mav.addObject("info", publicBoard);
return mav;
}
@GetMapping("/viewModal")
public ModelAndView viewModal (@AuthenticationPrincipal UserInfo loginUser, PublicBoard publicBoard){
ModelAndView mav = null;
switch (publicBoard.getPublicType()) {
case "PLB001": // 공지사항
mav = new ModelAndView("publicBoard/notice/noticeViewModal");
break;
case "PLB002": // 공용게시판
mav = new ModelAndView("publicBoard/board/boardViewModal");
break;
case "PLB003": // 자료실
mav = new ModelAndView("publicBoard/reference/referenceViewModal");
break;
case "PLB004": // Q&A
mav = new ModelAndView("publicBoard/qna/qnaViewModal");
break;
}
publicBoard = publicBoardService.selectPublicBoard(publicBoard.getPublicKey()); publicBoard = publicBoardService.selectPublicBoard(publicBoard.getPublicKey());
mav.addObject("userSeq", loginUser.getUserSeq()); }else{
mav.addObject("info", publicBoard); publicBoard.setWrtOrgan(loginUser.getOgCd());
return mav; publicBoard.setWrtPart(loginUser.getOfcCd());
} publicBoard.setWrtUserSeq(loginUser.getUserSeq());
publicBoard.setWrtUserGrd(loginUser.getTitleCd());
@PostMapping("/saveContent") publicBoard.setWrtUserNm(loginUser.getUserNm());
public Integer saveContent (PublicBoard publicBoard, publicBoard.setWrtDt(LocalDateTime.now());
MultipartHttpServletRequest request,
@RequestParam(value = "fileSeq", required = false) List < Integer > deleteFileSeq){
publicBoard.setMultipartFileList(request.getMultiFileMap().get("uploadFiles"));
return publicBoardService.saveContent(publicBoard, deleteFileSeq);
}
@PostMapping("/saveComment")
public ModelAndView saveComment (@AuthenticationPrincipal UserInfo loginUser, PublicComment comment){
comment.setWrtOrgan(loginUser.getOgCd());
comment.setWrtPart(loginUser.getOfcCd());
comment.setWrtUserSeq(loginUser.getUserSeq());
comment.setWrtUserGrd(loginUser.getTitleCd());
comment.setWrtUserNm(loginUser.getUserNm());
comment.setWrtDt(LocalDateTime.now());
publicBoardService.saveComment(comment);
ModelAndView mav = new ModelAndView("publicBoard/commentDiv");
mav.addObject("comment", comment);
mav.addObject("userSeq", loginUser.getUserSeq());
return mav;
}
@PostMapping("/deleteComment")
@ResponseBody
public void deleteComment (@RequestBody PublicComment comment){
publicBoardService.deleteComment(comment.getPublicKey(), comment.getCommentKey());
} }
mav.addObject("info", publicBoard);
return mav;
} }
@GetMapping("/viewModal")
public ModelAndView viewModal (@AuthenticationPrincipal UserInfo loginUser, PublicBoard publicBoard){
ModelAndView mav = null;
switch (publicBoard.getPublicType()) {
case "PLB001": // 공지사항
mav = new ModelAndView("publicBoard/notice/noticeViewModal");
break;
case "PLB002": // 공용게시판
mav = new ModelAndView("publicBoard/board/boardViewModal");
break;
case "PLB003": // 자료실
mav = new ModelAndView("publicBoard/reference/referenceViewModal");
break;
case "PLB004": // Q&A
mav = new ModelAndView("publicBoard/qna/qnaViewModal");
break;
}
publicBoard = publicBoardService.selectPublicBoard(publicBoard.getPublicKey());
mav.addObject("userSeq", loginUser.getUserSeq());
mav.addObject("info", publicBoard);
return mav;
}
@PostMapping("/saveContent")
public Integer saveContent (PublicBoard publicBoard,
MultipartHttpServletRequest request,
@RequestParam(value = "fileSeq", required = false) List < Integer > deleteFileSeq){
publicBoard.setMultipartFileList(request.getMultiFileMap().get("uploadFiles"));
return publicBoardService.saveContent(publicBoard, deleteFileSeq);
}
@PostMapping("/saveComment")
public ModelAndView saveComment (@AuthenticationPrincipal UserInfo loginUser, PublicComment comment){
comment.setWrtOrgan(loginUser.getOgCd());
comment.setWrtPart(loginUser.getOfcCd());
comment.setWrtUserSeq(loginUser.getUserSeq());
comment.setWrtUserGrd(loginUser.getTitleCd());
comment.setWrtUserNm(loginUser.getUserNm());
comment.setWrtDt(LocalDateTime.now());
publicBoardService.saveComment(comment);
ModelAndView mav = new ModelAndView("publicBoard/commentDiv");
mav.addObject("comment", comment);
mav.addObject("userSeq", loginUser.getUserSeq());
return mav;
}
@PostMapping("/deleteComment")
@ResponseBody
public void deleteComment (@RequestBody PublicComment comment){
publicBoardService.deleteComment(comment.getPublicKey(), comment.getCommentKey());
}
}

View File

@ -2,7 +2,7 @@
<html lang="ko" <html lang="ko"
xmlns:th="http://www.thymeleaf.org" xmlns:th="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity5"> xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity5">
<header th:fragment="headerFragment" class="border-bottom row justify-content-between py-1 px-3"> <header th:fragment="headerFragment" class="border-bottom w-100 row justify-content-between py-1 px-3">
<div class="col-auto row justify-content-start"> <div class="col-auto row justify-content-start">
<div class="col-auto"> <div class="col-auto">
<div class="navbar-header"> <div class="navbar-header">

View File

@ -13,10 +13,16 @@
<input type="hidden" name="wrtOrgan" th:value="${info.wrtOrgan}"> <input type="hidden" name="wrtOrgan" th:value="${info.wrtOrgan}">
<input type="hidden" name="wrtPart" th:value="${info.wrtPart}"> <input type="hidden" name="wrtPart" th:value="${info.wrtPart}">
<input type="hidden" name="wrtUserSeq" th:value="${info.wrtUserSeq}"> <input type="hidden" name="wrtUserSeq" th:value="${info.wrtUserSeq}">
<input type="hidden" name="wrtUserGrd" th:value="${info.wrtUserGrd}">
<input type="hidden" name="wrtUserNm" th:value="${info.wrtUserNm}">
<div class="mb-3 row"> <div class="mb-3 row">
<label for="wrtUserNm" class="col-sm-2 col-form-label text-center">작성자</label> <label for="wrtUserNm" class="col-sm-2 col-form-label text-center">작성자</label>
<div class="col-sm-2"> <div class="col-sm-2">
<input type="text" class="form-control" id="wrtUserNm" name="wrtUserNm" th:value="${info.wrtUserNm}" readonly> <th:block th:each="commonCode:${session.commonCode.get('JT')}">
<th:block th:if="${commonCode.itemCd eq info.wrtUserGrd}">
<input type="text" class="form-control" id="wrtUserNm" th:value="|${commonCode.itemValue} ${info.wrtUserNm}|" readonly>
</th:block>
</th:block>
</div> </div>
<label for="wrtDt" class="col-sm-2 col-form-label text-center">작성일시</label> <label for="wrtDt" class="col-sm-2 col-form-label text-center">작성일시</label>
<div class="col-sm-2"> <div class="col-sm-2">

View File

@ -56,20 +56,21 @@
<div class="card"> <div class="card">
<div class="card-body"> <div class="card-body">
<div class="row"> <div class="row">
<table class="table table-hover"> <table class="table table-hover table-bordered">
<thead> <thead>
<tr> <tr>
<th></th> <th></th>
<th>제목</th> <th>제목</th>
<th>관서</th> <th>관서</th>
<th>부서</th> <th>부서</th>
<th>계급</th>
<th>작성자</th> <th>작성자</th>
<th>작성일시</th> <th>작성일시</th>
<th>첨부파일</th> <th>첨부파일</th>
<th>댓글</th> <th>댓글</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody class="table-group-divider">
<tr class="planTr" th:each="board:${boardList}"> <tr class="planTr" th:each="board:${boardList}">
<input type="hidden" class="planKey" th:value="${board.publicKey}"> <input type="hidden" class="planKey" th:value="${board.publicKey}">
<td><input type="checkbox" class="trChkBox"></td> <td><input type="checkbox" class="trChkBox"></td>
@ -80,6 +81,9 @@
<th:block th:each="commonCode:${session.commonCode.get('OFC')}"> <th:block th:each="commonCode:${session.commonCode.get('OFC')}">
<td th:if="${board.wrtPart eq commonCode.itemCd}" th:text="${commonCode.itemValue}"></td> <td th:if="${board.wrtPart eq commonCode.itemCd}" th:text="${commonCode.itemValue}"></td>
</th:block> </th:block>
<th:block th:each="commonCode:${session.commonCode.get('JT')}">
<td th:if="${board.wrtUserGrd eq commonCode.itemCd}" th:text="${commonCode.itemValue}"></td>
</th:block>
<td th:text="${board.wrtUserNm}"></td> <td th:text="${board.wrtUserNm}"></td>
<td th:text="${#temporals.format(board.wrtDt, 'yyyy-MM-dd HH:mm')}"></td> <td th:text="${#temporals.format(board.wrtDt, 'yyyy-MM-dd HH:mm')}"></td>
<td th:text="${board.fileCnt eq null?'파일 없음':#strings.concat(board.fileCnt,' 건')}"></td> <td th:text="${board.fileCnt eq null?'파일 없음':#strings.concat(board.fileCnt,' 건')}"></td>

View File

@ -11,7 +11,11 @@
<div class="mb-3 row"> <div class="mb-3 row">
<label for="wrtUserNm" class="col-sm-1 col-form-label text-center">작성자</label> <label for="wrtUserNm" class="col-sm-1 col-form-label text-center">작성자</label>
<div class="col-sm-2"> <div class="col-sm-2">
<input type="text" class="form-control border-0" id="wrtUserNm" name="wrtUserNm" th:value="${info.wrtUserNm}" readonly> <th:block th:each="commonCode:${session.commonCode.get('JT')}">
<th:block th:if="${commonCode.itemCd eq info.wrtUserGrd}">
<input type="text" class="form-control border-0" id="wrtUserNm" name="wrtUserNm" th:value="|${commonCode.itemValue} ${info.wrtUserNm}|" readonly>
</th:block>
</th:block>
</div> </div>
<label for="wrtDt" class="col-sm-1 col-form-label text-center">작성일시</label> <label for="wrtDt" class="col-sm-1 col-form-label text-center">작성일시</label>
<div class="col-sm-2"> <div class="col-sm-2">
@ -94,6 +98,9 @@
<th:block th:each="commonCode:${session.commonCode.get('OFC')}"> <th:block th:each="commonCode:${session.commonCode.get('OFC')}">
<div class="col-auto" th:if="${commonCode.itemCd eq comment.wrtPart}" th:text="${commonCode.itemValue}"></div> <div class="col-auto" th:if="${commonCode.itemCd eq comment.wrtPart}" th:text="${commonCode.itemValue}"></div>
</th:block> </th:block>
<th:block th:each="commonCode:${session.commonCode.get('JT')}">
<div class="col-auto" th:if="${commonCode.itemCd eq comment.wrtUserGrd}" th:text="${commonCode.itemValue}"></div>
</th:block>
<div class="col-auto" th:text="${comment.wrtUserNm}"></div> <div class="col-auto" th:text="${comment.wrtUserNm}"></div>
<div class="col-auto" th:text="|작성일시: ${#temporals.format(comment.wrtDt, 'yyyy-MM-dd HH:mm')}|"></div> <div class="col-auto" th:text="|작성일시: ${#temporals.format(comment.wrtDt, 'yyyy-MM-dd HH:mm')}|"></div>
<div class="col-auto"> <div class="col-auto">
@ -121,6 +128,9 @@
<th:block th:each="commonCode:${session.commonCode.get('OFC')}"> <th:block th:each="commonCode:${session.commonCode.get('OFC')}">
<div class="col-auto" th:if="${commonCode.itemCd eq childComment.wrtPart}" th:text="${commonCode.itemValue}"></div> <div class="col-auto" th:if="${commonCode.itemCd eq childComment.wrtPart}" th:text="${commonCode.itemValue}"></div>
</th:block> </th:block>
<th:block th:each="commonCode:${session.commonCode.get('JT')}">
<div class="col-auto" th:if="${commonCode.itemCd eq childComment.wrtUserGrd}" th:text="${commonCode.itemValue}"></div>
</th:block>
<div class="col-auto" th:text="${childComment.wrtUserNm}"></div> <div class="col-auto" th:text="${childComment.wrtUserNm}"></div>
<div class="col-auto" th:text="|작성일시: ${#temporals.format(childComment.wrtDt, 'yyyy-MM-dd HH:mm')}|"></div> <div class="col-auto" th:text="|작성일시: ${#temporals.format(childComment.wrtDt, 'yyyy-MM-dd HH:mm')}|"></div>
<div class="col-auto" th:if="${userSeq eq childComment.wrtUserSeq}"> <div class="col-auto" th:if="${userSeq eq childComment.wrtUserSeq}">

View File

@ -41,6 +41,9 @@
<th:block th:each="commonCode:${session.commonCode.get('OFC')}"> <th:block th:each="commonCode:${session.commonCode.get('OFC')}">
<div class="col-auto" th:if="${commonCode.itemCd eq comment.wrtPart}" th:text="${commonCode.itemValue}"></div> <div class="col-auto" th:if="${commonCode.itemCd eq comment.wrtPart}" th:text="${commonCode.itemValue}"></div>
</th:block> </th:block>
<th:block th:each="commonCode:${session.commonCode.get('JT')}">
<div class="col-auto" th:if="${commonCode.itemCd eq comment.wrtUserGrd}" th:text="${commonCode.itemValue}"></div>
</th:block>
<div class="col-auto" th:text="${comment.wrtUserNm}"></div> <div class="col-auto" th:text="${comment.wrtUserNm}"></div>
<div class="col-auto" th:text="|작성일시: ${#temporals.format(comment.wrtDt, 'yyyy-MM-dd HH:mm')}|"></div> <div class="col-auto" th:text="|작성일시: ${#temporals.format(comment.wrtDt, 'yyyy-MM-dd HH:mm')}|"></div>
<div class="col-auto" th:if="${userSeq eq comment.wrtUserSeq}"> <div class="col-auto" th:if="${userSeq eq comment.wrtUserSeq}">

View File

@ -13,10 +13,16 @@
<input type="hidden" name="wrtOrgan" th:value="${info.wrtOrgan}"> <input type="hidden" name="wrtOrgan" th:value="${info.wrtOrgan}">
<input type="hidden" name="wrtPart" th:value="${info.wrtPart}"> <input type="hidden" name="wrtPart" th:value="${info.wrtPart}">
<input type="hidden" name="wrtUserSeq" th:value="${info.wrtUserSeq}"> <input type="hidden" name="wrtUserSeq" th:value="${info.wrtUserSeq}">
<input type="hidden" name="wrtUserGrd" th:value="${info.wrtUserGrd}">
<input type="hidden" name="wrtUserNm" th:value="${info.wrtUserNm}">
<div class="mb-3 row"> <div class="mb-3 row">
<label for="wrtUserNm" class="col-sm-2 col-form-label text-center">작성자</label> <label for="wrtUserNm" class="col-sm-2 col-form-label text-center">작성자</label>
<div class="col-sm-2"> <div class="col-sm-2">
<input type="text" class="form-control" id="wrtUserNm" name="wrtUserNm" th:value="${info.wrtUserNm}" readonly> <th:block th:each="commonCode:${session.commonCode.get('JT')}">
<th:block th:if="${commonCode.itemCd eq info.wrtUserGrd}">
<input type="text" class="form-control" id="wrtUserNm" th:value="|${commonCode.itemValue} ${info.wrtUserNm}|" readonly>
</th:block>
</th:block>
</div> </div>
<label for="wrtDt" class="col-sm-2 col-form-label text-center">작성일시</label> <label for="wrtDt" class="col-sm-2 col-form-label text-center">작성일시</label>
<div class="col-sm-2"> <div class="col-sm-2">

View File

@ -57,20 +57,21 @@
<div class="card"> <div class="card">
<div class="card-body"> <div class="card-body">
<div class="row"> <div class="row">
<table class="table table-hover"> <table class="table table-hover table-bordered">
<thead> <thead>
<tr> <tr>
<th></th> <th></th>
<th>제목</th> <th>제목</th>
<th>관서</th> <th>관서</th>
<th>부서</th> <th>부서</th>
<th>계급</th>
<th>작성자</th> <th>작성자</th>
<th>작성일시</th> <th>작성일시</th>
<th>첨부파일</th> <th>첨부파일</th>
<th>댓글</th> <th>댓글</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody class="table-group-divider">
<tr class="planTr" th:each="qna:${qnaList}"> <tr class="planTr" th:each="qna:${qnaList}">
<input type="hidden" class="planKey" th:value="${qna.publicKey}"> <input type="hidden" class="planKey" th:value="${qna.publicKey}">
<td><input type="checkbox" class="trChkBox"></td> <td><input type="checkbox" class="trChkBox"></td>
@ -81,6 +82,9 @@
<th:block th:each="commonCode:${session.commonCode.get('OFC')}"> <th:block th:each="commonCode:${session.commonCode.get('OFC')}">
<td th:if="${qna.wrtPart eq commonCode.itemCd}" th:text="${commonCode.itemValue}"></td> <td th:if="${qna.wrtPart eq commonCode.itemCd}" th:text="${commonCode.itemValue}"></td>
</th:block> </th:block>
<th:block th:each="commonCode:${session.commonCode.get('JT')}">
<td th:if="${qna.wrtUserGrd eq commonCode.itemCd}" th:text="${commonCode.itemValue}"></td>
</th:block>
<td th:text="${qna.wrtUserNm}"></td> <td th:text="${qna.wrtUserNm}"></td>
<td th:text="${#temporals.format(qna.wrtDt, 'yyyy-MM-dd HH:mm')}"></td> <td th:text="${#temporals.format(qna.wrtDt, 'yyyy-MM-dd HH:mm')}"></td>
<td th:text="${qna.fileCnt eq null?'파일 없음':#strings.concat(qna.fileCnt,' 건')}"></td> <td th:text="${qna.fileCnt eq null?'파일 없음':#strings.concat(qna.fileCnt,' 건')}"></td>

View File

@ -11,7 +11,11 @@
<div class="mb-3 row"> <div class="mb-3 row">
<label for="wrtUserNm" class="col-sm-1 col-form-label text-center">작성자</label> <label for="wrtUserNm" class="col-sm-1 col-form-label text-center">작성자</label>
<div class="col-sm-2"> <div class="col-sm-2">
<input type="text" class="form-control border-0" id="wrtUserNm" name="wrtUserNm" th:value="${info.wrtUserNm}" readonly> <th:block th:each="commonCode:${session.commonCode.get('JT')}">
<th:block th:if="${commonCode.itemCd eq info.wrtUserGrd}">
<input type="text" class="form-control border-0" id="wrtUserNm" name="wrtUserNm" th:value="|${commonCode.itemValue} ${info.wrtUserNm}|" readonly>
</th:block>
</th:block>
</div> </div>
<label for="wrtDt" class="col-sm-1 col-form-label text-center">작성일시</label> <label for="wrtDt" class="col-sm-1 col-form-label text-center">작성일시</label>
<div class="col-sm-2"> <div class="col-sm-2">
@ -94,6 +98,9 @@
<th:block th:each="commonCode:${session.commonCode.get('OFC')}"> <th:block th:each="commonCode:${session.commonCode.get('OFC')}">
<div class="col-auto" th:if="${commonCode.itemCd eq comment.wrtPart}" th:text="${commonCode.itemValue}"></div> <div class="col-auto" th:if="${commonCode.itemCd eq comment.wrtPart}" th:text="${commonCode.itemValue}"></div>
</th:block> </th:block>
<th:block th:each="commonCode:${session.commonCode.get('JT')}">
<div class="col-auto" th:if="${commonCode.itemCd eq comment.wrtUserGrd}" th:text="${commonCode.itemValue}"></div>
</th:block>
<div class="col-auto" th:text="${comment.wrtUserNm}"></div> <div class="col-auto" th:text="${comment.wrtUserNm}"></div>
<div class="col-auto" th:text="|작성일시: ${#temporals.format(comment.wrtDt, 'yyyy-MM-dd HH:mm')}|"></div> <div class="col-auto" th:text="|작성일시: ${#temporals.format(comment.wrtDt, 'yyyy-MM-dd HH:mm')}|"></div>
<div class="col-auto"> <div class="col-auto">
@ -121,6 +128,9 @@
<th:block th:each="commonCode:${session.commonCode.get('OFC')}"> <th:block th:each="commonCode:${session.commonCode.get('OFC')}">
<div class="col-auto" th:if="${commonCode.itemCd eq childComment.wrtPart}" th:text="${commonCode.itemValue}"></div> <div class="col-auto" th:if="${commonCode.itemCd eq childComment.wrtPart}" th:text="${commonCode.itemValue}"></div>
</th:block> </th:block>
<th:block th:each="commonCode:${session.commonCode.get('JT')}">
<div class="col-auto" th:if="${commonCode.itemCd eq childComment.wrtUserGrd}" th:text="${commonCode.itemValue}"></div>
</th:block>
<div class="col-auto" th:text="${childComment.wrtUserNm}"></div> <div class="col-auto" th:text="${childComment.wrtUserNm}"></div>
<div class="col-auto" th:text="|작성일시: ${#temporals.format(childComment.wrtDt, 'yyyy-MM-dd HH:mm')}|"></div> <div class="col-auto" th:text="|작성일시: ${#temporals.format(childComment.wrtDt, 'yyyy-MM-dd HH:mm')}|"></div>
<div class="col-auto" th:if="${userSeq eq childComment.wrtUserSeq}"> <div class="col-auto" th:if="${userSeq eq childComment.wrtUserSeq}">

View File

@ -13,10 +13,16 @@
<input type="hidden" name="wrtOrgan" th:value="${info.wrtOrgan}"> <input type="hidden" name="wrtOrgan" th:value="${info.wrtOrgan}">
<input type="hidden" name="wrtPart" th:value="${info.wrtPart}"> <input type="hidden" name="wrtPart" th:value="${info.wrtPart}">
<input type="hidden" name="wrtUserSeq" th:value="${info.wrtUserSeq}"> <input type="hidden" name="wrtUserSeq" th:value="${info.wrtUserSeq}">
<input type="hidden" name="wrtUserGrd" th:value="${info.wrtUserGrd}">
<input type="hidden" name="wrtUserNm" th:value="${info.wrtUserNm}">
<div class="mb-3 row"> <div class="mb-3 row">
<label for="wrtUserNm" class="col-sm-2 col-form-label text-center">작성자</label> <label for="wrtUserNm" class="col-sm-2 col-form-label text-center">작성자</label>
<div class="col-sm-2"> <div class="col-sm-2">
<input type="text" class="form-control" id="wrtUserNm" name="wrtUserNm" th:value="${info.wrtUserNm}" readonly> <th:block th:each="commonCode:${session.commonCode.get('JT')}">
<th:block th:if="${commonCode.itemCd eq info.wrtUserGrd}">
<input type="text" class="form-control" id="wrtUserNm" th:value="|${commonCode.itemValue} ${info.wrtUserNm}|" readonly>
</th:block>
</th:block>
</div> </div>
<label for="wrtDt" class="col-sm-1 col-form-label text-center">작성일시</label> <label for="wrtDt" class="col-sm-1 col-form-label text-center">작성일시</label>
<div class="col-sm-2"> <div class="col-sm-2">

View File

@ -10,123 +10,128 @@
<div layout:fragment="content"> <div layout:fragment="content">
<main class="pt-3"> <main class="pt-3">
<h4>자료실</h4> <h4>자료실</h4>
<ul class="nav nav-tabs" id="boardTab" role="tablist">
<th:block th:each="tab:${tabStatusList}">
<li class="nav-item" role="presentation">
<button class="nav-link referenceTab" th:data-tabcd="${tab.itemCd}" th:classappend="${tab.itemCd eq searchParams.tabStatus?'active':''}" data-bs-toggle="tab" type="button" role="tab" th:text="${tab.itemValue}"></button>
</li>
</th:block>
</ul>
<input type="hidden" name="_csrf_header" th:value="${_csrf.headerName}"/> <input type="hidden" name="_csrf_header" th:value="${_csrf.headerName}"/>
<input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/> <input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/>
<div class="row mx-0"> <div class="row mx-0">
<div class="col-12 card text-center"> <div class="col-12 card text-center">
<div class="card-body"> <div class="card-body">
<form method="get" th:action="@{/publicBoard/referencePage}"> <ul class="nav nav-tabs" id="boardTab" role="tablist">
<input type="hidden" name="pageIndex" id="pageIndex" th:value="${searchParams.pageIndex}"> <th:block th:each="tab:${tabStatusList}">
<input type="hidden" name="tabStatus" th:value="${searchParams.tabStatus}"> <li class="nav-item" role="presentation">
<div class="row justify-content-between pe-3 py-1"> <button class="nav-link referenceTab" th:data-tabcd="${tab.itemCd}" th:classappend="${tab.itemCd eq searchParams.tabStatus?'active':''}" data-bs-toggle="tab" type="button" role="tab" th:text="${tab.itemValue}"></button>
<div class="col-auto"> </li>
<select class="form-select" name="rowCnt" id="rowCnt"> </th:block>
<th:block th:each="num : ${#numbers.sequence(1,5)}"> </ul>
<option th:value="${num*10}" th:text="${num*10}" th:selected="${searchParams.rowCnt eq num*10}"></option> <div class="tab-content border border-top-0 p-3" id="userContent">
</th:block> <form method="get" th:action="@{/publicBoard/referencePage}">
</select> <input type="hidden" name="pageIndex" id="pageIndex" th:value="${searchParams.pageIndex}">
</div> <input type="hidden" name="tabStatus" th:value="${searchParams.tabStatus}">
<div class="col-auto"> <div class="row justify-content-between pe-3 py-1">
<div class="row justify-content-end"> <div class="col-auto">
<div class="col-auto" sec:authorize="hasRole('ROLE_SUB_ADMIN')"> <select class="form-select" name="rowCnt" id="rowCnt">
<select class="form-select form-select-sm" name="wrtOrgan"> <th:block th:each="num : ${#numbers.sequence(1,5)}">
<option value="">관서 선택</option> <option th:value="${num*10}" th:text="${num*10}" th:selected="${searchParams.rowCnt eq num*10}"></option>
<th:block th:each="commonCode:${session.commonCode.get('OG')}"> </th:block>
<th:block th:if="${#lists.contains(mgtOrganList, commonCode.itemCd </select>
</div>
<div class="col-auto">
<div class="row justify-content-end">
<div class="col-auto" sec:authorize="hasRole('ROLE_SUB_ADMIN')">
<select class="form-select form-select-sm" name="wrtOrgan">
<option value="">관서 선택</option>
<th:block th:each="commonCode:${session.commonCode.get('OG')}">
<th:block th:if="${#lists.contains(mgtOrganList, commonCode.itemCd
)}"> )}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}" th:selected="${commonCode.itemCd eq searchParams.wrtOrgan}"></option> <option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}" th:selected="${commonCode.itemCd eq searchParams.wrtOrgan}"></option>
</th:block>
</th:block> </th:block>
</th:block> </select>
</select>
</div>
<div class="col-auto">
<input type="text" class="form-control form-control-sm" placeholder="제목" name="title" th:value="${searchParams.title}">
</div>
<div class="col-4">
<div class="input-group w-auto input-daterange" id="dateSelectorDiv">
<input type="text" class="form-control form-control-sm" id="startDate" name="startDate" placeholder="시작일" autocomplete="off" readonly th:value="${searchParams.startDate}">
<input type="text" class="form-control form-control-sm" id="endDate" name="endDate" placeholder="종료일" autocomplete="off" readonly th:value="${searchParams.endDate}">
</div> </div>
<div class="col-auto">
<input type="text" class="form-control form-control-sm" placeholder="제목" name="title" th:value="${searchParams.title}">
</div>
<div class="col-4">
<div class="input-group w-auto input-daterange" id="dateSelectorDiv">
<input type="text" class="form-control form-control-sm" id="startDate" name="startDate" placeholder="시작일" autocomplete="off" readonly th:value="${searchParams.startDate}">
<input type="text" class="form-control form-control-sm" id="endDate" name="endDate" placeholder="종료일" autocomplete="off" readonly th:value="${searchParams.endDate}">
</div>
</div>
<input type="submit" class="btn btn-sm btn-primary col-auto" id="searchBtn" value="검색">
</div> </div>
<input type="submit" class="btn btn-sm btn-primary col-auto" id="searchBtn" value="검색">
</div> </div>
</div> </div>
</div> </form>
</form> <div class="row justify-content-start">
<div class="row justify-content-start"> <div class="col-12">
<div class="col-12"> <div class="card">
<div class="card"> <div class="card-body">
<div class="card-body"> <div class="row">
<div class="row"> <table class="table table-hover table-bordered">
<table class="table table-hover"> <thead>
<thead> <tr>
<tr> <th></th>
<th></th> <th>제목</th>
<th>제목</th> <th>관서</th>
<th>관서</th> <th>부서</th>
<th>부서</th> <th>계급</th>
<th>작성자</th> <th>작성자</th>
<th>작성일시</th> <th>작성일시</th>
<th>첨부파일</th> <th>첨부파일</th>
<th>댓글</th> <th>댓글</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody class="table-group-divider">
<tr class="planTr" th:each="reference:${referenceList}"> <tr class="planTr" th:each="reference:${referenceList}">
<input type="hidden" class="planKey" th:value="${reference.publicKey}"> <input type="hidden" class="planKey" th:value="${reference.publicKey}">
<td><input type="checkbox" class="trChkBox"></td> <td><input type="checkbox" class="trChkBox"></td>
<td th:text="${reference.title}"></td> <td th:text="${reference.title}"></td>
<th:block th:each="commonCode:${session.commonCode.get('OG')}"> <th:block th:each="commonCode:${session.commonCode.get('OG')}">
<td th:if="${reference.wrtOrgan eq commonCode.itemCd}" th:text="${commonCode.itemValue}"></td> <td th:if="${reference.wrtOrgan eq commonCode.itemCd}" th:text="${commonCode.itemValue}"></td>
</th:block>
<th:block th:each="commonCode:${session.commonCode.get('OFC')}">
<td th:if="${reference.wrtPart eq commonCode.itemCd}" th:text="${commonCode.itemValue}"></td>
</th:block>
<td th:text="${reference.wrtUserNm}"></td>
<td th:text="${#temporals.format(reference.wrtDt, 'yyyy-MM-dd HH:mm')}"></td>
<td th:text="${reference.fileCnt eq null?'파일 없음':#strings.concat(reference.fileCnt,' 건')}"></td>
<td th:text="${reference.commentCnt eq null?'0':reference.commentCnt}"></td>
</tr>
</tbody>
</table>
</div>
<div class="row justify-content-between">
<div class="col-auto"></div>
<div class="col-auto">
<nav aria-label="Page navigation">
<ul class="pagination">
<th:block th:if="${searchParams.pageIndex>3}">
<li class="page-item" th:data-pageindex="${(searchParams.pageIndex)-3}">
<a class="page-link" href="#" aria-label="Previous">
<span aria-hidden="true">&laquo;</span>
</a>
</li>
</th:block> </th:block>
<th:block th:each="num : ${#numbers.sequence(searchParams.startNum, searchParams.endNum)}"> <th:block th:each="commonCode:${session.commonCode.get('OFC')}">
<li class="page-item" th:data-pageindex="${num}" th:classappend="${searchParams.pageIndex eq num?'active':''}"> <td th:if="${reference.wrtPart eq commonCode.itemCd}" th:text="${commonCode.itemValue}"></td>
<a class="page-link" href="#" th:text="${num}"></a>
</li>
</th:block> </th:block>
<th:block th:if="${searchParams.maxNum>searchParams.endNum+2}"> <th:block th:each="commonCode:${session.commonCode.get('JT')}">
<li class="page-item" th:data-pageindex="${(searchParams.pageIndex)+3}"> <td th:if="${reference.wrtUserGrd eq commonCode.itemCd}" th:text="${commonCode.itemValue}"></td>
<a class="page-link" href="#" aria-label="Next">
<span aria-hidden="true">&raquo;</span>
</a>
</li>
</th:block> </th:block>
</ul> <td th:text="${reference.wrtUserNm}"></td>
</nav> <td th:text="${#temporals.format(reference.wrtDt, 'yyyy-MM-dd HH:mm')}"></td>
<td th:text="${reference.fileCnt eq null?'파일 없음':#strings.concat(reference.fileCnt,' 건')}"></td>
<td th:text="${reference.commentCnt eq null?'0':reference.commentCnt}"></td>
</tr>
</tbody>
</table>
</div> </div>
<div class="col-auto"> <div class="row justify-content-between">
<input type="button" class="btn btn-success" value="등록" id="addReferenceBtn"> <div class="col-auto"></div>
<div class="col-auto">
<nav aria-label="Page navigation">
<ul class="pagination">
<th:block th:if="${searchParams.pageIndex>3}">
<li class="page-item" th:data-pageindex="${(searchParams.pageIndex)-3}">
<a class="page-link" href="#" aria-label="Previous">
<span aria-hidden="true">&laquo;</span>
</a>
</li>
</th:block>
<th:block th:each="num : ${#numbers.sequence(searchParams.startNum, searchParams.endNum)}">
<li class="page-item" th:data-pageindex="${num}" th:classappend="${searchParams.pageIndex eq num?'active':''}">
<a class="page-link" href="#" th:text="${num}"></a>
</li>
</th:block>
<th:block th:if="${searchParams.maxNum>searchParams.endNum+2}">
<li class="page-item" th:data-pageindex="${(searchParams.pageIndex)+3}">
<a class="page-link" href="#" aria-label="Next">
<span aria-hidden="true">&raquo;</span>
</a>
</li>
</th:block>
</ul>
</nav>
</div>
<div class="col-auto">
<input type="button" class="btn btn-success" value="등록" id="addReferenceBtn">
</div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -8,11 +8,14 @@
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<input type="hidden" name="publicKeyKey" id="viewModalPublicKey" th:value="${info.publicKey}"> <input type="hidden" name="publicKeyKey" id="viewModalPublicKey" th:value="${info.publicKey}">
<div class="mb-3 row"> <div class="mb-3 row">
<label for="wrtUserNm" class="col-sm-1 col-form-label text-center">작성자</label> <label for="wrtUserNm" class="col-sm-1 col-form-label text-center">작성자</label>
<div class="col-sm-2"> <div class="col-sm-2">
<input type="text" class="form-control border-0" id="wrtUserNm" name="wrtUserNm" th:value="${info.wrtUserNm}" readonly> <th:block th:each="commonCode:${session.commonCode.get('JT')}">
<th:block th:if="${commonCode.itemCd eq info.wrtUserGrd}">
<input type="text" class="form-control border-0" id="wrtUserNm" name="wrtUserNm" th:value="|${commonCode.itemValue} ${info.wrtUserNm}|" readonly>
</th:block>
</th:block>
</div> </div>
<label for="wrtDt" class="col-sm-1 col-form-label text-center">작성일시</label> <label for="wrtDt" class="col-sm-1 col-form-label text-center">작성일시</label>
<div class="col-sm-2"> <div class="col-sm-2">
@ -102,6 +105,9 @@
<th:block th:each="commonCode:${session.commonCode.get('OFC')}"> <th:block th:each="commonCode:${session.commonCode.get('OFC')}">
<div class="col-auto" th:if="${commonCode.itemCd eq comment.wrtPart}" th:text="${commonCode.itemValue}"></div> <div class="col-auto" th:if="${commonCode.itemCd eq comment.wrtPart}" th:text="${commonCode.itemValue}"></div>
</th:block> </th:block>
<th:block th:each="commonCode:${session.commonCode.get('JT')}">
<div class="col-auto" th:if="${commonCode.itemCd eq comment.wrtUserGrd}" th:text="${commonCode.itemValue}"></div>
</th:block>
<div class="col-auto" th:text="${comment.wrtUserNm}"></div> <div class="col-auto" th:text="${comment.wrtUserNm}"></div>
<div class="col-auto" th:text="|작성일시: ${#temporals.format(comment.wrtDt, 'yyyy-MM-dd HH:mm')}|"></div> <div class="col-auto" th:text="|작성일시: ${#temporals.format(comment.wrtDt, 'yyyy-MM-dd HH:mm')}|"></div>
<div class="col-auto"> <div class="col-auto">
@ -129,6 +135,9 @@
<th:block th:each="commonCode:${session.commonCode.get('OFC')}"> <th:block th:each="commonCode:${session.commonCode.get('OFC')}">
<div class="col-auto" th:if="${commonCode.itemCd eq childComment.wrtPart}" th:text="${commonCode.itemValue}"></div> <div class="col-auto" th:if="${commonCode.itemCd eq childComment.wrtPart}" th:text="${commonCode.itemValue}"></div>
</th:block> </th:block>
<th:block th:each="commonCode:${session.commonCode.get('JT')}">
<div class="col-auto" th:if="${commonCode.itemCd eq childComment.wrtUserGrd}" th:text="${commonCode.itemValue}"></div>
</th:block>
<div class="col-auto" th:text="${childComment.wrtUserNm}"></div> <div class="col-auto" th:text="${childComment.wrtUserNm}"></div>
<div class="col-auto" th:text="|작성일시: ${#temporals.format(childComment.wrtDt, 'yyyy-MM-dd HH:mm')}|"></div> <div class="col-auto" th:text="|작성일시: ${#temporals.format(childComment.wrtDt, 'yyyy-MM-dd HH:mm')}|"></div>
<div class="col-auto" th:if="${userSeq eq childComment.wrtUserSeq}"> <div class="col-auto" th:if="${userSeq eq childComment.wrtUserSeq}">