From 691c9bb5fb9390c3d735cc490d70ee51362d467a Mon Sep 17 00:00:00 2001 From: hylee Date: Thu, 13 Jul 2023 17:06:59 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20pms-#3265=20"=20=EB=A9=94=EB=89=B4?= =?UTF-8?q?=EB=A5=BC=20=ED=86=B5=ED=95=9C=20=EB=A1=9C=EA=B7=B8=EC=9D=B8=20?= =?UTF-8?q?=EC=8B=9C=20=ED=99=94=EB=A9=B4=20=EC=98=A4=EB=A5=98=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=20=EC=9A=94=EC=B2=AD"=20=EC=99=84=EB=A3=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/utl/user/service/CheckLoginUtil.java | 4 +- .../let/uat/uia/web/EgovLoginController.java | 5 +- .../web/EduRsltMngTngrController.java | 109 +++++++++++++++++- .../jsp/oprtn/tngrVisitEdu/eduRsltMngList.jsp | 30 ++++- 4 files changed, 140 insertions(+), 8 deletions(-) diff --git a/src/main/java/kcc/com/utl/user/service/CheckLoginUtil.java b/src/main/java/kcc/com/utl/user/service/CheckLoginUtil.java index 154e2028..b69ebfd5 100644 --- a/src/main/java/kcc/com/utl/user/service/CheckLoginUtil.java +++ b/src/main/java/kcc/com/utl/user/service/CheckLoginUtil.java @@ -367,8 +367,8 @@ public class CheckLoginUtil { } HttpSession session = request.getSession(); - session.setAttribute("beforeSiteUrl", request.getRequestURI()); - //return "redirect:/web/user/login/ssoLogin.do"; +// session.setAttribute("beforeSiteUrl", request.getRequestURI()); + session.setAttribute("beforeSiteUrl", request.getRequestURI().replace(request.getContextPath() , "")); return "redirect:/web/user/login/ssoLogin.do"; } diff --git a/src/main/java/kcc/let/uat/uia/web/EgovLoginController.java b/src/main/java/kcc/let/uat/uia/web/EgovLoginController.java index 86482bb4..a6f739fb 100644 --- a/src/main/java/kcc/let/uat/uia/web/EgovLoginController.java +++ b/src/main/java/kcc/let/uat/uia/web/EgovLoginController.java @@ -939,6 +939,9 @@ public class EgovLoginController { System.out.println("==15=="); } +// session.setAttribute("beforeSiteUrl", request.getRequestURI()); + System.out.println("session.getAttributesession.getAttributesession.getAttributesession.getAttribute"); + loginVO.setBeforeUrl((String) request.getSession().getAttribute("beforeSiteUrl")); // 로그인 전 URL 호출 시 if (loginVO.getBeforeUrl() != null && !("").equals(loginVO.getBeforeUrl())) { request.getSession().setAttribute("usrBeforeUrl", loginVO.getBeforeUrl()); @@ -1509,7 +1512,7 @@ public class EgovLoginController { if (session.getAttribute("beforeSiteUrl") != null) { // 사용자 메인 String tempSessionUrl = (String) session.getAttribute("beforeSiteUrl"); - tempSessionUrl = tempSessionUrl.replace("/offedu", ""); +// tempSessionUrl = tempSessionUrl.replace("/offedu", ""); session.setAttribute("pageType", null); session.setAttribute("beforeSiteUrl", null); diff --git a/src/main/java/kcc/ve/oprtn/tngrVisitEdu/eduRsltMng/web/EduRsltMngTngrController.java b/src/main/java/kcc/ve/oprtn/tngrVisitEdu/eduRsltMng/web/EduRsltMngTngrController.java index 8903fcac..3416afcb 100644 --- a/src/main/java/kcc/ve/oprtn/tngrVisitEdu/eduRsltMng/web/EduRsltMngTngrController.java +++ b/src/main/java/kcc/ve/oprtn/tngrVisitEdu/eduRsltMng/web/EduRsltMngTngrController.java @@ -1256,6 +1256,8 @@ public class EduRsltMngTngrController { } }); + System.out.println("atchFileIdList.size() :: "+ atchFileIdList.size()); + FileVO fileVO = new FileVO(); fileVO.setDownloadType(downloadType); @@ -1297,12 +1299,13 @@ public class EduRsltMngTngrController { int size = 1024; byte[] buf = new byte[size]; -// String outZipNm = fvoList.get(0).getFileStreCours()+File.separator + orgnZipNm; - String outZipNm = "/usr/local/tomcat/file/sht/"+File.separator + orgnZipNm; + String outZipNm = fvoList.get(0).getFileStreCours()+File.separator + orgnZipNm; +// String outZipNm = "/usr/local/tomcat/file/sht/"+File.separator + orgnZipNm; FileInputStream fis = null; ZipArchiveOutputStream zos = null; BufferedInputStream bis = null; + int fileCnt = 0; try { System.out.println("outZipNm : "+ outZipNm); // Zip 파일생성 @@ -1317,7 +1320,8 @@ public class EduRsltMngTngrController { boolean isExists = file.exists(); if(isExists) { System.out.println("getStreFileNm() " + vo.getStreFileNm()); - System.out.println("I find the existFile.txt"); + System.out.println("I find the existFile.txt"); + fileCnt++; } else { continue; } @@ -1348,7 +1352,8 @@ public class EduRsltMngTngrController { if( fis != null ) fis.close(); if( bis != null ) bis.close(); } - + + System.out.println("fileCnt :: "+ fileCnt); File uFile = new File(fvoList.get(0).getFileStreCours(), orgnZipNm); long fSize = uFile.length(); @@ -1403,6 +1408,102 @@ public class EduRsltMngTngrController { } + + @SuppressWarnings("rawtypes") + @RequestMapping(value = "eduRsltFileChk.do") + public ModelAndView eduRsltFileChk(@ModelAttribute("vEEduAplctVO") VEEduAplctVO vEEduAplctVO + , HttpServletRequest request + , HttpServletResponse response + , ModelMap model) throws Exception { + + ModelAndView modelAndView = new ModelAndView(); + modelAndView.setViewName("jsonView"); + // 요청, 반려건 + vEEduAplctVO.setSearchNotStatusArr(new String[]{"60"}); + // 청소년 + vEEduAplctVO.setLctrDivCd(VeConstants.LCTR_DIV_CD_10); + vEEduAplctVO.setMode(VeConstants.MODE_EXCEL); + List list = vEEduMIXService.selectExcelList(vEEduAplctVO); + + System.out.println("============="); + List atchFileIdList = new ArrayList(); + + /* + * 게시글 리스트에 첨부파일이 있는지 확인 + * */ + list.forEach( vo -> { + if(vo.getAtchFileId() != null) { + atchFileIdList.add(vo.getAtchFileId()); + } + }); + + /* + * 게시글 리스트에 첨부파일이 없으면 없음 리턴 + * */ + System.out.println("chk atchFileIdList.size() :: "+ atchFileIdList.size()); + if(atchFileIdList.size() < 1) + { + /* + * 파일 없음 리턴 + * */ + modelAndView.addObject("result", "fail"); + modelAndView.addObject("msg", "첨부 파일이 없습니다."); + return modelAndView; + + } + + + /* + * + * */ + FileVO fileVO = new FileVO(); + String downloadType = "A"; + fileVO.setDownloadType(downloadType); + fileVO.setAtchFileIdList(atchFileIdList); + List fvoList = fileService.selectZipFileList(fileVO); // 해당 기능에 맞게 파일 조회 + + System.out.println("=========================="); + + + int fileCnt = 0; + for ( FileVO vo : fvoList ){ + + // Create a file object + File file = new File(vo.getFileStreCours() + "/" + vo.getStreFileNm()); + // 1. check if the file exists or not + boolean isExists = file.exists(); + if(isExists) { + fileCnt++; + System.out.println("getStreFileNm() " + vo.getStreFileNm()); + System.out.println("I find the existFile.txt"); + } else { + continue; + } + } + + + /* + * 실재 존재하는 파일이 있는지 확인 + * */ + System.out.println("chk fileCnt :: "+ fileCnt); + if(fileCnt == 0){ + + /* + * 파일 없음 리턴 + * */ + modelAndView.addObject("result", "fail"); + modelAndView.addObject("msg", "첨부 파일이 없습니다."); + return modelAndView; + } + + /* + * 파일 없음 리턴 + * */ + modelAndView.addObject("result", "susess"); + return modelAndView; + + } + //강사만족도 excel download @SuppressWarnings("rawtypes") @RequestMapping(value = "eduRsltSatisfactionExcelDownLoad.do") diff --git a/src/main/webapp/WEB-INF/jsp/oprtn/tngrVisitEdu/eduRsltMngList.jsp b/src/main/webapp/WEB-INF/jsp/oprtn/tngrVisitEdu/eduRsltMngList.jsp index 8f2765f8..08604fc4 100644 --- a/src/main/webapp/WEB-INF/jsp/oprtn/tngrVisitEdu/eduRsltMngList.jsp +++ b/src/main/webapp/WEB-INF/jsp/oprtn/tngrVisitEdu/eduRsltMngList.jsp @@ -231,6 +231,7 @@ } }); } + function fncExcelDownLoad(){ var listForm = document.listForm ; @@ -238,6 +239,33 @@ listForm.submit(); } + function eduRsltFileChk(){ + + var data1 = new FormData(document.getElementById("listForm")); + $.ajax({ + type:"POST", + url: "", + data: data1, + dataType:'json', + async: false, + processData: false, + contentType: false, + cache: false, + success:function(returnData){ + console.log('returnData : ', returnData); + if(returnData.result == 'fail'){ + alert(returnData.msg); + }else{ + fncFileDown(); + } + + }, + error:function(request , status, error){ + alert("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+error); + } + }); + } + function fncFileDown(){ var listForm = document.listForm ; listForm.action = ""; @@ -423,7 +451,7 @@
- +