From e85aeee9c5e0e8932bd8361e9b1accdca870180f Mon Sep 17 00:00:00 2001 From: myname Date: Tue, 7 May 2024 17:19:07 +0900 Subject: [PATCH] =?UTF-8?q?2024-05-07=2017:18=20=EC=B2=AD=EC=86=8C?= =?UTF-8?q?=EB=85=84=20=EC=84=A4=EB=AC=B8=20=EC=88=98=EC=A0=95,=20?= =?UTF-8?q?=EC=B2=B4=ED=97=98=EA=B5=90=EC=8B=A4=20=EC=84=9C=EC=95=BD?= =?UTF-8?q?=EC=84=9C=20=EB=8B=A4=EC=9A=B4=EB=A1=9C=EB=93=9C=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../utl/user/service/QustnrCommonUtil.java | 87 +++++++ .../web/OprtnAplctMngController.java | 226 ++++++++++++++++++ .../web/EduRsltMngTngrController.java | 51 ++++ .../cpyrgExprnClsrm/oprtnStateMngList.jsp | 45 +++- .../oprtn/tngrVisitEdu/eduRsltMngDetail.jsp | 97 ++++++++ 5 files changed, 502 insertions(+), 4 deletions(-) diff --git a/src/main/java/kcc/com/utl/user/service/QustnrCommonUtil.java b/src/main/java/kcc/com/utl/user/service/QustnrCommonUtil.java index 99adf9de..dc27bbc5 100644 --- a/src/main/java/kcc/com/utl/user/service/QustnrCommonUtil.java +++ b/src/main/java/kcc/com/utl/user/service/QustnrCommonUtil.java @@ -69,6 +69,39 @@ public class QustnrCommonUtil { return p_model; } + public ModelMap _qustnrQesItm_TA( + ModelMap p_model + , String p_siteId + , String p_siteIdCd + , String p_qestnrTmplatId + , VEALettnQestnrMIXService p_vEALettnQestnrMIXService + , EgovQustnrRespondInfoService p_egovQustnrRespondInfoService + , String p_eduAplctOrd + , String p_eduChasiOrd + )throws Exception{ + //설문 문항 정보 + { + //설문지 정보 + System.out.println("===========!설문지정보!==========="); + VEAQestnrVO vEAQestnrVO = new VEAQestnrVO(); + vEAQestnrVO.setSiteId(p_siteId); //청소년 + vEAQestnrVO.setSiteIdCd(p_siteIdCd); //10-기본설문, 20-신청자설문, 30-강사설문 + vEAQestnrVO.setEduAplctOrd(p_eduAplctOrd); + vEAQestnrVO.setEduChasiOrd(p_eduChasiOrd); + vEAQestnrVO = p_vEALettnQestnrMIXService.selectDetail_MIX_LQI_02(vEAQestnrVO); + + //문항정보 + Map commandMap =new HashMap(); + commandMap.put("qestnrTmplatId", p_qestnrTmplatId); + commandMap.put("qestnrId",vEAQestnrVO.getQestnrId()); //문제 ID + System.out.println("===========!문항 정보!==========="); + p_model.addAttribute("Comtnqustnrqesitm_TA", p_egovQustnrRespondInfoService.selectQustnrRespondInfoManageComtnqustnrqesitm(commandMap)); + p_model.addAttribute("qestnrId_TA", vEAQestnrVO.getQestnrId()); + p_model.addAttribute("qustnrTmplatId_TA", vEAQestnrVO.getQustnrTmplatId()); + } + + return p_model; + } public ModelMap _chasiSrvyList( ModelMap p_model @@ -94,6 +127,31 @@ public class QustnrCommonUtil { return p_model; } + + public ModelMap _chasiSrvyList_TA( + ModelMap p_model + , String p_siteId + , String p_siteIdCd + , String p_eduAplctOrd + , String p_eduChasiOrd + , VEALettnQestnrMIXService p_vEALettnQestnrMIXService + )throws Exception{ + VEAQestnrVO vEAQestnrVO = new VEAQestnrVO(); + vEAQestnrVO.setSiteId(p_siteId); //청소년 + vEAQestnrVO.setSiteIdCd(p_siteIdCd); //10-기본설문, 20-신청자설문, 30-강사설문 + vEAQestnrVO.setEduAplctOrd(p_eduAplctOrd); + vEAQestnrVO.setEduChasiOrd(p_eduChasiOrd); + + List chasiSrvyList = p_vEALettnQestnrMIXService.selectDetail_MIX_LQI_03(vEAQestnrVO); + + if(chasiSrvyList.size() > 0) { + p_model.addAttribute("qestnrRespondent_TA", chasiSrvyList.get(0).getQestnrRespondent()); + p_model.addAttribute("qestnrParticipant_TA", chasiSrvyList.get(0).getQestnrParticipant()); + p_model.addAttribute("chasiSrvyList_TA",chasiSrvyList); + } + + return p_model; + } public ModelMap _chasiSrvyEAList( ModelMap p_model @@ -121,6 +179,35 @@ public class QustnrCommonUtil { p_model.addAttribute("chasiSrvyEAList",chasiSrvyList); } + return p_model; + } + + public ModelMap _chasiSrvyEAList_TA( + ModelMap p_model + , String p_siteId + , String p_siteIdCd + , String p_eduAplctOrd + , String p_eduChasiOrd + , VEALettnQestnrMIXService p_vEALettnQestnrMIXService + )throws Exception{ + + //설문지 정보 + System.out.println("===========!설문지정보!==========="); + VEAQestnrVO vEAQestnrVO = new VEAQestnrVO(); + vEAQestnrVO.setSiteId(p_siteId); //청소년 + vEAQestnrVO.setSiteIdCd(p_siteIdCd); //10-기본설문, 20-신청자설문, 30-강사설문 + vEAQestnrVO.setEduAplctOrd(p_eduAplctOrd); + vEAQestnrVO.setEduChasiOrd(p_eduChasiOrd); + vEAQestnrVO = p_vEALettnQestnrMIXService.selectDetail_MIX_LQI_02(vEAQestnrVO); + + vEAQestnrVO.setEduAplctOrd(p_eduAplctOrd); + vEAQestnrVO.setEduChasiOrd(p_eduChasiOrd); + List chasiSrvyList = p_vEALettnQestnrMIXService.selectDetail_MIX_LQI_04(vEAQestnrVO); + + if(chasiSrvyList.size() > 0) { + p_model.addAttribute("chasiSrvyEAList_TA",chasiSrvyList); + } + return p_model; } } \ No newline at end of file diff --git a/src/main/java/kcc/ve/oprtn/cpyrgExprnClsrm/oprtnAplctMng/web/OprtnAplctMngController.java b/src/main/java/kcc/ve/oprtn/cpyrgExprnClsrm/oprtnAplctMng/web/OprtnAplctMngController.java index b1a55feb..5b7d8e30 100644 --- a/src/main/java/kcc/ve/oprtn/cpyrgExprnClsrm/oprtnAplctMng/web/OprtnAplctMngController.java +++ b/src/main/java/kcc/ve/oprtn/cpyrgExprnClsrm/oprtnAplctMng/web/OprtnAplctMngController.java @@ -793,6 +793,39 @@ String[] order = { return modelAndView; } + /** + * 저작권 체험교실 서약서 파일 유무 체크 + * @param model + * @return + * @throws Exception + */ + @RequestMapping(value = "oprtnAplctSendFileChkAjax.do") + public ModelAndView oprtnAplctSendFileChkAjax(VEEduAplctVO vEEduAplctVO + , HttpServletRequest request, HttpServletResponse response) throws Exception { + + ModelAndView modelAndView = new ModelAndView(); + modelAndView.setViewName("jsonView"); + + vEEduAplctVO.setEduAplctOrdList(Arrays.asList(vEEduAplctVO.getChk().split(","))); + List vEEduAplctVOList = vEEduMIXService.selectExprnRsltFileDownList(vEEduAplctVO); + + List atchFileIdList = new ArrayList(); + vEEduAplctVOList.forEach( vo -> { + if(vo.getOathAtchFileId() != null) { + atchFileIdList.add(vo.getOathAtchFileId()); + } + }); + + if(atchFileIdList.size() < 1) { + modelAndView.addObject("result", "fail"); + modelAndView.addObject("msg", "첨부 파일이 없습니다."); + }else { + modelAndView.addObject("result", "success"); + } + + return modelAndView; + } + /** * 저작권 체험교실 운영현황 목록 결과보고 파일 일괄 다운로드 * @param model @@ -967,6 +1000,199 @@ String[] order = { printwriter.flush(); printwriter.close(); } + } + + /** + * 저작권 체험교실 운영현황 목록 서약서 파일 일괄 다운로드 + * @param model + * @return + * @throws Exception + */ + @RequestMapping(value = "oprtnAplctSendFileDownLoad.do") + public void oprtnAplctSendFileDownLoad(VEEduAplctVO vEEduAplctVO + , HttpServletRequest request, HttpServletResponse response) throws Exception { + + + vEEduAplctVO.setEduAplctOrdList(Arrays.asList(vEEduAplctVO.getChk().split(","))); + List vEEduAplctVOList = vEEduMIXService.selectExprnRsltFileDownList(vEEduAplctVO); + vEEduAplctVOList = egovCryptoUtil.decryptVEEduAplctVOList(vEEduAplctVOList); + //첨부파일있는 항목만 재배치 + String orgnZipNm = "서약서.zip"; + String downloadType = "A"; + //첨부파일있는 항목만 재배치 + List atchFileIdList = new ArrayList(); + List fileNmList = new ArrayList(); + vEEduAplctVOList.forEach( vo -> { + if(vo.getOathAtchFileId() != null) { + atchFileIdList.add(vo.getOathAtchFileId()); + fileNmList.add(vo.getScholInsttNm()+"_"+vo.getChrgNm()+"_서약서"); + } + }); + + FileVO fileVO = new FileVO(); + fileVO.setDownloadType(downloadType); + + fileVO.setAtchFileIdList(atchFileIdList); + + //IN에 들어간대로 정렬하기 위한 처리 + String orderQuery = "'"; + for(String fileId : atchFileIdList) { + orderQuery += fileId + ","; + } + orderQuery = orderQuery.substring(0, orderQuery.length() -1); //마지막 쉼표 삭제 + orderQuery += "' , a.ATCH_FILE_ID"; + fileVO.setOrderQuery(orderQuery); + + System.out.println("123555"); + + List fvoList = fileService.selectZipFileOrderList(fileVO); // 해당 기능에 맞게 파일 조회 + + System.out.println("123555"); + System.out.println(fvoList); + + int size = 1024; + byte[] buf = new byte[size]; + + String outZipNm = ""; + FileInputStream fis = null; + ZipArchiveOutputStream zos = null; + BufferedInputStream bis = null; + + + try { + outZipNm = fvoList.get(0).getFileStreCours()+File.separator + orgnZipNm; + }catch(Exception ex) { + ex.printStackTrace(); + } + + int fileCnt = 0; + try { + + System.out.println("outZipNm : "+ outZipNm); + // Zip 파일생성 + zos = new ZipArchiveOutputStream(new BufferedOutputStream(new FileOutputStream(outZipNm))); + + Iterator fvoIterator = fvoList.iterator(); + Iterator fileNmIterator = fileNmList.iterator(); + + while (fvoIterator.hasNext() && fileNmIterator.hasNext() ){ + FileVO vo = fvoIterator.next(); + String fileNm = fileNmIterator.next(); + zos.setEncoding("UTF-8"); + + // 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) { + System.out.println("getStreFileNm() " + vo.getStreFileNm()); + System.out.println("I find the existFile.txt"); + fileCnt++; + } else { + continue; + } + + /*String renamedFileName = generateRenamedFileName(vo.getOrignlFileNm());*/ + String renamedFileName = fileNm + "."+ vo.getFileExtsn(); + vo.setOrignlFileNm(renamedFileName); + + //buffer에 해당파일의 stream을 입력한다. + fis = new FileInputStream(vo.getFileStreCours() + "/" + vo.getStreFileNm()); + + bis = new BufferedInputStream(fis,size); + + //zip에 넣을 다음 entry 를 가져온다. + zos.putArchiveEntry(new ZipArchiveEntry(vo.getOrignlFileNm())); + + //준비된 버퍼에서 집출력스트림으로 write 한다. + int len; + while((len = bis.read(buf,0,size)) != -1) zos.write(buf,0,len); + + bis.close(); + fis.close(); + zos.closeArchiveEntry(); + } + + zos.close(); + + } catch (FileNotFoundException e) { + e.printStackTrace(); + }finally{ + if( zos != null ) zos.close(); + if( fis != null ) fis.close(); + if( bis != null ) bis.close(); + } + + System.out.println("123555000000000000000"); + System.out.println(fvoList); + + File uFile = null; + long fSize = 0; + + if (fvoList!=null) { + + try { + uFile = new File(fvoList.get(0).getFileStreCours(), orgnZipNm); + fSize = uFile.length(); + + if (fSize > 0) { + String mimetype = "application/x-msdownload"; + + response.setContentType(mimetype); + setDisposition(orgnZipNm, request, response); + //response.setContentLength(fSize); + + BufferedInputStream in = null; + BufferedOutputStream out = null; + + try { + in = new BufferedInputStream(new FileInputStream(uFile)); + out = new BufferedOutputStream(response.getOutputStream()); + + FileCopyUtils.copy(in, out); + out.flush(); + } catch (Exception ex) { + LOGGER.debug("IGNORED: {}", ex.getMessage()); + } finally { + if (in != null) { + try { + in.close(); + } catch (Exception ignore) { + LOGGER.debug("IGNORED: {}", ignore.getMessage()); + } + } + if (out != null) { + try { + out.close(); + } catch (Exception ignore) { + LOGGER.debug("IGNORED: {}", ignore.getMessage()); + } + } + } + //파일 다운로드 후 파일 삭제 + File delFile = new File(outZipNm); + delFile.delete(); + } else { + response.setContentType("application/x-msdownload"); + PrintWriter printwriter = response.getWriter(); + printwriter.println(""); + printwriter.println("


Could not get file name:
" + orgnZipNm + "

"); + printwriter.println("


Back

"); + printwriter.println("


© webAccess"); + printwriter.println(""); + printwriter.flush(); + printwriter.close(); + } + + }catch(Exception ex) { + ex.printStackTrace(); + + } + } + + + + } ////////////////////////////////////////////////////////////////////////////////////////////////////////////// // 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 e6a01301..8aab6e66 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 @@ -770,6 +770,57 @@ public class EduRsltMngTngrController { ex.printStackTrace(); } + + //설문 문항 정보-TA + try { + model = qustnrCommonUtil._qustnrQesItm_TA( + model + , VeConstants.LCTR_DIV_CD_10 //청소년 -10, 성인-20, ...VE0012 + , "20" //10-기본설문, 20-신청자설문, 30-강사설문 VEA012 + , "QTMPLA_0000000000001" + , vEALettnQestnrMIXService + , egovQustnrRespondInfoService + , vEEduAplctVO.getEduAplctOrd() + , vEEduAplctVO.getEduChasiOrd() + ); + + }catch(Exception ex) { + ex.printStackTrace(); + } + + + System.out.println("================================= Comtnqustnrqesitm ================================="); + // 설문조사 정보 - TA + try{ + model = qustnrCommonUtil._chasiSrvyList_TA( + model + , VeConstants.LCTR_DIV_CD_10 //청소년 -10, 성인-20, ...VE0012 + , "20" //10-기본설문, 20-신청자설문, 30-강사설문 VEA012 + , vEEduAplctVO.getEduAplctOrd() + , vEEduAplctVO.getEduChasiOrd() + , vEALettnQestnrMIXService + ); + + }catch(Exception ex) { + ex.printStackTrace(); + } + + + //개인별 만족도 관리 - chasiSrvyEAList - TA + try{ + model = qustnrCommonUtil._chasiSrvyEAList_TA( + model + , VeConstants.LCTR_DIV_CD_10 //청소년 -10, 성인-20, ...VE0012 + , "20" //10-기본설문, 20-신청자설문, 30-강사설문 VEA012 + , vEEduAplctVO.getEduAplctOrd() + , vEEduAplctVO.getEduChasiOrd() + , vEALettnQestnrMIXService + ); + + }catch(Exception ex) { + ex.printStackTrace(); + } + System.out.println("=============================================chasiSrvyEAList============================================="); /* diff --git a/src/main/webapp/WEB-INF/jsp/oprtn/cpyrgExprnClsrm/oprtnStateMngList.jsp b/src/main/webapp/WEB-INF/jsp/oprtn/cpyrgExprnClsrm/oprtnStateMngList.jsp index bf297afe..21aaac3b 100644 --- a/src/main/webapp/WEB-INF/jsp/oprtn/cpyrgExprnClsrm/oprtnStateMngList.jsp +++ b/src/main/webapp/WEB-INF/jsp/oprtn/cpyrgExprnClsrm/oprtnStateMngList.jsp @@ -211,6 +211,37 @@ } }); } + //서약서-일괄 다운로드 + function sendFileChk() { + var chkLen = $(listForm).find("input[name=chk]:checked").length; + if(chkLen ==0){ + alert("선택된 항목이 없습니다."); + return; + } + var downForm = new FormData(document.getElementById("listForm")); + $.ajax({ + type:"POST", + url: "", + data: downForm, + 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{ + sendFileDownLoad(); + } + + }, + error:function(request , status, error){ + alert("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+error); + } + }); + } function fileDownLoad() { var downForm = document.listForm; downForm.action = ""; @@ -221,6 +252,11 @@ downForm.action = ""; downForm.submit(); } + function sendFileDownLoad() { + var downForm = document.listForm; + downForm.action = ""; + downForm.submit(); + } 교육과정관리 @@ -361,12 +397,13 @@

건의 접수가 검색되었습니다.

+
diff --git a/src/main/webapp/WEB-INF/jsp/oprtn/tngrVisitEdu/eduRsltMngDetail.jsp b/src/main/webapp/WEB-INF/jsp/oprtn/tngrVisitEdu/eduRsltMngDetail.jsp index c92f71a2..06f18553 100644 --- a/src/main/webapp/WEB-INF/jsp/oprtn/tngrVisitEdu/eduRsltMngDetail.jsp +++ b/src/main/webapp/WEB-INF/jsp/oprtn/tngrVisitEdu/eduRsltMngDetail.jsp @@ -1012,12 +1012,108 @@ function replyCalculation(){ --> + +
+

교육 내용에 대한 전반적 만족도 평가(신청자)

+
+
+ + + + + + + + + + + + + + + + + + + + + + +
+

참석자

+
+ "> + + +

응답자

+
+ "> + +
등록된 평가문항이 없습니다.
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
평가문항매우만족만족보통불만족매우불만족
+ ${status1.count}) + + + + + + + + + + +
+
+
+ + + +