<% /*********************************************************** * @@ 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"%> <% PersistenceManager pm = new MPersistenceManager(PMF.get().getPersistenceManager()); Transaction tx = pm.currentTransaction(); try { Logger LOG = LoggerFactory.getLogger(this.getClass()); /** * ******** session³»ÀÇ userId ********* */ String usID = HttpSSOLogin.getLoginID(request); String dpID = HttpSSOLogin.getDeptID(request); int sysAuth = HttpSSOLogin.getSysAuth(request); /** * **** Parameter ***** */ 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 = URLDecoder.decode(MString.checkNull(request.getParameter("findWord")), "UTF-8"); // } // String uri = URLEncoder.encode("doc_list.jsp?docType=" + MString.checkNull(docType) + "&findOption=" + MString.checkNull(findOption), "UTF-8") + "&method=GET"; String stDate = clearXSS(request.getParameter("stDate"),""); String edDate = clearXSS(request.getParameter("edDate"),""); 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 = 30; /************ ¸®½ºÆ® ÆäÀÌÁö ±¸¼º ************/ 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) { 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){%> <% } else { %> <% } %> <% } else { %> <% } %> <% if ("END".equals(docType)) { %> <%if(sysAuth == Moumi.SYSADM || sysAuth == Moumi.SUB_SYSADM){%>      ~ <% } %> <% } %>
<% // Á¾·áÀÚ·áÀÎ °æ¿ì 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.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<%}%> /> <% if (docVO.isRegularDoc() && docVO.isDocCollection()) {%> <%} else if (docVO.isRegularDoc() && !docVO.isDocCollection()) { %> <%} else if (docVO.isDocCollection()) { %> <%} else if (!docVO.isDocCollection()) { %> <%}%> <% if ("PRSS".equals(docType)) { %>   &reportID=<%=docVO.getId()%>"><%= MString.getEllipsis(docVO.getName(), wordLengthLimit)%>--%> href="javascript:fn_goToViewReport('<%=docVO.getId()%>', '<%=docVO.getDeptId()%>');"> <%= MString.getEllipsis(docVO.getName(), wordLengthLimit)%> <% } else { %>   &reportID=<%=docVO.getId()%>"><%= MString.getEllipsis(docVO.getName(), wordLengthLimit)%>--%> href="javascript:fn_goToViewTotal('<%=docVO.getId()%>', '<%=docVO.getDeptId()%>');"> <%= 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(); } %>