feat : pms - 3268/3269 [사용자] 저작권 체험교실 > 운영내역목록 > 상세화면 ==> 서약서 / 계획서 업로드
대용량 파일 솔루션 적용 완료 [퍼블 진행중]
This commit is contained in:
parent
c0154540aa
commit
9b27f07475
119
src/main/java/kcc/kccadr/cmm/RestResponse.java
Normal file
119
src/main/java/kcc/kccadr/cmm/RestResponse.java
Normal file
@ -0,0 +1,119 @@
|
||||
package kcc.kccadr.cmm;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.http.HttpStatus;
|
||||
|
||||
import com.mashape.unirest.http.HttpResponse;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @packageName : itn.let.mail.service
|
||||
* @fileName : SuccessResponse.java
|
||||
* @author : 이호영
|
||||
* @date : 2022.07.04
|
||||
* @description : RestApi 응답에 사용할 Class
|
||||
* @TODO : CLASS 위치를 다시 잡아서 사용해야함
|
||||
* ===========================================================
|
||||
* DATE AUTHOR NOTE
|
||||
* ----------------------------------------------------------- *
|
||||
* 2022.07.04 이호영 최초 생성
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* • 1XX : 조건부 응답
|
||||
* • 2XX : 성공
|
||||
* • 3XX : 리다이렉션 완료
|
||||
* • 4XX : 요청 오류
|
||||
* • 500 : 서버 오류
|
||||
*
|
||||
* 참고 : https://km0830.tistory.com/33
|
||||
*
|
||||
* */
|
||||
|
||||
public class RestResponse {
|
||||
|
||||
private HttpStatus status;
|
||||
|
||||
private String data;
|
||||
|
||||
private String dataSub;
|
||||
|
||||
private LocalDateTime timestamp;
|
||||
|
||||
private List<?> dataList;
|
||||
|
||||
public RestResponse(HttpStatus status, String data, LocalDateTime timestamp) {
|
||||
this.status = status;
|
||||
this.data = data;
|
||||
this.timestamp = timestamp;
|
||||
}
|
||||
|
||||
public RestResponse(HttpStatus status, String data, String dataSub, LocalDateTime timestamp) {
|
||||
this.status = status;
|
||||
this.data = data;
|
||||
this.dataSub = dataSub;
|
||||
this.timestamp = timestamp;
|
||||
}
|
||||
|
||||
public RestResponse(HttpStatus status, List<?> dataList, String data, LocalDateTime timestamp) {
|
||||
this.status = status;
|
||||
this.dataList = dataList;
|
||||
this.data = data;
|
||||
this.timestamp = timestamp;
|
||||
}
|
||||
|
||||
public RestResponse(HttpStatus status, List<?> dataList, LocalDateTime timestamp) {
|
||||
this.status = status;
|
||||
this.dataList = dataList;
|
||||
this.timestamp = timestamp;
|
||||
}
|
||||
|
||||
public HttpStatus getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(HttpStatus status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(String data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public LocalDateTime getTimestamp() {
|
||||
return timestamp;
|
||||
}
|
||||
|
||||
public void setTimestamp(LocalDateTime timestamp) {
|
||||
this.timestamp = timestamp;
|
||||
}
|
||||
|
||||
public List<?> getDataList() {
|
||||
return dataList;
|
||||
}
|
||||
|
||||
public void setDataList(List<?> dataList) {
|
||||
this.dataList = dataList;
|
||||
}
|
||||
|
||||
public String getDataSub() {
|
||||
return dataSub;
|
||||
}
|
||||
|
||||
public void setDataSub(String dataSub) {
|
||||
this.dataSub = dataSub;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,96 @@
|
||||
package kcc.kccadr.cmm.innorix.service;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import kcc.com.cmm.ComDefaultVO;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @author : 이호영
|
||||
* @fileName : InnorixVO.java
|
||||
* @date : 2022.11.01
|
||||
* @description : 대용량 파일 등록 솔루션 VO
|
||||
* ===========================================================
|
||||
* DATE AUTHOR NOTE
|
||||
* ----------------------------------------------------------- *
|
||||
* 2022.11.01 이호영 최초 생성
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class AdrInnorixFileVO extends ComDefaultVO implements Serializable {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 4400281789694196418L;
|
||||
|
||||
// 사용자 ID
|
||||
public String uniqId = "";
|
||||
|
||||
// 파일 구분을 위한 타입
|
||||
public String fileType = "";
|
||||
|
||||
// 파일 등록 후 리턴 메세지 jsp에서 넘겨줌
|
||||
public String successMsg = "";
|
||||
public String eduAplctOrd = "";
|
||||
|
||||
|
||||
// private String frstRegistPnttm; //등록일시
|
||||
// private String frstRegisterId; //등록자
|
||||
// private String lastUpdtPnttm; //수정일시
|
||||
// private String lastUpdusrId; //수정자
|
||||
|
||||
public List<InnorixFileVO> innorixFileListVO = new ArrayList<InnorixFileVO>();
|
||||
|
||||
|
||||
|
||||
|
||||
public String getFileType() {
|
||||
return fileType;
|
||||
}
|
||||
|
||||
public void setFileType(String fileType) {
|
||||
this.fileType = fileType;
|
||||
}
|
||||
|
||||
public String getSuccessMsg() {
|
||||
return successMsg;
|
||||
}
|
||||
|
||||
public void setSuccessMsg(String successMsg) {
|
||||
this.successMsg = successMsg;
|
||||
}
|
||||
|
||||
public List<InnorixFileVO> getInnorixFileListVO() {
|
||||
return innorixFileListVO;
|
||||
}
|
||||
|
||||
public void setInnorixFileListVO(List<InnorixFileVO> innorixFileListVO) {
|
||||
this.innorixFileListVO = innorixFileListVO;
|
||||
}
|
||||
|
||||
public String getUniqId() {
|
||||
return uniqId;
|
||||
}
|
||||
|
||||
public void setUniqId(String uniqId) {
|
||||
this.uniqId = uniqId;
|
||||
}
|
||||
|
||||
public String getEduAplctOrd() {
|
||||
return eduAplctOrd;
|
||||
}
|
||||
|
||||
public void setEduAplctOrd(String eduAplctOrd) {
|
||||
this.eduAplctOrd = eduAplctOrd;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,28 @@
|
||||
package kcc.kccadr.cmm.innorix.service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import egovframework.rte.fdl.cmmn.exception.FdlException;
|
||||
import kcc.kccadr.cmm.RestResponse;
|
||||
|
||||
/**
|
||||
* @Class Name : EgovFileMngService.java
|
||||
* @Description : 파일정보의 관리를 위한 서비스 인터페이스
|
||||
* @Modification Information
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- ------- -------------------
|
||||
* 2009. 3. 25. 이삼섭 최초생성
|
||||
*
|
||||
* @author 공통 서비스 개발팀 이삼섭
|
||||
* @since 2009. 3. 25.
|
||||
* @version
|
||||
* @see
|
||||
*
|
||||
*/
|
||||
public interface InnorixFileService {
|
||||
|
||||
RestResponse insertInnorixFile(AdrInnorixFileVO adrInnorixFileVO);
|
||||
|
||||
}
|
||||
180
src/main/java/kcc/kccadr/cmm/innorix/service/InnorixFileVO.java
Normal file
180
src/main/java/kcc/kccadr/cmm/innorix/service/InnorixFileVO.java
Normal file
@ -0,0 +1,180 @@
|
||||
package kcc.kccadr.cmm.innorix.service;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import kcc.com.cmm.ComDefaultVO;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @author : 이호영
|
||||
* @fileName : InnorixVO.java
|
||||
* @date : 2022.11.01
|
||||
* @description : 대용량 파일 등록 솔루션 VO
|
||||
* ===========================================================
|
||||
* DATE AUTHOR NOTE
|
||||
* ----------------------------------------------------------- *
|
||||
* 2022.11.01 이호영 최초 생성
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class InnorixFileVO extends ComDefaultVO implements Serializable {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 5641887401063483713L;
|
||||
|
||||
public String rowID = "";
|
||||
|
||||
public String controlId = "";
|
||||
|
||||
public String uploadUrl = "";
|
||||
|
||||
public String clientFilePath = "";
|
||||
|
||||
public String clientFileName = "";
|
||||
|
||||
public String rootName = "";
|
||||
|
||||
public String fileState = "";
|
||||
|
||||
public Integer fileSize = 0;
|
||||
|
||||
public String serverFilePath = "";
|
||||
|
||||
public String serverFileName = "";
|
||||
|
||||
public Boolean isFolder = null;
|
||||
|
||||
public Boolean firstTransferCompleted = null;
|
||||
|
||||
public Integer totalTransferTime = 0;
|
||||
|
||||
public Integer transferTime = 0;
|
||||
|
||||
private String frstRegistPnttm;
|
||||
|
||||
private String frstRegisterId;
|
||||
|
||||
private String lastUpdtPnttm;
|
||||
|
||||
private String lastUpdusrId;
|
||||
|
||||
|
||||
|
||||
|
||||
public String getRowID() {
|
||||
return rowID;
|
||||
}
|
||||
public void setRowID(String rowID) {
|
||||
this.rowID = rowID;
|
||||
}
|
||||
public String getControlId() {
|
||||
return controlId;
|
||||
}
|
||||
public void setControlId(String controlId) {
|
||||
this.controlId = controlId;
|
||||
}
|
||||
public String getUploadUrl() {
|
||||
return uploadUrl;
|
||||
}
|
||||
public void setUploadUrl(String uploadUrl) {
|
||||
this.uploadUrl = uploadUrl;
|
||||
}
|
||||
public String getClientFilePath() {
|
||||
return clientFilePath;
|
||||
}
|
||||
public void setClientFilePath(String clientFilePath) {
|
||||
this.clientFilePath = clientFilePath;
|
||||
}
|
||||
public String getClientFileName() {
|
||||
return clientFileName;
|
||||
}
|
||||
public void setClientFileName(String clientFileName) {
|
||||
this.clientFileName = clientFileName;
|
||||
}
|
||||
public String getRootName() {
|
||||
return rootName;
|
||||
}
|
||||
public void setRootName(String rootName) {
|
||||
this.rootName = rootName;
|
||||
}
|
||||
public String getFileState() {
|
||||
return fileState;
|
||||
}
|
||||
public void setFileState(String fileState) {
|
||||
this.fileState = fileState;
|
||||
}
|
||||
public Integer getFileSize() {
|
||||
return fileSize;
|
||||
}
|
||||
public void setFileSize(Integer fileSize) {
|
||||
this.fileSize = fileSize;
|
||||
}
|
||||
public String getServerFilePath() {
|
||||
return serverFilePath;
|
||||
}
|
||||
public void setServerFilePath(String serverFilePath) {
|
||||
this.serverFilePath = serverFilePath;
|
||||
}
|
||||
public String getServerFileName() {
|
||||
return serverFileName;
|
||||
}
|
||||
public void setServerFileName(String serverFileName) {
|
||||
this.serverFileName = serverFileName;
|
||||
}
|
||||
public Boolean getIsFolder() {
|
||||
return isFolder;
|
||||
}
|
||||
public void setIsFolder(Boolean isFolder) {
|
||||
this.isFolder = isFolder;
|
||||
}
|
||||
public Boolean getFirstTransferCompleted() {
|
||||
return firstTransferCompleted;
|
||||
}
|
||||
public void setFirstTransferCompleted(Boolean firstTransferCompleted) {
|
||||
this.firstTransferCompleted = firstTransferCompleted;
|
||||
}
|
||||
public Integer getTotalTransferTime() {
|
||||
return totalTransferTime;
|
||||
}
|
||||
public void setTotalTransferTime(Integer totalTransferTime) {
|
||||
this.totalTransferTime = totalTransferTime;
|
||||
}
|
||||
public Integer getTransferTime() {
|
||||
return transferTime;
|
||||
}
|
||||
public void setTransferTime(Integer transferTime) {
|
||||
this.transferTime = transferTime;
|
||||
}
|
||||
public String getFrstRegistPnttm() {
|
||||
return frstRegistPnttm;
|
||||
}
|
||||
public void setFrstRegistPnttm(String frstRegistPnttm) {
|
||||
this.frstRegistPnttm = frstRegistPnttm;
|
||||
}
|
||||
public String getFrstRegisterId() {
|
||||
return frstRegisterId;
|
||||
}
|
||||
public void setFrstRegisterId(String frstRegisterId) {
|
||||
this.frstRegisterId = frstRegisterId;
|
||||
}
|
||||
public String getLastUpdtPnttm() {
|
||||
return lastUpdtPnttm;
|
||||
}
|
||||
public void setLastUpdtPnttm(String lastUpdtPnttm) {
|
||||
this.lastUpdtPnttm = lastUpdtPnttm;
|
||||
}
|
||||
public String getLastUpdusrId() {
|
||||
return lastUpdusrId;
|
||||
}
|
||||
public void setLastUpdusrId(String lastUpdusrId) {
|
||||
this.lastUpdusrId = lastUpdusrId;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,207 @@
|
||||
package kcc.kccadr.cmm.innorix.service.impl;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.dreamsecurity.magicline.util.Log;
|
||||
|
||||
import egovframework.rte.fdl.cmmn.EgovAbstractServiceImpl;
|
||||
import egovframework.rte.fdl.cmmn.exception.FdlException;
|
||||
import egovframework.rte.fdl.idgnr.EgovIdGnrService;
|
||||
import egovframework.rte.fdl.property.EgovPropertyService;
|
||||
import kcc.com.cmm.service.EgovFileMngService;
|
||||
import kcc.com.cmm.service.FileVO;
|
||||
import kcc.com.cmm.service.impl.FileManageDAO;
|
||||
import kcc.kccadr.accdnt.ans.service.AnsVO;
|
||||
import kcc.kccadr.accdnt.ans.service.impl.AnsDAO;
|
||||
import kcc.kccadr.cmm.RestResponse;
|
||||
import kcc.kccadr.cmm.innorix.service.AdrInnorixFileVO;
|
||||
import kcc.kccadr.cmm.innorix.service.InnorixFileService;
|
||||
import kcc.kccadr.cmm.innorix.service.InnorixFileVO;
|
||||
import kcc.let.utl.fcc.service.EgovStringUtil;
|
||||
import kcc.ve.instr.tngrVisitEdu.eduInfo.service.VEEduAplctService;
|
||||
import kcc.ve.instr.tngrVisitEdu.eduInfo.service.VEEduAplctVO;
|
||||
|
||||
/**
|
||||
* @Class Name : EgovCmmUseServiceImpl.java
|
||||
* @Description : 공통코드등 전체 업무에서 공용해서 사용해야 하는 서비스를 정의하기위한 서비스 구현 클래스
|
||||
* @Modification Information
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- ------- -------------------
|
||||
* 2009. 3. 11. 이삼섭
|
||||
*
|
||||
* @author 공통 서비스 개발팀 이삼섭
|
||||
* @since 2009. 3. 11.
|
||||
* @version
|
||||
* @see
|
||||
*
|
||||
*/
|
||||
@Service("InnorixFileService")
|
||||
public class InnorixFileServiceImpl extends EgovAbstractServiceImpl implements InnorixFileService {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(InnorixFileServiceImpl.class);
|
||||
|
||||
|
||||
@Resource(name = "FileManageDAO")
|
||||
private FileManageDAO fileManageDAO;
|
||||
|
||||
@Resource(name = "egovFileIdGnrService")
|
||||
private EgovIdGnrService idgenService;
|
||||
|
||||
@Resource(name = "propertiesService")
|
||||
protected EgovPropertyService propertyService;
|
||||
|
||||
//파일 처리 egov
|
||||
@Resource(name = "EgovFileMngService")
|
||||
private EgovFileMngService fileMngService;
|
||||
|
||||
//교육신청
|
||||
@Resource(name = "vEEduAplctService")
|
||||
private VEEduAplctService vEEduAplctService;
|
||||
|
||||
/**
|
||||
* @methodName : fileDataUpload
|
||||
* @author : 이호영
|
||||
* @date : 2022.11.04
|
||||
* @description : 파일정보 업로드
|
||||
* @param innorixVO
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<FileVO> insertFileData(AdrInnorixFileVO innorixVO) throws Exception {
|
||||
|
||||
|
||||
|
||||
List<FileVO> result = this.fileChange(innorixVO);
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// public String updateFileData(AdrInnorixFileVO innorixVO) throws Exception {
|
||||
|
||||
|
||||
// String atchFileId = innorixVO.getAtchFileId();
|
||||
//
|
||||
//
|
||||
// FileVO fvo = new FileVO();
|
||||
// fvo.setAtchFileId(atchFileId);
|
||||
// int fileSn = fileMngService.getMaxFileSN(fvo);
|
||||
//
|
||||
// List<FileVO> result = this.fileChange(innorixVO);
|
||||
//
|
||||
//
|
||||
// // 파일 업로드
|
||||
// fileManageDAO.updateFileInfs(result);
|
||||
//
|
||||
// return atchFileId;
|
||||
// }
|
||||
|
||||
|
||||
|
||||
private List<FileVO> fileChange(AdrInnorixFileVO innorixVO) throws FdlException {
|
||||
|
||||
|
||||
String atchFileId = idgenService.getNextStringId();
|
||||
List<FileVO> result = new ArrayList<FileVO>();
|
||||
String storePathString = propertyService.getString("Globals.fileStorePath");
|
||||
|
||||
int fileSn = 0;
|
||||
log.info(" file data 반복문 시작 :: [{}]", innorixVO.getInnorixFileListVO().size());
|
||||
for(InnorixFileVO innorixFileVO : innorixVO.getInnorixFileListVO())
|
||||
{
|
||||
FileVO fileVO = new FileVO();
|
||||
// new 파일명
|
||||
|
||||
// log.info("[{}]번쨰 newName :: [{}]", fileSn, newName);
|
||||
|
||||
String oriFullPath = innorixFileVO.getServerFilePath();
|
||||
|
||||
String newFileNm = innorixVO.getFileType() + "_" + EgovStringUtil.getTimeStamp() + "0";
|
||||
String newFullPath = storePathString + File.separator + newFileNm;
|
||||
|
||||
try {
|
||||
File orifile = FileUtils.getFile(oriFullPath);
|
||||
File newfile = FileUtils.getFile(newFullPath);
|
||||
FileUtils.moveFile(orifile, newfile);
|
||||
|
||||
fileVO.setAtchFileId(atchFileId);
|
||||
fileVO.setFileSn(Integer.toString(fileSn));
|
||||
fileVO.setFileStreCours(storePathString);
|
||||
fileVO.setStreFileNm(newFileNm);
|
||||
fileVO.setOrignlFileNm(innorixFileVO.getServerFileName());
|
||||
fileVO.setFileExtsn(FilenameUtils.getExtension(oriFullPath));
|
||||
fileVO.setFileMg(Integer.toString(innorixFileVO.getFileSize()));
|
||||
|
||||
result.add(fileVO);
|
||||
|
||||
fileSn++;
|
||||
} catch (IOException e) {
|
||||
log.info("파일명 수정 실패 :: [{}] ==> [{}]", oriFullPath, newFullPath );
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
log.info(" // file data 반복문 끝 ");
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public RestResponse insertInnorixFile(AdrInnorixFileVO adrInnorixFileVO) {
|
||||
|
||||
List<FileVO> result = null;
|
||||
try {
|
||||
// 파일 저장 후 저장할 file 정보를 받아옴
|
||||
result = this.insertFileData(adrInnorixFileVO);
|
||||
|
||||
// 파일 정보 insert
|
||||
String atchFileId = fileManageDAO.insertFileInfs(result);
|
||||
|
||||
|
||||
VEEduAplctVO vEEduAplctVO = new VEEduAplctVO();
|
||||
|
||||
String fileType = adrInnorixFileVO.getFileType();
|
||||
log.info("file Type :: [{}]", fileType);
|
||||
if("TRANS".equals(fileType)) {
|
||||
vEEduAplctVO.setTransAtchFileId(atchFileId); //거래선 첨부파일
|
||||
} else if("OATH".equals(fileType)) {
|
||||
vEEduAplctVO.setOathAtchFileId(atchFileId); //서약서 첨부파일
|
||||
} else if("PLAN".equals(fileType)) {
|
||||
vEEduAplctVO.setPlanAtchFileId(atchFileId); //계획서 첨부파일
|
||||
} else if("ATTEND".equals(fileType)) {
|
||||
vEEduAplctVO.setAttendAtchFileId(atchFileId); //강사 참석 확인서 첨부파일
|
||||
} else if("PHT".equals(fileType)) {
|
||||
vEEduAplctVO.setPhtAtchFileId(atchFileId); //교육사진 첨부파일
|
||||
}
|
||||
|
||||
|
||||
vEEduAplctVO.setLastUpdusrId(adrInnorixFileVO.getUniqId());
|
||||
vEEduAplctVO.setEduAplctOrd(adrInnorixFileVO.getEduAplctOrd());
|
||||
|
||||
//저장
|
||||
vEEduAplctService.update(vEEduAplctVO);
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return new RestResponse(HttpStatus.BAD_REQUEST, "등록에 실패하였습니다.", LocalDateTime.now());
|
||||
}
|
||||
|
||||
return new RestResponse(HttpStatus.OK, adrInnorixFileVO.getSuccessMsg(), LocalDateTime.now());
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,73 @@
|
||||
package kcc.kccadr.cmm.innorix.web;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
|
||||
import egovframework.rte.fdl.security.userdetails.util.EgovUserDetailsHelper;
|
||||
import kcc.com.cmm.LoginVO;
|
||||
import kcc.com.utl.fcc.service.EgovStringUtil;
|
||||
import kcc.kccadr.accdnt.ans.service.AnsVO;
|
||||
import kcc.kccadr.cmm.RestResponse;
|
||||
import kcc.kccadr.cmm.innorix.service.AdrInnorixFileVO;
|
||||
import kcc.kccadr.cmm.innorix.service.InnorixFileService;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author : 이호영
|
||||
* @fileName : InnorixFileController.java
|
||||
* @date : 2022.11.01
|
||||
* @description : innorix 대용량 파일 업로드 솔루션
|
||||
* ===========================================================
|
||||
* DATE AUTHOR NOTE
|
||||
* ----------------------------------------------------------- *
|
||||
* 2022.11.01 이호영 최초 생성
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
@Controller
|
||||
public class InnorixFileController {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(InnorixFileController.class);
|
||||
|
||||
/** EgovPropertyService */
|
||||
@Resource(name = "InnorixFileService")
|
||||
protected InnorixFileService innorixService;
|
||||
|
||||
|
||||
/**
|
||||
* @methodName : insertInnorixFile
|
||||
* @author : 이호영
|
||||
* @date : 2022.12.26
|
||||
* @description : 파일 insert 전용
|
||||
* @param adrInnorixFileVO
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = {"/web/common/insertInnorixFileAjax.do"}, method = RequestMethod.POST)
|
||||
public ResponseEntity<RestResponse> insertInnorixFile(@RequestBody AdrInnorixFileVO adrInnorixFileVO) throws Exception {
|
||||
|
||||
//로그인 권한정보 불러오기
|
||||
LoginVO loginVO = EgovUserDetailsHelper.isAuthenticated()? (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser():null;
|
||||
String userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getUniqId());
|
||||
|
||||
if(userId.equals("")) {
|
||||
return ResponseEntity.ok(new RestResponse(HttpStatus.UNAUTHORIZED, "로그인이 필요합니다.", LocalDateTime.now()));
|
||||
}
|
||||
adrInnorixFileVO.setUniqId(userId);
|
||||
|
||||
return ResponseEntity.ok(innorixService.insertInnorixFile(adrInnorixFileVO));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -1,6 +1,8 @@
|
||||
package kcc.ve.aplct.cpyrgExprnClsrm.exprnClsrmAplct.service;
|
||||
|
||||
|
||||
import kcc.kccadr.cmm.RestResponse;
|
||||
import kcc.kccadr.cmm.innorix.service.AdrInnorixFileVO;
|
||||
import kcc.ve.instr.tngrVisitEdu.eduInfo.service.VEEduAplctVO;
|
||||
import kcc.ve.instr.tngrVisitEdu.prcsInfo.service.VEPrcsDetailVO;
|
||||
|
||||
|
||||
@ -1,11 +1,13 @@
|
||||
package kcc.ve.aplct.cpyrgExprnClsrm.exprnClsrmAplct.service.impl;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
@ -16,7 +18,10 @@ import kcc.com.cmm.service.EgovFileMngService;
|
||||
import kcc.com.cmm.service.FileVO;
|
||||
import kcc.com.utl.user.service.CheckFileUtil;
|
||||
import kcc.com.utl.user.service.CheckLoginUtil;
|
||||
import kcc.kccadr.cmm.RestResponse;
|
||||
import kcc.kccadr.cmm.innorix.service.AdrInnorixFileVO;
|
||||
import kcc.let.utl.fcc.service.EgovCryptoUtil;
|
||||
import kcc.let.utl.fcc.service.EgovStringUtil;
|
||||
import kcc.ve.aplct.cpyrgExprnClsrm.exprnClsrmAplct.service.ExprnClsrmAplctService;
|
||||
import kcc.ve.cmm.VeConstants;
|
||||
import kcc.ve.instr.tngrVisitEdu.eduInfo.service.VEEduAplctOnlnService;
|
||||
@ -204,9 +209,49 @@ public class ExprnClsrmAplctServiceImpl implements ExprnClsrmAplctService {
|
||||
@Override
|
||||
public boolean eduAplctChkProcess(VEPrcsDetailVO vEPrcsDetailVO, HttpServletRequest request, ModelAndView modelAndView) throws Exception {
|
||||
LoginVO loginVO = checkLoginUtil.getAuthLoginVO(); //권한에 따른 로그인 정보 가져오기
|
||||
//SsoLoginVO ssoLoginVO = checkLoginUtil.getSSOLoginVO(request); //SSO 로그인 정보 가져오기
|
||||
// SsoLoginVO ssoLoginVO = checkLoginUtil.getSSOLoginVO(request); //SSO 로그인 정보 가져오기
|
||||
|
||||
//로그인 처리====================================
|
||||
// 로그인 처리====================================
|
||||
|
||||
|
||||
|
||||
// step1
|
||||
// 파일 사이즈 등 유효 체크
|
||||
|
||||
// step2 파일명 만들기
|
||||
// KeyStr + EgovStringUtil.getTimeStamp() + fileKey;
|
||||
// type + EgovStringUtil.getTimeStamp() + 0;
|
||||
|
||||
// step3
|
||||
// LETTNFILE INSERT
|
||||
// insert("FileManageDAO.insertFileMaster", vo);
|
||||
|
||||
// step4
|
||||
// LETTNFILEDETAIL INSERTS
|
||||
// insert("FileManageDAO.insertFileDetail", vo);
|
||||
|
||||
// step5 RETURN된 파일 ID를 타입에 맞게 넣어줌
|
||||
/*
|
||||
if("TRANS".equals(vEEduAplctVO.getFileType())) {
|
||||
vEEduAplctVO.setTransAtchFileId(s_transAtchFileId); //거래선 첨부파일
|
||||
} else if("OATH".equals(vEEduAplctVO.getFileType())) {
|
||||
vEEduAplctVO.setOathAtchFileId(s_transAtchFileId); //서약서 첨부파일
|
||||
} else if("PLAN".equals(vEEduAplctVO.getFileType())) {
|
||||
vEEduAplctVO.setPlanAtchFileId(s_transAtchFileId); //계획서 첨부파일
|
||||
} else if("ATTEND".equals(vEEduAplctVO.getFileType())) {
|
||||
vEEduAplctVO.setAttendAtchFileId(s_transAtchFileId); //강사 참석 확인서 첨부파일
|
||||
} else if("PHT".equals(vEEduAplctVO.getFileType())) {
|
||||
vEEduAplctVO.setPhtAtchFileId(s_transAtchFileId); //교육사진 첨부파일
|
||||
*/
|
||||
|
||||
|
||||
// step6
|
||||
// VE_EDU_APLCT 테이블에 파일정보 UPDATE
|
||||
|
||||
// step7
|
||||
// vEEduAplctDAO.update(paramVO);
|
||||
|
||||
// step8
|
||||
|
||||
boolean flag = true;
|
||||
|
||||
@ -221,4 +266,5 @@ public class ExprnClsrmAplctServiceImpl implements ExprnClsrmAplctService {
|
||||
|
||||
return flag;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package kcc.ve.aplct.cpyrgExprnClsrm.exprnClsrmAplct.web;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@ -10,21 +11,29 @@ import javax.servlet.http.HttpSession;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import egovframework.rte.fdl.idgnr.EgovIdGnrService;
|
||||
import egovframework.rte.fdl.security.userdetails.util.EgovUserDetailsHelper;
|
||||
import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationInfo;
|
||||
import kcc.com.cmm.LoginVO;
|
||||
import kcc.com.cmm.service.EgovFileMngService;
|
||||
import kcc.com.cmm.service.FileVO;
|
||||
import kcc.com.cmm.util.DateUtil;
|
||||
import kcc.com.utl.fcc.service.EgovStringUtil;
|
||||
import kcc.com.utl.user.service.CheckFileUtil;
|
||||
import kcc.com.utl.user.service.CheckLoginUtil;
|
||||
import kcc.kccadr.cmm.RestResponse;
|
||||
import kcc.kccadr.cmm.innorix.service.AdrInnorixFileVO;
|
||||
import kcc.let.uat.uia.service.SsoLoginVO;
|
||||
import kcc.let.utl.fcc.service.EgovCryptoUtil;
|
||||
import kcc.ve.aplct.cpyrgExprnClsrm.exprnClsrmAplct.service.ExprnClsrmAplctService;
|
||||
@ -391,7 +400,8 @@ public class ExprnClsrmAplctController {
|
||||
String s_file_exts = checkFileUtil.getS_exts(); // file exts
|
||||
|
||||
String s_transAtchFileId = checkFileUtil.fileValCheckNdbInsert(
|
||||
multiRequest, modelAndView
|
||||
multiRequest
|
||||
, modelAndView
|
||||
, vEEduAplctVO.getFileType()+"_" //file_name_prefix (화면에서 hidden 으로 받아옴)
|
||||
, s_file_exts
|
||||
, i_limit_size
|
||||
@ -428,8 +438,6 @@ public class ExprnClsrmAplctController {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 체험교실 수정
|
||||
*/
|
||||
|
||||
@ -29,11 +29,11 @@
|
||||
|
||||
$(document).ready(function() {
|
||||
//파일첨부버튼
|
||||
// $(".btn_add_file").on('click', function(){
|
||||
// $("#file_temp").click();
|
||||
// });
|
||||
$(".btn_add_file").on('click', function(){
|
||||
$("#file_temp").click();
|
||||
});
|
||||
|
||||
/* $('#file_temp').change(function(e){
|
||||
$('#file_temp').change(function(e){
|
||||
var objUpload = $(".upload_area");
|
||||
var files = $('#file_temp')[0].files;
|
||||
|
||||
@ -41,7 +41,7 @@
|
||||
if($("#file_temp").length > 0){
|
||||
$("#file_temp").val(""); //파일지우기
|
||||
}
|
||||
}); */
|
||||
});
|
||||
|
||||
// 레이어팝업 포커싱 이동 수정
|
||||
/* $(".tooltip-close").click(function(){
|
||||
@ -59,20 +59,21 @@
|
||||
* 파일전송 컨트롤 생성
|
||||
* ==================================================================
|
||||
*/
|
||||
control = innorix.create({
|
||||
control = innorix.create({
|
||||
el: '#fileControl' // 컨트롤 출력 HTML 객체 ID
|
||||
, transferMode: 'both' // 업로드, 다운로드 혼합사용
|
||||
, installUrl: '<c:url value="/innorix/install/install.html" />' // Agent 설치 페이지
|
||||
, uploadUrl: '/innorix/exam/upload.jsp' // 업로드 URL
|
||||
// , uploadUrl: '<c:url value="/innorix/exam/upload.jsp" />' // 업로드 URL
|
||||
, uploadUrl: '<c:url value="/innorix/exam/upload.jsp" />' // 업로드 URL
|
||||
, height:80
|
||||
, width: 635
|
||||
, width: 600
|
||||
, maxFileCount : 1 // 첨부파일 최대 갯수
|
||||
});
|
||||
|
||||
// 업로드 완료 후 이벤트
|
||||
control.on('uploadComplete', function (p) {
|
||||
console.log('uploadComplete : ', p);
|
||||
fn_callBackInnorix(p.files); // 파일 정보 DB isnert function
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
@ -81,37 +82,7 @@
|
||||
window.close();
|
||||
}
|
||||
|
||||
|
||||
//거래선 업로드
|
||||
function fncSaveFile(type){
|
||||
var setMsg = "";
|
||||
if(type == 'TRANS') {
|
||||
setMsg = "거래선을";
|
||||
} else if (type == 'OATH') {
|
||||
setMsg="서약서를";
|
||||
} else if (type == 'PLAN') {
|
||||
setMsg = "계획서를";
|
||||
} else if (type == 'ATTEND') {
|
||||
setMsg = "강사 참석 확인서를";
|
||||
} else if (type == 'PHT') {
|
||||
setMsg = "교육사진을";
|
||||
}
|
||||
|
||||
|
||||
if(confirm(setMsg + " 업로드 하시겠습니까?")){
|
||||
if(control.getUploadFiles().length > 0){
|
||||
var postObj = new Object();
|
||||
postObj.innoDirPath = $('#innoDirPath').val();
|
||||
control.setPostData(postObj); // 업로드시 함께 전달될 POST Param 추가
|
||||
|
||||
control.upload(); // 업로드 시작
|
||||
}else{
|
||||
alert("등록된 첨부파일이 없습니다.");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* function fncSaveFile(type){
|
||||
/* function fncSaveFile(type){
|
||||
var setMsg = "";
|
||||
if(type == 'TRANS') {
|
||||
setMsg = "거래선을";
|
||||
@ -153,7 +124,7 @@
|
||||
cache: false,
|
||||
success: function (returnData, status) {
|
||||
if(status == 'success'){
|
||||
alert("등록 되었습니다.");
|
||||
// alert("등록 되었습니다.");
|
||||
location.reload();
|
||||
} else if(status== 'fail'){
|
||||
alert("등록에 실패하였습니다.");
|
||||
@ -162,7 +133,7 @@
|
||||
error: function (e) { alert("저장에 실패하였습니다."); console.log("ERROR : ", e); }
|
||||
});
|
||||
}
|
||||
} */
|
||||
} */
|
||||
|
||||
/* 등록되어 있는 파일 삭제버튼 클릭시 */
|
||||
function delAtchFile(itemId , fileSn){
|
||||
@ -211,26 +182,67 @@
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
//거래선 업로드
|
||||
function fncSaveFile(type){
|
||||
var setMsg = "";
|
||||
if(type == 'TRANS') {
|
||||
setMsg = "거래선을";
|
||||
} else if (type == 'OATH') {
|
||||
setMsg="서약서를";
|
||||
} else if (type == 'PLAN') {
|
||||
setMsg = "계획서를";
|
||||
} else if (type == 'ATTEND') {
|
||||
setMsg = "강사 참석 확인서를";
|
||||
} else if (type == 'PHT') {
|
||||
setMsg = "교육사진을";
|
||||
}
|
||||
|
||||
|
||||
if(confirm(setMsg + " 업로드 하시겠습니까?")){
|
||||
if(control.getUploadFiles().length > 0){
|
||||
var postObj = new Object();
|
||||
postObj.innoDirPath = $('#innoDirPath').val();
|
||||
control.setPostData(postObj); // 업로드시 함께 전달될 POST Param 추가
|
||||
// 가능한 확장자 txt|xls|xlsx|png|jpg|jpeg|doc|ppt|hwp|pdf|zip
|
||||
control.upload(); // 업로드 시작
|
||||
}else{
|
||||
alert("등록된 첨부파일이 없습니다.");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 파일 정보 DB insert Ajax
|
||||
* */
|
||||
function fn_callBackInnorix(data){
|
||||
function fn_callBackInnorix(data){
|
||||
|
||||
|
||||
var url = "<c:url value='/kccadr/common/insertInnorixFileAndRpplAjax.do' />";
|
||||
var type = $('#fileType').val();
|
||||
var setMsg = "";
|
||||
if(type == 'TRANS') {
|
||||
setMsg = "거래선";
|
||||
} else if (type == 'OATH') {
|
||||
setMsg="서약서";
|
||||
} else if (type == 'PLAN') {
|
||||
setMsg = "계획서";
|
||||
} else if (type == 'ATTEND') {
|
||||
setMsg = "강사 참석 확인서";
|
||||
} else if (type == 'PHT') {
|
||||
setMsg = "교육사진";
|
||||
}
|
||||
|
||||
var url = "<c:url value='/web/common/insertInnorixFileAjax.do' />";
|
||||
|
||||
var filePath = location.pathname;
|
||||
var jspFileName = filePath.substring(filePath.lastIndexOf("/")+1, filePath.lastIndexOf("."));
|
||||
|
||||
var sendData = {
|
||||
"adrSeq": $('#adrSeq').val()
|
||||
, "adrSn": $('#adrSn').val()
|
||||
, "adrDocTy": $('#adrDocTy').val()
|
||||
, "rpplSeq": $('#rpplSeq').val()
|
||||
, "adrDocCn1": $('#adrDocCn1').val()
|
||||
, "openYn": $('#openYn').val()
|
||||
, "jspFileName": jspFileName
|
||||
"fileType": $('#fileType').val()
|
||||
, "eduAplctOrd": $('#eduAplctOrd').val()
|
||||
, "innorixFileListVO": data
|
||||
, "successMsg" : "사건문서 제출이 완료되었습니다."
|
||||
, "successMsg" : setMsg+" 등록이 완료되었습니다."
|
||||
}
|
||||
|
||||
/*
|
||||
@ -239,10 +251,10 @@
|
||||
*/
|
||||
if(fn_innorixCmmAjax(sendData, url) == "OK")
|
||||
{
|
||||
opener.location.reload(true);
|
||||
self.close();
|
||||
location.reload(true);
|
||||
location.reload(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- 파일 업로드 -->
|
||||
@ -268,8 +280,8 @@
|
||||
<div class="pop_search_wrap">
|
||||
<label for="fileNm" class="label">첨부파일 선택</label>
|
||||
<!-- <button type="button" class="btnType01 btn_add_file">찾아보기</button> -->
|
||||
<input type="file" id="file_temp" name="file_temp" class="uploadFile" style="display:none;"/>
|
||||
<button type="button" onclick="control.openFileDialog();" class="btnType01 btn_add_file">파일찾기</button>
|
||||
<!-- <input type="file" id="file_temp" name="file_temp" class="uploadFile" style="display:none;"/> -->
|
||||
<button type="button" onclick="control.openFileDialogSingle();" class="btnType01 btn_add_file">파일찾기</button>
|
||||
</div>
|
||||
<div id="fileControl"></div><br/>
|
||||
<%-- <div class="file_wrap file_upload_box no_img_box">
|
||||
@ -329,49 +341,8 @@
|
||||
</c:forEach>
|
||||
</tbody>
|
||||
</table>
|
||||
</div> --%>
|
||||
</div>
|
||||
|
||||
<%--
|
||||
<!--HOLDING-->
|
||||
<c:if test="${fileType eq 'TRANS'}">
|
||||
<div>
|
||||
<table>
|
||||
<colgroup>
|
||||
<col style="width: 30%;">
|
||||
<col style="width: auto;">
|
||||
</colgroup>
|
||||
<tbody class="">
|
||||
<tr>
|
||||
<th>학교명</th>
|
||||
<td>
|
||||
<input type="text" name="" id="" value="">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>성명</th>
|
||||
<td>
|
||||
<input type="text" name="" id="" value="">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>계좌번호(은행)</th>
|
||||
<td>
|
||||
<input type="text" name="" id="" value="">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>주민등록번호</th>
|
||||
<td>
|
||||
<input type="text" name="" id="" value="">
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</c:if>
|
||||
|
||||
--%>
|
||||
</div>
|
||||
</div> --%>
|
||||
<div class="pop_btn_wrap btn_layout01">
|
||||
<div class="btn_left">
|
||||
</div>
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
el: '#fileControl', // 컨트롤 출력 HTML 객체 ID
|
||||
transferMode: 'both', // 업로드, 다운로드 혼합사용
|
||||
installUrl: '/offeduadvc/innorix/install/install.html', // Agent 설치 페이지
|
||||
uploadUrl: '/offeduadvc/innorix/exam/upload_test_220916.jsp' // 업로드 URL
|
||||
uploadUrl: '/offeduadvc/innorix/exam/upload.jsp' // 업로드 URL
|
||||
});
|
||||
|
||||
// 업로드 완료 이벤트
|
||||
|
||||
@ -8,7 +8,7 @@ if (request.getMethod().equals("POST"))
|
||||
String directory = InnorixUpload.getServletAbsolutePath(request);
|
||||
// directory = directory.substring(0, directory.lastIndexOf("/") + 1) + "data";
|
||||
// directory = PropertyService.getString("Globals.fileStorePath");
|
||||
directory = "/usr/local/tomcat/file/sht/";
|
||||
directory = "/app/doc/offedu/sht111/";
|
||||
int maxPostSize = 2147482624; // bytes
|
||||
|
||||
|
||||
@ -53,7 +53,8 @@ if (request.getMethod().equals("POST"))
|
||||
위 코드를 넣어 줘야 함
|
||||
|
||||
*/
|
||||
uploader.setDirectory(_innoFilePath);
|
||||
// uploader.setDirectory(_innoFilePath);
|
||||
uploader.setDirectory("/app/doc/offedu/sht/");
|
||||
|
||||
String _run_retval = uploader.run();
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user