From 9b27f07475fc11fd3f13c2d524a5a508de3629e4 Mon Sep 17 00:00:00 2001 From: hylee Date: Thu, 20 Jul 2023 11:38:35 +0900 Subject: [PATCH] =?UTF-8?q?feat=20:=20pms=20-=203268/3269=20=09[=EC=82=AC?= =?UTF-8?q?=EC=9A=A9=EC=9E=90]=20=EC=A0=80=EC=9E=91=EA=B6=8C=20=EC=B2=B4?= =?UTF-8?q?=ED=97=98=EA=B5=90=EC=8B=A4=20>=20=EC=9A=B4=EC=98=81=EB=82=B4?= =?UTF-8?q?=EC=97=AD=EB=AA=A9=EB=A1=9D=20>=20=EC=83=81=EC=84=B8=ED=99=94?= =?UTF-8?q?=EB=A9=B4=20=3D=3D>=20=EC=84=9C=EC=95=BD=EC=84=9C=20/=20?= =?UTF-8?q?=EA=B3=84=ED=9A=8D=EC=84=9C=20=EC=97=85=EB=A1=9C=EB=93=9C=20?= =?UTF-8?q?=EB=8C=80=EC=9A=A9=EB=9F=89=20=ED=8C=8C=EC=9D=BC=20=EC=86=94?= =?UTF-8?q?=EB=A3=A8=EC=85=98=20=EC=A0=81=EC=9A=A9=20=EC=99=84=EB=A3=8C=20?= =?UTF-8?q?[=ED=8D=BC=EB=B8=94=20=EC=A7=84=ED=96=89=EC=A4=91]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/kcc/kccadr/cmm/RestResponse.java | 119 ++++++++++ .../cmm/innorix/service/AdrInnorixFileVO.java | 96 ++++++++ .../innorix/service/InnorixFileService.java | 28 +++ .../cmm/innorix/service/InnorixFileVO.java | 180 +++++++++++++++ .../service/impl/InnorixFileServiceImpl.java | 207 ++++++++++++++++++ .../innorix/web/InnorixFileController.java | 73 ++++++ .../service/ExprnClsrmAplctService.java | 2 + .../impl/ExprnClsrmAplctServiceImpl.java | 50 ++++- .../web/ExprnClsrmAplctController.java | 14 +- .../WEB-INF/jsp/web/ve/comm/fileUploadPop.jsp | 173 ++++++--------- src/main/webapp/innorix/exam/upload.html | 2 +- src/main/webapp/innorix/exam/upload.jsp | 5 +- 12 files changed, 840 insertions(+), 109 deletions(-) create mode 100644 src/main/java/kcc/kccadr/cmm/RestResponse.java create mode 100644 src/main/java/kcc/kccadr/cmm/innorix/service/AdrInnorixFileVO.java create mode 100644 src/main/java/kcc/kccadr/cmm/innorix/service/InnorixFileService.java create mode 100644 src/main/java/kcc/kccadr/cmm/innorix/service/InnorixFileVO.java create mode 100644 src/main/java/kcc/kccadr/cmm/innorix/service/impl/InnorixFileServiceImpl.java create mode 100644 src/main/java/kcc/kccadr/cmm/innorix/web/InnorixFileController.java diff --git a/src/main/java/kcc/kccadr/cmm/RestResponse.java b/src/main/java/kcc/kccadr/cmm/RestResponse.java new file mode 100644 index 00000000..dff497ff --- /dev/null +++ b/src/main/java/kcc/kccadr/cmm/RestResponse.java @@ -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; + } + +} + diff --git a/src/main/java/kcc/kccadr/cmm/innorix/service/AdrInnorixFileVO.java b/src/main/java/kcc/kccadr/cmm/innorix/service/AdrInnorixFileVO.java new file mode 100644 index 00000000..19365c24 --- /dev/null +++ b/src/main/java/kcc/kccadr/cmm/innorix/service/AdrInnorixFileVO.java @@ -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 innorixFileListVO = new ArrayList(); + + + + + 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 getInnorixFileListVO() { + return innorixFileListVO; + } + + public void setInnorixFileListVO(List 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; + } + + + + + +} \ No newline at end of file diff --git a/src/main/java/kcc/kccadr/cmm/innorix/service/InnorixFileService.java b/src/main/java/kcc/kccadr/cmm/innorix/service/InnorixFileService.java new file mode 100644 index 00000000..39211c01 --- /dev/null +++ b/src/main/java/kcc/kccadr/cmm/innorix/service/InnorixFileService.java @@ -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); + +} diff --git a/src/main/java/kcc/kccadr/cmm/innorix/service/InnorixFileVO.java b/src/main/java/kcc/kccadr/cmm/innorix/service/InnorixFileVO.java new file mode 100644 index 00000000..91aab5b3 --- /dev/null +++ b/src/main/java/kcc/kccadr/cmm/innorix/service/InnorixFileVO.java @@ -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; + } + + + +} \ No newline at end of file diff --git a/src/main/java/kcc/kccadr/cmm/innorix/service/impl/InnorixFileServiceImpl.java b/src/main/java/kcc/kccadr/cmm/innorix/service/impl/InnorixFileServiceImpl.java new file mode 100644 index 00000000..9487ed51 --- /dev/null +++ b/src/main/java/kcc/kccadr/cmm/innorix/service/impl/InnorixFileServiceImpl.java @@ -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 insertFileData(AdrInnorixFileVO innorixVO) throws Exception { + + + + List 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 result = this.fileChange(innorixVO); +// +// +// // 파일 업로드 +// fileManageDAO.updateFileInfs(result); +// +// return atchFileId; +// } + + + + private List fileChange(AdrInnorixFileVO innorixVO) throws FdlException { + + + String atchFileId = idgenService.getNextStringId(); + List result = new ArrayList(); + 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 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()); + } +} diff --git a/src/main/java/kcc/kccadr/cmm/innorix/web/InnorixFileController.java b/src/main/java/kcc/kccadr/cmm/innorix/web/InnorixFileController.java new file mode 100644 index 00000000..fe949066 --- /dev/null +++ b/src/main/java/kcc/kccadr/cmm/innorix/web/InnorixFileController.java @@ -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 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)); + } + + +} \ No newline at end of file diff --git a/src/main/java/kcc/ve/aplct/cpyrgExprnClsrm/exprnClsrmAplct/service/ExprnClsrmAplctService.java b/src/main/java/kcc/ve/aplct/cpyrgExprnClsrm/exprnClsrmAplct/service/ExprnClsrmAplctService.java index c02af4e1..4fd3db67 100644 --- a/src/main/java/kcc/ve/aplct/cpyrgExprnClsrm/exprnClsrmAplct/service/ExprnClsrmAplctService.java +++ b/src/main/java/kcc/ve/aplct/cpyrgExprnClsrm/exprnClsrmAplct/service/ExprnClsrmAplctService.java @@ -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; diff --git a/src/main/java/kcc/ve/aplct/cpyrgExprnClsrm/exprnClsrmAplct/service/impl/ExprnClsrmAplctServiceImpl.java b/src/main/java/kcc/ve/aplct/cpyrgExprnClsrm/exprnClsrmAplct/service/impl/ExprnClsrmAplctServiceImpl.java index 4e8b25d9..2be8b0fd 100644 --- a/src/main/java/kcc/ve/aplct/cpyrgExprnClsrm/exprnClsrmAplct/service/impl/ExprnClsrmAplctServiceImpl.java +++ b/src/main/java/kcc/ve/aplct/cpyrgExprnClsrm/exprnClsrmAplct/service/impl/ExprnClsrmAplctServiceImpl.java @@ -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; } + } diff --git a/src/main/java/kcc/ve/aplct/cpyrgExprnClsrm/exprnClsrmAplct/web/ExprnClsrmAplctController.java b/src/main/java/kcc/ve/aplct/cpyrgExprnClsrm/exprnClsrmAplct/web/ExprnClsrmAplctController.java index 60666e1b..73cd0346 100644 --- a/src/main/java/kcc/ve/aplct/cpyrgExprnClsrm/exprnClsrmAplct/web/ExprnClsrmAplctController.java +++ b/src/main/java/kcc/ve/aplct/cpyrgExprnClsrm/exprnClsrmAplct/web/ExprnClsrmAplctController.java @@ -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 { } - - /** * 체험교실 수정 */ diff --git a/src/main/webapp/WEB-INF/jsp/web/ve/comm/fileUploadPop.jsp b/src/main/webapp/WEB-INF/jsp/web/ve/comm/fileUploadPop.jsp index 1f11a92d..d5961034 100644 --- a/src/main/webapp/WEB-INF/jsp/web/ve/comm/fileUploadPop.jsp +++ b/src/main/webapp/WEB-INF/jsp/web/ve/comm/fileUploadPop.jsp @@ -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: '' // Agent 설치 페이지 - , uploadUrl: '/innorix/exam/upload.jsp' // 업로드 URL -// , uploadUrl: '' // 업로드 URL + , uploadUrl: '' // 업로드 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 = ""; + 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 = ""; 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); } - } + } @@ -268,8 +280,8 @@
- - + +

<%--
@@ -329,49 +341,8 @@ -
--%> - - - <%-- - - -
- - - - - - - - - - - - - - - - - - - - - - - -
학교명 - -
성명 - -
계좌번호(은행) - -
주민등록번호 - -
-
-
- - --%> + + --%>
diff --git a/src/main/webapp/innorix/exam/upload.html b/src/main/webapp/innorix/exam/upload.html index c6104ec8..703765fa 100644 --- a/src/main/webapp/innorix/exam/upload.html +++ b/src/main/webapp/innorix/exam/upload.html @@ -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 }); // 업로드 완료 이벤트 diff --git a/src/main/webapp/innorix/exam/upload.jsp b/src/main/webapp/innorix/exam/upload.jsp index ac908f2f..e9710d85 100644 --- a/src/main/webapp/innorix/exam/upload.jsp +++ b/src/main/webapp/innorix/exam/upload.jsp @@ -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();