Compare commits

..

6 Commits

35 changed files with 1824 additions and 55 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -7,30 +7,36 @@ function EgovFooter() {
}else{
return (
<div className="footer">
<div className="upper">
<div className="row up">
<div className="col-2 left"><span>건설기준코드 <br />건설기준위원회 <br />정보제공 <br /></span>센터소개</div>
<div className="col-10 right"><span>건설기준코드 안내 | 건설기준코드 검색 | ()건설기준 검색<br />
진행현황 | 위원회 일정<br />
공지사항 | Q&A | 수요조사 | 주요행사 | 건설교육안내 | 기술자료 | 보도자료 | 관련사이트 | API서비스 | 영문기준 제공 | 건설기준용어 | 건설기준 연구 <br /></span>
인사말 | 연혁 | 홍보자료 | 주요업무 | 찾아오시는길
</div>
</div>
</div>
<div className="inner">
<h1>
<Link to="">
국가건설 기준센터
{/*<img className="w" src="/assets/images/logo_footer_w.png" alt="" />
<img className="m" src="/assets/images/logo_footer_m.png" alt="" />*/}
</Link>
<img className="w" src="/assets/images/copy3.png" alt="" />
</h1>
<div className="info">
<p>
대표문의메일 : kcsc@kict.re.kr <span className="m_hide">|</span><br className="m_show" /> 대표전화 : 0000-0000 (000-0000-0000)<br />
호환성확인 : 000-0000-0000 | 교육문의 : 0000-0000-0000
상호명 : 한국건설기술연구원 <span className="m_hide">|</span> 대표자 : 김병석 | 대표메일 : kcsc@kict.re.kr<br />
사업자등록번호 : 229-82-01135 | 주소 : 경기도 고양시 일산서구 고양대로 283(대화동)
</p>
<p className="copy">Copyright © 2021 Ministry Of The Interior And Safety. All Rights Reserved.</p>
<p className="copy">Copyright © 2011 KOREA INSTITUTE of CIVIL ENGINEERING and BUILDING TECHNOLOGY. All Rights Reserved.</p>
</div>
<div className="right_col">
<Link to="">
<img className="w" src="/assets/images/banner_w_01.png" alt="" />
<img className="m" src="/assets/images/banner_m_01.png" alt="" />
</Link>
<Link to="">
<img className="w" src="/assets/images/banner_w_02.png" alt="" />
<img className="m" src="/assets/images/banner_m_02.png" alt="" />
</Link>
{/*<Link to="">*/}
{/* <img className="w" src="/assets/images/banner_w_01.png" alt="" />*/}
{/* <img className="m" src="/assets/images/banner_m_01.png" alt="" />*/}
{/*</Link>*/}
{/*<Link to="">*/}
{/* <img className="w" src="/assets/images/banner_w_02.png" alt="" />*/}
{/* <img className="m" src="/assets/images/banner_m_02.png" alt="" />*/}
{/*</Link>*/}
</div>
</div>
</div>

View File

@ -71,21 +71,34 @@ function EgovHeader({ loginUser, onChangeLogin }) {
<div className="header">
<div className="inner">
<h1 className="logo">
<Link to={URL.MAIN} className="w">국가건설기준센터</Link>{/*<img src="/assets/images/logo_w.png" alt="국가건설기준센터" />*/}
<Link to={URL.MAIN} className="m">국가건설기준센터</Link>{/*<img src="/assets/images/logo_m.png" alt="국가건설기준센터" />*/}
<Link to={URL.MAIN} className="w">
<div className="logotop"><img src="/assets/images/copy.png" alt="국가건설기준센터" /></div><img src="/assets/images/logo.png" alt="국가건설기준센터" /></Link>
<Link to={URL.MAIN} className="m"><img src="/assets/images/logo_m.png" alt="국가건설기준센터" /></Link>{/*<img src="/assets/images/logo_m.png" alt="국가건설기준센터" />*/}
</h1>
<div className="gnb">
<h2 className="blind">주메뉴</h2>
<ul>
<li><NavLink to={URL.STANDARD_CODE_INFO} className={({ isActive }) => (isActive ? "cur" : "")}>건설기준코드</NavLink></li>
{/*<li><NavLink to={URL.ABOUT} className={({ isActive }) => (isActive ? "cur" : "")}>사이트소개</NavLink></li>*/}
<li><NavLink to={URL.INTRO} className={({ isActive }) => (isActive ? "cur" : "")}>정보마당</NavLink></li>
<li><NavLink to={URL.SUPPORT} className={({ isActive }) => (isActive ? "cur" : "")}>고객지원</NavLink></li>
<li><NavLink to={URL.INFORM} className={({ isActive }) => (isActive ? "cur" : "")}>알림마당</NavLink></li>
{sessionUserSe ==='ACC_TP01' &&
<li><NavLink to={URL.ADMIN} className={({ isActive }) => (isActive ? "cur" : "")}>사이트관리</NavLink></li>
}
<div className="row ">
<div className="w-100">
<form className="form-inline">
<div className="input-group w-75" style={{ border: "2px solid #1c488f", borderRadius: "20px", padding: "10px", width: "fit-content" }}>
<input type="text" className="form-control border-0" placeholder="검색어를 입력하세요." />
<div className="input-group-append">
<button type="button" className="topsearch"></button>
</div>
</div>
</form>
</div>
</div>
{/*<li><NavLink to={URL.STANDARD_CODE_INFO} className={({ isActive }) => (isActive ? "cur" : "")}>건설기준코드</NavLink></li>*/}
{/*/!*<li><NavLink to={URL.ABOUT} className={({ isActive }) => (isActive ? "cur" : "")}>사이트소개</NavLink></li>*!/*/}
{/*<li><NavLink to={URL.INTRO} className={({ isActive }) => (isActive ? "cur" : "")}>정보마당</NavLink></li>*/}
{/*<li><NavLink to={URL.SUPPORT} className={({ isActive }) => (isActive ? "cur" : "")}>고객지원</NavLink></li>*/}
{/*<li><NavLink to={URL.INFORM} className={({ isActive }) => (isActive ? "cur" : "")}>알림마당</NavLink></li>*/}
{/*{sessionUserSe ==='ACC_TP01' &&*/}
{/* <li><NavLink to={URL.ADMIN} className={({ isActive }) => (isActive ? "cur" : "")}>사이트관리</NavLink></li>*/}
{/*}*/}
</ul>
</div>

View File

@ -5,16 +5,17 @@ body {min-width: 1400px;}
.header {position: relative;}
.header::after {content: ""; display: block; position: absolute; left: 0; bottom: 0; width: 100%; height: 1px; background: #dedede;}
.header > .inner {position: relative; width: 1400px; height: 150px; margin: 0 auto; padding: 0 50px;}
.header h1 {display: inline-block; margin-top: 62px;}
.header h1 {display: inline-block; margin-top: 32px;}
.header h1 a,
.header h1 img {display: block;}
.header .logo .m {display: none;}
.header .user_info {position: absolute; right: 50px; top: 20px; line-height: 30px;}
.header .logo .logotop {display: flex; width: 220px; justify-content: flex-end;}
.header .user_info {position: absolute; right: 50px; top: 10px; line-height: 30px;}
.header .user_info .person {display: inline-block; color: #169bd5; font-weight: 500;}
.header .user_info .person::before {content: ""; display: inline-block; width: 22px; height: 22px; margin-right: 7px; background: url(css/images/ico_person.png) no-repeat; background-size: contain; vertical-align: -4px;}
.header .user_info .btn {margin-left: 14px; padding: 0 20px; border-radius: 15px; color: #fff; font-size: 14px; line-height: 30px; background: #169bd5;}
.header .gnb {position: absolute; left: 430px; top: 78px; width: 920px;}
.header .gnb {position: absolute; left: 430px; top: 50px; width: 920px;}
.header .gnb ul {font-size: 0; text-align: center;}
.header .gnb ul::after {content: ""; display: block; clear: both;}
.header .gnb ul li {float: left;}
@ -22,11 +23,13 @@ body {min-width: 1400px;}
.header .gnb ul li a {color: #666; font-size: 20px; font-weight: 700; letter-spacing: -0.25px;}
.header .gnb ul li a.cur {color: #222;}
.header .right_a {position: absolute; right: 50px; top: 75px;}
.header .right_a {position: absolute; right: 50px; top: 65px;}
.header .right_a .btn {width: 30px; height: 30px; font-size: 0; background: url(css/images/ico_allmenu.png) no-repeat right; background-size: 22px 18px;}
.header .right_a .btn.active {background: url(css/images/ico_allmenu_close.png) no-repeat right; background-size: 22px 18px;}
.header .right_a .btn.mobile {display: none;}
.header .topsearch {width: 25px; height: 27px; background: url(css/images/ico_search_b.png) no-repeat; margin: 5px;}
/* All menu */
.all_menu {transition: transform .2s ease-in-out, opacity .2s ease-in-out; transform-origin: top; z-index: 10;}
.all_menu.Mobile {display: none;}
@ -75,14 +78,18 @@ body {min-width: 1400px;}
.location ul li a.home::before {content: ""; display: block; position: absolute; left: 0; top: 3px; width: 14px; height: 13px; background: url(css/images/ico_home.png) no-repeat;}
.footer {position: relative; height: 180px;}
.footer {position: relative; background-color: #2c394b; }
.footer .upper {width: 100%; background-color: #384556; font-size: 12px;}
.footer .upper .up {width: 1400px; margin: 0 auto; padding: 10px 50px; }
.footer .upper .up .left {text-align: right; color: #B4B5B7; font-weight: 700;}
.footer .upper .up .right {color: #96A1AE; }
.footer::before {content: ""; display: block; position: absolute; left: 0; top: 0; width: 100%; height: 1px; background: #ccc;}
.footer .inner {position: relative; width: 1400px; margin: 0 auto; padding: 0 50px;}
.footer .inner::after {content: ""; display: block; clear: both;}
.footer h1 {float: left; width: 220px; padding-top: 50px;}
.footer h1 {float: left; width: 220px; padding-top: 20px;}
.footer h1 .m {display: none;}
.footer .info {float: left; padding-top: 44px; color: #888; font-size: 16px; line-height: 26px;}
.footer .info .copy {margin-top: 12px;}
.footer .info {float: left; padding: 14px 10px; color: #888; font-size: 13px; }
.footer .info .copy {padding-top: 5px;}
.footer .info .m_show {display: none;}
.footer .right_col {position: absolute; right: 0; top: 73px; font-size: 0;}
.footer .right_col a {display: inline-block; margin-right: 60px; vertical-align: top;}

View File

@ -8,6 +8,102 @@ import URL from 'constants/url';
import { default as EgovLeftNav } from 'components/leftmenu/EgovLeftNavAdmin';
import EgovPagingPaginationInfo from 'components/EgovPagingPaginationInfo';
import styled from "styled-components";
const StyledDiv = styled.div`
.BRD008 {
.head {
span {
text-align: left;
&:nth-child(1) {
width: 32px;
text-align: center;
}
&:nth-child(2) {
width: 60px;
text-align: center;
}
&:nth-child(3) {
width: 300px;
}
&:nth-child(4) {
width: 120px;
}
&:nth-child(5) {
width: 80px;
}
&:nth-child(6) {
width: 70px;
}
&:nth-child(7) {
width: 50px;
text-align: center;
}
&:nth-child(8) {
width: 50px;
text-align: center;
}
}
}
.result .list_item {
& > div {
text-align: left;
&:nth-child(1) {
width: 32px;
text-align: center;
}
&:nth-child(2) {
width: 60px;
text-align: center;
}
&:nth-child(3) {
width: 300px;
}
&:nth-child(4) {
width: 120px;
}
&:nth-child(5) {
width: 80px;
}
&:nth-child(6) {
width: 70px;
}
&:nth-child(7) {
width: 50px;
text-align: center;
}
&:nth-child(8) {
width: 50px;
text-align: center;
}
}
}
}
.board-bot {
margin-top: 20px;
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: flex-start;
align-items: stretch;
justify-content: center;
& > *:nth-child(1) {
width: 16%;
justify-content: left;
}
& > *:nth-child(2) {
width: 68%;
justify-content: center;
}
& > *:nth-child(3) {
width: 16%;
justify-content: right;
}
}
`;
function ProgressStatus(props) {
const location = useLocation();
@ -16,6 +112,11 @@ function ProgressStatus(props) {
const [paginationInfo, setPaginationInfo] = useState({});
const [searchCondition, setSearchCondition] = useState(location.state?.searchCondition || { pageIndex: 1, searchCnd: '0', searchWrd: '' });
useEffect(function () {
getList(searchCondition);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
const requestOptions = {
method: "GET",
headers: {
@ -25,11 +126,11 @@ function ProgressStatus(props) {
const getList = (searchCondition) => {
EgovNet.requestFetch(`/contents/api/popup-manage/list?page=${searchCondition.pageIndex-1}&size=10&sort=popupSeq,desc`,
EgovNet.requestFetch(`/admin/committee/progress-status/list?page=${searchCondition.pageIndex-1}&size=10&sort=popupSeq,desc`,
requestOptions,
function (resp) {
console.log('%o', resp);
setListItem(resp.result.listPopup);
setListItem(resp.result.list);
setPaginationInfo({...resp.result.paginationInfo});
}
);
@ -63,17 +164,22 @@ function ProgressStatus(props) {
<div className="contents " id="contents">
{/* <!-- 본문 --> */}
<div className="top_tit">
<h1 className="tit_1">진행현황 관리</h1>
</div>
<StyledDiv>
<div className="top_tit">
<h1 className="tit_1">진행현황 관리</h1>
</div>
{/* <!-- 게시판목록 --> */}
<div className="board_list BRD008">
{/* <!-- 게시판목록 --> */}
<div className="board_list BRD008">
<div className="head">
<span>번호</span>
<span>제목</span>
<span>기간</span>
<span>사용여부</span>
<span>#</span>
<span>구분</span>
<span>제목 / 코드명</span>
<span>진행위원회</span>
<span>진행단계</span>
<span>등록일</span>
<span>수정</span>
<span>삭제</span>
</div>
<div className="result">
{/* <!-- case : 데이터 없을때 --> */}
@ -83,6 +189,13 @@ function ProgressStatus(props) {
{listItem.map((it)=>(
<div className='list_item' key={it.seq}>
<div>{it.number}</div>
<div>{it.drftTypeNm}</div>
<div>{it.categoryNm}<br /><Link to={URL.MAIN} className="home">{it.title}</Link></div>
<div>{it.orgNm}</div>
<div>진행단계표시</div>
<div>{it.regDate}</div>
<div><button type='button' className='btn btn_blue_h31 px-1'>수정</button></div>
<div><button type='button' className='btn btn_red_h31 px-1'>삭제</button></div>
</div>
))}
</div>
@ -105,6 +218,7 @@ function ProgressStatus(props) {
</div>
{/* <!--/ Paging --> */}
</StyledDiv>
{/* <!--// 본문 --> */}
</div>
</div>

View File

@ -6,12 +6,15 @@ import URL from 'constants/url';
import { default as EgovLeftNav } from 'components/leftmenu/EgovLeftNavAdmin';
import * as EgovNet from "../../../api/egovFetch";
import Modal from "react-bootstrap/Modal";
import SurveyModal from "./survey/SurveyModal";
import QuestionModal from "./survey/QuestionModal";
function Survey({}) {
const [listTag, setListTag] = useState([]);
const [show, setShow] = useState(false);
const [modalSize, setModalSize] = useState("md");
const [modalBody, setModalBody] = useState();
const handleClose = () => setShow(false);
@ -34,7 +37,7 @@ function Survey({}) {
<div className={"list_item"} key={"surveyListDiv_"+index}>
<div>{item.svyTitle}</div>
<div>{item.svyStartDt}~{item.svyEndDt}</div>
<div><button className={"btn btn_blue_h31 px-1"}>질문관리</button></div>
<div><button className={"btn btn_blue_h31 px-1"} onClick={()=>{editSurveyQt(item)}}>질문관리</button></div>
<div></div>
<div><button className={"btn btn_blue_h31 px-1"}>설문지 보기</button></div>
<div><button className={"btn btn_blue_h31 px-1"}>통계 보기</button></div>
@ -56,9 +59,16 @@ function Survey({}) {
);
},[]);
function editSurvey(){
function editSurvey(item){
handleShow();
setModalBody(<></>);
setModalSize("md")
setModalBody(<SurveyModal savedInfo={item} reloadFunction={retrieveList}></SurveyModal>);
}
function editSurveyQt(item){
handleShow();
setModalSize("xl")
setModalBody(<QuestionModal svySeq={item.svySeq}></QuestionModal>);
}
useEffect(()=>{
@ -104,7 +114,7 @@ function Survey({}) {
</div>
</div>
<Modal show={show} onHide={handleClose} keyboard={false}>
<Modal size={modalSize} show={show} onHide={handleClose} keyboard={false} scrollable>
{modalBody}
</Modal>
</div>

View File

@ -0,0 +1,141 @@
import React, {useEffect, useState} from "react";
import Modal from "react-bootstrap/Modal";
import Row from "react-bootstrap/Row";
import Col from "react-bootstrap/Col";
import Form from "react-bootstrap/Form";
import Table from "react-bootstrap/Table";
import * as EgovNet from "api/egovFetch";
function QuestionModal({svySeq}){
const [qtTag, setQtTag] = useState([]);
const [itemTag, setItemTag] = useState([]);
function getSurveyQt(){
EgovNet.requestFetch(
'/admin/survey/edit-qt?svySeq='+svySeq,
{
method: "GET"
},
(resp) => {
const temp = [];
resp.result.qtList.forEach(function (qt, index){
temp.push(
<tr>
<td className={"clickable"} onClick={()=>selectQt(qt.itemList)}>
<Form.Control type={"text"} defaultValue={qt.qtTitle}/>
</td>
</tr>
)
})
setQtTag(temp);
},
function (resp) {
console.log("err response : ", resp);
}
);
}
function selectQt(itemList){
const temp = [];
itemList.forEach(function (item, index){
temp.push(
<tr>
<td>
<Form.Control type={"text"} defaultValue={item.itemNm}/>
</td>
</tr>
)
})
setItemTag(temp);
}
function addQt(){
const temp = [...qtTag]
temp.push(
<tr>
<td>
<Form.Control type={"text"}/>
</td>
</tr>
)
setQtTag(temp)
}
function addItem(){
const temp = [...itemTag]
temp.push(
<tr>
<td>
<Form.Control type={"text"}/>
</td>
</tr>
)
setItemTag(temp)
}
function editSurveyQt(e){
}
useEffect(() => {
getSurveyQt()
}, []);
return (
<>
<Modal.Header closeButton>
<Modal.Title>질문관리</Modal.Title>
</Modal.Header>
<Modal.Body>
<Row>
<Col xs={6}>
<Table>
<thead>
<tr>
<th>질문</th>
</tr>
</thead>
<tbody>
{qtTag}
</tbody>
<tfoot>
<tr>
<td>
<button className={"btn btn_blue_h31"} onClick={addQt}>추가</button>
</td>
</tr>
</tfoot>
</Table>
</Col>
<Col xs={6}>
<Table>
<thead>
<tr>
<th>보기</th>
</tr>
</thead>
<tbody>
{itemTag}
</tbody>
<tfoot>
<tr>
<td>
<button className={"btn btn_blue_h31"} onClick={addItem}>추가</button>
</td>
</tr>
</tfoot>
</Table>
</Col>
</Row>
</Modal.Body>
<Modal.Footer>
<button type="button" className={"btn btn_blue_h31 px-3"}>저장</button>
</Modal.Footer>
</>
);
}
export default QuestionModal;

View File

@ -0,0 +1,107 @@
import React from "react";
import Modal from "react-bootstrap/Modal";
import Form from "react-bootstrap/Form";
import Row from "react-bootstrap/Row";
import Col from "react-bootstrap/Col";
import * as EgovNet from "api/egovFetch";
import CODE from "constants/code";
function SurveyModal({savedInfo, reloadFunction}){
function editSurvey(e){
e.preventDefault();
e.stopPropagation();
const form = e.target;
const info = {
menuId: form.menuId.value,
menuTitle: form.menuTitle.value,
menuGroup: form.menuGroup.value,
menuLevel: form.menuLevel.value,
menuSort: form.menuSort.value,
menuUrl: form.menuUrl.value,
menuTypeCd: form.menuTypeCd.value,
}
EgovNet.requestFetch(
'/admin/config/menu-mgt',
{
method: "PUT",
headers: {
'Content-type': 'application/json'
},
body: JSON.stringify(info)
},
(resp) => {
if (Number(resp.resultCode) === Number(CODE.RCV_SUCCESS)) {
alert("저장되었습니다.")
reloadFunction();
}else if(Number(resp.resultCode) === Number(CODE.RCV_ERROR_AUTH)){
console.log("토큰 갱신중.")
}else{
alert(resp.resultMessage)
}
}
)
}
return (
<>
<Modal.Header closeButton>
<Modal.Title>
{savedInfo!==undefined?savedInfo?.svyTitle:'설문 생성'}
</Modal.Title>
</Modal.Header>
<Modal.Body>
<Form onSubmit={(e) =>{editSurvey(e)}} noValidate>
<Form.Group as={Row} className="mb-3">
<Form.Label column sm={3}>
제목
</Form.Label>
<Col sm={9}>
<Form.Control type="email" name="svyTitle" required defaultValue={savedInfo?.svyTitle} />
</Col>
</Form.Group>
<Form.Group as={Row} className="mb-3">
<Form.Label column sm={3}>
설명
</Form.Label>
<Col sm={9}>
<Form.Control as={"textarea"} name="svyDesc" rows={3} defaultValue={savedInfo?.svyDesc}/>
</Col>
</Form.Group>
<Form.Group as={Row} className="mb-3">
<Form.Label column sm={3}>
시작일
</Form.Label>
<Col sm={9}>
<Form.Control type="text" name="svyStartDt" required defaultValue={savedInfo?.svyStartDt} />
</Col>
</Form.Group>
<Form.Group as={Row} className="mb-3">
<Form.Label column sm={3}>
종료일
</Form.Label>
<Col sm={9}>
<Form.Control type="text" name="svyEndDt" required defaultValue={savedInfo?.svyEndDt} />
</Col>
</Form.Group>
<Form.Group as={Row} className="mb-3">
<Form.Label column sm={3}>
첨부파일
</Form.Label>
<Col sm={9}>
<Form.Control type="text" name="fileGrpId" selectedValue={savedInfo?.fileGrpId}/>
</Col>
</Form.Group>
<Row className="mb-3">
<Col xs={10}></Col>
<Col xs={2}>
<button type="submit" className={"btn btn_blue_h31 px-3"}>저장</button>
</Col>
</Row>
</Form>
</Modal.Body>
</>
);
}
export default SurveyModal;

View File

@ -0,0 +1,606 @@
package com.dbnt.kcscbackend.admin.config;
import com.dbnt.kcscbackend.admin.config.entity.TcMenu;
import com.dbnt.kcscbackend.admin.config.entity.TnPartnerSite;
import com.dbnt.kcscbackend.admin.config.model.CreateCommitteeCodeManagementVO;
import com.dbnt.kcscbackend.admin.config.model.SetCommitteeCodeManagementVO;
import com.dbnt.kcscbackend.admin.config.service.AdminCommitteeCodeManagementService;
import com.dbnt.kcscbackend.commonCode.entity.TcCodeGrp;
import com.dbnt.kcscbackend.commonCode.entity.TcCodeItem;
import com.dbnt.kcscbackend.admin.config.service.AdminConfigService;
import com.dbnt.kcscbackend.auth.entity.LoginVO;
import com.dbnt.kcscbackend.commonCode.service.CommonCodeService;
import com.dbnt.kcscbackend.config.common.BaseController;
import com.dbnt.kcscbackend.config.common.ResponseCode;
import com.dbnt.kcscbackend.config.common.ResultVO;
import io.swagger.annotations.ApiParam;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.http.MediaType;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.validation.Errors;
import org.springframework.validation.FieldError;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;
@RestController
@RequiredArgsConstructor
@RequestMapping("/admin/config")
@Tag(name="AdminConfigController", description = "사이트관리 환결설정 메뉴 컨트롤러")
public class AdminConfigController extends BaseController {
private final AdminConfigService adminConfigService;
private final CommonCodeService commonCodeService;
@Resource(name = "adminCommitteeCodeManagementService")
private AdminCommitteeCodeManagementService adminCommitteeCodeManagementService;
@Operation(
summary = "기본코드 그룹 조회",
description = "기본코드 그룹 조회",
tags = {"AdminConfigController"}
)
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "조회 성공"),
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님")
})
@RequestMapping(method = RequestMethod.GET, value = "/code-grp")
public ResultVO getCodeGrp() throws Exception{
ResultVO resultVO = new ResultVO();
Map<String, Object> resultMap = new HashMap<>();
resultMap.put("codeGrpList", adminConfigService.selectCodeGrpList());
resultVO.setResult(resultMap);
return resultVO;
}
@Operation(
summary = "기본코드 그룹 저장",
description = "기본코드 그룹 저장",
tags = {"AdminConfigController"}
)
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "저장 성공"),
@ApiResponse(responseCode = "303", description = "만료된 토큰"),
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님")
})
@RequestMapping(method = RequestMethod.POST, value = "/code-grp", consumes = MediaType.APPLICATION_JSON_VALUE)
public ResultVO addCodeGrp(@RequestBody TcCodeGrp codeGrp, @AuthenticationPrincipal LoginVO user) throws Exception{
ResultVO resultVO = new ResultVO();
if(user == null){
resultVO.setResultCode(ResponseCode.TOKEN_EXPIRED.getCode());
}else{
if(!user.getUserSe().equals("ACC_TP01")){
resultVO.setResultCode(ResponseCode.AUTH_ERROR.getCode());
resultVO.setResultMessage(ResponseCode.AUTH_ERROR.getMessage());
}else if(codeGrp.getGrpCd().isEmpty()){
resultVO.setResultCode(ResponseCode.INPUT_CHECK_ERROR.getCode());
resultVO.setResultMessage(ResponseCode.INPUT_CHECK_ERROR.getMessage());
}else{
codeGrp.setFrstCrtDt(LocalDateTime.now());
codeGrp.setFrstCrtId(user.getId());
codeGrp.setUseYn("Y");
String result = adminConfigService.addCodeGrp(codeGrp);
if(result.equals("isSaved")){
resultVO.setResultCode(ResponseCode.SAVE_ERROR.getCode());
resultVO.setResultMessage("중복되는 코드그룹이 있습니다.");
}else{
resultVO.setResultCode(ResponseCode.SUCCESS.getCode());
}
}
}
return resultVO;
}
@Operation(
summary = "기본코드 그룹 수정",
description = "기본코드 그룹 수정",
tags = {"AdminConfigController"}
)
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "수정 성공"),
@ApiResponse(responseCode = "303", description = "만료된 토큰"),
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님")
})
@RequestMapping(method = RequestMethod.PUT, value = "/code-grp", consumes = MediaType.APPLICATION_JSON_VALUE)
public ResultVO modifyCodeGrp(@RequestBody TcCodeGrp codeGrp, @AuthenticationPrincipal LoginVO user) throws Exception{
ResultVO resultVO = new ResultVO();
if(user == null){
resultVO.setResultCode(ResponseCode.TOKEN_EXPIRED.getCode());
}else{
if(!user.getUserSe().equals("ACC_TP01")){
resultVO.setResultCode(ResponseCode.AUTH_ERROR.getCode());
resultVO.setResultMessage(ResponseCode.AUTH_ERROR.getMessage());
}else if(codeGrp.getGrpCd().isEmpty()){
resultVO.setResultCode(ResponseCode.INPUT_CHECK_ERROR.getCode());
resultVO.setResultMessage(ResponseCode.INPUT_CHECK_ERROR.getMessage());
}else{
codeGrp.setLastChgDt(LocalDateTime.now());
codeGrp.setLastChgId(user.getId());
String result = adminConfigService.modifyCodeGrp(codeGrp);
if(result.equals("modified")){
resultVO.setResultCode(ResponseCode.SUCCESS.getCode());
}else{
resultVO.setResultCode(ResponseCode.SAVE_ERROR.getCode());
}
}
}
return resultVO;
}
@Operation(
summary = "기본코드 아이템 조회",
description = "기본코드 아이템 조회",
tags = {"AdminConfigController"}
)
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "조회 성공"),
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님")
})
@RequestMapping(method = RequestMethod.GET, value = "/code-item")
public ResultVO getCodeItem(String grpCd) throws Exception{
ResultVO resultVO = new ResultVO();
Map<String, Object> resultMap = new HashMap<>();
resultMap.put("codeItemList", adminConfigService.selectCodeItemList(grpCd));
resultVO.setResult(resultMap);
return resultVO;
}
@Operation(
summary = "기본코드 아이템 저장",
description = "기본코드 아이템 저장",
tags = {"AdminConfigController"}
)
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "저장 성공"),
@ApiResponse(responseCode = "303", description = "만료된 토큰"),
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님")
})
@RequestMapping(method = RequestMethod.POST, value = "/code-item", consumes = MediaType.APPLICATION_JSON_VALUE)
public ResultVO addCodeItem(@RequestBody TcCodeItem codeItem, @AuthenticationPrincipal LoginVO user) throws Exception{
ResultVO resultVO = new ResultVO();
if(user == null){
resultVO.setResultCode(ResponseCode.TOKEN_EXPIRED.getCode());
}else{
if(!user.getUserSe().equals("ACC_TP01")){
resultVO.setResultCode(ResponseCode.AUTH_ERROR.getCode());
resultVO.setResultMessage(ResponseCode.AUTH_ERROR.getMessage());
}else if(codeItem.getGrpCd()==null || codeItem.getGrpCd().isEmpty()){
resultVO.setResultCode(ResponseCode.INPUT_CHECK_ERROR.getCode());
resultVO.setResultMessage(ResponseCode.INPUT_CHECK_ERROR.getMessage());
}else{
codeItem.setFrstCrtDt(LocalDateTime.now());
codeItem.setFrstCrtId(user.getId());
codeItem.setUseYn("Y");
String result = adminConfigService.addCodeItem(codeItem);
if(result.equals("isSaved")){
resultVO.setResultCode(ResponseCode.SAVE_ERROR.getCode());
resultVO.setResultMessage("중복되는 코드가 있습니다.");
}else{
resultVO.setResultCode(ResponseCode.SUCCESS.getCode());
}
}
}
return resultVO;
}
@Operation(
summary = "기본코드 아이템 수정",
description = "기본코드 아이템 수정",
tags = {"AdminConfigController"}
)
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "수정 성공"),
@ApiResponse(responseCode = "303", description = "만료된 토큰"),
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님")
})
@RequestMapping(method = RequestMethod.PUT, value = "/code-item", consumes = MediaType.APPLICATION_JSON_VALUE)
public ResultVO modifyCodeItem(@RequestBody TcCodeItem codeItem, @AuthenticationPrincipal LoginVO user) throws Exception{
ResultVO resultVO = new ResultVO();
if(user == null){
resultVO.setResultCode(ResponseCode.TOKEN_EXPIRED.getCode());
}else{
if(!user.getUserSe().equals("ACC_TP01")){
resultVO.setResultCode(ResponseCode.AUTH_ERROR.getCode());
resultVO.setResultMessage(ResponseCode.AUTH_ERROR.getMessage());
}else if(codeItem.getGrpCd().isEmpty()){
resultVO.setResultCode(ResponseCode.INPUT_CHECK_ERROR.getCode());
resultVO.setResultMessage(ResponseCode.INPUT_CHECK_ERROR.getMessage());
}else{
codeItem.setLastChgDt(LocalDateTime.now());
codeItem.setLastChgId(user.getId());
String result = adminConfigService.modifyCodeItem(codeItem);
if(result.equals("modified")){
resultVO.setResultCode(ResponseCode.SUCCESS.getCode());
}else{
resultVO.setResultCode(ResponseCode.SAVE_ERROR.getCode());
}
}
}
return resultVO;
}
@Operation(
summary = "메뉴 조회",
description = "메뉴 조회",
tags = {"AdminConfigController"}
)
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "조회 성공"),
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님")
})
@RequestMapping(method = RequestMethod.GET, value = "/menu-mgt")
public ResultVO getMenuMgt(){
ResultVO resultVO = new ResultVO();
Map<String, Object> resultMap = new HashMap<>();
resultMap.put("menuList", adminConfigService.selectMenuList());
resultVO.setResult(resultMap);
return resultVO;
}
@Operation(
summary = "메뉴 저장",
description = "메뉴 저장",
tags = {"AdminConfigController"}
)
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "저장 성공"),
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님")
})
@RequestMapping(method = RequestMethod.PUT, value = "/menu-mgt")
public ResultVO saveMenuMgt(@RequestBody @Valid TcMenu menu, Errors errors, @AuthenticationPrincipal LoginVO user){
ResultVO resultVO = new ResultVO();
if(user == null){
resultVO.setResultCode(ResponseCode.TOKEN_EXPIRED.getCode());
}else {
menu.setRoleGrpId(menu.getMenuTypeCd().equals("MNU_0000")?"ADMIN_USER":"ALL_USER");
if(errors.hasErrors()){
StringBuilder msg = new StringBuilder();
for(FieldError error: errors.getFieldErrors()){
msg.append(error.getDefaultMessage());
msg.append("\n");
}
resultVO.setResultCode(ResponseCode.INPUT_CHECK_ERROR.getCode());
resultVO.setResultMessage(msg.toString());
}else if (!user.getUserSe().equals("ACC_TP01")) {
resultVO.setResultCode(ResponseCode.AUTH_ERROR.getCode());
resultVO.setResultMessage(ResponseCode.AUTH_ERROR.getMessage());
} else {
adminConfigService.saveMenu(menu, user.getId());
resultVO.setResultCode(ResponseCode.SUCCESS.getCode());
}
}
return resultVO;
}
@Operation(
summary = "메뉴 삭제",
description = "메뉴 삭제",
tags = {"AdminConfigController"}
)
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "삭제 성공"),
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님")
})
@RequestMapping(method = RequestMethod.DELETE, value = "/menu-mgt")
public ResultVO removeMenuMgt(@RequestBody TcMenu menu, @AuthenticationPrincipal LoginVO user){
ResultVO resultVO = new ResultVO();
if(user == null){
resultVO.setResultCode(ResponseCode.TOKEN_EXPIRED.getCode());
}else {
if (!user.getUserSe().equals("ACC_TP01")) {
resultVO.setResultCode(ResponseCode.AUTH_ERROR.getCode());
resultVO.setResultMessage(ResponseCode.AUTH_ERROR.getMessage());
} else {
String result = adminConfigService.deleteMenu(menu.getMenuId(), user.getId());
if(result==null){
resultVO.setResultCode(ResponseCode.SUCCESS.getCode());
}else if(result.equals("notFind")){
resultVO.setResultCode(ResponseCode.SAVE_ERROR.getCode());
resultVO.setResultMessage("대상이 존재하지 않습니다.");
}
}
}
return resultVO;
}
@Operation(
summary = "메뉴 권한 조회",
description = "메뉴 권한 조회",
tags = {"AdminConfigController"}
)
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "조회 성공"),
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님")
})
@RequestMapping(method = RequestMethod.GET, value = "/menu-auth-mgt")
public ResultVO getMenuAuthMgt(){
ResultVO resultVO = new ResultVO();
Map<String, Object> resultMap = new HashMap<>();
resultMap.put("menuList", adminConfigService.selectMenuAuthList());
resultMap.put("roleList", commonCodeService.selectCodeItemList("ROLE"));
resultVO.setResult(resultMap);
return resultVO;
}
@Operation(
summary = "메뉴 권한 수정",
description = "메뉴 권한 수정",
tags = {"AdminConfigController"}
)
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "수정 성공"),
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님")
})
@RequestMapping(method = RequestMethod.PUT, value = "/menu-auth-mgt")
public ResultVO editMenuAuthMgt(@RequestBody TcMenu menu, @AuthenticationPrincipal LoginVO user){
ResultVO resultVO = new ResultVO();
if(user == null){
resultVO.setResultCode(ResponseCode.TOKEN_EXPIRED.getCode());
}else {
if (!user.getUserSe().equals("ACC_TP01")) {
resultVO.setResultCode(ResponseCode.AUTH_ERROR.getCode());
resultVO.setResultMessage(ResponseCode.AUTH_ERROR.getMessage());
} else {
adminConfigService.editMenuAuth(menu);
resultVO.setResultCode(ResponseCode.SUCCESS.getCode());
}
}
return resultVO;
}
@Operation(
summary = "'위원회 코드 관리' 페이지에서 목록 불러오는 API",
description = "관리자 단에서 '환경설정' > '위원회코드 관리' 페이지에서 목록 불러오는 API",
tags = {"AdminConfigController"}
)
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "조회 성공"),
@ApiResponse(responseCode = "303", description = "만료된 토큰"),
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님")
})
@GetMapping(value = "/committee-code-management")
public ResultVO getCommitteeCodeManagement(
@AuthenticationPrincipal LoginVO user,
HttpServletRequest request,
@ApiParam(value="상위 code") @RequestParam(required=true) String paramCodeGroup,
@ApiParam(value="code level") @RequestParam(required=true) String paramCodeLevel
) throws Exception {
ResultVO resultVO = new ResultVO();
if(user == null) {
resultVO.setResultCode(ResponseCode.TOKEN_EXPIRED.getCode());
} else {
try {
Long upCmtSeq = null;
if (!paramCodeGroup.equals("null")) {
upCmtSeq = Long.parseLong(paramCodeGroup);
}
resultVO = adminCommitteeCodeManagementService.getCommitteeCodeManagement(resultVO, request, user, upCmtSeq, paramCodeLevel);
} catch (Exception e) {
resultVO.setResultCode(ResponseCode.FAILED.getCode());
resultVO.setResultMessage(e.getMessage());
}
}
System.out.println(
"\n--------------------------------------------------------------\n" +
request.getRequestURI() + " OUT:" +
"\n--------------------------------------------------------------\n" +
"resultVO.toString():" + "\n" +
resultVO.toString() + "\n" +
"\n--------------------------------------------------------------\n"
);
return resultVO;
}
@Operation(
summary = "'위원회 코드 관리' 페이지에서 위원회 코드 추가하는 API",
description = "관리자 단에서 '환경설정' > '위원회코드 관리' 페이지에서 +(추가) 버튼으로 항목 추가하는 API",
tags = {"AdminConfigController"}
)
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "조회 성공"),
@ApiResponse(responseCode = "303", description = "만료된 토큰"),
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님")
})
@PostMapping(value = "/committee-code-management")
public ResultVO createCommitteeCodeManagement(
@AuthenticationPrincipal LoginVO user,
HttpServletRequest request,
CreateCommitteeCodeManagementVO createCommitteeCodeManagementVO
) throws Exception {
ResultVO resultVO = new ResultVO();
if(user == null) {
resultVO.setResultCode(ResponseCode.TOKEN_EXPIRED.getCode());
} else {
try {
resultVO = adminCommitteeCodeManagementService.createCommitteeCodeManagement(resultVO, request, user, createCommitteeCodeManagementVO);
} catch (Exception e) {
resultVO.setResultCode(ResponseCode.FAILED.getCode());
resultVO.setResultMessage(e.getMessage());
}
}
System.out.println(
"\n--------------------------------------------------------------\n" +
request.getRequestURI() + " OUT:" +
"\n--------------------------------------------------------------\n" +
"resultVO.toString():" + "\n" +
resultVO.toString() + "\n" +
"\n--------------------------------------------------------------\n"
);
return resultVO;
}
@Operation(
summary = "'위원회 코드 관리' 페이지에서 위원회 코드 삭제하는 API",
description = "관리자 단에서 '환경설정' > '위원회코드 관리' 페이지에서 휴지통 모양 삭제 버튼으로 항목 삭제하는 API",
tags = {"AdminConfigController"}
)
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "등록 성공"),
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님")
})
@DeleteMapping(value = "/committee-code-management/{orgId}")
public ResultVO deleteSchedule
(
@AuthenticationPrincipal LoginVO user,
HttpServletRequest request,
@PathVariable("orgId") String strOrgId
) throws Exception {
ResultVO resultVO = new ResultVO();
Long orgId = Long.valueOf(strOrgId);
try {
resultVO = adminCommitteeCodeManagementService.deleteCommitteeCodeManagement(resultVO, request, user, orgId);
} catch (Exception e) {
resultVO.setResultCode(ResponseCode.FAILED.getCode());
resultVO.setResultMessage(e.getMessage());
}
System.out.println(
"\n--------------------------------------------------------------\n" +
request.getRequestURI() + " OUT:" +
"\n--------------------------------------------------------------\n" +
"resultVO.toString():" + "\n" +
resultVO.toString() + "\n" +
"\n--------------------------------------------------------------\n"
);
return resultVO;
}
/* ---- 관련사이트 관리 ----- */
@Operation(
summary = "관련사이트 목록 조회",
description = "관련사이트 목록 조회",
tags = {"AdminConfigController"}
)
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "조회 성공"),
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님")
})
@RequestMapping(method = RequestMethod.GET, value = "/partner-site-list", consumes = MediaType.APPLICATION_JSON_VALUE)
public ResultVO getPartnerSiteList() throws Exception {
ResultVO resultVO = new ResultVO();
Map<String, Object> resultMap = new HashMap<>();
resultMap.put("partnerSiteList", adminConfigService.selectPartnerSiteList());
resultVO.setResult(resultMap);
return resultVO;
}
@Operation(
summary = "관련사이트 저장",
description = "관련사이트 저장",
tags = {"AdminConfigController"}
)
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "저장 성공"),
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님")
})
@RequestMapping(method = RequestMethod.PUT, value = "/partner-site-mgt")
public ResultVO savePartnerSite(@RequestBody @Valid TnPartnerSite tnPartnerSite, Errors errors, @AuthenticationPrincipal LoginVO user) {
ResultVO resultVO = new ResultVO();
if (user == null) {
resultVO.setResultCode(ResponseCode.TOKEN_EXPIRED.getCode());
} else {
if (errors.hasErrors()) {
StringBuilder msg = new StringBuilder();
for (FieldError error : errors.getFieldErrors()) {
msg.append(error.getDefaultMessage());
msg.append("\n");
}
resultVO.setResultCode(ResponseCode.INPUT_CHECK_ERROR.getCode());
resultVO.setResultMessage(msg.toString());
} else {
System.out.println("@@@ bbs.getBbsSeq() : " + tnPartnerSite.getSiteSeq());
adminConfigService.savePartnerSite(tnPartnerSite, user.getId());
resultVO.setResultCode(ResponseCode.SUCCESS.getCode());
}
}
return resultVO;
}
@Operation(
summary = "관련사이트 삭제",
description = "관련사이트 삭제",
tags = {"AdminConfigController"}
)
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "삭제 성공"),
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님")
})
@RequestMapping(method = RequestMethod.DELETE, value = "/partner-site-mgt")
public ResultVO removePartnerSite(@RequestBody TnPartnerSite tnPartnerSite, @AuthenticationPrincipal LoginVO user) {
ResultVO resultVO = new ResultVO();
if (user == null) {
resultVO.setResultCode(ResponseCode.TOKEN_EXPIRED.getCode());
} else {
String result = adminConfigService.deletePartnerSite(tnPartnerSite, user.getId());
if (result == null) {
resultVO.setResultCode(ResponseCode.SUCCESS.getCode());
} else if (result.equals("notFind")) {
resultVO.setResultCode(ResponseCode.SAVE_ERROR.getCode());
resultVO.setResultMessage("대상이 존재하지 않습니다.");
}
}
return resultVO;
}
@Operation(
summary = "'위원회 코드 관리' 페이지에서 위원회 코드 수정하는 API",
description = "관리자 단에서 '환경설정' > '위원회코드 관리' 페이지에서 연필 모양 수정 버튼으로 항목 수정하는 API",
tags = {"AdminConfigController"}
)
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "등록 성공"),
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님"),
})
@PutMapping(value = "/committee-code-management/{orgId}")
public ResultVO setCommitteeCodeManagement(
HttpServletRequest request,
@AuthenticationPrincipal LoginVO loginVO,
SetCommitteeCodeManagementVO setCommitteeCodeManagementVO,
@PathVariable("orgId") Long orgId
) throws Exception {
ResultVO resultVO = new ResultVO();
try {
resultVO = adminCommitteeCodeManagementService.setCommitteeCodeManagement(resultVO, request, loginVO, setCommitteeCodeManagementVO, orgId);
} catch (Exception e) {
resultVO.setResultCode(ResponseCode.FAILED.getCode());
resultVO.setResultMessage(e.getMessage());
}
System.out.println(
"\n--------------------------------------------------------------\n" +
request.getRequestURI() + " OUT:" +
"\n--------------------------------------------------------------\n" +
"resultVO.toString():" + "\n" +
resultVO.toString() + "\n" +
"\n--------------------------------------------------------------\n"
);
return resultVO;
}
}

