Compare commits
6 Commits
0ea10e7313
...
3a8f9f700e
| Author | SHA1 | Date |
|---|---|---|
|
|
3a8f9f700e | |
|
|
2c7604f3fa | |
|
|
65b0154477 | |
|
|
ca9dd81dc1 | |
|
|
d2901908c8 | |
|
|
1857be50ee |
|
|
@ -23,7 +23,7 @@ const AnalyticEcommerce = ({ color, title, count, percentage, isLoss, extra }) =
|
||||||
{count}
|
{count}
|
||||||
</Typography>
|
</Typography>
|
||||||
</Grid>
|
</Grid>
|
||||||
{percentage && (
|
{percentage !== undefined && (
|
||||||
<Grid item>
|
<Grid item>
|
||||||
<Chip
|
<Chip
|
||||||
variant="combined"
|
variant="combined"
|
||||||
|
|
|
||||||
|
|
@ -31,28 +31,30 @@ function EgovLeftNavAdmin(props) {
|
||||||
activeKey = "5";
|
activeKey = "5";
|
||||||
} else if (activeFolder === "logs") {
|
} else if (activeFolder === "logs") {
|
||||||
activeKey = "6";
|
activeKey = "6";
|
||||||
} else {
|
|
||||||
activeKey = "7";
|
|
||||||
}
|
}
|
||||||
|
// else {
|
||||||
|
// activeKey = "7";
|
||||||
|
// }
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="nav">
|
<div className="nav">
|
||||||
<div className="inner">
|
<div className="inner">
|
||||||
<h2 className={"nav_title"}>사이트관리</h2>
|
<h2 className={"nav_title"}>사이트관리
|
||||||
|
<NavLink to={URL.ADMIN_SCHEDULE} className={({ isActive }) => (isActive ? "cur" : "")}><h6 className={"nav_subtitle"}>Dashboard</h6></NavLink></h2>
|
||||||
<Accordion defaultActiveKey={activeKey}>
|
<Accordion defaultActiveKey={activeKey}>
|
||||||
<Accordion.Item eventKey={"7"}>
|
{/*<Accordion.Item eventKey={"7"}>*/}
|
||||||
<Accordion.Header>사이트 관리</Accordion.Header>
|
{/* <Accordion.Header>사이트 관리</Accordion.Header>*/}
|
||||||
<Accordion.Body>
|
{/* <Accordion.Body>*/}
|
||||||
<ul className="menu4">
|
{/* <ul className="menu4">*/}
|
||||||
<li><NavLink to={URL.ADMIN_SCHEDULE} className={({ isActive }) => (isActive ? "cur" : "")}>Dashboard</NavLink></li>
|
{/* <li><NavLink to={URL.ADMIN_SCHEDULE} className={({ isActive }) => (isActive ? "cur" : "")}>Dashboard</NavLink></li>*/}
|
||||||
{/*<li><NavLink to={URL.ADMIN_BOARD} className={({ isActive }) => (isActive ? "cur" : "")}>게시판생성관리</NavLink></li>
|
{/* /!*<li><NavLink to={URL.ADMIN_BOARD} className={({ isActive }) => (isActive ? "cur" : "")}>게시판생성관리</NavLink></li>*/}
|
||||||
<li><NavLink to={URL.ADMIN_USAGE} className={({ isActive }) => (isActive ? "cur" : "")}>게시판사용관리</NavLink></li>
|
{/* <li><NavLink to={URL.ADMIN_USAGE} className={({ isActive }) => (isActive ? "cur" : "")}>게시판사용관리</NavLink></li>*/}
|
||||||
<li><NavLink to={URL.ADMIN_NOTICE} className={({ isActive }) => (isActive ? "cur" : "")}>공지사항관리</NavLink></li>
|
{/* <li><NavLink to={URL.ADMIN_NOTICE} className={({ isActive }) => (isActive ? "cur" : "")}>공지사항관리</NavLink></li>*/}
|
||||||
<li><NavLink to={URL.ADMIN_GALLERY} className={({ isActive }) => (isActive ? "cur" : "")}>사이트갤러리관리</NavLink></li>
|
{/* <li><NavLink to={URL.ADMIN_GALLERY} className={({ isActive }) => (isActive ? "cur" : "")}>사이트갤러리관리</NavLink></li>*/}
|
||||||
<li><NavLink to={URL.ADMIN_MANAGER} className={({ isActive }) => (isActive ? "cur" : "")}>사이트관리자 암호변경</NavLink></li>*/}
|
{/* <li><NavLink to={URL.ADMIN_MANAGER} className={({ isActive }) => (isActive ? "cur" : "")}>사이트관리자 암호변경</NavLink></li>*!/*/}
|
||||||
</ul>
|
{/* </ul>*/}
|
||||||
</Accordion.Body>
|
{/* </Accordion.Body>*/}
|
||||||
</Accordion.Item>
|
{/*</Accordion.Item>*/}
|
||||||
<Accordion.Item eventKey={"0"}>
|
<Accordion.Item eventKey={"0"}>
|
||||||
<Accordion.Header>환경설정</Accordion.Header>
|
<Accordion.Header>환경설정</Accordion.Header>
|
||||||
<Accordion.Body>
|
<Accordion.Body>
|
||||||
|
|
@ -82,7 +84,7 @@ function EgovLeftNavAdmin(props) {
|
||||||
<ul className="menu4">
|
<ul className="menu4">
|
||||||
<li><NavLink to={URL.ADMIN__BOARDS__LIST} className={({ isActive }) => (isActive ? "cur" : "")}>게시판 관리</NavLink></li>
|
<li><NavLink to={URL.ADMIN__BOARDS__LIST} className={({ isActive }) => (isActive ? "cur" : "")}>게시판 관리</NavLink></li>
|
||||||
<li><NavLink to={URL.ADMIN__BOARDS__POSTS} className={({ isActive }) => (isActive ? "cur" : "")}>게시물 관리</NavLink></li>
|
<li><NavLink to={URL.ADMIN__BOARDS__POSTS} className={({ isActive }) => (isActive ? "cur" : "")}>게시물 관리</NavLink></li>
|
||||||
<li><NavLink to={URL.ADMIN__BOARDS__KEYWORDS} className={({ isActive }) => (isActive ? "cur" : "")}>키워드 관리</NavLink></li>
|
{/*<li><NavLink to={URL.ADMIN__BOARDS__KEYWORDS} className={({ isActive }) => (isActive ? "cur" : "")}>키워드 관리</NavLink></li>*/}
|
||||||
</ul>
|
</ul>
|
||||||
</Accordion.Body>
|
</Accordion.Body>
|
||||||
</Accordion.Item>
|
</Accordion.Item>
|
||||||
|
|
@ -91,7 +93,7 @@ function EgovLeftNavAdmin(props) {
|
||||||
<Accordion.Header>건설기준관리</Accordion.Header>
|
<Accordion.Header>건설기준관리</Accordion.Header>
|
||||||
<Accordion.Body>
|
<Accordion.Body>
|
||||||
<ul className="menu4">
|
<ul className="menu4">
|
||||||
<li><NavLink to={URL.ADMIN__STANDARDS__REFERENCE_CODES} className={({ isActive }) => (isActive ? "cur" : "")}>참조코드 관리</NavLink></li>
|
{/*<li><NavLink to={URL.ADMIN__STANDARDS__REFERENCE_CODES} className={({ isActive }) => (isActive ? "cur" : "")}>참조코드 관리</NavLink></li>*/}
|
||||||
<li><NavLink to={URL.ADMIN__STANDARDS__API_KYES} className={({ isActive }) => (isActive ? "cur" : "")}>API KEY 관리</NavLink></li>
|
<li><NavLink to={URL.ADMIN__STANDARDS__API_KYES} className={({ isActive }) => (isActive ? "cur" : "")}>API KEY 관리</NavLink></li>
|
||||||
<li><NavLink to={URL.ADMIN__STANDARDS__SIMILARITY_CHECK} className={({ isActive }) => (isActive ? "cur" : "")}>유사성 검사</NavLink></li>
|
<li><NavLink to={URL.ADMIN__STANDARDS__SIMILARITY_CHECK} className={({ isActive }) => (isActive ? "cur" : "")}>유사성 검사</NavLink></li>
|
||||||
<li><NavLink to={URL.ADMIN__STANDARDS__INFO_DISCLOSURE} className={({ isActive }) => (isActive ? "cur" : "")}>건설기준 내용 관리</NavLink></li>
|
<li><NavLink to={URL.ADMIN__STANDARDS__INFO_DISCLOSURE} className={({ isActive }) => (isActive ? "cur" : "")}>건설기준 내용 관리</NavLink></li>
|
||||||
|
|
@ -127,7 +129,7 @@ function EgovLeftNavAdmin(props) {
|
||||||
<ul className="menu4">
|
<ul className="menu4">
|
||||||
<li><NavLink to={URL.ADMIN__LOGS__MENU_ACCESS_INFO} className={({ isActive }) => (isActive ? "cur" : "")}>메뉴별 접속 현황</NavLink></li>
|
<li><NavLink to={URL.ADMIN__LOGS__MENU_ACCESS_INFO} className={({ isActive }) => (isActive ? "cur" : "")}>메뉴별 접속 현황</NavLink></li>
|
||||||
<li><NavLink to={URL.ADMIN__LOGS__USER_CONNECTIONS} className={({ isActive }) => (isActive ? "cur" : "")}>사용자 접속 현황</NavLink></li>
|
<li><NavLink to={URL.ADMIN__LOGS__USER_CONNECTIONS} className={({ isActive }) => (isActive ? "cur" : "")}>사용자 접속 현황</NavLink></li>
|
||||||
<li><NavLink to={URL.ADMIN__LOGS__PRIVACY_LOGS} className={({ isActive }) => (isActive ? "cur" : "")}>개인정보 로그</NavLink></li>
|
<li><NavLink to={URL.ADMIN__LOGS__PRIVACY_LOGS} className={({ isActive }) => (isActive ? "cur" : "")}>개인정보 로그 현황</NavLink></li>
|
||||||
<li><NavLink to={URL.ADMIN__LOGS__FILE_DOWNLOAD_STATUS} className={({ isActive }) => (isActive ? "cur" : "")}>파일 다운 현황</NavLink></li>
|
<li><NavLink to={URL.ADMIN__LOGS__FILE_DOWNLOAD_STATUS} className={({ isActive }) => (isActive ? "cur" : "")}>파일 다운 현황</NavLink></li>
|
||||||
</ul>
|
</ul>
|
||||||
</Accordion.Body>
|
</Accordion.Body>
|
||||||
|
|
|
||||||
|
|
@ -115,13 +115,15 @@ function ListCreateUpdateDelete(props) {
|
||||||
</Grid>
|
</Grid>
|
||||||
</Typography>
|
</Typography>
|
||||||
<Demo>
|
<Demo>
|
||||||
<List dense={false} sx={{ px: 0, '&': { height: '253px', overflowY: 'auto'}}}>
|
<List dense={false} sx={{ px: 0, '&': { minHeight: '315px', height: '650px', overflowY: 'auto'}}}>
|
||||||
{generate(
|
{generate(
|
||||||
props.items,
|
props.items,
|
||||||
<ListItem
|
<ListItem
|
||||||
secondaryAction={
|
secondaryAction={
|
||||||
<div>
|
<div>
|
||||||
<IconButton sx={{ mx: 0 }} edge="start" aria-label="edit" onClick={(e)=> {alert('수정 클릭')}}>
|
<IconButton sx={{ mx: 0 }} edge="start" aria-label="edit" onClick={(e)=> {
|
||||||
|
props.setIsPopupOpen(true);
|
||||||
|
}}>
|
||||||
<EditIcon />
|
<EditIcon />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
<IconButton edge="end" aria-label="delete" onClick={(e)=> {
|
<IconButton edge="end" aria-label="delete" onClick={(e)=> {
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,9 @@ function CommitteeCodeMgt(props) {
|
||||||
|
|
||||||
const [confirm, setConfirm] = React.useState();
|
const [confirm, setConfirm] = React.useState();
|
||||||
|
|
||||||
|
const [editCreateMode, setEditCreateMode] = React.useState(); // 생성 or 수정 여부
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 위원회 코드 등록 팝업을 보이거나 닫는다.
|
// 위원회 코드 등록 팝업을 보이거나 닫는다.
|
||||||
const [isCommitteeCodeRegistrationPopupOpen, setIsCommitteeCodeRegistrationPopupOpen] = React.useState(false);
|
const [isCommitteeCodeRegistrationPopupOpen, setIsCommitteeCodeRegistrationPopupOpen] = React.useState(false);
|
||||||
|
|
@ -324,7 +327,7 @@ function CommitteeCodeMgt(props) {
|
||||||
/>
|
/>
|
||||||
|
|
||||||
</Box>
|
</Box>
|
||||||
{ true &&
|
{ false &&
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
|
|
|
||||||
|
|
@ -323,7 +323,7 @@ function EgovAdminDashboard(props) {
|
||||||
<Grid item xs={12} md={7} lg={8}>
|
<Grid item xs={12} md={7} lg={8}>
|
||||||
<Grid container alignItems="center" justifyContent="space-between">
|
<Grid container alignItems="center" justifyContent="space-between">
|
||||||
<Grid item>
|
<Grid item>
|
||||||
<Typography variant="h5">최근 문의사항</Typography>
|
<Typography variant="h5">미답변 문의사항</Typography>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item />
|
<Grid item />
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,13 @@
|
||||||
import React, {useEffect, useState} from "react";
|
import React from "react";
|
||||||
|
import { SERVER_URL } from 'config';
|
||||||
import {Button, Modal, Nav} from "react-bootstrap";
|
import {Button, Modal, Nav} from "react-bootstrap";
|
||||||
import Col from "react-bootstrap/Col";
|
|
||||||
import Row from "react-bootstrap/Row";
|
|
||||||
import * as EgovNet from "api/egovFetch";
|
|
||||||
|
|
||||||
|
|
||||||
function HistoryModal({closeFn, standardCode}){
|
function HistoryModal({closeFn, standardCode}){
|
||||||
|
|
||||||
|
function fileDownload(fileSeq){
|
||||||
|
window.open(encodeURI(SERVER_URL+'/file/download?fileSeq='+fileSeq));
|
||||||
|
}
|
||||||
|
|
||||||
return(
|
return(
|
||||||
<>
|
<>
|
||||||
<Modal.Header closeButton>
|
<Modal.Header closeButton>
|
||||||
|
|
@ -28,10 +29,12 @@ function HistoryModal({closeFn, standardCode}){
|
||||||
<div className="list_item">
|
<div className="list_item">
|
||||||
<div className="mainCategory">{history.rvsnYmd.split('T')[0]}</div>
|
<div className="mainCategory">{history.rvsnYmd.split('T')[0]}</div>
|
||||||
<div className="middleCategory">
|
<div className="middleCategory">
|
||||||
<Button size={"sm"} variant={"outline-secondary"}>다운로드</Button>
|
{history.docFileGrpId}
|
||||||
|
{history.docFileGrpId?<Button size={"sm"} variant={"outline-secondary"} onClick={()=>fileDownload(history.docFileGrpId)}>다운로드 </Button>:''}
|
||||||
</div>
|
</div>
|
||||||
<div className="kcscCd">
|
<div className="kcscCd">
|
||||||
<Button size={"sm"} variant={"outline-secondary"}>다운로드</Button>
|
{history.rvsnFileGrpId}
|
||||||
|
{history.rvsnFileGrpId?<Button size={"sm"} variant={"outline-secondary"} onClick={()=>fileDownload(history.rvsnFileGrpId)}>다운로드 </Button>:''}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,11 @@ public interface DashboardRepository extends JpaRepository<TnDailyMenuLog, Long>
|
||||||
") " +
|
") " +
|
||||||
"SELECT " +
|
"SELECT " +
|
||||||
" this_month_cnt, " +
|
" this_month_cnt, " +
|
||||||
" ROUND(((CAST(this_month_cnt AS NUMERIC) - last_month_cnt) / last_month_cnt * 100), 1) AS ratio, " +
|
" CASE " +
|
||||||
|
" WHEN last_month_cnt = 0 AND this_month_cnt = 0 THEN 0" +
|
||||||
|
" WHEN last_month_cnt = 0 THEN 100" +
|
||||||
|
" ELSE ROUND(((CAST(this_month_cnt AS NUMERIC) - last_month_cnt) / last_month_cnt * 100), 1)" +
|
||||||
|
" END AS ratio, " +
|
||||||
" last_month_cnt " +
|
" last_month_cnt " +
|
||||||
"FROM this_month_logs, last_month_logs", nativeQuery = true)
|
"FROM this_month_logs, last_month_logs", nativeQuery = true)
|
||||||
List<Object[]> ConnMonthlyCount();
|
List<Object[]> ConnMonthlyCount();
|
||||||
|
|
@ -44,7 +48,11 @@ public interface DashboardRepository extends JpaRepository<TnDailyMenuLog, Long>
|
||||||
") " +
|
") " +
|
||||||
"SELECT " +
|
"SELECT " +
|
||||||
" this_month_cnt, " +
|
" this_month_cnt, " +
|
||||||
" ROUND(((CAST(this_month_cnt AS NUMERIC) - last_month_cnt) / last_month_cnt * 100), 1) AS ratio, " +
|
" CASE " +
|
||||||
|
" WHEN last_month_cnt = 0 AND this_month_cnt = 0 THEN 0" +
|
||||||
|
" WHEN last_month_cnt = 0 THEN 100" +
|
||||||
|
" ELSE ROUND(((CAST(this_month_cnt AS NUMERIC) - last_month_cnt) / last_month_cnt * 100), 1) " +
|
||||||
|
" END AS ratio, " +
|
||||||
" last_month_cnt " +
|
" last_month_cnt " +
|
||||||
"FROM this_month_logs, last_month_logs", nativeQuery = true)
|
"FROM this_month_logs, last_month_logs", nativeQuery = true)
|
||||||
List<Object[]> DocuMonthlyCount();
|
List<Object[]> DocuMonthlyCount();
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ import org.springframework.format.annotation.DateTimeFormat;
|
||||||
import javax.persistence.*;
|
import javax.persistence.*;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
|
|
@ -22,13 +23,26 @@ import java.awt.*;
|
||||||
@Table(name = "th_attach_file_log")
|
@Table(name = "th_attach_file_log")
|
||||||
public class ThAttachFileLog {
|
public class ThAttachFileLog {
|
||||||
@Id
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
@Column(name = "file_log_seq")
|
@Column(name = "file_log_seq")
|
||||||
private Long fileLogSeq;
|
private Long fileLogSeq;
|
||||||
|
|
||||||
|
@Column(name = "file_seq")
|
||||||
|
private Long fileSeq;
|
||||||
|
|
||||||
@Column(name = "access_type")
|
@Column(name = "access_type")
|
||||||
private Long accessType;
|
private String accessType;
|
||||||
|
|
||||||
|
@Column(name = "access_id")
|
||||||
|
private String accessId;
|
||||||
|
|
||||||
@Column(name = "access_dt")
|
@Column(name = "access_dt")
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private LocalDate accessDt;
|
private LocalDateTime accessDt;
|
||||||
|
|
||||||
|
@Column(name = "ip_address")
|
||||||
|
private String ipAddress;
|
||||||
|
|
||||||
|
@Column(name = "group_cur_cd")
|
||||||
|
private String groupCurCd;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import com.dbnt.kcscbackend.admin.logs.repository.FileLogsRepository;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl;
|
import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
@ -22,4 +23,9 @@ public class AdminFileService extends EgovAbstractServiceImpl {
|
||||||
return fileLogsRepository.countDistinctFileIds(startDate, endDate);
|
return fileLogsRepository.countDistinctFileIds(startDate, endDate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public void updateDownloadCnt(String accessId, String ipAddress, String groupCurCd){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -72,16 +72,18 @@ public class CustomUrlAuthenticationSuccessHandler extends SimpleUrlAuthenticati
|
||||||
resultMap.put("resultCode", ResponseCode.SUCCESS.getCode());
|
resultMap.put("resultCode", ResponseCode.SUCCESS.getCode());
|
||||||
resultMap.put("accessToken", accessToken);
|
resultMap.put("accessToken", accessToken);
|
||||||
resultMap.put("refreshToken", refreshToken);
|
resultMap.put("refreshToken", refreshToken);
|
||||||
|
//로그인 로그 기록
|
||||||
|
adminLogsService.insertLoginLog(securityUser.getUserId(), accessIp, accessToken, "Y", ClientUtils.getWebType(request));
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
// 로그인 제한 해제시 주석 해제 및 위 if문 주석처리 할 것.
|
||||||
String accessToken = jwtTokenUtil.generateAccessToken(securityUser, request.getRemoteAddr());
|
String accessToken = jwtTokenUtil.generateAccessToken(securityUser, request.getRemoteAddr());
|
||||||
String refreshToken = jwtTokenUtil.generateRefreshTokenToken(securityUser, request.getRemoteAddr());
|
String refreshToken = jwtTokenUtil.generateRefreshTokenToken(securityUser, request.getRemoteAddr());
|
||||||
resultMap.put("resultCode", ResponseCode.SUCCESS.getCode());
|
resultMap.put("resultCode", ResponseCode.SUCCESS.getCode());
|
||||||
resultMap.put("accessToken", accessToken);
|
resultMap.put("accessToken", accessToken);
|
||||||
resultMap.put("refreshToken", refreshToken);
|
resultMap.put("refreshToken", refreshToken);
|
||||||
|
|
||||||
//로그인 로그 기록
|
|
||||||
adminLogsService.insertLoginLog(securityUser.getUserId(), accessIp, accessToken, "Y", ClientUtils.getWebType(request));
|
adminLogsService.insertLoginLog(securityUser.getUserId(), accessIp, accessToken, "Y", ClientUtils.getWebType(request));
|
||||||
|
*/
|
||||||
|
|
||||||
if (jsonConverter.canWrite(resultMap.getClass(), jsonMimeType)) {
|
if (jsonConverter.canWrite(resultMap.getClass(), jsonMimeType)) {
|
||||||
jsonConverter.write(resultMap, jsonMimeType, new ServletServerHttpResponse(response));
|
jsonConverter.write(resultMap, jsonMimeType, new ServletServerHttpResponse(response));
|
||||||
|
|
|
||||||
|
|
@ -71,6 +71,7 @@ public class SecurityConfig {
|
||||||
|
|
||||||
"/cmm/main/**.do", // 메인페이지
|
"/cmm/main/**.do", // 메인페이지
|
||||||
"/cmm/fms/FileDown.do", //파일 다운로드
|
"/cmm/fms/FileDown.do", //파일 다운로드
|
||||||
|
"/file/download", //파일 다운로드
|
||||||
"/cmm/fms/getImage.do", //갤러리 이미지보기
|
"/cmm/fms/getImage.do", //갤러리 이미지보기
|
||||||
|
|
||||||
"/cop/bbs/selectUserBBSMasterInfAPI.do", //게시판 마스터 상세 조회
|
"/cop/bbs/selectUserBBSMasterInfAPI.do", //게시판 마스터 상세 조회
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package com.dbnt.kcscbackend.file;
|
||||||
import com.dbnt.kcscbackend.config.util.ClientUtils;
|
import com.dbnt.kcscbackend.config.util.ClientUtils;
|
||||||
import com.dbnt.kcscbackend.file.entity.TnAttachFile;
|
import com.dbnt.kcscbackend.file.entity.TnAttachFile;
|
||||||
import com.dbnt.kcscbackend.file.service.FileService;
|
import com.dbnt.kcscbackend.file.service.FileService;
|
||||||
|
import com.dbnt.kcscbackend.standardCode.service.StandardCodeService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.util.FileCopyUtils;
|
import org.springframework.util.FileCopyUtils;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
@ -19,6 +20,7 @@ import java.io.*;
|
||||||
public class FileController {
|
public class FileController {
|
||||||
|
|
||||||
private final FileService fileService;
|
private final FileService fileService;
|
||||||
|
private final StandardCodeService standardCodeService;
|
||||||
|
|
||||||
@RequestMapping(method = RequestMethod.GET, value = "/download")
|
@RequestMapping(method = RequestMethod.GET, value = "/download")
|
||||||
public void download(HttpServletRequest request, HttpServletResponse response, TnAttachFile tnAttachFile) throws Exception{
|
public void download(HttpServletRequest request, HttpServletResponse response, TnAttachFile tnAttachFile) throws Exception{
|
||||||
|
|
@ -43,4 +45,28 @@ public class FileController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequestMapping(method = RequestMethod.GET, value = "/standardCode/download")
|
||||||
|
public void standardCodeDownload(HttpServletRequest request, HttpServletResponse response, TnAttachFile tnAttachFile) throws Exception{
|
||||||
|
|
||||||
|
tnAttachFile = fileService.selectTnAttachFile(tnAttachFile);
|
||||||
|
|
||||||
|
if(tnAttachFile != null){
|
||||||
|
BufferedInputStream in;
|
||||||
|
BufferedOutputStream out;
|
||||||
|
try {
|
||||||
|
File file = new File(tnAttachFile.getFilePath());
|
||||||
|
|
||||||
|
ClientUtils.setDisposition(tnAttachFile.getFileOldName(), request, response);
|
||||||
|
in = new BufferedInputStream(new FileInputStream(file));
|
||||||
|
out = new BufferedOutputStream(response.getOutputStream());
|
||||||
|
FileCopyUtils.copy(in, out);
|
||||||
|
out.flush();
|
||||||
|
if(out!=null) out.close();
|
||||||
|
if(in!=null )in.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -54,4 +54,7 @@ public class TnAttachFile {
|
||||||
@Column(name = "old_seq")
|
@Column(name = "old_seq")
|
||||||
private Integer oldSeq;
|
private Integer oldSeq;
|
||||||
|
|
||||||
|
@Transient
|
||||||
|
private String kcscCd;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import com.dbnt.kcscbackend.file.entity.TnAttachFile;
|
||||||
import com.dbnt.kcscbackend.file.repository.TnAttachFileRepository;
|
import com.dbnt.kcscbackend.file.repository.TnAttachFileRepository;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
|
|
@ -11,13 +12,16 @@ public class FileService {
|
||||||
|
|
||||||
private final TnAttachFileRepository tnAttachFileRepository;
|
private final TnAttachFileRepository tnAttachFileRepository;
|
||||||
|
|
||||||
|
@Transactional
|
||||||
public TnAttachFile selectTnAttachFile(TnAttachFile tnAttachFile) {
|
public TnAttachFile selectTnAttachFile(TnAttachFile tnAttachFile) {
|
||||||
if(tnAttachFile.getFileSeq()!=null){
|
if(tnAttachFile.getFileSeq()!=null){
|
||||||
return tnAttachFileRepository.findById(tnAttachFile.getFileSeq()).orElse(null);
|
tnAttachFile = tnAttachFileRepository.findById(tnAttachFile.getFileSeq()).orElse(null);
|
||||||
}else{
|
}else{
|
||||||
return tnAttachFileRepository.findByFileGrpId(tnAttachFile.getFileGrpId()).orElse(null);
|
tnAttachFile = tnAttachFileRepository.findByFileGrpId(tnAttachFile.getFileGrpId()).orElse(null);
|
||||||
}
|
}
|
||||||
|
int downCnt = tnAttachFile.getDownCnt()==null?0: tnAttachFile.getDownCnt();
|
||||||
|
tnAttachFile.setDownCnt(downCnt+1);
|
||||||
|
tnAttachFileRepository.save(tnAttachFile);
|
||||||
|
return tnAttachFile;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue