Compare commits

...

2 Commits

11 changed files with 60 additions and 41 deletions

View File

@ -86,7 +86,7 @@
.P_MAIN .banner_bot > div.b2 > div {background: url(css/images/ico_bn02.png) no-repeat center 60px;} .P_MAIN .banner_bot > div.b2 > div {background: url(css/images/ico_bn02.png) no-repeat center 60px;}
.P_MAIN .banner_bot > div.b3 > div {background: url(css/images/ico_bn03.png) no-repeat center 60px;} .P_MAIN .banner_bot > div.b3 > div {background: url(css/images/ico_bn03.png) no-repeat center 60px;}
.P_MAIN .banner_bot > div.b4 > div {background: url(css/images/ico_bn04.png) no-repeat center 60px;} .P_MAIN .banner_bot > div.b4 > div {background: url(css/images/ico_bn04.png) no-repeat center 60px;}
/* 오늘의 행사 */ /* 오늘의 행사 */
.BRD001 .head > span:nth-child(1) {width: 150px;} .BRD001 .head > span:nth-child(1) {width: 150px;}
@ -141,16 +141,16 @@
.BRD005 .result .list_item > div:nth-child(4) {width: 120px;} .BRD005 .result .list_item > div:nth-child(4) {width: 120px;}
.BRD005 .result .list_item > div:nth-child(5) {width: 100px;} .BRD005 .result .list_item > div:nth-child(5) {width: 100px;}
/* 게시판생성 관리 */ /* 게시판 관리 */
.BRD006 .head > span:nth-child(1) {width: 70px;} .BRD006 .head > span:nth-child(1) {width: 75px;}
.BRD006 .head > span:nth-child(3) {width: 160px;} .BRD006 .head > span:nth-child(3) {width: 160px;}
.BRD006 .head > span:nth-child(4) {width: 168px;} .BRD006 .head > span:nth-child(4) {width: 168px;}
.BRD006 .head > span:nth-child(5) {width: 140px;} .BRD006 .head > span:nth-child(5) {width: 70px;}
.BRD006 .head > span:nth-child(6) {width: 140px;} .BRD006 .head > span:nth-child(6) {width: 140px;}
.BRD006 .result .list_item > div:nth-child(1) {width: 70px;} .BRD006 .result .list_item > div:nth-child(1) {width: 75px;}
.BRD006 .result .list_item > div:nth-child(3) {width: 160px;} .BRD006 .result .list_item > div:nth-child(3) {width: 160px;}
.BRD006 .result .list_item > div:nth-child(4) {width: 168px;} .BRD006 .result .list_item > div:nth-child(4) {width: 168px;}
.BRD006 .result .list_item > div:nth-child(5) {width: 140px;} .BRD006 .result .list_item > div:nth-child(5) {width: 70px;}
.BRD006 .result .list_item > div:nth-child(6) {width: 140px;} .BRD006 .result .list_item > div:nth-child(6) {width: 140px;}
/* 사이트관리 > 사용자관리 > 사용자목록 */ /* 사이트관리 > 사용자관리 > 사용자목록 */
@ -254,13 +254,17 @@
.PDS_LIST .tit_5 {margin-top: 42px;} .PDS_LIST .tit_5 {margin-top: 42px;}
.PDS_LIST .board_list {margin-top: 50px;} .PDS_LIST .board_list {margin-top: 50px;}
.BRD007 .head > span:nth-child(1) {width: 70px;} .BRD007 .head > span:nth-child(1) {width: 70px;}
.BRD007 .head > span:nth-child(3) {width: 90px;} .BRD007 .head > span:nth-child(3) {width: 160px;}
.BRD007 .head > span:nth-child(4) {width: 90px;} .BRD007 .head > span:nth-child(4) {width: 120px;}
.BRD007 .head > span:nth-child(5) {width: 120px;} .BRD007 .head > span:nth-child(5) {width: 70px;}
.BRD007 .head > span:nth-child(6) {width: 120px;}
.BRD007 .head > span:nth-child(7) {width: 140px;}
.BRD007 .result .list_item > div:nth-child(1) {width: 70px;} .BRD007 .result .list_item > div:nth-child(1) {width: 70px;}
.BRD007 .result .list_item > div:nth-child(3) {width: 90px;} .BRD007 .result .list_item > div:nth-child(3) {width: 160px;}
.BRD007 .result .list_item > div:nth-child(4) {width: 90px;} .BRD007 .result .list_item > div:nth-child(4) {width: 120px;}
.BRD007 .result .list_item > div:nth-child(5) {width: 120px;} .BRD007 .result .list_item > div:nth-child(5) {width: 70px;}
.BRD007 .result .list_item > div:nth-child(6) {width: 120px;}
.BRD007 .result .list_item > div:nth-child(7) {width: 140px;}
.PDS_REG .pds_desc_edit {margin: 14px 0 30px 0;} .PDS_REG .pds_desc_edit {margin: 14px 0 30px 0;}