View File

@ -0,0 +1,39 @@
package com.dbnt.kcscbackend.admin.config.entity;
import lombok.*;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.springframework.format.annotation.DateTimeFormat;
import javax.persistence.*;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.time.LocalDateTime;
@Getter
@Setter
@Entity
@NoArgsConstructor
@DynamicInsert
@DynamicUpdate
@Table(name = "tb_menu_role")
@IdClass(TbMenuRole.TbMenuRoleId.class)
public class TbMenuRole {
@Id
@Column(name = "role_id")
private String roleId;
@Id
@Column(name = "menu_id")
private String menuId;
@Column(name = "write_yn")
private String writeYn;
@Embeddable
@Data
@NoArgsConstructor
@AllArgsConstructor
public static class TbMenuRoleId implements Serializable {
private String roleId;
private String menuId;
}
}

View File

@ -0,0 +1,93 @@
package com.dbnt.kcscbackend.admin.committee.entity;
import lombok.*;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import javax.persistence.*;
@Getter
@Setter
@Entity
@NoArgsConstructor
@DynamicInsert
@DynamicUpdate
@Table(name = "tn_cmt_draft")
public class TnCmtDraft {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "drft_seq")
private String drftSeq;
@Column(name = "drft_title")
private String drftTitle;
@Column(name = "doc_info_seq")
private String docInfoSeq;
@Column(name = "drft_type_cd")
private String drftTypeCd;
@Column(name = "drft_dt")
private String drftDt;
@Column(name = "cmt_seq")
private String cmtSeq;
@Column(name = "measure_pre_data_file_grp_id")
private String measurePreDataFileGrpId;
@Column(name = "measure_pre_form_file_grp_id")
private String measurePreFormFileGrpId;
@Column(name = "measure_partner_file_grp_id")
private String measurePartnerFileGrpId;
@Column(name = "drft_confe_charger")
private String drftConfeCharger;
@Column(name = "drft_confe_pw")
private String drftConfePw;
@Column(name = "drft_confe_room")
private String drftConfeRoom;
@Column(name = "drft_stat_cd")
private String drftStatCd;
@Column(name = "drft_summery")
private String drftSummery;
@Column(name = "measure_plan_file_grp_id")
private String measurePlanFileGrpId;
@Column(name = "measure_result_file_grp_id")
private String measureResultFileGrpId;
@Column(name = "start_dt")
private String startDt;
@Column(name = "end_dt")
private String endDt;
@Column(name = "frst_crt_id")
private String frstCrtId;
@Column(name = "frst_crt_dt")
private String frstCrtDt;
@Column(name = "last_chg_id")
private String lastChgId;
@Column(name = "last_chg_dt")
private String lastChgDt;
@Column(name = "use_yn")
private String useYn;
@Column(name = "old_seq")
private String oldSeq;
}

