Compare commits
No commits in common. "d2901908c8ad5232229e5d50660424a3bafde365" and "0ea10e7313c5c8e993e06fc10dc89e7746bcdc85" have entirely different histories.
d2901908c8
...
0ea10e7313
|
|
@ -1,13 +1,12 @@
|
||||||
import React from "react";
|
import React, {useEffect, useState} 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>
|
||||||
|
|
@ -29,12 +28,10 @@ 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">
|
||||||
{history.docFileGrpId}
|
<Button size={"sm"} variant={"outline-secondary"}>다운로드</Button>
|
||||||
{history.docFileGrpId?<Button size={"sm"} variant={"outline-secondary"} onClick={()=>fileDownload(history.docFileGrpId)}>다운로드 </Button>:''}
|
|
||||||
</div>
|
</div>
|
||||||
<div className="kcscCd">
|
<div className="kcscCd">
|
||||||
{history.rvsnFileGrpId}
|
<Button size={"sm"} variant={"outline-secondary"}>다운로드</Button>
|
||||||
{history.rvsnFileGrpId?<Button size={"sm"} variant={"outline-secondary"} onClick={()=>fileDownload(history.rvsnFileGrpId)}>다운로드 </Button>:''}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,6 @@ 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
|
||||||
|
|
@ -23,26 +22,13 @@ import java.time.LocalDateTime;
|
||||||
@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 String accessType;
|
private Long accessType;
|
||||||
|
|
||||||
@Column(name = "access_id")
|
|
||||||
private String accessId;
|
|
||||||
|
|
||||||
@Column(name = "access_dt")
|
@Column(name = "access_dt")
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||||
private LocalDateTime accessDt;
|
private LocalDate accessDt;
|
||||||
|
|
||||||
@Column(name = "ip_address")
|
|
||||||
private String ipAddress;
|
|
||||||
|
|
||||||
@Column(name = "group_cur_cd")
|
|
||||||
private String groupCurCd;
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@ 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;
|
||||||
|
|
||||||
|
|
@ -23,9 +22,4 @@ 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,18 +72,16 @@ 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,7 +71,6 @@ 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,7 +3,6 @@ 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;
|
||||||
|
|
@ -20,7 +19,6 @@ 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{
|
||||||
|
|
@ -45,28 +43,4 @@ 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,7 +54,4 @@ public class TnAttachFile {
|
||||||
@Column(name = "old_seq")
|
@Column(name = "old_seq")
|
||||||
private Integer oldSeq;
|
private Integer oldSeq;
|
||||||
|
|
||||||
@Transient
|
|
||||||
private String kcscCd;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@ 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
|
||||||
|
|
@ -12,16 +11,13 @@ 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){
|
||||||
tnAttachFile = tnAttachFileRepository.findById(tnAttachFile.getFileSeq()).orElse(null);
|
return tnAttachFileRepository.findById(tnAttachFile.getFileSeq()).orElse(null);
|
||||||
}else{
|
}else{
|
||||||
tnAttachFile = tnAttachFileRepository.findByFileGrpId(tnAttachFile.getFileGrpId()).orElse(null);
|
return 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