Merge branch 'hylee' into advc

This commit is contained in:
hylee 2024-03-12 16:11:59 +09:00
commit 485796c7e3
6 changed files with 389 additions and 77 deletions

View File

@ -2296,18 +2296,18 @@ public class CndtnTrgtMngController {
4000, 5000, 5000, 5000, 3000 4000, 5000, 5000, 5000, 3000
, 3000, 5000, 4000, 5000, 13000 , 3000, 5000, 4000, 5000, 13000
, 3500 , 3500, 13000
}; // 너비 }; // 너비
String[] header = { String[] header = {
"의뢰일", "사건번호", "관할청", "생년월일", "성명" "의뢰일", "사건번호", "관할청", "생년월일", "성명"
, "성별" , "의뢰번호", "의뢰상태", "교육상태", "주소" , "성별" , "의뢰번호", "의뢰상태", "교육상태", "주소"
, "검사명" , "검사명", "비공개메모"
}; // 헤더에 들어갈 이름 }; // 헤더에 들어갈 이름
String[] order = { String[] order = {
"ReqPnttm", "VntYear", "CmptntAthrt", "DBirth", "TrgtNm" "ReqPnttm", "VntYear", "CmptntAthrt", "DBirth", "TrgtNm"
, "Sex", "ReqNmbr", "ReqStateCd", "EduStateCd", "Addr" , "Sex", "ReqNmbr", "ReqStateCd", "EduStateCd", "Addr"
, "PrsctrNm" , "PrsctrNm", "Rmrks"
}; // vo 내부의 필드 이름 (첫글자 대문자, 낙타체 사용) }; // vo 내부의 필드 이름 (첫글자 대문자, 낙타체 사용)
excelDown( excelDown(

View File

@ -36,6 +36,7 @@ import kcc.com.cmm.service.FileVO;
import kcc.com.cmm.service.impl.CmmUseDAO; import kcc.com.cmm.service.impl.CmmUseDAO;
import kcc.com.cmm.spring.data.util.ExcelUtil; import kcc.com.cmm.spring.data.util.ExcelUtil;
import kcc.com.cmm.util.StringUtil; import kcc.com.cmm.util.StringUtil;
import kcc.com.utl.user.service.CheckFileUtil;
import kcc.com.utl.user.service.CheckLoginUtil; import kcc.com.utl.user.service.CheckLoginUtil;
import kcc.let.uat.uia.service.SsoLoginVO; import kcc.let.uat.uia.service.SsoLoginVO;
import kcc.let.uss.notify.service.NotifyManageService; import kcc.let.uss.notify.service.NotifyManageService;
@ -160,6 +161,9 @@ public class CndtnPrcsInfoMngController {
@Resource(name="EgovFileMngUtil") @Resource(name="EgovFileMngUtil")
private EgovFileMngUtil egovFileMngUtil; private EgovFileMngUtil egovFileMngUtil;
//파일 체크 util
@Resource(name = "checkFileUtil")
private CheckFileUtil checkFileUtil;
@ -687,6 +691,7 @@ public class CndtnPrcsInfoMngController {
, ModelMap model , ModelMap model
//, RedirectAttributes redirectAttributes //, RedirectAttributes redirectAttributes
, HttpServletRequest request , HttpServletRequest request
, final MultipartHttpServletRequest multiRequest
) throws Exception { ) throws Exception {
ModelAndView modelAndView = new ModelAndView(); ModelAndView modelAndView = new ModelAndView();
@ -706,11 +711,40 @@ public class CndtnPrcsInfoMngController {
SsoLoginVO ssoLoginVO = checkLoginUtil.getSSOLoginVO(request); //SSO 로그인 정보 가져오기 SsoLoginVO ssoLoginVO = checkLoginUtil.getSSOLoginVO(request); //SSO 로그인 정보 가져오기
//step2.파일 처리====================================
//파일 정상 처리 여부와 첨부 파일 정보
//String atchFileId = this.takeFile(multiRequest, modelAndView, bmVO);
//파일 제한 수량 가져오기, 없으면 기본값 사용
int i_file_limit = checkFileUtil.getLimitCount(request); // file count
int i_limit_size = checkFileUtil.getLimitSize(request); // file MB
String s_file_exts = checkFileUtil.getS_exts(); // file exts
String atchFileId = checkFileUtil.fileValCheckNdbInsert(
multiRequest, modelAndView
, "APLCT_" //file_name_prefix
, s_file_exts
, i_limit_size
, i_file_limit
); //EXT, MB size and ea
if ("ERROR".equals(atchFileId)) return modelAndView;
vEPrcsDetailVO.setFrstRegisterId(loginVO.getUniqId()); //esntl_id vEPrcsDetailVO.setFrstRegisterId(loginVO.getUniqId()); //esntl_id
vEPrcsDetailVO.setLctrDivCd(LCTR_DIV_CD); //강의구분코드 VE0011 10-청소년강의, 20-성인강의, 30-체험, 50-기반강화, 60-조건부 vEPrcsDetailVO.setLctrDivCd(LCTR_DIV_CD); //강의구분코드 VE0011 10-청소년강의, 20-성인강의, 30-체험, 50-기반강화, 60-조건부
vEPrcsDetailVO.setUseYn("Y"); vEPrcsDetailVO.setUseYn("Y");
String prcsAplctPrdOrd = prcsAplctPrdGnrService.getNextStringId(); // 고유ID String prcsAplctPrdOrd = prcsAplctPrdGnrService.getNextStringId(); // 고유ID
vEPrcsDetailVO.setPrcsAplctPrdOrd(prcsAplctPrdOrd); vEPrcsDetailVO.setPrcsAplctPrdOrd(prcsAplctPrdOrd);
vEPrcsDetailVO.setAtchFileId(atchFileId);
vEPrcsAplctPrdService.insert(vEPrcsDetailVO); vEPrcsAplctPrdService.insert(vEPrcsDetailVO);
@ -2184,6 +2218,15 @@ public class CndtnPrcsInfoMngController {
VEPrcsDetailVO vEPrcsDetailVODetail = vEPrcsAplctPrdService.selectDetailNewOne4Fndth(vEPrcsDetailVO); VEPrcsDetailVO vEPrcsDetailVODetail = vEPrcsAplctPrdService.selectDetailNewOne4Fndth(vEPrcsDetailVO);
//파일 정보 가져오기
FileVO fileVO = new FileVO();
fileVO.setAtchFileId(vEPrcsDetailVODetail.getAtchFileId());
List<FileVO> result = fileService.selectFileInfs(fileVO);
model.addAttribute("fileList", result);
model.addAttribute("fileListCnt", result.size());
ComDefaultCodeVO codeVO = new ComDefaultCodeVO(); ComDefaultCodeVO codeVO = new ComDefaultCodeVO();
codeVO.setCodeId("VEA001");//기관구분코드 codeVO.setCodeId("VEA001");//기관구분코드
codeVO.setCode(vEPrcsDetailVODetail.getPrcsDiv()); codeVO.setCode(vEPrcsDetailVODetail.getPrcsDiv());
@ -2206,6 +2249,7 @@ public class CndtnPrcsInfoMngController {
, ModelMap model , ModelMap model
//, RedirectAttributes redirectAttributes //, RedirectAttributes redirectAttributes
, HttpServletRequest request , HttpServletRequest request
, final MultipartHttpServletRequest multiRequest
) throws Exception { ) throws Exception {
ModelAndView modelAndView = new ModelAndView(); ModelAndView modelAndView = new ModelAndView();
@ -2227,12 +2271,33 @@ public class CndtnPrcsInfoMngController {
SsoLoginVO ssoLoginVO = checkLoginUtil.getSSOLoginVO(request); //SSO 로그인 정보 가져오기 SsoLoginVO ssoLoginVO = checkLoginUtil.getSSOLoginVO(request); //SSO 로그인 정보 가져오기
//step2.파일 처리====================================
//파일 정상 처리 여부와 첨부 파일 정보
//String atchFileId = this.takeFile(multiRequest, modelAndView, bmVO);
//파일 제한 수량 가져오기, 없으면 기본값 사용
int i_file_limit = checkFileUtil.getLimitCount(request); // file count
int i_limit_size = checkFileUtil.getLimitSize(request); // file MB
String s_file_exts = checkFileUtil.getS_exts(); // file exts
String atchFileId = checkFileUtil.fileValCheckNdbInsert(
multiRequest, modelAndView
, "APLCT_" //file_name_prefix
, s_file_exts
, i_limit_size
, i_file_limit
); //EXT, MB size and ea
if ("ERROR".equals(atchFileId)) return modelAndView;
//String prcsAplctPrdOrd = prcsAplctPrdGnrService.getNextStringId(); // 고유ID //String prcsAplctPrdOrd = prcsAplctPrdGnrService.getNextStringId(); // 고유ID
//vEPrcsDetailVO.setPrcsAplctPrdOrd(prcsAplctPrdOrd); //vEPrcsDetailVO.setPrcsAplctPrdOrd(prcsAplctPrdOrd);
vEPrcsDetailVO.setLctrDivCd("60"); //강의구분코드 VE0011 10-청소년강의, 20-성인강의, 30-체험, 50-기반강화, 60-조건부 vEPrcsDetailVO.setLctrDivCd("60"); //강의구분코드 VE0011 10-청소년강의, 20-성인강의, 30-체험, 50-기반강화, 60-조건부
vEPrcsDetailVO.setLastUpdusrId(loginVO.getUniqId()); //강의구분코드 VE0011 10-청소년강의, 20-성인강의, 30-체험, 50-기반강화, 60-조건부 vEPrcsDetailVO.setLastUpdusrId(loginVO.getUniqId()); //강의구분코드 VE0011 10-청소년강의, 20-성인강의, 30-체험, 50-기반강화, 60-조건부
//vEPrcsDetailVO.setUseYn("Y"); //vEPrcsDetailVO.setUseYn("Y");
vEPrcsDetailVO.setFrstRegisterId(loginVO.getUniqId()); //esntl_id vEPrcsDetailVO.setFrstRegisterId(loginVO.getUniqId()); //esntl_id
vEPrcsDetailVO.setAtchFileId(atchFileId);
vEPrcsAplctPrdService.update(vEPrcsDetailVO); vEPrcsAplctPrdService.update(vEPrcsDetailVO);

View File

@ -426,7 +426,17 @@
</td> </td>
</tr> </tr>
<tr>
<th scope="row">
<p>첨부파일</p>
</th>
<td>
<c:import url="/cmm/fms/selectBBSFileInfs.do" charEncoding="utf-8">
<c:param name="param_atchFileId" value="${info.atchFileId}" />
<c:param name="pdf_view" value="Y" />
</c:import>
</td>
</tr>
<%-- <tr> <%-- <tr>
<th scope="row"> <th scope="row">
<p>공개여부(사용여부)</p> <p>공개여부(사용여부)</p>

View File

@ -41,6 +41,12 @@
var prcsDiv = "<c:out value='${info.prcsDiv }' />"; var prcsDiv = "<c:out value='${info.prcsDiv }' />";
prcsDivChk(prcsDiv) prcsDivChk(prcsDiv)
$(".btn_type01").on('click', function(){
$("#file_temp").click();
});
}); });
/* /*
@ -161,6 +167,14 @@
} }
var data = new FormData(document.getElementById("createForm")); var data = new FormData(document.getElementById("createForm"));
//첨부파일 등록 처리-step2
_fileForm2.forEach(function(obj, idx) {
if (obj) data.append("file"+idx, obj.fileObj);
});
if(confirm("저장하시겠습니까?")){ if(confirm("저장하시겠습니까?")){
var url = "<c:url value='/kccadr/oprtn/cndtnSspnIdtmt/cndtnEduPrcsAplctPrdMngMdfyAjax.do'/>"; var url = "<c:url value='/kccadr/oprtn/cndtnSspnIdtmt/cndtnEduPrcsAplctPrdMngMdfyAjax.do'/>";
console.log(data); console.log(data);
@ -325,6 +339,86 @@
</td> </td>
</tr> </tr>
<tr>
<th scope="row">
<p class="req_text"><span>필수입력 항목</span>*</p>
<p>첨부파일</p>
</th>
<td class="upload_area" colspan="3">
<!-- <input type="text" id="fileNm" size="30" class="file_input" readonly> --><!-- <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" id="filebutton" class="btn_type01">파일 첨부하기</button>
<p style="padding-left:30px;">첨부파일 가능 용량은 20MB입니다. </p><!-- <p style="color:red;font-weight:500">업로드 순서는 1.신청서 2.안내문 입니다.</p> -->
<div class="file_wrap file_upload_box no_img_box">
<table class="tbType02">
<caption>첨부파일 리스트 : 파일명, 종류, 크기, 삭제</caption>
<colgroup>
<col style="width: 60%;">
<col style="width: auto;">
<col style="width: 20%;">
<col style="width: 10%;">
</colgroup>
<thead>
<!-- <th>
<input type="checkbox" id="all_check"><label for="all_check"></label>
</th> -->
<th scope="col">파일 명</th>
<th scope="col">종류</th>
<th scope="col">크기</th>
<th scope="col">삭제</th>
</thead>
<tbody class="tb_file_before">
<tr>
<td colspan="4">
<p>첨부하실 파일을 <span>마우스로 끌어서</span> 넣어주세요.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="file_wrap fileAfter file_list_div">
<table class="tbType02">
<caption>첨부파일 리스트 : 파일명, 종류, 크기, 삭제</caption>
<colgroup>
<col style="width: 60%">
<col style="width: 10%">
<col style="width: 20%">
<col style="width: 10%">
</colgroup>
<thead>
<!-- <th>
<input type="checkbox" id="all_check"><label for="all_check"></label>
</th> -->
<th scope="col">파일 명</th>
<th scope="col">종류</th>
<th scope="col">크기</th>
<th scope="col">삭제</th>
</thead>
<tbody id="tbody_fiielist" class="tb_file_after">
<c:forEach var="fileList" items="${fileList}" varStatus="status">
<tr class="item_<c:out value='${fileList.atchFileId}' />_<c:out value='${fileList.fileSn}' /> uploaded_obj">
<input type="hidden" name="fileSize" class="item_file_size" value="${fileList.fileSize}">
<td class="td_filename">
<!-- <img src="/direct/img/upload_hwp_img.png" alt="" /> -->
<span class="file_name_text"><c:out value='${fileList.orignlFileNm}' /></span>
</td>
<td class="td_filesort">
<span class="file_filesort_text" value="<c:out value="${fileList.fileExtsn}"/>"><c:out value="${fileList.fileExtsn}"/></span>
</td>
<td class="td_filesize">
<span class="file_size_text" value="<c:out value="${fileList.fileMg}"/>"><c:out value="${fileList.fileMg}"/></span>
</td>
<td>
<button type="button" class="btn_del" onclick="delAtchFile('<c:out value='${fileList.atchFileId}' />', '<c:out value='${fileList.fileSn}' />'); return false;" title="파일삭제"><i></i></button>
</td>
</tr>
</c:forEach>
</tbody>
</table>
</div>
</td>
</tr>
</tbody> </tbody>
</table> </table>
</div> </div>

View File

@ -47,7 +47,13 @@
}); });
var prcsDiv = "<c:out value='${prcsDiv }' />"; var prcsDiv = "<c:out value='${prcsDiv }' />";
prcsDivChk(prcsDiv) prcsDivChk(prcsDiv);
$(".btn_type01").on('click', function(){
$("#file_temp").click();
});
}); });
@ -75,10 +81,21 @@
} }
var data = new FormData(document.getElementById("createForm")); var data = new FormData(document.getElementById("createForm"));
//첨부파일 등록 처리-step2
_fileForm2.forEach(function(obj, idx) {
if (obj) data.append("file"+idx, obj.fileObj);
});
if(confirm("저장하시겠습니까?")){ if(confirm("저장하시겠습니까?")){
var url = "${pageContext.request.contextPath}/kccadr/oprtn/cndtnSspnIdtmt/cndtnEduPrcsAplctPrdMngRegAjax.do"; var url = "${pageContext.request.contextPath}/kccadr/oprtn/cndtnSspnIdtmt/cndtnEduPrcsAplctPrdMngRegAjax.do";
$.ajax({ $.ajax({
type:"POST", type:"POST",
enctype: 'multipart/form-data',
url: url, url: url,
data: data, data: data,
dataType:'json', dataType:'json',
@ -131,6 +148,40 @@
listForm.submit(); listForm.submit();
} }
/* 파일등록 */
var _fileIdx = 0;
var _fileForm2 = new Array();
function handleFileUpload(files,obj) //업로드 function
{
console.log('files', files);
var limitsize = 20*1024*1024; //파일 제한 체크(1개, 20MB)
for (var i = 0; i < files.length; i++){
if(files[i].size > limitsize){
alert(files[i].name+"파일 사이즈가"+getStrFileSize(files[i].size)+"로 20MB이하만 업로드 가능합니다.");
return ;
}
}
for (var i = 0; i < files.length; i++)
{
var fd = new FormData();
fd.append('file', files[i]);
var tmpObj = new Object();
tmpObj.name = "file_" + _fileIdx;
tmpObj.fileObj = files[i];
_fileForm2.push(tmpObj);
sendFileToServer(fd, obj, files[i], _fileIdx);
_fileIdx++;
var totalfileSize = 0;
$('.totalfileCount').text($('.item_file_size').length) ;
$('.item_file_size').each(function(){
totalfileSize += $(this).val()*1 ;
});
$('.totalfileSize').text(getStrFileSize(totalfileSize)) ;
}
}
</script> </script>
</head> </head>
@ -248,6 +299,87 @@
<kc:select codeId="VEA004" name="ddlnCd" id="ddlnCd" defaultText="전체" defaultValue="" css="class='sel_type1'" /> <kc:select codeId="VEA004" name="ddlnCd" id="ddlnCd" defaultText="전체" defaultValue="" css="class='sel_type1'" />
</td> </td>
</tr> </tr>
<tr>
<th scope="row">
<p class="req_text"><span>필수입력 항목</span>*</p>
<p>첨부파일</p>
</th>
<td class="upload_area" colspan="3">
<!-- <input type="text" id="fileNm" size="30" class="file_input" readonly> --><!-- <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" id="filebutton" class="btn_type01">파일 첨부하기</button>
<p style="padding-left:30px;">첨부파일 가능 용량은 20MB입니다. </p><!-- <p style="color:red;font-weight:500">업로드 순서는 1.신청서 2.안내문 입니다.</p> -->
<div class="file_wrap file_upload_box no_img_box">
<table class="tbType02">
<caption>첨부파일 리스트 : 파일명, 종류, 크기, 삭제</caption>
<colgroup>
<col style="width: 60%;">
<col style="width: auto;">
<col style="width: 20%;">
<col style="width: 10%;">
</colgroup>
<thead>
<!-- <th>
<input type="checkbox" id="all_check"><label for="all_check"></label>
</th> -->
<th scope="col">파일 명</th>
<th scope="col">종류</th>
<th scope="col">크기</th>
<th scope="col">삭제</th>
</thead>
<tbody class="tb_file_before">
<tr>
<td colspan="4">
<p>첨부하실 파일을 <span>마우스로 끌어서</span> 넣어주세요.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="file_wrap fileAfter file_list_div">
<table class="tbType02">
<caption>첨부파일 리스트 : 파일명, 종류, 크기, 삭제</caption>
<colgroup>
<col style="width: 60%">
<col style="width: 10%">
<col style="width: 20%">
<col style="width: 10%">
</colgroup>
<thead>
<!-- <th>
<input type="checkbox" id="all_check"><label for="all_check"></label>
</th> -->
<th scope="col">파일 명</th>
<th scope="col">종류</th>
<th scope="col">크기</th>
<th scope="col">삭제</th>
</thead>
<tbody id="tbody_fiielist" class="tb_file_after">
<c:forEach var="fileList" items="${fileList}" varStatus="status">
<tr class="item_<c:out value='${fileList.atchFileId}' />_<c:out value='${fileList.fileSn}' /> uploaded_obj">
<input type="hidden" name="fileSize" class="item_file_size" value="${fileList.fileSize}">
<td class="td_filename">
<!-- <img src="/direct/img/upload_hwp_img.png" alt="" /> -->
<span class="file_name_text"><c:out value='${fileList.orignlFileNm}' /></span>
</td>
<td class="td_filesort">
<span class="file_filesort_text" value="<c:out value="${fileList.fileExtsn}"/>"><c:out value="${fileList.fileExtsn}"/></span>
</td>
<td class="td_filesize">
<span class="file_size_text" value="<c:out value="${fileList.fileMg}"/>"><c:out value="${fileList.fileMg}"/></span>
</td>
<td>
<button type="button" class="btn_del" onclick="delAtchFile('<c:out value='${fileList.atchFileId}' />', '<c:out value='${fileList.fileSn}' />'); return false;" title="파일삭제"><i></i></button>
</td>
</tr>
</c:forEach>
</tbody>
</table>
</div>
</td>
</tr>
</tbody> </tbody>
</table> </table>
</div> </div>

View File

@ -465,6 +465,17 @@
</c:choose> </c:choose>
</td> </td>
</tr> </tr>
<tr>
<th scope="row">
<p>첨부파일</p>
</th>
<td>
<c:import url="/cmm/fms/selectBBSFileInfs.do" charEncoding="utf-8">
<c:param name="param_atchFileId" value="${info.atchFileId}" />
<c:param name="pdf_view" value="Y" />
</c:import>
</td>
</tr>
</tbody> </tbody>
</table> </table>
</div> </div>