<%-- Document : report_list.jsp Created on : 2014. 8. 19, ¿ÀÈÄ 5:12:19 Author : choyoungjun * ¾÷¹«Æ÷Å» ¿¬°èÆ÷Ʋ¸´ ¼³Á¤¹æ¹ý 1. ¾÷¹«Æ÷Å»¿¡ °ü¸®ÀÚ·Î ·Î±×ÀÎ 2. ¿ìÃø »ó´Ü [°ü¸®ÀÚ] Ŭ¸¯ -> [Æ÷Åкô´õ] Ŭ¸¯ 3. ÁÂÃø ¸Þ´º [Æ÷Ʋ¸´] Ŭ¸¯ 4. Æ÷Ʋ¸´ ã±â (2014.08.20 ±âÁØ Æ÷Ʋ¸´¸íÀÌ "ÀÚ·áÁý°è¸ñ·Ï" À¸·Î ÀúÀåµÇ¾îÀÖÀ½) --%> <%@page import="kr.co.kihyun.moumi.MoumiConfig"%> <%@page import="java.util.Date"%> <%@page import="java.util.Calendar"%> <%@page import="java.util.List"%> <%@page import="java.util.Map"%> <%@page import="java.util.HashMap"%> <%@page import="java.text.SimpleDateFormat"%> <%@page import="javax.jdo.Transaction"%> <%@page import="kr.co.kihyun.moumi.Moumi"%> <%@page import="kr.co.kihyun.lang.Encoder"%> <%@page import="kr.co.kihyun.lang.MInteger"%> <%@page import="kr.co.kihyun.lang.MString"%> <%@page import="kr.co.kihyun.beans.entity.MUser"%> <%@page import="kr.co.kihyun.beans.entity.*"%> <%@page import="kr.co.kihyun.beans.entity.TotReportProcess"%> <%@page import="kr.co.kihyun.beans.entity.util.PMF"%> <%@page import="kr.co.kihyun.beans.entity.util.MPersistenceManager"%> <%@page import="kr.co.kihyun.beans.user.HttpSSOLogin"%> <%@page import="kr.co.kihyun.service.vo.TotReportVO"%> <%@page import="kr.co.kihyun.service.TotReportService"%> <%@page contentType="text/html" pageEncoding="EUC-KR"%> <%@ include file="/totsys/common/inc/sec/secure.inc.jsp"%> <% String currentServerName = request.getServerName(); //System.out.println("=====> currentServerName : " + currentServerName); String usID = (String) session.getAttribute("SSO_USER_ID"); String dpID = HttpSSOLogin.getDeptID(request); if (MString.isNull(usID)) { if (MString.isNull(HttpSSOLogin.getLoginID(request))) { out.println("
¡Ø ÅëÇշα×ÀÎ(SSO)ÀÌ µÇÁö ¾Ê¾Æ ³»¿ëÀ» Ç¥½ÃÇÒ ¼ö ¾ø½À´Ï´Ù.
"); return; } else { usID = HttpSSOLogin.getLoginID(request); } } //System.out.println("=====> usID : " + usID); MPersistenceManager pm = new MPersistenceManager(PMF.get().getPersistenceManager()); Transaction tx = pm.currentTransaction(); try { /********** Parameter **********/ String strPage = clearXSS(request.getParameter("strPage"),""); String findOption = clearXSS(request.getParameter("findOption"),null); String findWord = clearXSS(Encoder.toJava(request.getParameter("findWord")),null); //String method = clearXSS(request.getParameter("method"),""); //if(method.equals("GET")) findWord = URLDecoder.decode(MString.checkNull(request.getParameter("findWord")), "UTF-8"); //String uri = URLEncoder.encode("report_list.jsp?findOption="+MString.checkNull(findOption),"UTF-8")+"&method=GET"; int docNameLengthLimit = 30; // Á¦¸ñ(ÀÚ·á¸í) ±æÀÌ Á¦ÇÑ tx.begin(); String tmpMagam; int pageSize=0; int currentPage=0; int currentPageSetUp=0; int recordSize=3; // Ãâ·Â ·¹ÄÚµå °¹¼ö if(strPage == null || strPage.length()<=0) { currentPage = 1; } else if(strPage.equals("null")) { currentPage = 1; } else { try { currentPage=Integer.parseInt(strPage); } catch(NumberFormatException ex) { System.out.println(ex); } } //====================================================================== MUser mUser = pm.getObjectById(MUser.class, usID); SysAuth sysAuth = mUser.getSysAuth(); TotReportService reportService = new TotReportService(pm); //°Ë»öÁ¶°ÇÆÄ¶ó¹ÌÅÍ(¿¬°èÆ÷Ʋ¸´¿¡¼­´Â °Ë»ö ±â´ÉÀÌ Á¦¿ÜµÈ´Ù.) Map params = new HashMap(); params.put("findOption", findOption); params.put("filterValue", findWord); params.put("userId", usID); params.put("deptId", dpID); params.put("sysAuth", mUser.getSysAuth()); //°Ë»ö¸ÞÀÎÄõ¸®¿Í ·¹Äڵ尹¼öÁ¶È¸Äõ¸®¸¦ »ý¼º ÈÄ ¸â¹öº¯¼ö·Î ÀúÀå reportService.createAcceptReportListSearchQuery(params); //·¹Äڵ尹¼öÁ¶È¸Äõ¸®¸¦ ½ÇÇàÇÏ¿© ·¹Äڵ尹¼ö¸¦ ±¸ÇÔ int count = reportService.getCountFromMainQuery(); if((count%recordSize) == 0) { pageSize = (int)(count/recordSize); } else { pageSize = (int)(count/recordSize)+1; } if( currentPage > pageSize ) currentPage = pageSize; currentPageSetUp = (int)(currentPage/10)*10; if (currentPage%10 == 0) { currentPageSetUp-=10; } int startNo = (currentPage - 1) * recordSize + 1; int endNo = currentPage * recordSize; List list = null; //°Ë»ö¸ñ·ÏÁ¶È¸Äõ¸® ½ÇÇà if( count > 0 ) { //ÆäÀ̡󸮸¦ À§ÇÑ Ãß°¡ÆÄ¶ó¹ÌÅÍ ¼³Á¤ reportService.getParams().put("startNo", startNo); reportService.getParams().put("endNo", endNo); //°Ë»ö¸ÞÀÎÄõ¸®¸¦ ÆäÀ̡󸮸¦ À§ÇÑ Äõ¸®·Î º¯È¯ reportService.convertToPagenatingQuery(); //¸¸Á·ÇÏ´Â ·¹Äڵ尡 Á¸ÀçÇϸé Á¶È¸ list = reportService.executeQuery(TotReportVO.class); } //====================================================================== tx.rollback(); SimpleDateFormat ymdFormat = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Calendar cal = Calendar.getInstance(); String nowTime = ""; nowTime = sdf.format(cal.getTime()); Date nowDate = sdf.parse(nowTime); %> ¾÷¹«Æ÷Å» ¸ÞÀÎÆäÀÌÁö ¿¬°èÆ÷Ʋ¸´
<% tx.begin(); if( count > 0 ) { int listCount = list.size(); for(int i = 0; i < listCount; i++){ TotReportVO reportVO = (TotReportVO)list.get(i); String tmpMoumiAcptLimitStrategy = Integer.toString(reportVO.getSubmitLimitCnt()); String tmp2= null; String tstr = "½Ã Á¾·á"; String tcnt; tcnt = "("+Integer.toString(reportVO.getSubmitLimitCnt())+"°³ ±â°ü)"; if(tmpMoumiAcptLimitStrategy.equals("0")){ tmp2 = new SimpleDateFormat("yyyy-MM-dd HH").format(reportVO.getEndDate()); tcnt = ""; }else{ tmp2 = Moumi.getMessageBundle().getString("moumi.message.tot_doc.endBySubmitTotal"); tstr = ""; } if(tmp2.contains("9999-12-30")) tmp2=Moumi.getMessageBundle().getString("moumi.message.tot_doc.endManually"); if(tmp2.equals(Moumi.getMessageBundle().getString("moumi.message.tot_doc.endManually"))) tstr = ""; tmpMagam = tmp2; %> <% } //end of for list } //end of if( count > 0) else { %> <% } tx.rollback(); %>
<%=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")%> <%=Moumi.getMessageBundle().getString("moumi.message.tot_doc.remark")%>
<%= MString.getEllipsis(reportVO.getDocName(), docNameLengthLimit) %> <%= MString.checkNull(reportVO.getDeptName()) %> <%= MString.checkNull(reportVO.getDocOwnerName()) %> <%=ymdFormat.format(reportVO.getStartDate())%> <% out.write(tmp2+tstr+tcnt); %> <%if(reportVO.getDownDocId() == 0){%> <%if(reportVO.getPrss() == 3){%> <%=TotReportProcess.RETURN %> <%}%>  <%}else{%> <%if(reportVO.getPrss() == 3){%> <%=TotReportProcess.RETURN %> <%}%> <%}%> 
Á¢¼öµÈ ÀÚ·á°¡ ¾ø½À´Ï´Ù.
<% } 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(); } %>