View File

@ -0,0 +1,46 @@
package com.dbnt.kcscbackend.admin.committee.entity;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import javax.persistence.*;
@Getter
@Setter
@Entity
@NoArgsConstructor
@DynamicInsert
@DynamicUpdate
@Table(name = "tn_cmt_draft_attend")
public class TnCmtDraftAttend {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "drft_atd_seq")
private Long drftAtdSeq;
@Column(name = "drft_seq")
private Long drftSeq;
@Column(name = "drft_final_type")
private String drftFinalType;
@Column(name = "drft_final_comment")
private String drftFinalComment;
@Column(name = "user_id")
private String userId;
@Column(name = "nick_name")
private String nickName;
@Column(name = "write_dt")
private String writeDt;
@Column(name = "drft_file_grp_id")
private String drftFileGrpId;
}

View File

@ -0,0 +1,23 @@
package com.dbnt.kcscbackend.admin.config.service;
import com.dbnt.kcscbackend.admin.config.model.CreateCommitteeCodeManagementVO;
import com.dbnt.kcscbackend.admin.config.model.SetCommitteeCodeManagementVO;
import com.dbnt.kcscbackend.admin.standardResearch.model.CreateStandardResearchVO;
import com.dbnt.kcscbackend.admin.standardResearch.model.UpdateStandardResearchVO;
import com.dbnt.kcscbackend.auth.entity.LoginVO;
import com.dbnt.kcscbackend.config.common.ResultVO;
import io.swagger.annotations.ApiParam;
import org.springframework.data.domain.Pageable;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import javax.servlet.http.HttpServletRequest;
public interface AdminCommitteeCodeManagementService {
public ResultVO createCommitteeCodeManagement(ResultVO resultVO, HttpServletRequest request, LoginVO user, CreateCommitteeCodeManagementVO createCommitteeCodeManagementVO) throws Exception;
public ResultVO getCommitteeCodeManagement(ResultVO resultVO, HttpServletRequest request, LoginVO user, Long upCmtSeq, String cmtType) throws Exception;
public ResultVO setCommitteeCodeManagement(ResultVO resultVO, HttpServletRequest request, LoginVO user, SetCommitteeCodeManagementVO setCommitteeCodeManagementVO, Long cmtSeq) throws Exception;
public ResultVO deleteCommitteeCodeManagement(ResultVO resultVO, HttpServletRequest request, LoginVO user, Long cmtSeq) throws Exception;
}