View File

@ -131,7 +131,6 @@ function AdminPostMgtEdit({props, reloadFunction}) {
}, },
(resp) => { (resp) => {
if (Number(resp.resultCode) === Number(CODE.RCV_SUCCESS)) { if (Number(resp.resultCode) === Number(CODE.RCV_SUCCESS)) {
alert("삭제되었습니다.")
reloadFunction(); reloadFunction();
} else if (Number(resp.resultCode) === Number(CODE.RCV_ERROR_AUTH)) { } else if (Number(resp.resultCode) === Number(CODE.RCV_ERROR_AUTH)) {
console.log("토큰 갱신중.") console.log("토큰 갱신중.")

View File

@ -14,6 +14,7 @@ import AdminPostMgtEdit from "./AdminPostMgtEdit";
import Modal from "react-bootstrap/Modal"; import Modal from "react-bootstrap/Modal";
import {format} from "date-fns"; import {format} from "date-fns";
import {Form} from "react-bootstrap"; import {Form} from "react-bootstrap";
const fileIconPath = require('../../../css/images/ico_file.png');
function AdminPostMgtList(props) { function AdminPostMgtList(props) {
console.group("EgovAdminPostList"); console.group("EgovAdminPostList");
@ -44,7 +45,7 @@ function AdminPostMgtList(props) {
console.groupCollapsed("EgovAdminPostList.retrieveList()"); console.groupCollapsed("EgovAdminPostList.retrieveList()");
const retrieveListURL = '/admin/boards/post-list' + params; const retrieveListURL = '/admin/boards/post-list' + params;
const requestOptions = { const requestOptions = {
method: "GET", method: "GET",
headers: { headers: {
@ -58,21 +59,37 @@ function AdminPostMgtList(props) {
(resp) => { (resp) => {
setPaginationInfo(resp.result.paginationInfo); setPaginationInfo(resp.result.paginationInfo);
setCategoryList(resp.result.categoryList); setCategoryList(resp.result.categoryList);
console.log("@@@ resultCnt : " + resp.result.resultCnt);
let mutListTag = []; let mutListTag = [];
setListTag([]); setListTag([]);
resp.result.fixedList.forEach(function (item) {
const finalModifiedDate = item?.lastChgDt ? item?.lastChgDt : item?.frstCrtDt;
const formattedDate = finalModifiedDate ? format(finalModifiedDate, "yyyy-MM-dd HH:mm") : "";
mutListTag.push(
<div className="list_item">
<div>공지</div>
<div>{item?.bbsContTitle}</div>
<div>{item?.frstCrtId}</div>
<div>{formattedDate}</div>
<div>{item?.bbsReadCnt}</div>
<div>{item?.fileGrpId && <img src={fileIconPath} alt="File Icon" />}</div>
<div><button className={"btn btn_blue_h31 px-1"} onClick={()=>{editPost(item)}}>수정</button></div>
</div>
);
});
resp.result.postList.forEach(function (item, index) { resp.result.postList.forEach(function (item, index) {
const finalModifiedDate = item?.lastChgDt ? item?.lastChgDt : item?.frstCrtDt; const finalModifiedDate = item?.lastChgDt ? item?.lastChgDt : item?.frstCrtDt;
const formattedDate = finalModifiedDate ? format(finalModifiedDate, "yyyy-MM-dd HH:mm") : ""; const formattedDate = finalModifiedDate ? format(finalModifiedDate, "yyyy-MM-dd HH:mm") : "";
mutListTag.push( mutListTag.push(
<div className="list_item"> <div className="list_item">
<div>{item?.bbsContSeq}</div> <div>{resp.result.resultCnt - (resp.result.paginationInfo.pageIndex -1) * resp.result.paginationInfo.rowCnt - index}</div>
<div>{item?.bbsContTitle}</div> <div>{item?.bbsContTitle}</div>
<div>{item?.frstCrtId}</div> <div>{item?.frstCrtId}</div>
<div>{formattedDate}</div> <div>{formattedDate}</div>
<div>{item?.bbsReadCnt}</div> <div>{item?.bbsReadCnt}</div>
<div>{item?.fileGrpId}</div> <div>{item?.fileGrpId && <img src={fileIconPath} alt="File Icon" />}</div>
<div><button className={"btn btn_blue_h31 px-1"} onClick={()=>{editPost(item)}}>수정</button></div> <div><button className={"btn btn_blue_h31 px-1"} onClick={()=>{editPost(item)}}>수정</button></div>
</div> </div>
); );
@ -159,7 +176,7 @@ function AdminPostMgtList(props) {
{/* <!--// 검색조건 --> */} {/* <!--// 검색조건 --> */}
{/* <!-- 게시판목록 --> */} {/* <!-- 게시판목록 --> */}
<div className="board_list BRD006"> <div className="board_list BRD007">
<div className="head"> <div className="head">
<span>번호</span> <span>번호</span>
<span>제목</span> <span>제목</span>

View File

@ -122,7 +122,6 @@ function EgovAdminBoardEdit({props, reloadFunction}) {
}, },
(resp) => { (resp) => {
if (Number(resp.resultCode) === Number(CODE.RCV_SUCCESS)) { if (Number(resp.resultCode) === Number(CODE.RCV_SUCCESS)) {
alert("삭제되었습니다.")
reloadFunction(); reloadFunction();
} else if (Number(resp.resultCode) === Number(CODE.RCV_ERROR_AUTH)) { } else if (Number(resp.resultCode) === Number(CODE.RCV_ERROR_AUTH)) {
console.log("토큰 갱신중.") console.log("토큰 갱신중.")
@ -179,7 +178,6 @@ function EgovAdminBoardEdit({props, reloadFunction}) {
<dt><label htmlFor="bbsTitle">게시판 타입</label><span className="req">필수</span></dt> <dt><label htmlFor="bbsTitle">게시판 타입</label><span className="req">필수</span></dt>
<dd> <dd>
<Form.Select id="select1" name="bbsType"> <Form.Select id="select1" name="bbsType">
<option value="">선택</option>
{bbsTypeList.map((item) => ( {bbsTypeList.map((item) => (
<option key={item.itemCd} value={item.itemCd} selected={props?.bbsType === item.itemCd}>{item.itemNm}</option> <option key={item.itemCd} value={item.itemCd} selected={props?.bbsType === item.itemCd}>{item.itemNm}</option>
))} ))}
@ -226,7 +224,7 @@ function EgovAdminBoardEdit({props, reloadFunction}) {
<dt><label htmlFor="bbsTitle">읽기 권한</label><span className="req">필수</span></dt> <dt><label htmlFor="bbsTitle">읽기 권한</label><span className="req">필수</span></dt>
<dd> <dd>
<Form.Select id="select1" name="readRole"> <Form.Select id="select1" name="readRole">
<option value="">선택</option> <option value="0">비회원</option>
{roleList.map((item) => ( {roleList.map((item) => (
<option key={item.itemCd} value={item.grpOrder} selected={props?.readRole === item.grpOrder}>{item.itemNm}</option> <option key={item.itemCd} value={item.grpOrder} selected={props?.readRole === item.grpOrder}>{item.itemNm}</option>
))} ))}
@ -237,7 +235,6 @@ function EgovAdminBoardEdit({props, reloadFunction}) {
<dt><label htmlFor="bbsTitle">쓰기 권한</label><span className="req">필수</span></dt> <dt><label htmlFor="bbsTitle">쓰기 권한</label><span className="req">필수</span></dt>
<dd> <dd>
<Form.Select id="select1" name="writeRole"> <Form.Select id="select1" name="writeRole">
<option value="">선택</option>
{roleList.map((item) => ( {roleList.map((item) => (
<option key={item.itemCd} value={item.grpOrder} selected={props?.writeRole === item.grpOrder}>{item.itemNm}</option> <option key={item.itemCd} value={item.grpOrder} selected={props?.writeRole === item.grpOrder}>{item.itemNm}</option>
))} ))}

View File

@ -58,7 +58,6 @@ function EgovAdminBoardList(props) {
mutListTag.push( mutListTag.push(
<div className="list_item"> <div className="list_item">
<div></div>
<div>{item.bbsId}</div> <div>{item.bbsId}</div>
<div>{item.bbsTitle}</div> <div>{item.bbsTitle}</div>
<div>{item.frstCrtId}</div> <div>{item.frstCrtId}</div>
@ -122,7 +121,6 @@ function EgovAdminBoardList(props) {
{/* <!-- 게시판목록 --> */} {/* <!-- 게시판목록 --> */}
<div className="board_list BRD006"> <div className="board_list BRD006">
<div className="head"> <div className="head">
<span></span>
<span>아이디</span> <span>아이디</span>
<span>제목</span> <span>제목</span>
<span>작성자</span> <span>작성자</span>

View File

@ -51,7 +51,6 @@ function StandardCodeMgt(props) {
mutListTag.push( mutListTag.push(
<div className="list_item"> <div className="list_item">
<div></div>
<div>{item.siteTitle}</div> <div>{item.siteTitle}</div>
<div>{item.siteUrl}</div> <div>{item.siteUrl}</div>
<div><Image src={"http://back.kcsc.dbnt.co.kr/admin/config/get-site-image?fileGrpId=" + item.fileGrpId} alt="이미지" onClick={(e) => window.open(e.target.src)}/></div> <div><Image src={"http://back.kcsc.dbnt.co.kr/admin/config/get-site-image?fileGrpId=" + item.fileGrpId} alt="이미지" onClick={(e) => window.open(e.target.src)}/></div>
@ -148,7 +147,6 @@ function StandardCodeMgt(props) {
{/* <!-- 게시판목록 --> */} {/* <!-- 게시판목록 --> */}
<div className="board_list BRD006"> <div className="board_list BRD006">
<div className="head"> <div className="head">
<span></span>
<span>사이트명</span> <span>사이트명</span>
<span>URL</span> <span>URL</span>
<span>배너이미지</span> <span>배너이미지</span>

View File

@ -243,7 +243,11 @@ function AboutSiteModal({props, reloadFunction}) {
<dt><label htmlFor="siteOrder">정렬순서</label><span className="req">필수</span></dt> <dt><label htmlFor="siteOrder">정렬순서</label><span className="req">필수</span></dt>
<dd> <dd>
<Form.Control className="f_txtar w_full" type="text" name="siteOrder" placeholder="정렬순서" required <Form.Control className="f_txtar w_full" type="text" name="siteOrder" placeholder="정렬순서" required
defaultValue={props?.siteOrder}/> defaultValue={props?.siteOrder} onChange={(e) => {
const inputValue = e.target.value;
const numericValue = inputValue.replace(/\D/g, '');
e.target.value = numericValue;
}}/>
</dd> </dd>
</dl> </dl>
<dl> <dl>

View File

@ -130,7 +130,7 @@ public class AdminBoardsController extends BaseController {
if (user == null) { if (user == null) {
resultVO.setResultCode(ResponseCode.TOKEN_EXPIRED.getCode()); resultVO.setResultCode(ResponseCode.TOKEN_EXPIRED.getCode());
} else { } else {
String result = adminBoardsService.deleteBoard(bbs, user.getId()); String result = adminBoardsService.deleteBoard(bbs);
if (result == null) { if (result == null) {
resultVO.setResultCode(ResponseCode.SUCCESS.getCode()); resultVO.setResultCode(ResponseCode.SUCCESS.getCode());
} else if (result.equals("notFind")) { } else if (result.equals("notFind")) {
@ -256,7 +256,7 @@ public class AdminBoardsController extends BaseController {
resultVO.setResultCode(ResponseCode.TOKEN_EXPIRED.getCode()); resultVO.setResultCode(ResponseCode.TOKEN_EXPIRED.getCode());
} else { } else {
contents.setIpAddress(ClientUtils.getRemoteIP(request)); contents.setIpAddress(ClientUtils.getRemoteIP(request));
String result = adminBoardsService.deletePost(contents, user.getId()); String result = adminBoardsService.deletePost(contents);
if (result == null) { if (result == null) {
resultVO.setResultCode(ResponseCode.SUCCESS.getCode()); resultVO.setResultCode(ResponseCode.SUCCESS.getCode());
} else if (result.equals("notFind")) { } else if (result.equals("notFind")) {

View File

@ -57,23 +57,25 @@ public class AdminBoardsService extends EgovAbstractServiceImpl {
} }
@Transactional @Transactional
public String deleteBoard(TnBbs bbs, String userId) { public String deleteBoard(TnBbs bbs) {
TnBbs savedBoard = tnBbsRepository.findById(bbs.getBbsSeq()).orElse(null); TnBbs savedBoard = tnBbsRepository.findById(bbs.getBbsSeq()).orElse(null);
if (savedBoard == null) { if (savedBoard == null) {
return "notFind"; return "notFind";
} else { } else {
savedBoard.setUseYn("N"); tnBbsRepository.deleteById(bbs.getBbsSeq());
savedBoard.setLastChgDt(LocalDateTime.now());
savedBoard.setLastChgId(userId);
tnBbsRepository.save(savedBoard);
return null; return null;
} }
} }
public Map<String, Object> selectPostList(TnBbsContents params) { public Map<String, Object> selectPostList(TnBbsContents params) {
Map<String, Object> resultMap = new HashMap<>(); Map<String, Object> resultMap = new HashMap<>();
resultMap.put("resultCnt", String.valueOf(adminBoardsMapper.selectPostListCnt(params)));
params.setFixedYn("N");
resultMap.put("postList", adminBoardsMapper.selectPostList(params)); resultMap.put("postList", adminBoardsMapper.selectPostList(params));
resultMap.put("resultCnt", String.valueOf(adminBoardsMapper.selectPostListCnt(params)));
params.setFixedYn("Y");
resultMap.put("fixedList", adminBoardsMapper.selectPostList(params));
return resultMap; return resultMap;
} }
@ -158,16 +160,12 @@ public class AdminBoardsService extends EgovAbstractServiceImpl {
} }
@Transactional @Transactional
public String deletePost(TnBbsContents contents, String userId) { public String deletePost(TnBbsContents contents) {
TnBbsContents savedPost = tnBbsContentsRepository.findById(contents.getBbsContSeq()).orElse(null); TnBbsContents savedPost = tnBbsContentsRepository.findById(contents.getBbsContSeq()).orElse(null);
if (savedPost == null) { if (savedPost == null) {
return "notFind"; return "notFind";
} else { } else {
savedPost.setIpAddress(contents.getIpAddress()); tnBbsContentsRepository.deleteById(contents.getBbsContSeq());
savedPost.setUseYn("N");
savedPost.setLastChgDt(LocalDateTime.now());
savedPost.setLastChgId(userId);
tnBbsContentsRepository.save(savedPost);
return null; return null;
} }
} }

View File

@ -532,7 +532,6 @@ public class AdminConfigController extends BaseController {
}) })
@RequestMapping(method = RequestMethod.GET, value = "/get-site-image") @RequestMapping(method = RequestMethod.GET, value = "/get-site-image")
public void getSiteImage(HttpServletResponse response, @RequestParam String fileGrpId) throws Exception { public void getSiteImage(HttpServletResponse response, @RequestParam String fileGrpId) throws Exception {
System.out.println("@@@ in : ");
List<TnAttachFile> dbImgList = fileService.findByFileGrpId(fileGrpId); List<TnAttachFile> dbImgList = fileService.findByFileGrpId(fileGrpId);
String realFile = dbImgList.get(0).getFilePath(); String realFile = dbImgList.get(0).getFilePath();
String fileNm = dbImgList.get(0).getFileNewName(); String fileNm = dbImgList.get(0).getFileNewName();

View File

@ -30,7 +30,9 @@
from tn_bbs_contents from tn_bbs_contents
<include refid="selectPostListWhere"></include> <include refid="selectPostListWhere"></include>
order by bbs_cont_seq desc order by bbs_cont_seq desc
<if test='fixedYn != "Y"'>
limit #{rowCnt} offset #{firstIndex} limit #{rowCnt} offset #{firstIndex}
</if>
</select> </select>
<select id="selectPostListCnt" parameterType="TnBbsContents" resultType="int"> <select id="selectPostListCnt" parameterType="TnBbsContents" resultType="int">
@ -41,6 +43,9 @@
<sql id="selectPostListWhere"> <sql id="selectPostListWhere">
<where> <where>
<if test='fixedYn != null and fixedYn != ""'>
and fixed_yn = #{fixedYn}
</if>
<if test='bbsSeq != null and bbsSeq != ""'> <if test='bbsSeq != null and bbsSeq != ""'>
and bbs_seq = #{bbsSeq} and bbs_seq = #{bbsSeq}
</if> </if>