Compare commits

..

No commits in common. "d2901908c8ad5232229e5d50660424a3bafde365" and "0ea10e7313c5c8e993e06fc10dc89e7746bcdc85" have entirely different histories.

8 changed files with 17 additions and 76 deletions

View File

@ -1,13 +1,12 @@
import React from "react";
import { SERVER_URL } from 'config';
import React, {useEffect, useState} from "react";
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 fileDownload(fileSeq){
window.open(encodeURI(SERVER_URL+'/file/download?fileSeq='+fileSeq));
}
return(
<>
<Modal.Header closeButton>
@ -29,12 +28,10 @@ function HistoryModal({closeFn, standardCode}){
<div className="list_item">
<div className="mainCategory">{history.rvsnYmd.split('T')[0]}</div>
<div className="middleCategory">
{history.docFileGrpId}
{history.docFileGrpId?<Button size={"sm"} variant={"outline-secondary"} onClick={()=>fileDownload(history.docFileGrpId)}>다운로드 </Button>:''}
<Button size={"sm"} variant={"outline-secondary"}>다운로드</Button>
</div>
<div className="kcscCd">
{history.rvsnFileGrpId}
{history.rvsnFileGrpId?<Button size={"sm"} variant={"outline-secondary"} onClick={()=>fileDownload(history.rvsnFileGrpId)}>다운로드 </Button>:''}
<Button size={"sm"} variant={"outline-secondary"}>다운로드</Button>
</div>
</div>
)

View File

@ -11,7 +11,6 @@ import org.springframework.format.annotation.DateTimeFormat;
import javax.persistence.*;
import java.time.LocalDate;
import java.awt.*;
import java.time.LocalDateTime;
@Getter
@Setter
@ -23,26 +22,13 @@ import java.time.LocalDateTime;
@Table(name = "th_attach_file_log")
public class ThAttachFileLog {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "file_log_seq")
private Long fileLogSeq;
@Column(name = "file_seq")
private Long fileSeq;
@Column(name = "access_type")
private String accessType;
@Column(name = "access_id")
private String accessId;
private Long accessType;
@Column(name = "access_dt")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime accessDt;
@Column(name = "ip_address")
private String ipAddress;
@Column(name = "group_cur_cd")
private String groupCurCd;
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate accessDt;
}

View File

@ -4,7 +4,6 @@ import com.dbnt.kcscbackend.admin.logs.repository.FileLogsRepository;
import lombok.RequiredArgsConstructor;
import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@ -23,9 +22,4 @@ public class AdminFileService extends EgovAbstractServiceImpl {
return fileLogsRepository.countDistinctFileIds(startDate, endDate);
}
@Transactional
public void updateDownloadCnt(String accessId, String ipAddress, String groupCurCd){
}
}

View File

@ -72,18 +72,16 @@ public class CustomUrlAuthenticationSuccessHandler extends SimpleUrlAuthenticati
resultMap.put("resultCode", ResponseCode.SUCCESS.getCode());
resultMap.put("accessToken", accessToken);
resultMap.put("refreshToken", refreshToken);
//로그인 로그 기록
adminLogsService.insertLoginLog(securityUser.getUserId(), accessIp, accessToken, "Y", ClientUtils.getWebType(request));
}
/*
// 로그인 제한 해제시 주석 해제 및 위 if문 주석처리 할 것.
String accessToken = jwtTokenUtil.generateAccessToken(securityUser, request.getRemoteAddr());
String refreshToken = jwtTokenUtil.generateRefreshTokenToken(securityUser, request.getRemoteAddr());
resultMap.put("resultCode", ResponseCode.SUCCESS.getCode());
resultMap.put("accessToken", accessToken);
resultMap.put("refreshToken", refreshToken);
//로그인 로그 기록
adminLogsService.insertLoginLog(securityUser.getUserId(), accessIp, accessToken, "Y", ClientUtils.getWebType(request));
*/
if (jsonConverter.canWrite(resultMap.getClass(), jsonMimeType)) {
jsonConverter.write(resultMap, jsonMimeType, new ServletServerHttpResponse(response));

View File

@ -71,7 +71,6 @@ public class SecurityConfig {
"/cmm/main/**.do", // 메인페이지
"/cmm/fms/FileDown.do", //파일 다운로드
"/file/download", //파일 다운로드
"/cmm/fms/getImage.do", //갤러리 이미지보기
"/cop/bbs/selectUserBBSMasterInfAPI.do", //게시판 마스터 상세 조회

View File

@ -3,7 +3,6 @@ package com.dbnt.kcscbackend.file;
import com.dbnt.kcscbackend.config.util.ClientUtils;
import com.dbnt.kcscbackend.file.entity.TnAttachFile;
import com.dbnt.kcscbackend.file.service.FileService;
import com.dbnt.kcscbackend.standardCode.service.StandardCodeService;
import lombok.RequiredArgsConstructor;
import org.springframework.util.FileCopyUtils;
import org.springframework.web.bind.annotation.RequestMapping;
@ -20,7 +19,6 @@ import java.io.*;
public class FileController {
private final FileService fileService;
private final StandardCodeService standardCodeService;
@RequestMapping(method = RequestMethod.GET, value = "/download")
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();
}
}
}
}

View File

@ -54,7 +54,4 @@ public class TnAttachFile {
@Column(name = "old_seq")
private Integer oldSeq;
@Transient
private String kcscCd;
}

View File

@ -4,7 +4,6 @@ import com.dbnt.kcscbackend.file.entity.TnAttachFile;
import com.dbnt.kcscbackend.file.repository.TnAttachFileRepository;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Service
@RequiredArgsConstructor
@ -12,16 +11,13 @@ public class FileService {
private final TnAttachFileRepository tnAttachFileRepository;
@Transactional
public TnAttachFile selectTnAttachFile(TnAttachFile tnAttachFile) {
if(tnAttachFile.getFileSeq()!=null){
tnAttachFile = tnAttachFileRepository.findById(tnAttachFile.getFileSeq()).orElse(null);
return tnAttachFileRepository.findById(tnAttachFile.getFileSeq()).orElse(null);
}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;
}
}