View File

@ -0,0 +1,209 @@
package com.dbnt.kcscbackend.admin.config.service.impl;
import com.dbnt.kcscbackend.admin.config.model.CreateCommitteeCodeManagementVO;
import com.dbnt.kcscbackend.admin.config.model.SetCommitteeCodeManagementVO;
import com.dbnt.kcscbackend.admin.config.service.AdminCommitteeCodeManagementService;
import com.dbnt.kcscbackend.admin.standardResearch.model.CreateStandardResearchVO;
import com.dbnt.kcscbackend.admin.standardResearch.model.UpdateStandardResearchVO;
import com.dbnt.kcscbackend.auth.entity.LoginVO;
import com.dbnt.kcscbackend.commonCode.entity.TnCmtOrg;
import com.dbnt.kcscbackend.commonCode.repository.TnCmtOrgRepository;
import com.dbnt.kcscbackend.config.common.ResponseCode;
import com.dbnt.kcscbackend.config.common.ResultVO;
import lombok.RequiredArgsConstructor;
import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl;
import org.egovframe.rte.ptl.mvc.tags.ui.pagination.PaginationInfo;
import org.springframework.data.domain.Pageable;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import javax.servlet.http.HttpServletRequest;
import java.time.format.DateTimeFormatter;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Service("adminCommitteeCodeManagementService")
@RequiredArgsConstructor
public class AdminCommitteeCodeManagementServiceImpl extends EgovAbstractServiceImpl implements AdminCommitteeCodeManagementService {
private final TnCmtOrgRepository tnCmtOrgRepository;
@Override
public ResultVO createCommitteeCodeManagement(ResultVO resultVO, HttpServletRequest request, LoginVO user, CreateCommitteeCodeManagementVO createCommitteeCodeManagementVO) throws Exception {
System.out.println(
"\n--------------------------------------------------------------\n" +
request.getRequestURI() + " IN:" +
"\n--------------------------------------------------------------\n" +
"user.getEmail():" + "\n" +
user.getEmail() + "\n" +
"\n--------------------------------------------------------------\n"
);
// 아래 null로 전달 되는 부분 확인하기.
// 유효성 검사 실시
if(createCommitteeCodeManagementVO.getParamCodeLevel().trim().isEmpty()) {
throw new Exception("오류가 발생했습니다. 시스템 담당자에게 문의 바랍니다. paramCodeLevel is empty.");
}
Integer upCmtSeq = null;
if( createCommitteeCodeManagementVO.getParamOrgId().trim().equals("00") == false ) { // 00은 '중앙건설기술심의' 항목의 부모 sequnce이다. 그러나 DB에 실제 00이란 sequence는 존재하지 않는다.
upCmtSeq = Integer.parseInt(createCommitteeCodeManagementVO.getParamOrgId());
}
Map<String, Object> response = tnCmtOrgRepository.spAddTnCmtOrg(
createCommitteeCodeManagementVO.getParamOrgNm(), // 위원회 이름
createCommitteeCodeManagementVO.getParamCodeLevel(), // 위원회 등급
createCommitteeCodeManagementVO.getParamOrgDesc(), // 위원회 설명
upCmtSeq, // 상위 위원회 sequence
1, // 정렬 순서
user.getId(),
null,
null,
null,
null
);
Map<String, Object> dto = new HashMap<String, Object>();
dto.put("id", response.get("_cmt_seq") );
resultVO.setResult(dto);
resultVO.setResultCode(ResponseCode.SUCCESS.getCode());
resultVO.setResultMessage(ResponseCode.SUCCESS.getMessage());
return resultVO;
}
@Override
public ResultVO getCommitteeCodeManagement(ResultVO resultVO, HttpServletRequest request, LoginVO user, Long upCmtSeq, String cmtType) throws Exception {
System.out.println(
"\n--------------------------------------------------------------\n" +
request.getRequestURI() + " IN:" +
"\n--------------------------------------------------------------\n" +
"user.getEmail():" + "\n" +
user.getEmail() + "\n" +
"\n--------------------------------------------------------------\n"
);
List<Map<String, Object>> list = tnCmtOrgRepository.findByUseYnAndUpCmtSeqAndCmtTypeOrderByCmtOrder("Y", upCmtSeq, cmtType).stream()
.map(item -> {
Map<String, Object> returnMap = new HashMap<>();
returnMap.put("orgId", item.getCmtSeq());
returnMap.put("orgNm", item.getCmtNm());
returnMap.put("orgDesc", item.getCmtDesc());
returnMap.put("omtOrder", item.getCmtOrder());
returnMap.put("upCmtSeq", item.getUpCmtSeq());
return returnMap;
})
.collect(Collectors.toList());
Map<String, Object> dto = new HashMap<String, Object>();
dto.put("list", list);
resultVO.setResult(dto);
resultVO.setResultCode(ResponseCode.SUCCESS.getCode());
resultVO.setResultMessage(ResponseCode.SUCCESS.getMessage());
return resultVO;
}
@Override
public ResultVO setCommitteeCodeManagement(ResultVO resultVO, HttpServletRequest request, LoginVO user, SetCommitteeCodeManagementVO setCommitteeCodeManagementVO, Long cmtSeq) throws Exception {
System.out.println(
"\n--------------------------------------------------------------\n" +
request.getRequestURI() + " IN:" +
"\n--------------------------------------------------------------\n" +
"setCommitteeCodeManagementVO:" + "\n" +
setCommitteeCodeManagementVO.toString() + "\n" +
"cmtSeq:" + "\n" +
cmtSeq + "\n" +
"\n--------------------------------------------------------------\n"
);
// 유효성 검사 실시
int isValid = tnCmtOrgRepository.spIsValidTnCmtOrgId(cmtSeq.intValue());
if( isValid == 0 ) {
throw new Exception("대상이 존재하지 않습니다.");
}
TnCmtOrg tnCmtOrg = tnCmtOrgRepository.findByCmtSeq(cmtSeq);
Map<String, Object> response = tnCmtOrgRepository.spUpdateTnCmtOrg(
cmtSeq.intValue(),
setCommitteeCodeManagementVO.getParamOrgNm(),
setCommitteeCodeManagementVO.getParamOrgDesc(),
tnCmtOrg.getCmtOrder(),
user.getId(),
null,
null,
null
);
Map<String, Object> dto = new HashMap<String, Object>();
dto.put("errorMessage", response.get("_error_message") );
dto.put("orgId", cmtSeq);
resultVO.setResult(dto);
resultVO.setResultCode(ResponseCode.SUCCESS.getCode());
resultVO.setResultMessage(ResponseCode.SUCCESS.getMessage());
return resultVO;
}
@Override
public ResultVO deleteCommitteeCodeManagement(ResultVO resultVO, HttpServletRequest request, LoginVO user, Long cmtSeq) throws Exception {
System.out.println(
"\n--------------------------------------------------------------\n" +
request.getRequestURI() + " IN:" +
"\n--------------------------------------------------------------\n" +
"cmtSeq:" + "\n" +
cmtSeq + "\n" +
"\n--------------------------------------------------------------\n"
);
Map<String, Object> response = tnCmtOrgRepository.spDeleteTnCmtOrg(
cmtSeq.intValue(),
user.getId(),
null,
null,
null
);
// 자식 코드들을 모두 제거한다.
getChildrenOrg(user, cmtSeq);
Map<String, Object> dto = new HashMap<String, Object>();
dto.put("errorMessage", response.get("_error_message") );
dto.put("orgId", cmtSeq );
resultVO.setResult(dto);
resultVO.setResultCode(ResponseCode.SUCCESS.getCode());
resultVO.setResultMessage(ResponseCode.SUCCESS.getMessage());
return resultVO;
}
private void getChildrenOrg(LoginVO user, Long upCmtSeq) {
List<Map<String, Object>> list = tnCmtOrgRepository.findByUpCmtSeq(upCmtSeq).stream()
.map(item -> {
Map<String, Object> returnMap = new HashMap<>();
returnMap.put("cmtSeq", item.getCmtSeq());
getChildrenOrg( user, item.getCmtSeq() );
Map<String, Object> response = tnCmtOrgRepository.spDeleteTnCmtOrg(
item.getCmtSeq().intValue(),
user.getId(),
null,
null,
null
);
return returnMap;
}).collect(Collectors.toList());
System.out.println("for Debugging");
}
}

