<%@page import="java.net.URLDecoder"%> <%@ page contentType="text/html; charset=UTF-8" import="java.net.URLEncoder" import="java.util.Date" import="java.text.*" import="kr.co.kihyun.util.MDate" import="kr.co.kihyun.lang.MLong" import="kr.co.kihyun.lang.MString" import="kr.co.kihyun.moumi.Moumi" import="kr.co.kihyun.moumi.MoumiUtil" import="kr.co.kihyun.beans.user.HttpSSOLogin" import="kr.co.kihyun.beans.user.UserGroup" import="kr.co.kihyun.beans.user.User" import="kr.co.kihyun.beans.user.UserGroupList" import="kr.co.kihyun.beans.user.Dept" import="kr.co.kihyun.lang.Encoder" import="kr.co.kihyun.beans.entity.MUser" import="java.util.*" import="javax.jdo.PersistenceManager" import="javax.jdo.Transaction" import="kr.co.kihyun.beans.entity.*" import="kr.co.kihyun.beans.entity.util.*" import="kr.co.kihyun.beans.entity.UserPart" import="kr.co.kihyun.service.*" import="kr.co.kihyun.service.vo.*" import="java.util.HashMap" import="java.util.Map" import="javax.jdo.Query" import="kr.co.kihyun.moumi.MoumiConfig" import="org.slf4j.Logger" import="org.slf4j.LoggerFactory" %> <%@ include file="/totsys/common/inc/sec/secure.inc.jsp"%> <% //final Logger LOG = LoggerFactory.getLogger(this.getClass()); PersistenceManager pm = new MPersistenceManager(PMF.get().getPersistenceManager()); Transaction tx = pm.currentTransaction(); try{ /********** session³»ÀÇ userId **********/ String usID = HttpSSOLogin.getLoginID(request); String deptID = HttpSSOLogin.getDeptID(request); int sysAuth = HttpSSOLogin.getSysAuth(request); /****** Parameter *******/ //String strPage = clearXSS(request.getParameter("strPage"),""); String searchType = clearXSS(request.getParameter("searchType"),""); String dateType = clearXSS(request.getParameter("dateType"),""); String stDate = clearXSS(request.getParameter("stDate"),""); String edDate = clearXSS(request.getParameter("edDate"),""); String searchOrgan = clearXSS(request.getParameter("search_organ"),""); String searchDept = clearXSS(request.getParameter("search_dept"),""); String chkboxDept = clearXSS(request.getParameter("chkbox_dept"),""); String chkboxSchool = clearXSS(request.getParameter("chkbox_school"),""); String searchOrganName = ""; tx.begin(); List list = null; DecimalFormat numberFormat = new DecimalFormat("#,###,###"); Long now_today = new Date().getTime(); SimpleDateFormat dForomat = new SimpleDateFormat("yyyy-MM-dd"); MDept mDept = pm.getObjectById(MDept.class, deptID); // if( LOG.isDebugEnabled() ) { // LOG.debug("sysAuth={}", sysAuth); // } boolean disableOrgan = false; boolean disableDept = false; DeptService deptService = new DeptService(pm); String sOrgan = "ALL"; String sDept = "ALL"; List organDeptList = null; List deptList = null; String rootDept = ""; //=========================================================== // ±³À°Ã», ºÎ¼­, Çб³¿¡ ´ëÇÑ ÄÞº¸¹Ú½º °ª Á¶È¸ //=========================================================== if( sysAuth == SysAuth.SYSADM.ordinal() ) { //9.½Ã½ºÅÛ°ü¸®ÀÚ rootDept = mDept.getRootDept(pm).getId(); organDeptList = deptService.getLOVFromDept(DeptService.TYPE.SAME_ROOT_DEPT, rootDept); }else if( sysAuth == SysAuth.SUB_SYSADM.ordinal() ) { //7.±â°ü½Ã½ºÅÛ°ü¸®ÀÚ sOrgan = mDept.getOrgan(); if( deptID.equals(sOrgan) ) { //±â°ü disableOrgan = true; organDeptList = new ArrayList(); CodeVO codeVO = new CodeVO(); codeVO.setCode(mDept.getName()); codeVO.setValue(mDept.getId()); organDeptList.add(codeVO); }else{ //ºÎ¼­, Çб³ sDept = deptID; disableOrgan = true; disableDept = true; organDeptList = new ArrayList(); CodeVO organCode = new CodeVO(); MDept mOrgan = pm.getObjectById(MDept.class, sOrgan); organCode.setCode(mOrgan.getName()); organCode.setValue(mOrgan.getId()); organDeptList.add(organCode); deptList = new ArrayList(); CodeVO codeVO = new CodeVO(); codeVO.setCode(mDept.getName()); codeVO.setValue(mDept.getId()); deptList.add(codeVO); Grade grade = mDept.getGrade(); if( grade == Grade.NULL ) { //ºÎ¼­ chkboxDept = "D"; }else{ //Çб³ chkboxSchool = "S"; } } } //=========================================================== if( !searchType.equals("") ) { sOrgan = searchOrgan; sDept = searchDept; String sDeptSchoolType = MString.checkNull(chkboxDept, chkboxSchool); StatisticsService service = new StatisticsService(pm); Map params = new HashMap(); params.put("organId", sOrgan); params.put("deptId", sDept); params.put("deptSchoolType", sDeptSchoolType); if( searchType.equals("all") ) { params.put("startDate", stDate); params.put("endDate", edDate); list = service.getStatisticsForAll(params); }else if( searchType.equals("period") ) { params.put("dateType", dateType); params.put("stDate", stDate); params.put("edDate", edDate); list = service.getStatisticsByDate(params); } } %> <%=Moumi.getTitle()%> <%----%>
<% if( !searchType.equals("") ) { %> <% } %> <%@ include file="/totsys/common/inc/buttom/buttom.jsp"%>
  " readonly onclick="showSetWin('searchForm.stDate');" style="cursor: pointer; vertical-align: middle;" class="inputtxt"> ~ " readonly onclick="showSetWin('searchForm.edDate');" style="cursor: pointer; vertical-align: middle;" class="inputtxt">    
          ¿¢¼¿ÀúÀå
