<%@page import="kr.co.kihyun.beans.entity.ecross.IRemotePersistable"%> <%@page import="kr.co.kihyun.beans.ecross.VCMCCMC2013"%> <%@page import="kr.co.kihyun.beans.ecross.ECrossInterface"%> <%@page import="kr.co.kihyun.beans.entity.MDept"%> <% /*********************************************************** * @@ Program Name : doc_list.jsp * @@ Description : /집계자/내문서함/진행함/문서 목록 * @@ Author : 기현테크 * @@ Create Date : 2010.11.18 * @@ History : 2014.09.30 Update by KWON,HAN : 페이징 처리하여 페이지별로 불러오도록 쿼리 수정 * @@******************************************************* */ %> <%@ page contentType="text/html; charset=UTF-8" import="java.net.URLEncoder" import="java.net.URLDecoder" import="java.util.List" import="java.util.Map" import="java.util.HashMap" import="java.util.Date" import="java.util.Calendar" import="java.text.SimpleDateFormat" import="javax.jdo.PersistenceManager" import="javax.jdo.Transaction" import="kr.co.kihyun.beans.user.HttpSSOLogin" import="kr.co.kihyun.lang.Encoder" import="kr.co.kihyun.lang.MInteger" import="kr.co.kihyun.lang.MString" import="kr.co.kihyun.moumi.MoumiConfig" import="kr.co.kihyun.moumi.Moumi" import="kr.co.kihyun.beans.entity.util.*" import="org.slf4j.Logger" import="org.slf4j.LoggerFactory" import="kr.co.kihyun.service.TotDocService" import="kr.co.kihyun.service.vo.TotDocVO"%> <%@ include file="/totsys/common/inc/sec/secure.inc.jsp"%> <% MPersistenceManager pm = new MPersistenceManager(PMF.get().getPersistenceManager()); Transaction tx = pm.currentTransaction(); try { Logger LOG = LoggerFactory.getLogger(this.getClass()); String usID = HttpSSOLogin.getLoginID(request); String dpID = HttpSSOLogin.getDeptID(request); int sysAuth = HttpSSOLogin.getSysAuth(request); String docType = clearXSS(request.getParameter("docType"), null); int strPage = MInteger.parseInt(request.getParameter("strPage"), 1); if(strPage <= 0) { strPage = 1; } String findOption = clearXSS(request.getParameter("findOption"), ""); String findWord = clearXSS(Encoder.toJava(request.getParameter("findWord")), ""); String method = clearXSS(request.getParameter("method"), ""); if (method.equals("GET")) { findWord = clearXSS(request.getParameter("findWord"), ""); } if(findWord != null){ String[] filter_word= {"--", "\\(", "\\)", "\\'", "\\\""}; for(int ii=0; ii< filter_word.length;ii++){ findWord = findWord.replaceAll(filter_word[ii], ""); } } String stDate = clearXSS(request.getParameter("stDate"),""); String edDate = clearXSS(request.getParameter("edDate"),""); MDept dpId = pm.getObjectById(MDept.class, dpID); String dpNM = dpId.getRootDept(pm).getId(); SimpleDateFormat dForomat = new SimpleDateFormat("yyyy-MM-dd"); Calendar date = Calendar.getInstance(); date.add(Calendar.MONTH, -12); Long prev_date = date.getTimeInMillis(); Long now_today = new Date().getTime(); if("".equals(stDate)) { stDate = dForomat.format(prev_date); } if("".equals(edDate)) { edDate = dForomat.format(now_today); } int wordLengthLimit = 50; /************ 리스트 페이지 구성 ************/ int pageSize = 0; int currentPage = 0; int currentPageSetUp = 0; int recordSize = 15; currentPage = strPage; currentPageSetUp = (int) (currentPage / 10) * 10; if (currentPage % 10 == 0) { currentPageSetUp -= 10; } tx.begin(); if (!"PRSS".equals(docType) && !"REG".equals(docType) && !"END".equals(docType)) { LOG.error("docType is not specified."); } //====================================================================== TotDocService docService = new TotDocService(pm); //검색조건파라미터 Map params = new HashMap(); params.put("userId", usID); params.put("deptId", dpID); params.put("findOption", findOption); params.put("filterValue", findWord); if("END".equals(docType)) { if(sysAuth == Moumi.SYSADM || sysAuth == Moumi.SUB_SYSADM || sysAuth == Moumi.SUB_TOTADM) { //SUB_TOTADM:6 추가 by wonseok Lee 20171101 params.put("stDate", stDate); params.put("edDate", edDate); } } //검색메인쿼리와 레코드갯수조회쿼리를 생성 후 멤버변수로 저장 docService.createDocListSearchQuery(params, docType); //레코드갯수조회쿼리를 실행하여 레코드갯수를 구함 int count = docService.getCountFromMainQuery(); if((count%recordSize) == 0){ pageSize = (int)(count/recordSize); }else{ pageSize = (int)(count/recordSize)+1; } if( currentPage > pageSize ) currentPage = pageSize; int startNo = (currentPage - 1) * recordSize + 1; int endNo = currentPage * recordSize; List list = null; //검색목록조회쿼리 실행 if( count > 0 ) { //페이징처리를 위한 추가파라미터 설정 docService.getParams().put("startNo", startNo); docService.getParams().put("endNo", endNo); //검색메인쿼리를 페이징처리를 위한 쿼리로 변환 docService.convertToPagenatingQuery(); //만족하는 레코드가 존재하면 조회 list = docService.executeQuery(TotDocVO.class); } tx.rollback(); %> <%=Moumi.getTitle()%>
<%@ include file="/totsys/common/inc/buttom/buttom.jsp"%>
<%if (count > 0) {%> <%} else {%> <%}%>
<% if (!"PRSS".equals(docType)) { %> <% } %>
<% if ("END".equals(docType)) { %> <%if(sysAuth == Moumi.SYSADM || sysAuth == Moumi.SUB_SYSADM || sysAuth == Moumi.SUB_TOTADM){%> <% } else { %> <% } %> <% } else { %> <% } %> <% if ("END".equals(docType)) { %> <%if(sysAuth == Moumi.SYSADM || sysAuth == Moumi.SUB_SYSADM || sysAuth == Moumi.SUB_TOTADM){%>      글머리 ~ 달력 <% } %> <% } %> <% if( "REG".equals(docType)){ %> 교육부 자료조회 <%}%>
<%=Moumi.getMessageBundle().getString(" /> <%=Moumi.getMessageBundle().getString(" /> <% // 종료자료인 경우 if (docType.equals("END")) { %> <%= Moumi.getMessageBundle().getString("moumi.message.tot_doc.user")%><%= Moumi.getMessageBundle().getString("moumi.message.tot_doc.share")%> <%=Moumi.getMessageBundle().getString(" /> <% } %> <%=Moumi.getMessageBundle().getString(" />
<%if (!"PRSS".equals(docType)) {%> <%}%> <% int index = 0; //배열에서 값을 꺼내오는 키값 int nextCount = 0; // if (currentPage > 1) { nextCount = ((currentPage - 1) * recordSize); } if( count > 0 ) { int listCount = list.size(); for(int i = 0; i < listCount; i++){ index = nextCount + i; TotDocVO docVO = (TotDocVO)list.get(i); %> <% if (!"PRSS".equals(docType)) { %> <% } %> <% } //end of for list } //end of if( count > 0) //tx.rollback(); %>
<%=Moumi.getMessageBundle().getString("moumi.message.tot_report.section")%> <%=Moumi.getMessageBundle().getString("moumi.message.tot_doc.executionCode")%> <%=Moumi.getMessageBundle().getString("moumi.message.tot_doc.doc")%><%=Moumi.getMessageBundle().getString("moumi.message.tot_doc.name")%> <%=Moumi.getMessageBundle().getString("moumi.message.tot_doc.request")%><%=Moumi.getMessageBundle().getString("moumi.message.totsys.sysadm.part.part_list_jsp")%> <%=Moumi.getMessageBundle().getString("moumi.message.tot_doc.request")%><%=Moumi.getMessageBundle().getString("moumi.message.tot_doc.person")%> <%=Moumi.getMessageBundle().getString("moumi.message.tot_doc.startDate")%> <%=Moumi.getMessageBundle().getString("moumi.message.tot_doc.endDate")%> <%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_report.compSnd")%>/<%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.all")%>(<%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.noteRecall")%>) <%=Moumi.getMessageBundle().getString("moumi.message.tot_doc.remark")%> <%=Moumi.getMessageBundle().getString("moumi.message.tot_doc.user")%><%=Moumi.getMessageBundle().getString("moumi.message.tot_doc.share")%>
<%if (docVO.getUserId() != null && !docVO.getUserId().equals(usID) && sysAuth == Moumi.TOTPER) {%>disabled<%}%> /> <%-- =docVO.getId()%> --%> <% if (docVO.isPeriodicalDoc() && docVO.isDocCollection()) {%> <%=Moumi.getMessageBundle().getString("moumi.message.tot_doc.create.periodical") + "/" + Moumi.getMessageBundle().getString("moumi.message.tot_doc.collection")%> <%} else if (docVO.isPeriodicalDoc() && !docVO.isDocCollection()) { %> <%=Moumi.getMessageBundle().getString("moumi.message.tot_doc.create.periodical") + "/" + Moumi.getMessageBundle().getString("moumi.message.tot_doc.file")%> <%} else if (!docVO.isPeriodicalDoc() && docVO.isDocCollection()) { %> <%=Moumi.getMessageBundle().getString("moumi.message.tot_doc.create.random") + "/" + Moumi.getMessageBundle().getString("moumi.message.tot_doc.collection")%> <%} else if (!docVO.isPeriodicalDoc() && !docVO.isDocCollection()) { %> <%=Moumi.getMessageBundle().getString("moumi.message.tot_doc.create.random") + "/" + Moumi.getMessageBundle().getString("moumi.message.tot_doc.file")%> <%}%> <%= docVO.getExecCode()%>  <%-- if ("PRSS".equals(docType)) { --%>    <%= MString.getEllipsis(docVO.getName(), wordLengthLimit)%> <%-- } else { %>    <%= MString.getEllipsis(docVO.getName(), wordLengthLimit)%> <% } --%> <%= MString.checkNull(docVO.getDeptName())%>  <%= docVO.getOwnerName()%> <%= docType.equals("REG") ? new SimpleDateFormat("yyyy-MM-dd HH:mm").format(docVO.getStartDate()) : new SimpleDateFormat("yyyy-MM-dd").format(docVO.getStartDate())%> > <% out.write(tmp2 + tstr + tcnt); %> <% //String tmpAllcnt = Long.toString(docVO.getAllCnt()); //String tmpSndcnt = Long.toString(docVO.getSndCnt()); //String tmpNotCcnt = Long.toString(docVO.getNoteCnt()); //out.write(tmpAllcnt + "/" + tmpSndcnt + "(" + tmpNotCcnt + ")"); out.write(docVO.getSndCnt() + "/" + docVO.getAllCnt() + "(" + docVO.getNoteCnt() + ")"); %> <%if (docVO.getRepId() != null && docVO.getRepId() != 0) { out.print(Moumi.getMessageBundle().getString("moumi.message.tot_doc.subDoc")); //연계등록자료 표시 }%>  <%if (docVO.getShareUserCount() > 0) { %> <%if (docVO.getShareDocRegId() != null && usID.equals(docVO.getShareDocRegId())) {%> <%}%> <%=docVO.getShareUserCount()%><%=Moumi.getMessageBundle().getString("moumi.message.doc.Name")%> <%if (usID.equals(docVO.getShareDocRegId())) {%> <%}%> <% } else {%>   <%}%>
<%-- --%>
<%=Moumi.getMessageBundle().getString("moumi.message.tot_doc.notDoc")%>
<% } catch (Exception ex) { ex.printStackTrace(); out.println(kr.co.kihyun.text.html.ServletUtil.getJavaScript("location='/servlet/kr.co.kihyun.beans.user.HttpSSOLogin?mode=logout';")); } finally { if (tx.isActive()) { tx.rollback(); } pm.close(); } %>