로그현황 - 파일다운 현황

thkim
Lim\jun 2024-01-19 13:59:22 +09:00
parent cc718b8df3
commit e3c91a9449
8 changed files with 530 additions and 31 deletions

View File

@ -15,26 +15,26 @@
.btn.noscript {font-size: 0;}
.btn > span {position: relative;}
.btn_blue_h46 {height: 46px; border-radius: 5px; color: #fff; font-size: 15px; line-height: 46px; text-align: center; background: #169bd5; padding: 0px;}
.btn_blue_h46:hover {height: 46px; border-radius: 5px; color: #169bd5; font-size: 15px; line-height: 46px; text-align: center; border: 1px solid #169bd5; padding: 0px;}
.btn_skyblue_h46 {height: 46px; border-radius: 5px; color: #005b82; font-size: 15px; line-height: 46px; text-align: center; background: #daedf5; padding: 0px;}
.btn_skyblue_h46:hover {height: 46px; border-radius: 5px; color: #005b82; font-size: 15px; line-height: 46px; text-align: center; border: 1px solid #daedf5; padding: 0px;}
.btn_red_h46 {height: 46px; border-radius: 5px; color: darkred; font-size: 15px; line-height: 46px; text-align: center; background: #ed898b; padding: 0px;}
.btn_red_h46:hover {height: 46px; border-radius: 5px; color: darkred; font-size: 15px; line-height: 46px; text-align: center; border: 1px solid #ed898b; padding: 0px;}
.btn_blue_h46 {height: 46px; border-radius: 5px; color: #fff; font-size: 15px; line-height: 46px; text-align: center; background: #169bd5; padding: 0 1rem 0 1rem !important;}
.btn_blue_h46:hover {height: 46px; border-radius: 5px; color: #169bd5; font-size: 15px; line-height: 46px; text-align: center; border: 1px solid #169bd5; padding: 0 1rem 0 1rem !important;}
.btn_skyblue_h46 {height: 46px; border-radius: 5px; color: #005b82; font-size: 15px; line-height: 46px; text-align: center; background: #daedf5; padding: 0 1rem 0 1rem !important;}
.btn_skyblue_h46:hover {height: 46px; border-radius: 5px; color: #005b82; font-size: 15px; line-height: 46px; text-align: center; border: 1px solid #daedf5; padding: 0 1rem 0 1rem !important;}
.btn_red_h46 {height: 46px; border-radius: 5px; color: darkred; font-size: 15px; line-height: 46px; text-align: center; background: #ed898b; padding: 0 1rem 0 1rem !important;}
.btn_red_h46:hover {height: 46px; border-radius: 5px; color: darkred; font-size: 15px; line-height: 46px; text-align: center; border: 1px solid #ed898b; padding: 0 1rem 0 1rem !important;}
.btn_blue_h32 {height: 32px; border-radius: 5px; color: #fff; font-size: 15px; line-height: 32px; text-align: center; background: #169bd5; padding: 0px;}
.btn_blue_h32:hover {height: 32px; border-radius: 5px; color: #169bd5; font-size: 15px; line-height: 32px; text-align: center; border: 1px solid #169bd5; padding: 0px;}
.btn_skyblue_h32 {height: 32px; border-radius: 5px; color: #005b82; font-size: 15px; line-height: 32px; text-align: center; background: #daedf5; padding: 0px;}
.btn_skyblue_h32:hover {height: 32px; border-radius: 5px; color: #005b82; font-size: 15px; line-height: 32px; text-align: center; border: 1px solid #daedf5; padding: 0px;}
.btn_red_h32 {height: 32px; border-radius: 5px; color: darkred; font-size: 15px; line-height: 32px; text-align: center; background: #ed898b; padding: 0px;}
.btn_red_h32:hover {height: 32px; border-radius: 5px; color: darkred; font-size: 15px; line-height: 32px; text-align: center; border: 1px solid #ed898b; padding: 0px;}
.btn_blue_h32 {height: 32px; border-radius: 5px; color: #fff; font-size: 15px; line-height: 32px; text-align: center; background: #169bd5; padding: 0 1rem 0 1rem !important;}
.btn_blue_h32:hover {height: 32px; border-radius: 5px; color: #169bd5; font-size: 15px; line-height: 32px; text-align: center; border: 1px solid #169bd5; padding: 0 1rem 0 1rem !important;}
.btn_skyblue_h32 {height: 32px; border-radius: 5px; color: #005b82; font-size: 15px; line-height: 32px; text-align: center; background: #daedf5; padding: 0 1rem 0 1rem !important;}
.btn_skyblue_h32:hover {height: 32px; border-radius: 5px; color: #005b82; font-size: 15px; line-height: 32px; text-align: center; border: 1px solid #daedf5; padding: 0 1rem 0 1rem !important;}
.btn_red_h32 {height: 32px; border-radius: 5px; color: darkred; font-size: 15px; line-height: 32px; text-align: center; background: #ed898b; padding: 0 1rem 0 1rem !important;}
.btn_red_h32:hover {height: 32px; border-radius: 5px; color: darkred; font-size: 15px; line-height: 32px; text-align: center; border: 1px solid #ed898b; padding: 0 1rem 0 1rem !important;}
.btn_blue_h31 {height: 31px; border-radius: 5px; color: #fff; font-size: 15px; line-height: 31px; text-align: center; background: #169bd5; padding: 0px;}
.btn_blue_h31:hover {height: 31px; border-radius: 5px; color: #169bd5; font-size: 15px; line-height: 31px; text-align: center; border: 1px solid #169bd5; padding: 0px;}
.btn_skyblue_h31 {height: 31px; border-radius: 5px; color: #005b82; font-size: 15px; line-height: 31px; text-align: center; background: #daedf5; padding: 0px;}
.btn_skyblue_h31:hover {height: 31px; border-radius: 5px; color: #005b82; font-size: 15px; line-height: 31px; text-align: center; border: 1px solid #daedf5; padding: 0px;}
.btn_red_h31 {height: 31px; border-radius: 5px; color: darkred; font-size: 15px; line-height: 31px; text-align: center; background: #ed898b; padding: 0px;}
.btn_red_h31:hover {height: 31px; border-radius: 5px; color: darkred; font-size: 15px; line-height: 31px; text-align: center; border: 1px solid #ed898b; padding: 0px;}
.btn_blue_h31 {height: 31px; border-radius: 5px; color: #fff; font-size: 15px; line-height: 31px; text-align: center; background: #169bd5; padding: 0 1rem 0 1rem !important;}
.btn_blue_h31:hover {height: 31px; border-radius: 5px; color: #169bd5; font-size: 15px; line-height: 31px; text-align: center; border: 1px solid #169bd5; padding: 0 1rem 0 1rem !important;}
.btn_skyblue_h31 {height: 31px; border-radius: 5px; color: #005b82; font-size: 15px; line-height: 31px; text-align: center; background: #daedf5; padding: 0 1rem 0 1rem !important;}
.btn_skyblue_h31:hover {height: 31px; border-radius: 5px; color: #005b82; font-size: 15px; line-height: 31px; text-align: center; border: 1px solid #daedf5; padding: 0 1rem 0 1rem !important;}
.btn_red_h31 {height: 31px; border-radius: 5px; color: darkred; font-size: 15px; line-height: 31px; text-align: center; background: #ed898b; padding: 0 1rem 0 1rem !important;}
.btn_red_h31:hover {height: 31px; border-radius: 5px; color: darkred; font-size: 15px; line-height: 31px; text-align: center; border: 1px solid #ed898b; padding: 0 1rem 0 1rem !important;}
.btn_upload {position: relative; width: 180px; height: 46px; border-radius: 5px; color: #fff; font-size: 16px; line-height: 46px; text-align: center; background: #169bd5;}
.btn_upload span {display: inline-block; height: 46px; line-height: 46px;}
@ -329,3 +329,7 @@ select::-ms-expand {display:none;}
font-weight: 700;
margin: 0
}
.recharts-legend-item-text {
font-size: 11px;
}

View File

@ -295,6 +295,35 @@
.BRD010 .result .list_item > div:nth-child(1) {width: 60%; text-overflow: ellipsis; white-space: nowrap; overflow: hidden;}
.BRD010 .result .list_item > div:nth-child(2) {width: 40%;}
/* 로그현황 - 파일다운현황*/
.BRD011 .head > span:nth-child(1) {width: 80px; font-size: 11px;}
.BRD011 .head > span:nth-child(2) {width: 60px; font-size: 10px;}
.BRD011 .head > span:nth-child(3) {width: 60px; font-size: 10px;}
.BRD011 .head > span:nth-child(4) {width: 60px; font-size: 10px;}
.BRD011 .head > span:nth-child(5) {width: 60px; font-size: 10px;}
.BRD011 .head > span:nth-child(6) {width: 60px; font-size: 10px;}
.BRD011 .head > span:nth-child(7) {width: 60px; font-size: 10px;}
.BRD011 .head > span:nth-child(8) {width: 60px; font-size: 10px;}
.BRD011 .head > span:nth-child(9) {width: 60px; font-size: 10px;}
.BRD011 .head > span:nth-child(10) {width: 60px; font-size: 10px;}
.BRD011 .head > span:nth-child(11) {width: 60px; font-size: 10px;}
.BRD011 .head > span:nth-child(12) {width: 60px; font-size: 10px;}
.BRD011 .head > span:nth-child(13) {width: 60px; font-size: 10px;}
.BRD011 .result .list_item > div:nth-child(1) {width: 80px;}
.BRD011 .result .list_item > div:nth-child(2) {width: 60px;}
.BRD011 .result .list_item > div:nth-child(3) {width: 60px;}
.BRD011 .result .list_item > div:nth-child(4) {width: 60px;}
.BRD011 .result .list_item > div:nth-child(5) {width: 60px;}
.BRD011 .result .list_item > div:nth-child(6) {width: 60px;}
.BRD011 .result .list_item > div:nth-child(7) {width: 60px;}
.BRD011 .result .list_item > div:nth-child(8) {width: 60px;}
.BRD011 .result .list_item > div:nth-child(9) {width: 60px;}
.BRD011 .result .list_item > div:nth-child(10) {width: 60px;}
.BRD011 .result .list_item > div:nth-child(11) {width: 60px;}
.BRD011 .result .list_item > div:nth-child(12) {width: 60px;}
.BRD011 .result .list_item > div:nth-child(13) {width: 60px;}
/* 게시판 사용관리 등록 */
.BOARD_USE_LIST .board_view2 dl dt {width: 185px;}
.BOARD_USE_LIST .board_view2 dl:nth-child(2) dd .f_input2 {width: 490px; margin-left: 17px;}

View File

@ -101,17 +101,27 @@
.list_1 li::before {top: 8px;}
.btn_blue_h46 {height: 40px; font-size: 13px; line-height: 40px;}
.btn_skyblue_h46 {height: 40px; font-size: 13px; line-height: 40px;}
.btn_red_h46 {height: 40px; font-size: 13px; line-height: 40px;}
.btn_blue_h46 {height: 40px; font-size: 13px; line-height: 40px; padding: 0 1rem 0 1rem !important;}
.btn_skyblue_h46 {height: 40px; font-size: 13px; line-height: 40px; padding: 0 1rem 0 1rem !important;}
.btn_red_h46 {height: 40px; font-size: 13px; line-height: 40px; padding: 0 1rem 0 1rem !important;}
.btn_blue_h46:hover {height: 40px; font-size: 13px; line-height: 40px; padding: 0 1rem 0 1rem !important;}
.btn_skyblue_h46:hover {height: 40px; font-size: 13px; line-height: 40px; padding: 0 1rem 0 1rem !important;}
.btn_red_h46:hover {height: 40px; font-size: 13px; line-height: 40px; padding: 0 1rem 0 1rem !important;}
.btn_blue_h32 {height: 28px; font-size: 13px; line-height: 28px;}
.btn_skyblue_h32 {height: 28px; font-size: 13px; line-height: 28px;}
.btn_red_h32 {height: 28px; font-size: 13px; line-height: 28px;}
.btn_blue_h32 {height: 28px; font-size: 13px; line-height: 28px; padding: 0 1rem 0 1rem !important;}
.btn_skyblue_h32 {height: 28px; font-size: 13px; line-height: 28px; padding: 0 1rem 0 1rem !important;}
.btn_red_h32 {height: 28px; font-size: 13px; line-height: 28px; padding: 0 1rem 0 1rem !important;}
.btn_blue_h32:hover {height: 28px; font-size: 13px; line-height: 28px; padding: 0 1rem 0 1rem !important;}
.btn_skyblue_h32:hover {height: 28px; font-size: 13px; line-height: 28px; padding: 0 1rem 0 1rem !important;}
.btn_red_h32:hover {height: 28px; font-size: 13px; line-height: 28px; padding: 0 1rem 0 1rem !important;}
.btn_blue_h31 {height: 28px; font-size: 13px; line-height: 28px; padding: 0 1rem 0 1rem !important;}
.btn_skyblue_h31 {height: 28px; font-size: 13px; line-height: 28px; padding: 0 1rem 0 1rem !important;}
.btn_red_h31 {height: 28px; font-size: 13px; line-height: 28px; padding: 0 1rem 0 1rem !important;}
.btn_blue_h31:hover {height: 28px; font-size: 13px; line-height: 28px; padding: 0 1rem 0 1rem !important;}
.btn_skyblue_h31:hover {height: 28px; font-size: 13px; line-height: 28px; padding: 0 1rem 0 1rem !important;}
.btn_red_h31:hover {height: 28px; font-size: 13px; line-height: 28px; padding: 0 1rem 0 1rem !important;}
.btn_blue_h31 {height: 28px; font-size: 13px; line-height: 28px;}
.btn_skyblue_h31 {height: 28px; font-size: 13px; line-height: 28px;}
.btn_red_h31 {height: 28px; font-size: 13px; line-height: 28px;}
.btn_calendar {width: 40px; height: 40px; background-size: contain;}
.btn_upload {height: 40px; font-size: 13px; line-height: 40px;}
.btn_upload span {height: 40px; line-height: 40px;}
@ -454,6 +464,22 @@
.BRD010 .result .list_item > div:nth-child(1) {width: 60%;}
.BRD010 .result .list_item > div:nth-child(2) {width: 40%; padding: 0 0 2px 0; font-weight: 700; text-align: left;}
/* 로그현황 - 파일다운현황 추후 수정 lim */
.BRD011 .head {display: none;}
.BRD011 .result .list_item {padding: 16px 0; border-bottom: 1px solid #dde2e5;}
.BRD011 .result .list_item > div {border-bottom: 0; font-size: 14px;}
.BRD011 .result .list_item > div:nth-child(1) {display: none;}
.BRD011 .result .list_item > div:nth-child(2) {width: 100%; padding: 0 0 2px 0; font-weight: 700; text-align: left;}
.BRD011 .result .list_item > div:nth-child(3),
.BRD011 .result .list_item > div:nth-child(4),
.BRD011 .result .list_item > div:nth-child(5),
.BRD011 .result .list_item > div:nth-child(6) {width: auto; margin-right: 5px; padding: 0;}
.BRD011 .result .list_item > div:nth-child(3)::after,
.BRD011 .result .list_item > div:nth-child(4)::after,
.BRD011 .result .list_item > div:nth-child(5)::after,
.BRD011 .result .list_item > div:nth-child(6)::after {content: ""; display: inline-block; width: 1px; height: 11px; margin-left: 6px; background: #ccc; vertical-align: 0px;}
.BRD011 .result .list_item > div:nth-child(6)::after {content: none;}
.BOARD_USE_LIST .board_view2 dl dt {width: 95px;}
.BOARD_USE_LIST .board_view2 dl:nth-child(2) dd .f_select {width: 100%;}
.BOARD_USE_LIST .board_view2 dl:nth-child(2) dd .f_input2 {width: 100%; margin: 15px 0 0 0;}

View File

@ -1,13 +1,326 @@
import React from 'react';
import React, {useState, useEffect, useCallback, useRef, PureComponent} from 'react';
import { Link, useLocation } from 'react-router-dom';
import {LineChart, Line, XAxis, YAxis, CartesianGrid, Tooltip, Legend, ResponsiveContainer} from 'recharts';
function FileDownloadStatus(props) {
import DatePicker from 'react-datepicker';
import 'react-datepicker/dist/react-datepicker.css';
import { CSVLink } from "react-csv";
import {format, sub} from "date-fns";
import { ko } from 'date-fns/locale';
import * as EgovNet from 'api/egovFetch';
import URL from 'constants/url';
import { default as EgovLeftNav } from 'components/leftmenu/EgovLeftNavAdmin';
import { itemIdxByPage } from 'utils/calc';
function FileConnections(props) {
// console.group("EgovAdminPrivacyList");
// console.log("[Start] EgovAdminPrivacyList ------------------------------");
// console.log("EgovAdminPrivacyList [props] : ", props);
const nowDate = new Date();
const oneMonthAgoDate = sub(nowDate, { months: 1 });
const [start_date, setStartDate] = useState(oneMonthAgoDate);
const [end_date, setEndDate] = useState(nowDate); // new Date()
const location = useLocation();
// console.log("EgovAdminPrivacyList [location] : ", location);
// eslint-disable-next-line no-unused-vars
const [searchCondition, setSearchCondition] = useState(location.state?.searchCondition || {start_date: format(start_date, "yyyy-MM-dd"), end_date: format(end_date, "yyyy-MM-dd")});
const [chartData, setChartData] = useState([]);
const [excelData, setExcelData] = useState([]);
const [listTag, setListTag] = useState([]);
const excelHeaders = [
{ label: "일자", key: "logdt" },
{ label: "설계기준", key: "group10" },
{ label: "표준시방서", key: "group20" },
{ label: "서울특별시", key: "group40" },
{ label: "고속도로공사", key: "group50" },
{ label: "농업생산기반시설", key: "group60" },
{ label: "철도건설공사", key: "group70" },
{ label: "LH", key: "group80" },
{ label: "K-water", key: "group90" },
{ label: "(구)설계기준", key: "groupO2" },
{ label: "(구)표준시방서", key: "groupO3" },
{ label: "(구)전문시방서", key: "groupO4" },
{ label: "(구)훈령.예규.지침", key: "groupO567" }
];
const retrieveList = useCallback((srchCnd) => {
// console.groupCollapsed("EgovAdminUsageList.retrieveList()");
const retrieveListURL = '/admin/logs/file';
const requestOptions = {
method: "POST",
headers: {
'Content-type': 'application/json',
},
body: JSON.stringify(srchCnd)
}
EgovNet.requestFetch(
retrieveListURL,
requestOptions,
(resp) => {
let mutListTag = [];
const resultCnt = parseInt(resp.result.resultCnt);
const currentPageNo = 1; // resp.result.paginationInfo.currentPageNo;
const pageSize = resultCnt; // resp.result.paginationInfo.pageSize;
//
if (resultCnt === 0) {
mutListTag.push(<p className="no_data" key="0">데이터가 없습니다.</p>);
} else {
resp.result.resultList.forEach(function (item, index) {
if (index === 0) mutListTag = []; //
const listIdx = itemIdxByPage(resultCnt, currentPageNo, pageSize, index);
mutListTag.push(
<div key={listIdx} className="list_item">
<div>{item[0]}</div>
<div style={{textAlign: 'right', paddingRight: '10px'}}>{item[1].toLocaleString()}</div>
<div style={{textAlign: 'right', paddingRight: '10px'}}>{item[2].toLocaleString()}</div>
<div style={{textAlign: 'right', paddingRight: '10px'}}>{item[3].toLocaleString()}</div>
<div style={{textAlign: 'right', paddingRight: '10px'}}>{item[4].toLocaleString()}</div>
<div style={{textAlign: 'right', paddingRight: '10px'}}>{item[5].toLocaleString()}</div>
<div style={{textAlign: 'right', paddingRight: '10px'}}>{item[6].toLocaleString()}</div>
<div style={{textAlign: 'right', paddingRight: '10px'}}>{item[7].toLocaleString()}</div>
<div style={{textAlign: 'right', paddingRight: '10px'}}>{item[8].toLocaleString()}</div>
<div style={{textAlign: 'right', paddingRight: '10px'}}>{item[9].toLocaleString()}</div>
<div style={{textAlign: 'right', paddingRight: '10px'}}>{item[10].toLocaleString()}</div>
<div style={{textAlign: 'right', paddingRight: '10px'}}>{item[11].toLocaleString()}</div>
<div style={{textAlign: 'right', paddingRight: '10px'}}>{item[12].toLocaleString()}</div>
</div>
);
});
}
setListTag(mutListTag);
// chart values
let chartDataArray = resp.result.resultList.map((item, index) => ({
logdt: item[0], // Assuming logdt is the x-axis data
"설계기준": item[1], // Assuming menuTitle is the y-axis data
"표준시방서": item[2],
"서울특별시": item[3],
"고속도로공사": item[4],
"농업생산기반시설": item[5],
"철도건설공사": item[6],
"LH": item[7],
"K-water": item[8],
"(구)설계기준": item[9],
"(구)표준시방서": item[10],
"(구)전문시방서": item[11],
"(구)훈령.예규.지침": item[12],
}));
setChartData(chartDataArray);
// excel value
let filteredExcelData = resp.result.resultList.map((item) => ({
logdt: item[0],
group10: item[1],
group20: item[2],
group40: item[3],
group50: item[4],
group60: item[5],
group70: item[6],
group80: item[7],
group90: item[8],
groupO2: item[9],
groupO3: item[10],
groupO4: item[11],
groupO567: item[12]
}));
setExcelData(filteredExcelData);
},
function (resp) {
console.log("err response : ", resp);
}
);
// console.groupEnd("EgovAdminPrivacyList.retrieveList()");
},[listTag]);
const CustomTooltip = ({ active, payload, label }) => {
if (active && payload && payload.length) {
return (
<div className="custom-tooltip">
<p className="intro">파일 다운 현황 [{`${label}`}]</p>
<p className="label">설계기준 : {`${payload[0].value}`}</p>
<p className="label">표준시방서 : {`${payload[1].value}`}</p>
<p className="label">서울특별시 : {`${payload[2].value}`}</p>
<p className="label">고속도로공사 : {`${payload[3].value}`}</p>
<p className="label">농업생산기반시설 : {`${payload[4].value}`}</p>
<p className="label">철도건설공사 : {`${payload[5].value}`}</p>
<p className="label">LH : {`${payload[6].value}`}</p>
<p className="label">K-water : {`${payload[7].value}`}</p>
<p className="label">()설계기준 : {`${payload[8].value}`}</p>
<p className="label">()표준시방서 : {`${payload[9].value}`}</p>
<p className="label">()전문시방서 : {`${payload[10].value}`}</p>
<p className="label">()훈령.예규.지침 : {`${payload[11].value}`}</p>
</div>
);
}
return null;
};
useEffect(() => {
retrieveList(searchCondition);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [start_date, end_date]);
// console.log("------------------------------EgovAdminPrivacyList [End]");
// console.groupEnd("EgovAdminPrivacyList");
return (
<div className="container">
FileDownloadStatus
<div className="c_wrap">
{/* <!-- Location --> */}
<div className="location">
<ul>
<li><Link to={URL.MAIN} className="home">Home</Link></li>
<li><Link to={URL.ADMIN} >사이트관리</Link></li>
<li>로그현황</li>
<li>파일 다운 현황</li>
</ul>
</div>
{/* <!--// Location --> */}
<div className="layout">
{/* <!-- Navigation --> */}
<EgovLeftNav></EgovLeftNav>
{/* <!--// Navigation --> */}
<div className="contents NOTICE_LIST" id="contents">
{/* <!-- 본문 --> */}
<div className="top_tit">
<h1 className="tit_1">파일 다운 현황</h1>
</div>
{/* <!-- 검색조건 --> */}
<div className="condition">
<ul>
<li className="half L">
<DatePicker
dateFormat='yyyy-MM-dd' //
shouldCloseOnSelect // datepicker
minDate={new Date('2017-01-01')} // minDate
maxDate={new Date()} // maxDate
selected={start_date}
locale={ko}
className="f_input1 al_c"
selectsStart
startDate={start_date}
endDate={end_date}
onChange={(date) => {
setStartDate(date);
setSearchCondition({
start_date: format(date, "yyyy-MM-dd"),
end_date: format(end_date, "yyyy-MM-dd")
});
}}
/> -
</li>
<li className="half R">
<DatePicker
dateFormat='yyyy-MM-dd' //
shouldCloseOnSelect // datepicker
minDate={new Date('2017-01-01')} // minDate
maxDate={new Date()} // maxDate
selected={end_date}
locale={ko}
className="f_input1 al_c"
selectsEnd
startDate={start_date}
endDate={end_date}
onChange={(date) => {
setEndDate(date);
setSearchCondition({
start_date: format(start_date, "yyyy-MM-dd"),
end_date: format(date, "yyyy-MM-dd")
});
}}
/>
{/*<button type="button" className="btn btn_blue_h32 ms-2" onClick={getExcelData}>엑셀 다운로드</button> */}
<CSVLink data={excelData}
headers={excelHeaders}
filename={"파일 다운 현황.csv"}
target="_blank"
className="btn btn_blue_h32 ms-2"
separator={";"}
>CSV </CSVLink>
</li>
</ul>
</div>
{/* <!--// 검색조건 --> */}
{/* <!-- 목록 --> */}
<div className="board_list BRD011">
<div className="head">
<span>일자</span>
<span>설계기준</span>
<span>표준시방서</span>
<span>서울특별시</span>
<span>고속도로공사</span>
<span>농업생산기반시설</span>
<span>철도건설공사</span>
<span>LH</span>
<span>K-water</span>
<span>()설계기준</span>
<span>()표준시방서</span>
<span>()전문시방서</span>
<span>()훈령.예규.지침</span>
</div>
<div className="result">
{listTag}
</div>
</div>
<div className="">
<ResponsiveContainer width="100%" height={477}>
<LineChart data={chartData}
height={477}
margin={{
top: 5,
right: 0,
left: 0,
bottom: 0,
}}
>
<CartesianGrid strokeDasharray="3 3" />
<XAxis type="category" dataKey="logdt" tick={{ fontSize: 10, whiteSpace: 'nowrap' }} />
<YAxis type="number" />
<Tooltip content={<CustomTooltip/>} />
<Legend />
<Line type="monotone" dataKey="설계기준" stroke="#87CEFA" />
<Line type="monotone" dataKey="표준시방서" stroke="#82ca9d" />
<Line type="monotone" dataKey="서울특별시" stroke="#8884d8" />
<Line type="monotone" dataKey="고속도로공사" stroke="#87B17A" />
<Line type="monotone" dataKey="농업생산기반시설" stroke="#F2857A" />
<Line type="monotone" dataKey="철도건설공사" stroke="#F6C86B" />
<Line type="monotone" dataKey="LH" stroke="#EA3322" />
<Line type="monotone" dataKey="K-water" stroke="#333" />
<Line type="monotone" dataKey="(구)설계기준" stroke="#F5C2CB" />
<Line type="monotone" dataKey="(구)표준시방서" stroke="#3B86F6" />
<Line type="monotone" dataKey="(구)전문시방서" stroke="#9CDE54" />
<Line type="monotone" dataKey="(구)훈령.예규.지침" stroke="#008080" />
</LineChart>
</ResponsiveContainer>
</div>
{/* <!--// 목록 --> */}
{/* <!--// 본문 --> */}
</div>
</div>
</div>
</div>
);
}
export default FileDownloadStatus;
export default FileConnections;

View File

@ -2,6 +2,7 @@ package com.dbnt.kcscbackend.admin.logs;
import com.dbnt.kcscbackend.admin.logs.entity.TnDailyMenuLog;
import com.dbnt.kcscbackend.admin.logs.entity.ThPrivacyLog;
import com.dbnt.kcscbackend.admin.logs.service.AdminFileService;
import com.dbnt.kcscbackend.admin.logs.service.AdminMenuService;
import com.dbnt.kcscbackend.admin.logs.service.AdminLogsService;
import com.dbnt.kcscbackend.admin.logs.service.AdminUserService;
@ -35,6 +36,7 @@ public class AdminLogsController extends BaseController {
private final AdminMenuService adminMenuService;
private final AdminUserService adminUserService;
private final AdminLogsService adminLogsService;
private final AdminFileService adminFileService;
@Operation(
summary = "로그현황 - 메뉴별 접속현황",
@ -93,6 +95,7 @@ public class AdminLogsController extends BaseController {
return resultVO;
}
@Operation(
summary = "로그현황 - 개인정보 로그",
description = "개인정보 로그현황",
@ -120,4 +123,32 @@ public class AdminLogsController extends BaseController {
return resultVO;
}
@Operation(
summary = "로그현황 - 파일 다운 현황",
description = "파일 다운 현황",
tags = {"AdminLogsController"}
)
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "조회 성공"),
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님")
})
@RequestMapping(method = RequestMethod.POST, value = "/file", consumes = MediaType.APPLICATION_JSON_VALUE)
public ResultVO FileListCount(@RequestBody Map<String, String> dateRange,
@AuthenticationPrincipal LoginVO user)
throws Exception {
ResultVO resultVO = new ResultVO();
Map<String, Object> resultMap = new HashMap<>();
String startDate = dateRange.get("start_date");
String endDate = dateRange.get("end_date");
resultMap.put("resultCnt", adminFileService.selectFileCountCnt(startDate, endDate));
resultMap.put("resultList", adminFileService.selectFileCount(startDate, endDate));
resultVO.setResultCode(ResponseCode.SUCCESS.getCode());
resultVO.setResultMessage(ResponseCode.SUCCESS.getMessage());
resultVO.setResult(resultMap);
return resultVO;
}
}

View File

@ -0,0 +1,34 @@
package com.dbnt.kcscbackend.admin.logs.entity;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.Accessors;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.springframework.format.annotation.DateTimeFormat;
import javax.persistence.*;
import java.time.LocalDate;
import java.awt.*;
@Getter
@Setter
@Accessors(chain = true)
@Entity
@NoArgsConstructor
@DynamicInsert
@DynamicUpdate
@Table(name = "th_attach_file_log")
public class ThAttachFileLog {
@Id
@Column(name = "file_log_seq")
private Long fileLogSeq;
@Column(name = "access_type")
private Long accessType;
@Column(name = "access_dt")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate accessDt;
}

View File

@ -0,0 +1,37 @@
package com.dbnt.kcscbackend.admin.logs.repository;
import com.dbnt.kcscbackend.admin.logs.entity.ThAttachFileLog;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import java.util.List;
public interface FileLogsRepository extends JpaRepository<ThAttachFileLog, Long> {
@Query(value = "SELECT COUNT(DISTINCT TO_CHAR(access_dt, 'YYYY-MM-DD')) "
+ "FROM th_attach_file_log "
+ "WHERE access_dt BETWEEN TO_DATE(:startDate, 'YYYY-MM-DD') AND TO_DATE(:endDate, 'YYYY-MM-DD')", nativeQuery = true)
long countDistinctFileIds(@Param("startDate") String startDate, @Param("endDate") String endDate);
@Query(value = "SELECT TO_CHAR(access_dt, 'YYYY-MM-DD') as log_dt,"
+ " COUNT(CASE WHEN group_cur_cd = '10' THEN 1 ELSE NULL END) AS Code10Cnt,"
+ " COUNT(CASE WHEN group_cur_cd = '20' THEN 1 ELSE NULL END) AS Code20Cnt,"
+ " COUNT(CASE WHEN group_cur_cd = '40' THEN 1 ELSE NULL END) AS Code40Cnt,"
+ " COUNT(CASE WHEN group_cur_cd = '50' THEN 1 ELSE NULL END) AS Code50Cnt,"
+ " COUNT(CASE WHEN group_cur_cd = '60' THEN 1 ELSE NULL END) AS Code60Cnt,"
+ " COUNT(CASE WHEN group_cur_cd = '70' THEN 1 ELSE NULL END) AS Code70Cnt,"
+ " COUNT(CASE WHEN group_cur_cd = '80' THEN 1 ELSE NULL END) AS Code80Cnt,"
+ " COUNT(CASE WHEN group_cur_cd = '90' THEN 1 ELSE NULL END) AS Code90Cnt,"
+ " COUNT(CASE WHEN group_cur_cd = 'O2' THEN 1 ELSE NULL END) AS CodeO2Cnt,"
+ " COUNT(CASE WHEN group_cur_cd = 'O3' THEN 1 ELSE NULL END) AS CodeO3Cnt,"
+ " COUNT(CASE WHEN group_cur_cd = 'O4' THEN 1 ELSE NULL END) AS CodeO4Cnt,"
+ " COUNT(CASE WHEN group_cur_cd IN ('O5', 'O6', 'O7') THEN 1 ELSE NULL END) AS CodeO5Cnt "
+ "FROM th_attach_file_log "
+ "WHERE access_dt BETWEEN TO_DATE(:startDate, 'YYYY-MM-DD') AND TO_DATE(:endDate, 'YYYY-MM-DD') "
+ "GROUP BY TO_CHAR(access_dt, 'YYYY-MM-DD') "
+ "ORDER BY log_dt asc", nativeQuery = true)
List<Object[]> selectCountFile(@Param("startDate") String startDate, @Param("endDate") String endDate);
}

View File

@ -0,0 +1,25 @@
package com.dbnt.kcscbackend.admin.logs.service;
import com.dbnt.kcscbackend.admin.logs.repository.FileLogsRepository;
import lombok.RequiredArgsConstructor;
import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
@RequiredArgsConstructor
public class AdminFileService extends EgovAbstractServiceImpl {
private final FileLogsRepository fileLogsRepository;
// 파일 다운 횟수
public List<Object[]> selectFileCount(String startDate, String endDate) {
return fileLogsRepository.selectCountFile(startDate, endDate);
}
// 전체 레코드 수 가져오기
public long selectFileCountCnt(String startDate, String endDate) {
return fileLogsRepository.countDistinctFileIds(startDate, endDate);
}
}