<% if( searchType.equals("") || searchType.equals("period") ) { %>
<% int prssTot = 0; //Áý°èÁøÇàÇÕ°è int endTot = 0; //Áý°è¿Ï·áÇÕ°è int acceptTot = 0; //Á¢¼öÇÕ°è int tempTot = 0; //Á¦ÃâÁøÇàÇÕ°è int compTot = 0; //Á¦Ãâ¿Ï·áÇÕ°è for(int i = 0; i < list.size(); i++ ) { Object[] row = (Object[])list.get(i); prssTot += Integer.parseInt(row[1].toString()); endTot += Integer.parseInt(row[2].toString()); acceptTot += Integer.parseInt(row[3].toString()); tempTot += Integer.parseInt(row[4].toString()); compTot += Integer.parseInt(row[5].toString()); %> <% } %>
<%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.day")%> <%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.person")%> <%=MoumiConfig.getMessageBundle().getString("moumi.message.statistics.tot_doc")%> <%=MoumiConfig.getMessageBundle().getString("moumi.message.statistics.temp")%> <%=MoumiConfig.getMessageBundle().getString("moumi.message.statistics.tot_doc")%> <%=MoumiConfig.getMessageBundle().getString("moumi.message.statistics.complete")%> <%=MoumiConfig.getMessageBundle().getString("moumi.message.statistics.accept")%> <%=MoumiConfig.getMessageBundle().getString("moumi.message.statistics.tot_report")%> <%=MoumiConfig.getMessageBundle().getString("moumi.message.statistics.temp")%> <%=MoumiConfig.getMessageBundle().getString("moumi.message.statistics.tot_report")%> <%=MoumiConfig.getMessageBundle().getString("moumi.message.statistics.complete")%>
<%= row[0] %> <%= numberFormat.format(row[1]).trim() %> <%= numberFormat.format(row[2]).trim() %> <%= numberFormat.format(row[3]).trim() %> <%= numberFormat.format(row[4]).trim() %> <%= numberFormat.format(row[5]).trim() %>
<%=MoumiConfig.getMessageBundle().getString("moumi.message.total")%> <%= numberFormat.format(prssTot).trim() %> <%= numberFormat.format(endTot).trim() %> <%= numberFormat.format(acceptTot).trim() %> <%= numberFormat.format(tempTot).trim() %> <%= numberFormat.format(compTot).trim() %>
<% }else if( searchType.equals("all") ) { Object[] row = (Object[])list.get(0); %>
 <%=MoumiConfig.getMessageBundle().getString("moumi.message.statistics.tot_doc")%>
<%=MoumiConfig.getMessageBundle().getString("moumi.message.statistics.tot_doc")%> <%=MoumiConfig.getMessageBundle().getString("moumi.message.statistics.temp")%> <%= numberFormat.format(row[0]).trim() %> <%=MoumiConfig.getMessageBundle().getString("moumi.message.statistics.job")%>
<%=MoumiConfig.getMessageBundle().getString("moumi.message.statistics.tot_doc")%> <%=MoumiConfig.getMessageBundle().getString("moumi.message.statistics.complete")%> <%= numberFormat.format(row[1]).trim() %> <%=MoumiConfig.getMessageBundle().getString("moumi.message.statistics.job")%>

 <%=MoumiConfig.getMessageBundle().getString("moumi.message.statistics.tot_report")%>
<%=MoumiConfig.getMessageBundle().getString("moumi.message.statistics.accept")%> <%= numberFormat.format(row[2]).trim() %> <%=MoumiConfig.getMessageBundle().getString("moumi.message.statistics.job")%>
<%=MoumiConfig.getMessageBundle().getString("moumi.message.statistics.tot_report")%> <%=MoumiConfig.getMessageBundle().getString("moumi.message.statistics.temp")%> <%= numberFormat.format(row[3]).trim() %> <%=MoumiConfig.getMessageBundle().getString("moumi.message.statistics.job")%>
<%=MoumiConfig.getMessageBundle().getString("moumi.message.statistics.tot_report")%> <%=MoumiConfig.getMessageBundle().getString("moumi.message.statistics.complete")%> <%= numberFormat.format(row[4]).trim() %> <%=MoumiConfig.getMessageBundle().getString("moumi.message.statistics.job")%>
<% } %>
<% tx.commit(); }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(); } %>