Compare commits
No commits in common. "020739c98a51fba6f1f2b5b414c3a924a6950a11" and "c9ea180686aea2d59c173426686180fa9e397092" have entirely different histories.
020739c98a
...
c9ea180686
|
|
@ -36,7 +36,7 @@ function EgovPaging({pagination, moveToPage}) {
|
||||||
}
|
}
|
||||||
if(pagination.endNum!=pagination.maxNum){
|
if(pagination.endNum!=pagination.maxNum){
|
||||||
// 다음 페이지 이동
|
// 다음 페이지 이동
|
||||||
const nextPageIndex = pagination.pageIndex+10 > pagination.maxNum?pagination.maxNum:(pagination.pageIndex+10)
|
const nextPageIndex = pagination.pageIndex+10 < pagination.maxNum?pagination.maxNum:(pagination.pageIndex-10)
|
||||||
paginationTag.push(<li key="np" className="btn">
|
paginationTag.push(<li key="np" className="btn">
|
||||||
<button onClick={e => {moveToPage(nextPageIndex)}} className="next">다음</button>
|
<button onClick={e => {moveToPage(nextPageIndex)}} className="next">다음</button>
|
||||||
</li>);
|
</li>);
|
||||||
|
|
@ -46,6 +46,59 @@ function EgovPaging({pagination, moveToPage}) {
|
||||||
<button onClick={e => {moveToPage(pagination.maxNum)}} className="last"></button>
|
<button onClick={e => {moveToPage(pagination.maxNum)}} className="last"></button>
|
||||||
</li>);
|
</li>);
|
||||||
}
|
}
|
||||||
|
/*const currentPageNo = pagination.currentPageNo;
|
||||||
|
const pageSize = pagination.pageSize;
|
||||||
|
const totalRecordCount = pagination.contentCnt;
|
||||||
|
const recordCountPerPage = pagination.rowCnt;
|
||||||
|
|
||||||
|
const totalPageCount = Math.ceil(totalRecordCount / recordCountPerPage);
|
||||||
|
const currentFirstPage = Math.floor((currentPageNo - 1) / pageSize) * pageSize + 1;
|
||||||
|
let currentLastPage = currentFirstPage + pageSize - 1;
|
||||||
|
currentLastPage = (currentLastPage > totalPageCount) ? totalPageCount : currentLastPage;
|
||||||
|
|
||||||
|
if (totalPageCount > pageSize) {
|
||||||
|
// 첫 페이지 이동
|
||||||
|
const firstPageTag = <li key="fp" className="btn">
|
||||||
|
<button onClick={e => {moveToPage(1)}} className="first">처음</button></li>;
|
||||||
|
paginationTag.push(firstPageTag);
|
||||||
|
|
||||||
|
// 이전 페이지 이동
|
||||||
|
const prevPageIndex = (currentPageNo - 1 > 0) ? currentPageNo - 1 : 1;
|
||||||
|
const previousPageTag = <li key="pp" className="btn">
|
||||||
|
<button onClick={e => {moveToPage(prevPageIndex)}} className="prev">이전</button></li>;
|
||||||
|
paginationTag.push(previousPageTag);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let i = currentFirstPage; i <= currentLastPage; i++) {
|
||||||
|
if (i === currentPageNo) {
|
||||||
|
// 현재 페이지
|
||||||
|
const currentPage = <li key={i}>
|
||||||
|
<button className="cur">{i}</button>
|
||||||
|
</li>;
|
||||||
|
paginationTag.push(currentPage);
|
||||||
|
} else {
|
||||||
|
// 다른 페이지
|
||||||
|
const otherPage = <li key={i}>
|
||||||
|
<button onClick={e => {moveToPage(i)}}>{i}</button>
|
||||||
|
</li>;
|
||||||
|
console.log("@@@ otherpage : " + otherPage);
|
||||||
|
paginationTag.push(otherPage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (totalPageCount > pageSize) {
|
||||||
|
// 다음 페이지 이동
|
||||||
|
const nextPageIndex = (currentLastPage + 1 < totalPageCount) ? currentLastPage + 1 : totalPageCount;
|
||||||
|
const nextPageTag = <li key="np" className="btn">
|
||||||
|
<button onClick={e => {moveToPage(nextPageIndex)}} className="next">다음</button>
|
||||||
|
</li>;
|
||||||
|
paginationTag.push(nextPageTag);
|
||||||
|
|
||||||
|
// 마지막 페이지 이동
|
||||||
|
const lastPageTag = <li key="lp" className="btn">
|
||||||
|
<button onClick={e => {moveToPage(totalPageCount)}} className="last"></button></li>;
|
||||||
|
paginationTag.push(lastPageTag);
|
||||||
|
}*/
|
||||||
}
|
}
|
||||||
console.log("paginationTag", paginationTag);
|
console.log("paginationTag", paginationTag);
|
||||||
console.groupEnd("EgovPaging");
|
console.groupEnd("EgovPaging");
|
||||||
|
|
|
||||||
|
|
@ -1,40 +1,10 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { useLocation } from 'react-router-dom';
|
|
||||||
import { NavLink } from 'react-router-dom';
|
import { NavLink } from 'react-router-dom';
|
||||||
import URL from 'constants/url';
|
import URL from 'constants/url';
|
||||||
import {Accordion} from "react-bootstrap";
|
import {Accordion} from "react-bootstrap";
|
||||||
|
|
||||||
function EgovLeftNavAdmin(props) {
|
function EgovLeftNavAdmin({activeKey}) {
|
||||||
const location = useLocation();
|
|
||||||
|
|
||||||
const getMiddleFolder = (url) => { // 중간 폴더를 가져오는 로직 추가
|
|
||||||
const parts = url.split('/').filter(Boolean); // '/'로 분할하고 빈 문자열을 필터링
|
|
||||||
if (parts.length >= 2) {
|
|
||||||
return parts[1]; // 중간 폴더 반환
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
};
|
|
||||||
const activeFolder = getMiddleFolder(location.pathname);
|
|
||||||
|
|
||||||
let activeKey;
|
|
||||||
if (activeFolder === "config") {
|
|
||||||
activeKey = "0";
|
|
||||||
} else if (activeFolder === "users") {
|
|
||||||
activeKey = "1";
|
|
||||||
} else if (activeFolder === "boards") {
|
|
||||||
activeKey = "2";
|
|
||||||
} else if (activeFolder === "standards") {
|
|
||||||
activeKey = "3";
|
|
||||||
} else if (activeFolder === "contents") {
|
|
||||||
activeKey = "4";
|
|
||||||
} else if (activeFolder === "committee") {
|
|
||||||
activeKey = "5";
|
|
||||||
} else if (activeFolder === "logs") {
|
|
||||||
activeKey = "6";
|
|
||||||
} else {
|
|
||||||
activeKey = "7";
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="nav">
|
<div className="nav">
|
||||||
<div className="inner">
|
<div className="inner">
|
||||||
|
|
@ -92,7 +62,7 @@ function EgovLeftNavAdmin(props) {
|
||||||
<ul className="menu4">
|
<ul className="menu4">
|
||||||
<li><NavLink to={URL.ADMIN__CONTENTS__SURVEY} className={({ isActive }) => (isActive ? "cur" : "")}>설문 관리</NavLink></li>
|
<li><NavLink to={URL.ADMIN__CONTENTS__SURVEY} className={({ isActive }) => (isActive ? "cur" : "")}>설문 관리</NavLink></li>
|
||||||
<li><NavLink to={URL.ADMIN__CONTENTS__POP_UP} className={({ isActive }) => (isActive ? "cur" : "")}>팝업 관리</NavLink></li>
|
<li><NavLink to={URL.ADMIN__CONTENTS__POP_UP} className={({ isActive }) => (isActive ? "cur" : "")}>팝업 관리</NavLink></li>
|
||||||
<li><NavLink to={URL.ADMIN__CONTENTS__STANDARDS_RESEARCH} className={({ isActive }) => (isActive ? "cur" : "")}>건설기준연구 관리</NavLink></li>
|
<li><NavLink to={URL.ADMIN__CONTENTS__STANDARD_RESEARCH} className={({ isActive }) => (isActive ? "cur" : "")}>건설기준연구 관리</NavLink></li>
|
||||||
<li><NavLink to={URL.ADMIN__CONTENTS__TEXT_MESSAGES} className={({ isActive }) => (isActive ? "cur" : "")}>문자 발송</NavLink></li>
|
<li><NavLink to={URL.ADMIN__CONTENTS__TEXT_MESSAGES} className={({ isActive }) => (isActive ? "cur" : "")}>문자 발송</NavLink></li>
|
||||||
</ul>
|
</ul>
|
||||||
</Accordion.Body>
|
</Accordion.Body>
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,6 @@ function ProgressStatus(props) {
|
||||||
<li><Link to={URL.MAIN} className="home">Home</Link></li>
|
<li><Link to={URL.MAIN} className="home">Home</Link></li>
|
||||||
<li><Link to={URL.ADMIN}>사이트 관리</Link></li>
|
<li><Link to={URL.ADMIN}>사이트 관리</Link></li>
|
||||||
<li>위원회 관리</li>
|
<li>위원회 관리</li>
|
||||||
<li>진행현황 관리</li>
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -187,7 +187,6 @@ function Schedules(props) {
|
||||||
<li><Link to={URL.MAIN} className="home">Home</Link></li>
|
<li><Link to={URL.MAIN} className="home">Home</Link></li>
|
||||||
<li><Link to={URL.ADMIN}>사이트 관리</Link></li>
|
<li><Link to={URL.ADMIN}>사이트 관리</Link></li>
|
||||||
<li>위원회 관리</li>
|
<li>위원회 관리</li>
|
||||||
<li>위원회 일정 관리</li>
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -212,7 +212,6 @@ function SchedulesEdit(props) {
|
||||||
<li><Link to={URL.MAIN} className="home">Home</Link></li>
|
<li><Link to={URL.MAIN} className="home">Home</Link></li>
|
||||||
<li><Link to={URL.ADMIN}>사이트 관리</Link></li>
|
<li><Link to={URL.ADMIN}>사이트 관리</Link></li>
|
||||||
<li>위원회 관리</li>
|
<li>위원회 관리</li>
|
||||||
<li>위원회 일정 관리</li>
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
{/* <!--// Location --> */}
|
{/* <!--// Location --> */}
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ function BaseCodeMgt(props) {
|
||||||
</div>
|
</div>
|
||||||
<div className="layout">
|
<div className="layout">
|
||||||
{/* <!-- Navigation --> */}
|
{/* <!-- Navigation --> */}
|
||||||
<EgovLeftNav />
|
<EgovLeftNav activeKey={"0"}></EgovLeftNav>
|
||||||
<div className="contents NOTICE_LIST" id="contents">
|
<div className="contents NOTICE_LIST" id="contents">
|
||||||
{/* <!-- 본문 --> */}
|
{/* <!-- 본문 --> */}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,6 @@ function CommitteeCodeMgt(props) {
|
||||||
<li><Link to={URL.MAIN} className="home">Home</Link></li>
|
<li><Link to={URL.MAIN} className="home">Home</Link></li>
|
||||||
<li><Link to={URL.ADMIN}>사이트 관리</Link></li>
|
<li><Link to={URL.ADMIN}>사이트 관리</Link></li>
|
||||||
<li>환경 설정</li>
|
<li>환경 설정</li>
|
||||||
<li>위원회 코드 관리</li>
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@ function PopUp(props) {
|
||||||
<li><Link to={URL.MAIN} className="home">Home</Link></li>
|
<li><Link to={URL.MAIN} className="home">Home</Link></li>
|
||||||
<li><Link to={URL.ADMIN}>사이트 관리</Link></li>
|
<li><Link to={URL.ADMIN}>사이트 관리</Link></li>
|
||||||
<li>컨텐츠 관리</li>
|
<li>컨텐츠 관리</li>
|
||||||
<li>팝업 관리</li>
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,6 @@ function StandardResearch(props) {
|
||||||
<li><Link to={URL.MAIN} className="home">Home</Link></li>
|
<li><Link to={URL.MAIN} className="home">Home</Link></li>
|
||||||
<li><Link to={URL.ADMIN}>사이트 관리</Link></li>
|
<li><Link to={URL.ADMIN}>사이트 관리</Link></li>
|
||||||
<li>컨텐츠 관리</li>
|
<li>컨텐츠 관리</li>
|
||||||
<li>건설기준연구 관리</li>
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,6 @@ function Survey(props) {
|
||||||
<li><Link to={URL.MAIN} className="home">Home</Link></li>
|
<li><Link to={URL.MAIN} className="home">Home</Link></li>
|
||||||
<li><Link to={URL.ADMIN}>사이트 관리</Link></li>
|
<li><Link to={URL.ADMIN}>사이트 관리</Link></li>
|
||||||
<li>컨텐츠 관리</li>
|
<li>컨텐츠 관리</li>
|
||||||
<li>설문 관리</li>
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -48,8 +48,8 @@ function PrivacyConnections(props) {
|
||||||
listTag.push(<p className="no_data" key="0">데이터가 없습니다.</p>); // 게시판 목록 초기값
|
listTag.push(<p className="no_data" key="0">데이터가 없습니다.</p>); // 게시판 목록 초기값
|
||||||
|
|
||||||
const resultCnt = parseInt(resp.result.resultCnt);
|
const resultCnt = parseInt(resp.result.resultCnt);
|
||||||
const currentPageNo = resp.result.paginationInfo.pageIndex;
|
const currentPageNo = resp.result.paginationInfo.currentPageNo;
|
||||||
const pageSize = resp.result.paginationInfo.rowCnt;
|
const pageSize = resp.result.paginationInfo.pageSize;
|
||||||
|
|
||||||
const startIndex = (currentPageNo - 1) * pageSize;
|
const startIndex = (currentPageNo - 1) * pageSize;
|
||||||
const endIndex = Math.min(startIndex + pageSize, resultCnt);
|
const endIndex = Math.min(startIndex + pageSize, resultCnt);
|
||||||
|
|
|
||||||
|
|
@ -216,14 +216,10 @@ function EgovAdminScheduleList(props) {
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, [scheduleList]);
|
}, [scheduleList]);
|
||||||
|
|
||||||
const [isDailyChart, setChart] = useState(true);
|
|
||||||
|
|
||||||
const getDailyUserLogList = useCallback(() => {
|
const getDailyUserLogList = useCallback(() => {
|
||||||
console.groupCollapsed("EgovAdminScheduleList.getDailyUserLogList()");
|
console.groupCollapsed("EgovAdminScheduleList.getDailyUserLogList()");
|
||||||
|
|
||||||
console.log("@@@ isDailyChart : " + isDailyChart);
|
const dailyUserLogListURL = '/admin/dashboard/daily-user-log-list';
|
||||||
|
|
||||||
const dailyUserLogListURL = isDailyChart ? '/admin/dashboard/daily-user-log-list' : '/admin/dashboard/monthly-user-log-list';
|
|
||||||
|
|
||||||
const requestOptions = {
|
const requestOptions = {
|
||||||
method: "GET",
|
method: "GET",
|
||||||
|
|
@ -243,29 +239,12 @@ function EgovAdminScheduleList(props) {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
console.groupEnd("EgovAdminScheduleList.getDailyUserLogList()");
|
console.groupEnd("EgovAdminScheduleList.getDailyUserLogList()");
|
||||||
}, [isDailyChart]);
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
getDailyUserLogList();
|
getDailyUserLogList();
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, [isDailyChart]);
|
}, []);
|
||||||
|
|
||||||
const handleChartToggle = () => {
|
|
||||||
setChart(!isDailyChart);
|
|
||||||
};
|
|
||||||
|
|
||||||
const ChartToggle = ({onToggle}) => {
|
|
||||||
|
|
||||||
const handleToggle = () => {
|
|
||||||
onToggle(!isDailyChart);
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<button onClick={handleToggle}>
|
|
||||||
{isDailyChart ? '월별차트보기' : '일별차트보기'}
|
|
||||||
</button>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
const data = dailyUserLogList.map(item => ({
|
const data = dailyUserLogList.map(item => ({
|
||||||
logDt: item.logDt,
|
logDt: item.logDt,
|
||||||
|
|
@ -274,12 +253,35 @@ function EgovAdminScheduleList(props) {
|
||||||
amt: item.pcCnt,
|
amt: item.pcCnt,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
const getIntroOfPage = (label) => {
|
||||||
|
if (label === 'Page A') {
|
||||||
|
return "Page A is about men's clothing";
|
||||||
|
}
|
||||||
|
if (label === 'Page B') {
|
||||||
|
return "Page B is about women's dress";
|
||||||
|
}
|
||||||
|
if (label === 'Page C') {
|
||||||
|
return "Page C is about women's bag";
|
||||||
|
}
|
||||||
|
if (label === 'Page D') {
|
||||||
|
return 'Page D is about household goods';
|
||||||
|
}
|
||||||
|
if (label === 'Page E') {
|
||||||
|
return 'Page E is about food';
|
||||||
|
}
|
||||||
|
if (label === 'Page F') {
|
||||||
|
return 'Page F is about baby food';
|
||||||
|
}
|
||||||
|
return '';
|
||||||
|
};
|
||||||
|
|
||||||
const CustomTooltip = ({active, payload, label}) => {
|
const CustomTooltip = ({active, payload, label}) => {
|
||||||
if (active && payload && payload.length) {
|
if (active && payload && payload.length) {
|
||||||
return (
|
return (
|
||||||
<div className="custom-tooltip">
|
<div className="custom-tooltip">
|
||||||
<p className="desc">사용자 접속 현황</p>
|
<p className="desc">사용자 접속 현황</p>
|
||||||
<p className="label">{`${label} : ${payload[0].value}`}</p>
|
<p className="label">{`${label} : ${payload[0].value}`}</p>
|
||||||
|
<p className="intro">{getIntroOfPage(label)}</p>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -287,7 +289,7 @@ function EgovAdminScheduleList(props) {
|
||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
class UserLogChart extends PureComponent {
|
class Example extends PureComponent {
|
||||||
static demoUrl = 'https://codesandbox.io/s/tooltip-with-customized-content-lyxvs';
|
static demoUrl = 'https://codesandbox.io/s/tooltip-with-customized-content-lyxvs';
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|
@ -339,10 +341,8 @@ function EgovAdminScheduleList(props) {
|
||||||
|
|
||||||
<h2 className="tit_2">일정관리</h2>
|
<h2 className="tit_2">일정관리</h2>
|
||||||
|
|
||||||
<ChartToggle isDailyChart={isDailyChart} onToggle={handleChartToggle}/>
|
|
||||||
|
|
||||||
<div style={{width: 1000, height: 300}}>
|
<div style={{width: 1000, height: 300}}>
|
||||||
<UserLogChart/>
|
<Example/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* <!-- 검색조건 --> */}
|
{/* <!-- 검색조건 --> */}
|
||||||
|
|
|
||||||
|
|
@ -99,7 +99,7 @@ function List(props) {
|
||||||
</div>
|
</div>
|
||||||
<div className="layout">
|
<div className="layout">
|
||||||
{/* <!-- Navigation --> */}
|
{/* <!-- Navigation --> */}
|
||||||
<EgovLeftNav/>
|
<EgovLeftNav activeKey={"1"}></EgovLeftNav>
|
||||||
<div className="contents NOTICE_LIST" id="contents">
|
<div className="contents NOTICE_LIST" id="contents">
|
||||||
{/* <!-- 본문 --> */}
|
{/* <!-- 본문 --> */}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -293,7 +293,7 @@ const SecondRoutes = () => {
|
||||||
{/* 관리자 - 컨텐츠 관리 */}
|
{/* 관리자 - 컨텐츠 관리 */}
|
||||||
<Route path={URL.ADMIN__CONTENTS__SURVEY} element={<AdminContentsSurvey />} />
|
<Route path={URL.ADMIN__CONTENTS__SURVEY} element={<AdminContentsSurvey />} />
|
||||||
<Route path={URL.ADMIN__CONTENTS__POP_UP} element={<AdminContentsPopUp />} />
|
<Route path={URL.ADMIN__CONTENTS__POP_UP} element={<AdminContentsPopUp />} />
|
||||||
<Route path={URL.ADMIN__CONTENTS__STANDARDS_RESEARCH} element={<AdminContentsStandardResearch />} />
|
<Route path={URL.ADMIN__CONTENTS__STANDARD_RESEARCH} element={<AdminContentsStandardResearch />} />
|
||||||
<Route path={URL.ADMIN__CONTENTS__TEXT_MESSAGES} element={<AdminContentsTextMessages />} />
|
<Route path={URL.ADMIN__CONTENTS__TEXT_MESSAGES} element={<AdminContentsTextMessages />} />
|
||||||
|
|
||||||
{/* 관리자 - 위원회 관리 */}
|
{/* 관리자 - 위원회 관리 */}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
package com.dbnt.kcscbackend.admin.dashboard;
|
package com.dbnt.kcscbackend.admin.dashboard;
|
||||||
|
|
||||||
import com.dbnt.kcscbackend.admin.dashboard.dto.MonthlyUserLogDTO;
|
|
||||||
import com.dbnt.kcscbackend.admin.dashboard.service.AdminDashboardService;
|
import com.dbnt.kcscbackend.admin.dashboard.service.AdminDashboardService;
|
||||||
import com.dbnt.kcscbackend.config.common.BaseController;
|
import com.dbnt.kcscbackend.config.common.BaseController;
|
||||||
import com.dbnt.kcscbackend.config.common.ResultVO;
|
import com.dbnt.kcscbackend.config.common.ResultVO;
|
||||||
|
|
@ -14,12 +13,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import java.math.BigInteger;
|
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
|
|
@ -30,9 +26,9 @@ public class AdminDashboardController extends BaseController {
|
||||||
private final AdminDashboardService adminDashboardService;
|
private final AdminDashboardService adminDashboardService;
|
||||||
|
|
||||||
@Operation(
|
@Operation(
|
||||||
summary = "일별 사용자 현황 차트 조회",
|
summary = "기본코드 그룹 조회",
|
||||||
description = "일별 사용자 현황 차트 조회",
|
description = "기본코드 그룹 조회",
|
||||||
tags = {"AdminDashboardController"}
|
tags = {"AdminConfigController"}
|
||||||
)
|
)
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(responseCode = "200", description = "조회 성공"),
|
@ApiResponse(responseCode = "200", description = "조회 성공"),
|
||||||
|
|
@ -46,6 +42,9 @@ public class AdminDashboardController extends BaseController {
|
||||||
// 현재 날짜
|
// 현재 날짜
|
||||||
// todo endDate 뒤에 .minus 지워야함
|
// todo endDate 뒤에 .minus 지워야함
|
||||||
LocalDate endDate = LocalDate.now().minusMonths(6);
|
LocalDate endDate = LocalDate.now().minusMonths(6);
|
||||||
|
|
||||||
|
System.out.println("@@@ localdate : " + endDate);
|
||||||
|
|
||||||
// 3개월 전 날짜 계산
|
// 3개월 전 날짜 계산
|
||||||
LocalDate startDate = endDate.minusMonths(3);
|
LocalDate startDate = endDate.minusMonths(3);
|
||||||
|
|
||||||
|
|
@ -53,34 +52,4 @@ public class AdminDashboardController extends BaseController {
|
||||||
resultVO.setResult(resultMap);
|
resultVO.setResult(resultMap);
|
||||||
return resultVO;
|
return resultVO;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Operation(
|
|
||||||
summary = "월별 사용자 현황 차트 조회",
|
|
||||||
description = "월별 사용자 현황 차트 조회",
|
|
||||||
tags = {"AdminDashboardController"}
|
|
||||||
)
|
|
||||||
@ApiResponses(value = {
|
|
||||||
@ApiResponse(responseCode = "200", description = "조회 성공"),
|
|
||||||
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님")
|
|
||||||
})
|
|
||||||
@RequestMapping(method = RequestMethod.GET, value = "/monthly-user-log-list", consumes = MediaType.APPLICATION_JSON_VALUE)
|
|
||||||
public ResultVO getMonthlyUserLogList() throws Exception {
|
|
||||||
ResultVO resultVO = new ResultVO();
|
|
||||||
Map<String, Object> resultMap = new HashMap<>();
|
|
||||||
|
|
||||||
// 현재 날짜
|
|
||||||
// todo endDate 뒤에 .minus 지워야함
|
|
||||||
LocalDate endDate = LocalDate.now().minusMonths(6);
|
|
||||||
// 3개월 전 날짜 계산
|
|
||||||
LocalDate startDate = endDate.minusMonths(3);
|
|
||||||
|
|
||||||
List<Object[]> result = adminDashboardService.selectMonthlyUserLogList(startDate, endDate);
|
|
||||||
List<MonthlyUserLogDTO> monthlyUserLogDTOList = result.stream()
|
|
||||||
.map(row -> new MonthlyUserLogDTO((String) row[0], (BigInteger) row[1]))
|
|
||||||
.collect(Collectors.toList());
|
|
||||||
|
|
||||||
resultMap.put("dailyUserLogList", monthlyUserLogDTOList);
|
|
||||||
resultVO.setResult(resultMap);
|
|
||||||
return resultVO;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
package com.dbnt.kcscbackend.admin.dashboard.dto;
|
|
||||||
|
|
||||||
import com.dbnt.kcscbackend.admin.dashboard.entity.TnDailyUserLog;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.ToString;
|
|
||||||
|
|
||||||
import java.math.BigInteger;
|
|
||||||
import java.time.LocalDate;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@AllArgsConstructor
|
|
||||||
@ToString
|
|
||||||
public class MonthlyUserLogDTO {
|
|
||||||
private String logDt;
|
|
||||||
private BigInteger logCnt;
|
|
||||||
|
|
||||||
public MonthlyUserLogDTO(Object[] row) {
|
|
||||||
this.logDt = (String) row[0];
|
|
||||||
this.logCnt = (BigInteger) row[1];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -7,7 +7,6 @@ import org.hibernate.annotations.DynamicInsert;
|
||||||
import org.hibernate.annotations.DynamicUpdate;
|
import org.hibernate.annotations.DynamicUpdate;
|
||||||
|
|
||||||
import javax.persistence.*;
|
import javax.persistence.*;
|
||||||
import java.math.BigInteger;
|
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
|
|
@ -34,6 +33,4 @@ public class TnDailyUserLog {
|
||||||
|
|
||||||
@Column(name = "pc_cnt")
|
@Column(name = "pc_cnt")
|
||||||
private Integer pcCnt;
|
private Integer pcCnt;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -2,21 +2,10 @@ package com.dbnt.kcscbackend.admin.dashboard.repository;
|
||||||
|
|
||||||
import com.dbnt.kcscbackend.admin.dashboard.entity.TnDailyUserLog;
|
import com.dbnt.kcscbackend.admin.dashboard.entity.TnDailyUserLog;
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
import org.springframework.data.jpa.repository.Query;
|
|
||||||
import org.springframework.data.repository.query.Param;
|
|
||||||
|
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public interface TnDailyUserLogRepository extends JpaRepository<TnDailyUserLog, Long> {
|
public interface TnDailyUserLogRepository extends JpaRepository<TnDailyUserLog, Long> {
|
||||||
List<TnDailyUserLog> findByLogDtBetweenOrderByLogDt(LocalDate startDate, LocalDate endDate);
|
List<TnDailyUserLog> findByLogDtBetweenOrderByLogDt(LocalDate startDate, LocalDate endDate);
|
||||||
|
|
||||||
@Query(value = "SELECT TO_CHAR(log_dt, 'YYYYMM') as log_dt, "
|
|
||||||
+ "SUM(log_cnt) as log_cnt "
|
|
||||||
+ "FROM tn_daily_user_log "
|
|
||||||
+ "WHERE log_dt BETWEEN :startDate AND :endDate "
|
|
||||||
+ "GROUP BY TO_CHAR(log_dt, 'YYYYMM') "
|
|
||||||
+ "ORDER BY log_dt", nativeQuery = true)
|
|
||||||
List<Object[]> selectMonthlyUserLogStatistics(@Param("startDate") LocalDate startDate, @Param("endDate") LocalDate endDate);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,4 @@ public class AdminDashboardService extends EgovAbstractServiceImpl {
|
||||||
public List<TnDailyUserLog> selectDailyUserLogList(LocalDate startDate, LocalDate endDate) {
|
public List<TnDailyUserLog> selectDailyUserLogList(LocalDate startDate, LocalDate endDate) {
|
||||||
return tnDailyUserLogRepository.findByLogDtBetweenOrderByLogDt(startDate, endDate);
|
return tnDailyUserLogRepository.findByLogDtBetweenOrderByLogDt(startDate, endDate);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Object[]> selectMonthlyUserLogList(LocalDate startDate, LocalDate endDate) {
|
|
||||||
return tnDailyUserLogRepository.selectMonthlyUserLogStatistics(startDate, endDate);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -49,12 +49,25 @@ public class AdminLogsController extends BaseController {
|
||||||
throws Exception {
|
throws Exception {
|
||||||
|
|
||||||
ResultVO resultVO = new ResultVO();
|
ResultVO resultVO = new ResultVO();
|
||||||
thPrivacyLog.setQueryInfo();
|
|
||||||
Map<String, Object> resultMap = adminLogsService.selectPrivacyList();
|
Map<String, Object> resultMap = adminLogsService.selectPrivacyList();
|
||||||
|
|
||||||
|
PaginationInfo paginationInfo = new PaginationInfo();
|
||||||
|
|
||||||
|
paginationInfo.setCurrentPageNo(thPrivacyLog.getPageIndex());
|
||||||
|
paginationInfo.setRecordCountPerPage(propertyService.getInt("Globals.pageUnit"));
|
||||||
|
paginationInfo.setPageSize(propertyService.getInt("Globals.pageSize"));
|
||||||
|
|
||||||
|
thPrivacyLog.setFirstIndex(paginationInfo.getFirstRecordIndex());
|
||||||
|
thPrivacyLog.setLastIndex(paginationInfo.getLastRecordIndex());
|
||||||
|
thPrivacyLog.setRecordCountPerPage(paginationInfo.getRecordCountPerPage());
|
||||||
|
|
||||||
int totCnt = Integer.parseInt((String)resultMap.get("resultCnt"));
|
int totCnt = Integer.parseInt((String)resultMap.get("resultCnt"));
|
||||||
thPrivacyLog.setContentCnt(totCnt);
|
paginationInfo.setTotalRecordCount(totCnt);
|
||||||
thPrivacyLog.setPaginationInfo();
|
|
||||||
resultMap.put("paginationInfo", thPrivacyLog);
|
// resultMap.put("resultList", adminLogsService.selectPrivacyList());
|
||||||
|
// resultMap.put("resultList", resultMap.get("resultList"));
|
||||||
|
// resultMap.put("resultCnt", totCnt);
|
||||||
|
resultMap.put("paginationInfo", paginationInfo);
|
||||||
|
|
||||||
resultVO.setResultCode(ResponseCode.SUCCESS.getCode());
|
resultVO.setResultCode(ResponseCode.SUCCESS.getCode());
|
||||||
resultVO.setResultMessage(ResponseCode.SUCCESS.getMessage());
|
resultVO.setResultMessage(ResponseCode.SUCCESS.getMessage());
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,6 @@
|
||||||
package com.dbnt.kcscbackend.admin.logs.entity;
|
package com.dbnt.kcscbackend.admin.logs.entity;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
import com.dbnt.kcscbackend.config.common.BoardParams;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
@ -24,9 +22,61 @@ import java.time.LocalDateTime;
|
||||||
@DynamicInsert
|
@DynamicInsert
|
||||||
@DynamicUpdate
|
@DynamicUpdate
|
||||||
@Table(name = "th_user_privacy_log")
|
@Table(name = "th_user_privacy_log")
|
||||||
public class ThPrivacyLog extends BoardParams implements Serializable {
|
public class ThPrivacyLog implements Serializable {
|
||||||
private static final long serialVersionUID = -3779821913760046011L;
|
private static final long serialVersionUID = -3779821913760046011L;
|
||||||
|
|
||||||
|
@Transient
|
||||||
|
@Schema(description = "검색시작일")
|
||||||
|
private String searchBgnDe = "";
|
||||||
|
|
||||||
|
@Transient
|
||||||
|
@Schema(description = "검색조건")
|
||||||
|
private String searchCnd = "";
|
||||||
|
|
||||||
|
@Transient
|
||||||
|
@Schema(description = "검색종료일")
|
||||||
|
private String searchEndDe = "";
|
||||||
|
|
||||||
|
@Transient
|
||||||
|
@Schema(description = "검색단어")
|
||||||
|
private String searchWrd = "";
|
||||||
|
|
||||||
|
@Transient
|
||||||
|
@Schema(description = "정렬순서(DESC,ASC)")
|
||||||
|
private long sortOrdr = 0L;
|
||||||
|
|
||||||
|
@Transient
|
||||||
|
@Schema(description = "검색사용여부")
|
||||||
|
private String searchUseYn = "";
|
||||||
|
|
||||||
|
@Transient
|
||||||
|
@Schema(description = "현재페이지")
|
||||||
|
private int pageIndex = 1;
|
||||||
|
|
||||||
|
@Transient
|
||||||
|
@Schema(description = "페이지갯수")
|
||||||
|
private int pageUnit = 10;
|
||||||
|
|
||||||
|
@Transient
|
||||||
|
@Schema(description = "페이지사이즈")
|
||||||
|
private int pageSize = 10;
|
||||||
|
|
||||||
|
@Transient
|
||||||
|
@Schema(description = "첫페이지 인덱스")
|
||||||
|
private int firstIndex = 1;
|
||||||
|
|
||||||
|
@Transient
|
||||||
|
@Schema(description = "마지막페이지 인덱스")
|
||||||
|
private int lastIndex = 1;
|
||||||
|
|
||||||
|
@Transient
|
||||||
|
@Schema(description = "페이지당 레코드 개수")
|
||||||
|
private int recordCountPerPage = 10;
|
||||||
|
|
||||||
|
@Transient
|
||||||
|
@Schema(description = "레코드 번호")
|
||||||
|
private int rowNo = 0;
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@Column(name = "upl_seq")
|
@Column(name = "upl_seq")
|
||||||
private Long uplSeq;
|
private Long uplSeq;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
package com.dbnt.kcscbackend.config.common;
|
package com.dbnt.kcscbackend.config.common;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
|
||||||
|
|
@ -29,16 +28,6 @@ public class BoardParams implements Serializable {
|
||||||
@Transient
|
@Transient
|
||||||
private Integer contentCnt=0;
|
private Integer contentCnt=0;
|
||||||
|
|
||||||
@Transient
|
|
||||||
@Schema(description = "검색시작일")
|
|
||||||
private String searchBgnDe = "";
|
|
||||||
@Transient
|
|
||||||
@Schema(description = "검색종료일")
|
|
||||||
private String searchEndDe = "";
|
|
||||||
@Transient
|
|
||||||
@Schema(description = "정렬순서(DESC,ASC)")
|
|
||||||
private long sortOrdr = 0L;
|
|
||||||
|
|
||||||
public void setQueryInfo(){
|
public void setQueryInfo(){
|
||||||
setFirstIndex((getPageIndex()-1)*getRowCnt());
|
setFirstIndex((getPageIndex()-1)*getRowCnt());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue