2024-05-07 17:18 청소년 설문 수정, 체험교실 서약서 다운로드 추가

This commit is contained in:
myname 2024-05-07 17:19:07 +09:00
parent ca9563448b
commit e85aeee9c5
5 changed files with 502 additions and 4 deletions

View File

@ -69,6 +69,39 @@ public class QustnrCommonUtil {
return p_model; 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 <String, Object> commandMap =new HashMap<String, Object>();
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( public ModelMap _chasiSrvyList(
ModelMap p_model ModelMap p_model
@ -95,6 +128,31 @@ public class QustnrCommonUtil {
return p_model; 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<VEAQestnrVO> 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( public ModelMap _chasiSrvyEAList(
ModelMap p_model ModelMap p_model
, String p_siteId , String p_siteId
@ -123,4 +181,33 @@ public class QustnrCommonUtil {
return p_model; 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<VEAQestnrVO> chasiSrvyList = p_vEALettnQestnrMIXService.selectDetail_MIX_LQI_04(vEAQestnrVO);
if(chasiSrvyList.size() > 0) {
p_model.addAttribute("chasiSrvyEAList_TA",chasiSrvyList);
}
return p_model;
}
} }

View File

@ -793,6 +793,39 @@ String[] order = {
return modelAndView; 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<VEEduAplctVO> vEEduAplctVOList = vEEduMIXService.selectExprnRsltFileDownList(vEEduAplctVO);
List<String> atchFileIdList = new ArrayList<String>();
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 * @param model
@ -967,6 +1000,199 @@ String[] order = {
printwriter.flush(); printwriter.flush();
printwriter.close(); 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<VEEduAplctVO> vEEduAplctVOList = vEEduMIXService.selectExprnRsltFileDownList(vEEduAplctVO);
vEEduAplctVOList = egovCryptoUtil.decryptVEEduAplctVOList(vEEduAplctVOList);
//첨부파일있는 항목만 재배치
String orgnZipNm = "서약서.zip";
String downloadType = "A";
//첨부파일있는 항목만 재배치
List<String> atchFileIdList = new ArrayList<String>();
List<String> fileNmList = new ArrayList<String>();
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<FileVO> 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<FileVO> fvoIterator = fvoList.iterator();
Iterator<String> 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("<html>");
printwriter.println("<br><br><br><h2>Could not get file name:<br>" + orgnZipNm + "</h2>");
printwriter.println("<br><br><br><center><h3><a href='javascript: history.go(-1)'>Back</a></h3></center>");
printwriter.println("<br><br><br>&copy; webAccess");
printwriter.println("</html>");
printwriter.flush();
printwriter.close();
}
}catch(Exception ex) {
ex.printStackTrace();
}
}
} }
////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////
// //

View File

@ -770,6 +770,57 @@ public class EduRsltMngTngrController {
ex.printStackTrace(); 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============================================="); System.out.println("=============================================chasiSrvyEAList=============================================");
/* /*

View File

@ -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: "<c:url value='/kccadr/oprtn/cpyrgExprnClsrm/oprtnAplctSendFileChkAjax.do'/>",
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() { function fileDownLoad() {
var downForm = document.listForm; var downForm = document.listForm;
downForm.action = "<c:url value='/kccadr/oprtn/cpyrgExprnClsrm/oprtnAplctFileAllDownLoad.do'/>"; downForm.action = "<c:url value='/kccadr/oprtn/cpyrgExprnClsrm/oprtnAplctFileAllDownLoad.do'/>";
@ -221,6 +252,11 @@
downForm.action = "<c:url value='/kccadr/oprtn/cpyrgExprnClsrm/oprtnAplctRsltFileDownLoad.do'/>"; downForm.action = "<c:url value='/kccadr/oprtn/cpyrgExprnClsrm/oprtnAplctRsltFileDownLoad.do'/>";
downForm.submit(); downForm.submit();
} }
function sendFileDownLoad() {
var downForm = document.listForm;
downForm.action = "<c:url value='/kccadr/oprtn/cpyrgExprnClsrm/oprtnAplctSendFileDownLoad.do'/>";
downForm.submit();
}
</script> </script>
<title>교육과정관리</title> <title>교육과정관리</title>
</head> </head>
@ -361,12 +397,13 @@
<p class="list_util_p"><span><c:out value="${paginationInfo.totalRecordCount}" /></span>건의 접수가 검색되었습니다.</p> <p class="list_util_p"><span><c:out value="${paginationInfo.totalRecordCount}" /></span>건의 접수가 검색되었습니다.</p>
<div> <div>
<select class="sel2 sel_type1" name="pageUnit" id="pageUnit" onchange="linkPage(1);" title="줄 선택" style="width: 140px"> <select class="sel2 sel_type1" name="pageUnit" id="pageUnit" onchange="linkPage(1);" title="줄 선택" style="width: 140px">
<option value='10' <c:if test="${adjReqMgrVO.pageUnit == '10' or adjReqMgrVO.pageUnit == ''}">selected</c:if>>10줄</option> <option value='10' <c:if test="${vEEduAplctVO.pageUnit == '10' or vEEduAplctVO.pageUnit == ''}">selected</c:if>>10줄</option>
<option value='20' <c:if test="${adjReqMgrVO.pageUnit == '20'}">selected</c:if>>20줄</option> <option value='20' <c:if test="${vEEduAplctVO.pageUnit == '20'}">selected</c:if>>20줄</option>
<option value='30' <c:if test="${adjReqMgrVO.pageUnit == '30'}">selected</c:if>>30줄</option> <option value='30' <c:if test="${vEEduAplctVO.pageUnit == '30'}">selected</c:if>>30줄</option>
<option value='100' <c:if test="${adjReqMgrVO.pageUnit == '100'}">selected</c:if>>100줄</option> <option value='100' <c:if test="${vEEduAplctVO.pageUnit == '100'}">selected</c:if>>100줄</option>
</select> </select>
<button type="button" class="btn_type06" style="height:40px; border:1px solid #3a72db; font-size:16px; border-radius:5px; vertical-align:middle;" onclick="rsltFileChk();">결과보고 일괄 다운로드</button> <button type="button" class="btn_type06" style="height:40px; border:1px solid #3a72db; font-size:16px; border-radius:5px; vertical-align:middle;" onclick="rsltFileChk();">결과보고 일괄 다운로드</button>
<button type="button" class="btn_type06" style="height:40px; border:1px solid #3a72db; font-size:16px; border-radius:5px; vertical-align:middle;" onclick="sendFileChk();">서약서 일괄 다운로드</button>
<!-- <button type="button" class="btn_type06" style="height:40px; border:1px solid #3a72db; font-size:16px; border-radius:5px; vertical-align:middle;" onclick="fileChk();">신청서 일괄 다운로드</button> --> <!-- <button type="button" class="btn_type06" style="height:40px; border:1px solid #3a72db; font-size:16px; border-radius:5px; vertical-align:middle;" onclick="fileChk();">신청서 일괄 다운로드</button> -->
<button type="button" class="btn_down_excel" onclick="excelDownLoad();">엑셀 다운로드</button> <button type="button" class="btn_down_excel" onclick="excelDownLoad();">엑셀 다운로드</button>
</div> </div>

View File

@ -1012,12 +1012,108 @@ function replyCalculation(){
</div> </div>
--> -->
<!-- 문항리스트_상세 -->
<div class="tb_tit01">
<p>교육 내용에 대한 전반적 만족도 평가(신청자)</p>
</div>
<div class="tb_type02">
<table>
<c:if test="${!empty chasiSrvyList_TA}">
<colgroup>
<col style="width: 15%;">
<col style="width: 35%;">
<col style="width: 15%;">
<col style="width: 35%;">
</colgroup>
<tbody>
<tr>
<th scope="row">
<p>참석자</p>
</th>
<td>
<input type="hidden" class="popupInput" id="qestnrParticipant_TA" name="qestnrParticipant_TA" value="<c:out value="${qestnrParticipant_TA}"/>">
<c:out value="${qestnrParticipant_TA}"/>
</td>
<th scope="row">
<p>응답자</p>
</th>
<td>
<input type="hidden" class="popupInput" id="qestnrRespondent_TA" name="qestnrRespondent_TA" value="<c:out value="${qestnrRespondent_TA}"/>">
<c:out value="${qestnrRespondent_TA}"/>
</td>
</tr>
</tbody>
</c:if>
<c:if test="${empty chasiSrvyList_TA}">
<tr>
<td colspan="2">등록된 평가문항이 없습니다.</td>
</tr>
</c:if>
</table>
</div>
<c:if test="${!empty chasiSrvyList_TA}">
<div class="tb_type01 list2">
<table>
<colgroup>
<col style="width: auto;">
<col style="width: 12%;">
<col style="width: 12%;">
<col style="width: 12%;">
<col style="width: 12%;">
<col style="width: 12%;">
</colgroup>
<thead>
<tr>
<th scope="col">평가문항</th>
<th scope="col">매우만족</th>
<th scope="col">만족</th>
<th scope="col">보통</th>
<th scope="col">불만족</th>
<th scope="col">매우불만족</th>
</tr>
</thead>
<tbody>
<c:forEach items="${Comtnqustnrqesitm_TA}" var="QestmInfo" varStatus="status1">
<c:forEach items="${chasiSrvyList_TA}" var="chasiSrvyInfo" varStatus="">
<c:if test="${QestmInfo.qestnrQesitmId eq chasiSrvyInfo.qestnrQesitmId}">
<tr>
<th scope="row" class="t_left">
${status1.count}) <c:out value="${QestmInfo.qestnCn}" escapeXml="true" />
</th>
<td>
<c:out value="${chasiSrvyInfo.verySatisfied}"/>
</td>
<td>
<c:out value="${chasiSrvyInfo.satisfied}"/>
</td>
<td>
<c:out value="${chasiSrvyInfo.neither}"/>
</td>
<td>
<c:out value="${chasiSrvyInfo.dissatisfied}"/>
</td>
<td>
<c:out value="${chasiSrvyInfo.veryDissatisfied}"/>
</td>
</tr>
</c:if>
</c:forEach>
</c:forEach>
</tbody>
</table>
</div>
</c:if>
<!-- 문항리스트_상세 --> <!-- 문항리스트_상세 -->
<!--
<div class="tb_tit01"> <div class="tb_tit01">
<p>개인별 만족도 등록자 리스트</p> <p>개인별 만족도 등록자 리스트</p>
</div> </div>
-->
<c:if test="${!empty chasiSrvyEAList}"> <c:if test="${!empty chasiSrvyEAList}">
<!--
<div class="tb_type01 list2"> <div class="tb_type01 list2">
<table> <table>
<colgroup> <colgroup>
@ -1063,6 +1159,7 @@ function replyCalculation(){
</tbody> </tbody>
</table> </table>
</div> </div>
-->
</c:if> </c:if>