View File

@ -1,9 +1,10 @@
package com.dbnt.kcscbackend.admin.contents.survey;
import com.dbnt.kcscbackend.admin.contents.survey.entity.TnSurvey;
import com.dbnt.kcscbackend.admin.contents.survey.service.AdminSurveyService;
import com.dbnt.kcscbackend.auth.entity.LoginVO;
import com.dbnt.kcscbackend.config.common.ResultVO;
import com.dbnt.kcscbackend.config.util.ClientUtils;
import lombok.RequiredArgsConstructor;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.web.bind.annotation.RequestMapping;
@ -22,7 +23,7 @@ public class AdminSurveyController {
private final AdminSurveyService adminSurveyService;
@RequestMapping(method = RequestMethod.GET, value = "/list")
public ResultVO getSurveyList(HttpServletRequest request, @AuthenticationPrincipal LoginVO user) throws Exception{
public ResultVO getSurveyList() throws Exception{
ResultVO resultVO = new ResultVO();
Map<String, Object> resultMap = new HashMap<>();
@ -30,4 +31,24 @@ public class AdminSurveyController {
resultVO.setResult(resultMap);
return resultVO;
}
@RequestMapping(method = RequestMethod.GET, value = "/edit")
public ResultVO surveyEdit(TnSurvey survey) throws Exception{
ResultVO resultVO = new ResultVO();
Map<String, Object> resultMap = new HashMap<>();
resultMap.put("survey", adminSurveyService.selectSurvey(survey));
resultVO.setResult(resultMap);
return resultVO;
}
@RequestMapping(method = RequestMethod.GET, value = "/edit-qt")
public ResultVO surveyEditQt(TnSurvey survey) throws Exception{
ResultVO resultVO = new ResultVO();
Map<String, Object> resultMap = new HashMap<>();
resultMap.put("qtList", adminSurveyService.selectSurveyQt(survey));
resultVO.setResult(resultMap);
return resultVO;
}
}

View File

@ -6,12 +6,11 @@ import lombok.Setter;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.*;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
@Getter
@Setter
@ -41,4 +40,7 @@ public class TnSurveyQt {
private String etcYn;
@Column(name = "old_seq")
private Integer oldSeq;
@Transient
private List<TnSurveyQtItem> itemList = new ArrayList<>();
}

View File

@ -3,5 +3,8 @@ package com.dbnt.kcscbackend.admin.contents.survey.repository;
import com.dbnt.kcscbackend.admin.contents.survey.entity.TnSurveyQtItem;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;
public interface TnSurveyQtItemRepository extends JpaRepository<TnSurveyQtItem, Integer> {
List<TnSurveyQtItem> findByQtSeqInOrderByQtItemSeq(List<Integer> qtSeqList);
}

View File

@ -3,5 +3,8 @@ package com.dbnt.kcscbackend.admin.contents.survey.repository;
import com.dbnt.kcscbackend.admin.contents.survey.entity.TnSurveyQt;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;
public interface TnSurveyQtRepository extends JpaRepository<TnSurveyQt, Integer> {
List<TnSurveyQt> findBySvySeqOrderByQtSeq(Integer svySeq);
}

View File

@ -1,12 +1,15 @@
package com.dbnt.kcscbackend.admin.contents.survey.service;
import com.dbnt.kcscbackend.admin.contents.survey.entity.TnSurvey;
import com.dbnt.kcscbackend.admin.contents.survey.entity.TnSurveyQt;
import com.dbnt.kcscbackend.admin.contents.survey.entity.TnSurveyQtItem;
import com.dbnt.kcscbackend.admin.contents.survey.repository.TnSurveyQtItemRepository;
import com.dbnt.kcscbackend.admin.contents.survey.repository.TnSurveyQtRepository;
import com.dbnt.kcscbackend.admin.contents.survey.repository.TnSurveyRepository;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
@Service
@ -19,4 +22,25 @@ public class AdminSurveyService {
public List<TnSurvey> selectSurveyList() {
return surveyRepository.findAllByOrderBySvySeqDesc();
}
public TnSurvey selectSurvey(TnSurvey survey) {
return surveyRepository.findById(survey.getSvySeq()).orElse(null);
}
public List<TnSurveyQt> selectSurveyQt(TnSurvey survey) {
List<TnSurveyQt> qtList = qtRepository.findBySvySeqOrderByQtSeq(survey.getSvySeq());
List<Integer> qtSeqList = new ArrayList<>();
for(TnSurveyQt qt: qtList){
qtSeqList.add(qt.getQtSeq());
}
List<TnSurveyQtItem> itemList = itemRepository.findByQtSeqInOrderByQtItemSeq(qtSeqList);
for(TnSurveyQt qt: qtList){
for(TnSurveyQtItem item: itemList){
if(qt.getQtSeq().equals(item.getQtSeq())){
qt.getItemList().add(item);
}
}
}
return qtList;
}
}

View File

@ -0,0 +1,100 @@
package com.dbnt.kcscbackend.commonCode.repository;
import com.dbnt.kcscbackend.commonCode.entity.TnPopupMng;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.jpa.repository.query.Procedure;
import org.springframework.data.repository.query.Param;
import java.util.Map;
public interface TnCmtDraftRepository extends JpaRepository<TnPopupMng, Long> {
@Query(value = "CALL sp_add_tn_popup_mng (" +
":_popup_title, " +
"TO_TIMESTAMP(" +
" :_popup_start_date," +
" 'YYYYMMDDHH24MISS'" +
")::::timestamptz AT TIME ZONE 'UTC', " +
"TO_TIMESTAMP(" +
" :_popup_end_date," +
" 'YYYYMMDDHH24MISS'" +
")::::timestamptz AT TIME ZONE 'UTC', " +
":_file_grp_id, " +
":_popup_contents, " +
":_modi_id, " +
":_popup_seq, " +
":_result_count, " +
":_result_code, " +
":_error_message)",
nativeQuery = true)
Map<String, Object> spAddTnPopupMng(
@Param("_popup_title") String popupTitle,
@Param("_popup_start_date") String popupStartDate,
@Param("_popup_end_date") String popupEndDate,
@Param("_file_grp_id") String fileGrpId,
@Param("_popup_contents") String popupContents,
@Param("_modi_id") String modiId,
@Param("_popup_seq") Integer popupSeq,
@Param("_result_count") Integer resultCount,
@Param("_result_code") String resultCode,
@Param("_error_message") String errorMessage
);
@Query(value = "CALL sp_update_tn_popup_mng (" +
":_popup_seq, " +
":_popup_title, " +
"TO_TIMESTAMP(" +
" :_popup_start_date," +
" 'YYYYMMDDHH24MISS'" +
")::::timestamptz AT TIME ZONE 'UTC', " +
"TO_TIMESTAMP(" +
" :_popup_end_date," +
" 'YYYYMMDDHH24MISS'" +
")::::timestamptz AT TIME ZONE 'UTC', " +
":_file_grp_id, " +
":_popup_contents, " +
":_modi_id, " +
":_result_count, " +
":_result_code, " +
":_error_message)",
nativeQuery = true)
Map<String, Object> spUpdateTnPopupMng(
@Param("_popup_seq") Integer popupSeq,
@Param("_popup_title") String popupTitle,
@Param("_popup_start_date") String popupStartDate,
@Param("_popup_end_date") String popupEndDate,
@Param("_file_grp_id") String fileGrpId,
@Param("_popup_contents") String popupContents,
@Param("_modi_id") String modiId,
@Param("_result_count") Integer resultCount,
@Param("_result_code") String resultCode,
@Param("_error_message") String errorMessage
);
@Query(value = "CALL sp_delete_tn_popup_mng (" +
":_popup_seq, " +
":_modi_id, " +
":_result_count, " +
":_result_code, " +
":_error_message)",
nativeQuery = true)
Map<String, Object> spDeleteTnPopupMng(
@Param("_popup_seq") Integer popupSeq,
@Param("_modi_id") String modiId,
@Param("_result_count") Integer resultCount,
@Param("_result_code") String resultCode,
@Param("_error_message") String errorMessage
);
@Procedure("sp_is_valid_tn_popup_mng_id")
int spIsValidTnPopupMngId( Integer popupSeq );
TnPopupMng findByPopupSeq(Long popupSeq);
}

View File

@ -0,0 +1,100 @@
package com.dbnt.kcscbackend.commonCode.repository;
import com.dbnt.kcscbackend.commonCode.entity.TnPopupMng;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.jpa.repository.query.Procedure;
import org.springframework.data.repository.query.Param;
import java.util.Map;
public interface TnCmtDraftAttendRepository extends JpaRepository<TnPopupMng, Long> {
@Query(value = "CALL sp_add_tn_popup_mng (" +
":_popup_title, " +
"TO_TIMESTAMP(" +
" :_popup_start_date," +
" 'YYYYMMDDHH24MISS'" +
")::::timestamptz AT TIME ZONE 'UTC', " +
"TO_TIMESTAMP(" +
" :_popup_end_date," +
" 'YYYYMMDDHH24MISS'" +
")::::timestamptz AT TIME ZONE 'UTC', " +
":_file_grp_id, " +
":_popup_contents, " +
":_modi_id, " +
":_popup_seq, " +
":_result_count, " +
":_result_code, " +
":_error_message)",
nativeQuery = true)
Map<String, Object> spAddTnPopupMng(
@Param("_popup_title") String popupTitle,
@Param("_popup_start_date") String popupStartDate,
@Param("_popup_end_date") String popupEndDate,
@Param("_file_grp_id") String fileGrpId,
@Param("_popup_contents") String popupContents,
@Param("_modi_id") String modiId,
@Param("_popup_seq") Integer popupSeq,
@Param("_result_count") Integer resultCount,
@Param("_result_code") String resultCode,
@Param("_error_message") String errorMessage
);
@Query(value = "CALL sp_update_tn_popup_mng (" +
":_popup_seq, " +
":_popup_title, " +
"TO_TIMESTAMP(" +
" :_popup_start_date," +
" 'YYYYMMDDHH24MISS'" +
")::::timestamptz AT TIME ZONE 'UTC', " +
"TO_TIMESTAMP(" +
" :_popup_end_date," +
" 'YYYYMMDDHH24MISS'" +
")::::timestamptz AT TIME ZONE 'UTC', " +
":_file_grp_id, " +
":_popup_contents, " +
":_modi_id, " +
":_result_count, " +
":_result_code, " +
":_error_message)",
nativeQuery = true)
Map<String, Object> spUpdateTnPopupMng(
@Param("_popup_seq") Integer popupSeq,
@Param("_popup_title") String popupTitle,
@Param("_popup_start_date") String popupStartDate,
@Param("_popup_end_date") String popupEndDate,
@Param("_file_grp_id") String fileGrpId,
@Param("_popup_contents") String popupContents,
@Param("_modi_id") String modiId,
@Param("_result_count") Integer resultCount,
@Param("_result_code") String resultCode,
@Param("_error_message") String errorMessage
);
@Query(value = "CALL sp_delete_tn_popup_mng (" +
":_popup_seq, " +
":_modi_id, " +
":_result_count, " +
":_result_code, " +
":_error_message)",
nativeQuery = true)
Map<String, Object> spDeleteTnPopupMng(
@Param("_popup_seq") Integer popupSeq,
@Param("_modi_id") String modiId,
@Param("_result_count") Integer resultCount,
@Param("_result_code") String resultCode,
@Param("_error_message") String errorMessage
);
@Procedure("sp_is_valid_tn_popup_mng_id")
int spIsValidTnPopupMngId( Integer popupSeq );
TnPopupMng findByPopupSeq(Long popupSeq);
}

View File

@ -0,0 +1,102 @@
package com.dbnt.kcscbackend.commonCode.repository;
import com.dbnt.kcscbackend.commonCode.entity.TnCmtEvent;
import com.dbnt.kcscbackend.commonCode.entity.TnPopupMng;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.jpa.repository.query.Procedure;
import org.springframework.data.repository.query.Param;
import java.util.List;
import java.util.Map;
public interface TnPopupMngRepository extends JpaRepository<TnPopupMng, Long> {
@Query(value = "CALL sp_add_tn_popup_mng (" +
":_popup_title, " +
"TO_TIMESTAMP(" +
" :_popup_start_date," +
" 'YYYYMMDDHH24MISS'" +
")::::timestamptz AT TIME ZONE 'UTC', " +
"TO_TIMESTAMP(" +
" :_popup_end_date," +
" 'YYYYMMDDHH24MISS'" +
")::::timestamptz AT TIME ZONE 'UTC', " +
":_file_grp_id, " +
":_popup_contents, " +
":_modi_id, " +
":_popup_seq, " +
":_result_count, " +
":_result_code, " +
":_error_message)",
nativeQuery = true)
Map<String, Object> spAddTnPopupMng(
@Param("_popup_title") String popupTitle,
@Param("_popup_start_date") String popupStartDate,
@Param("_popup_end_date") String popupEndDate,
@Param("_file_grp_id") String fileGrpId,
@Param("_popup_contents") String popupContents,
@Param("_modi_id") String modiId,
@Param("_popup_seq") Integer popupSeq,
@Param("_result_count") Integer resultCount,
@Param("_result_code") String resultCode,
@Param("_error_message") String errorMessage
);
@Query(value = "CALL sp_update_tn_popup_mng (" +
":_popup_seq, " +
":_popup_title, " +
"TO_TIMESTAMP(" +
" :_popup_start_date," +
" 'YYYYMMDDHH24MISS'" +
")::::timestamptz AT TIME ZONE 'UTC', " +
"TO_TIMESTAMP(" +
" :_popup_end_date," +
" 'YYYYMMDDHH24MISS'" +
")::::timestamptz AT TIME ZONE 'UTC', " +
":_file_grp_id, " +
":_popup_contents, " +
":_modi_id, " +
":_result_count, " +
":_result_code, " +
":_error_message)",
nativeQuery = true)
Map<String, Object> spUpdateTnPopupMng(
@Param("_popup_seq") Integer popupSeq,
@Param("_popup_title") String popupTitle,
@Param("_popup_start_date") String popupStartDate,
@Param("_popup_end_date") String popupEndDate,
@Param("_file_grp_id") String fileGrpId,
@Param("_popup_contents") String popupContents,
@Param("_modi_id") String modiId,
@Param("_result_count") Integer resultCount,
@Param("_result_code") String resultCode,
@Param("_error_message") String errorMessage
);
@Query(value = "CALL sp_delete_tn_popup_mng (" +
":_popup_seq, " +
":_modi_id, " +
":_result_count, " +
":_result_code, " +
":_error_message)",
nativeQuery = true)
Map<String, Object> spDeleteTnPopupMng(
@Param("_popup_seq") Integer popupSeq,
@Param("_modi_id") String modiId,
@Param("_result_count") Integer resultCount,
@Param("_result_code") String resultCode,
@Param("_error_message") String errorMessage
);
@Procedure("sp_is_valid_tn_popup_mng_id")
int spIsValidTnPopupMngId( Integer popupSeq );
TnPopupMng findByPopupSeq(Long popupSeq);
}