statisic_attenance_result.jsp
上传用户:guhaomin
上传日期:2007-06-10
资源大小:23203k
文件大小:13k
源码类别:

电子政务应用

开发平台:

Java

  1. <jsp:useBean id="hrProxyBean" class="com.vnex.intranet.hr.employer_info.proxy.MemberInfoProxyBean" scope="application" />
  2. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  3. <HTML>
  4. <jsp:include page="/vnex/page/FORM_HEAD.jsp" />
  5. <script Language="JavaScript" src="/vnex/intranet/calendar/Popup.js"></script>
  6. <script language="JavaScript" src="/vnex/validate.js"></script>
  7. <script language = "JavaScript">
  8. function do_submit()
  9. {
  10.    var sDate = document.form1.sDate.value;
  11.    var eDate = document.form1.eDate.value;
  12.    if( sDate == "" || eDate == "" ) 
  13.    {
  14.        
  15.        alert("请您选择统计起止日期.");   
  16.        return false;
  17.    }
  18.    if( document.form1.sDate.value > document.form1.eDate.value )
  19.    {
  20.       alert("您选择的起始时间晚于结束时间,请重新选择统计起止日期.");
  21.       return false;
  22.    }
  23.    
  24.    
  25.    form1.action="/mainctrl/attendance/statistic/statisticAttendanceResult";
  26.    form1.submit();
  27. }
  28. </script>
  29. <BODY text=#000000 vLink=#000000 aLink=#000000 link=#000000 bgColor=#ffffff 
  30. topMargin=20 leftmargin="0" marginwidth="0" marginheight="0">
  31. <script language="JavaScript" src="/vnex/menu/dockmenu_hr.js"></script>
  32. <script language="JavaScript" src="/vnex/menu/dockmenu.js"></script>
  33. <%@ page import="com.vnex.intranet.util.FieldUtil" %> 
  34. <%@ page language="java" %>
  35. <%@ page import = "com.vnex.intranet.attendance.statistic.proxy.AttendanceStatisticProxyBean"%>
  36. <%@ page import = "com.vnex.intranet.attendance.statistic.value.AttendanceStatisticValueBean"%>
  37. <%@ page import = "com.vnex.intranet.hr.employer_info.value.MemberInfo"%>
  38. <%@ page import = "com.vnex.intranet.hr.employer_info.proxy.MemberInfoProxyBean"%>
  39. <%
  40.     int empId = -1;
  41.     String strEmpId = request.getParameter("empId");
  42.     if ( strEmpId != null)
  43.         empId = Integer.parseInt( strEmpId ); 
  44.          
  45. %>
  46. <%
  47.     AttendanceStatisticProxyBean statProxy = new AttendanceStatisticProxyBean();
  48.     AttendanceStatisticValueBean statValue = new AttendanceStatisticValueBean();    
  49.     statValue.setStartYear(String.valueOf(request.getParameter("sDate")).substring(0,4));
  50.     statValue.setStartMonth(String.valueOf(request.getParameter("sDate")).substring(5,7));
  51.     statValue.setStartDay(String.valueOf(request.getParameter("sDate")).substring(8,10));
  52.     statValue.setEndYear(String.valueOf(request.getParameter("eDate")).substring(0,4));
  53.     statValue.setEndMonth(String.valueOf(request.getParameter("eDate")).substring(5,7));
  54.     statValue.setEndDay(String.valueOf(request.getParameter("eDate")).substring(8,10));
  55.     int colorNum = 0;
  56.     String bgColor = "";
  57.     MemberInfoProxyBean mbProxy = new MemberInfoProxyBean();
  58.      MemberInfo mbInfo = new MemberInfo();
  59.     if( empId > 0)
  60.         mbInfo = mbProxy.infoFind(empId);
  61.     
  62. %>
  63. <DIV align=center>
  64. <form name="form1"  >
  65. <input type = "hidden" name = "empId" value = <%=empId%>>
  66.   <TABLE class=outter cellSpacing=0 cellPadding=0 width=600 border=0>
  67.     <jsp:include page="/vnex/page/TTOA_TABLE_TOP.jsp" />
  68.     <TR> 
  69.         <TD colSpan=3 align="center"> 
  70.           <!--菜单开始 -->
  71.           <!--菜单结束 -->
  72.           <br>
  73.           
  74.           <!--个人信息开始 -->
  75.           <table width="600" border="1" cellspacing="1" bordercolor="#666666">
  76.             <tr>
  77.               <td bgcolor="#fafafa"> 
  78.                <table class=title cellspacing=1 cellpadding=2 width="600" border=0>
  79.                    <tr bgcolor="#666666"> 
  80.                     <td colspan="2"><font class="strongw"><a href="/mainctrl/home/index"><font color="#FFFFFF">首页</font></a>&gt;&gt;<a href="/mainctrl/hr/main"><font color="#FFFFFF">人力资源</font></a>&gt;&gt;<a href="/mainctrl/intranet/hr/search_result"><font color="#FFFFFF">员工信息</font></a>&gt;&gt;<font color="#FFFFFF">考勤统计结果</font></td>
  81.                   </tr>
  82.                 <tr> 
  83.                     <td bgcolor="#fafafa" width="100%" colspan=3 align="left"><font class=strong>&nbsp;选择统计日期区间:</font> 
  84.                         <input type="text" name="sDate" readonly class=text size="20" value="">
  85.                       &nbsp;<img src="/vnex/intranet/calendar/datetime.gif" style="cursor:hand;" align="absmiddle" alt="弹出日历下拉菜单" onClick="fPopUpCalendarDlg(sDate);return false"> 
  86.                       至 
  87.                       <input type="text" name="eDate" readonly class=text size="20" value="">
  88.                       <img src="/vnex/intranet/calendar/datetime.gif" style="cursor:hand;" align="absmiddle" alt="弹出日历下拉菜单" onClick="fPopUpCalendarDlg(eDate);return false">
  89.                       &nbsp;<input  type="button" value="查找" name="Submit2" onClick = "do_submit()" class=text>
  90.                     </td>
  91.                   </tr>
  92.                 </table>
  93.  
  94.                 <table class=title cellspacing=1 cellpadding=2 width="600" 
  95. border=0>
  96.                  <%
  97.             int lateTimes = statProxy.getLateTimes(empId ,statValue);
  98.             int lateTotal = statProxy.getLateTotal(empId ,statValue);
  99.             int  earlyLeaveTimes = statProxy.getEarlyLeaveTimes(empId ,statValue);
  100.             int  earlyLeaveTotal = statProxy.getEarlyLeaveTotal(empId ,statValue);
  101.             %>
  102.                  <tr> 
  103.                     <td colspan=5 bgcolor="#e0e0e0">
  104.                     &nbsp;姓名:<%=mbInfo.getName()%>&nbsp;
  105.                     统计阶段: <%=statValue.getStartYear()%>.<%=statValue.getStartMonth()%>.<%=statValue.getStartDay()%>-- 
  106.                       <%=statValue.getEndYear()%>.<%=statValue.getEndMonth()%>.<%=statValue.getEndDay()%> 
  107.                          </td>
  108.             </tr> 
  109.             <tr align=middle> 
  110.               <td width="300"><font class=strong>迟到次数</font></td>
  111.               <td width="300"><font class=strong>总计迟到时间</font></td>
  112.             </tr>
  113.          <tr align=middle bgcolor="#e0e0e0"> 
  114.               <td width="300" bgcolor="#e0e0e0"><%=lateTimes%> 次 <br>
  115.               </td>
  116.               <td width="300"><%=lateTotal%> 分钟 <br>
  117.               </td>
  118.             </tr>
  119.             </table>
  120.           
  121.           <table class=title cellspacing=1 cellpadding=2 width="600" 
  122. border=0>
  123. <%
  124.                 String workDate = "";
  125.                 String checkInTime = "";
  126.                 String lateCount = "";
  127.                 java.util.Collection coll = statProxy.getLateRecord(empId ,statValue);
  128.                 java.util.Iterator iter = coll.iterator();
  129.                 String inNotes = "";
  130.                 if(iter.hasNext())
  131.                 {
  132. %>
  133.            <tr> 
  134.                     <td width="146" align="center"><font class=strong>日期</font></td>
  135.                     <td width="140" align="center"><font class=strong>上班时间</font></td>
  136.                     <td width="152" align="center"><font class=strong>迟到时间</font></td>
  137.                     <td colspan="2" width="137" align="center"><font class=strong>备注</font> 
  138.                     </td>
  139.              <%
  140.                
  141.                
  142.                 while (iter.hasNext())
  143.                 {
  144.                 //交错显示颜色
  145.                 colorNum++;
  146.                 if(colorNum%2==0)
  147.                 {
  148.                     bgColor = "#e0e0e0";
  149.                 }
  150.                 else
  151.                 {
  152.                      bgColor = "#fafafa";
  153.                 }
  154.                 com.vnex.intranet.attendance.statistic.value.AttendanceLateValueBean bean =
  155.                     (com.vnex.intranet.attendance.statistic.value.AttendanceLateValueBean ) iter.next();
  156.                 out.println("<tr bgColor="+bgColor+">");
  157.                 workDate = bean.getWorkDate();
  158.                 workDate = workDate.substring(0,10);
  159.                 
  160.                 if ( workDate.equals("null"))
  161.                 {
  162.                     workDate = "";
  163.                 }
  164.                 
  165.                 if ( bean.getCheckInTime().equals("null" ) )
  166.                 {
  167.                     checkInTime = "";
  168.                 }
  169.                 else
  170.                 {
  171.                     checkInTime = bean.getCheckInTime().toString().substring(0,16);
  172.                 }
  173.                 
  174.                 if ( bean.getLateCount().equals("null" ) )
  175.                 {
  176.                     lateCount = "";
  177.                 }
  178.                 else
  179.                 {
  180.                     lateCount = bean.getLateCount();
  181.                 }
  182.                 
  183.                 if( bean.getInNotes()==null ) 
  184.                 {
  185.                     inNotes = "";
  186.                 }
  187.                 else
  188.                 {
  189.                     inNotes = FieldUtil.filterScriptTag(FieldUtil.filterQuotTag(bean.getInNotes()));
  190.                 }
  191.                 if( !checkInTime.equals("") && !lateCount.equals("") )
  192.                 {
  193.                     out.println(" <td width='23%' align='center'>" + workDate + "</td>");
  194.                     out.println(" <td width='23%' align='center'>" + checkInTime + "</td>");
  195.                     out.println(" <td width='23%' align='center'>" + lateCount + "</td>");
  196.                      
  197.                     out.println(" <td width='23%' align='center'>" +inNotes + "</td>");
  198.                     out.println("</tr>");
  199.                 }
  200.             }   
  201.           }  
  202.             %>
  203.           </table>
  204.          
  205.           <table class=title cellspacing=1 cellpadding=2 width="600" 
  206. border=0>
  207.                   <tr align=middle> 
  208.                     <td width="300"><font class=strong>早退次数</font></td>
  209.                     <td width="300"><font class=strong>总计早退时间</font></td>
  210.             </tr>
  211.             <tr align=middle bgcolor="#e0e0e0"> 
  212.               <td width="300" bgcolor="#e0e0e0"><%=earlyLeaveTimes%> 次 <br>
  213.               </td>
  214.               <td width="300"><%=earlyLeaveTotal%> 分钟<br>
  215.               </td>
  216.             </tr>
  217.          
  218.           </table>
  219.           <table class=title cellspacing=1 cellpadding=2 width="600" 
  220. border=0>
  221. <%
  222.             java.util.Collection earlyLeaveColl = statProxy.getEarlyLeaveRecord(empId ,statValue);
  223.             java.util.Iterator earlyLeaveIter = earlyLeaveColl.iterator();
  224.             String offNotes = "";
  225.             String checkOffTime = "";
  226.             String leaveCount = "";
  227.             String offNote = "";
  228.             if(earlyLeaveIter.hasNext())
  229.             {
  230. %>
  231.                   <tr> 
  232.                     <td width="149" align="center"><font class=strong> 日期</font></td>
  233.                     <td width="139" align="center"><font class=strong>下班时间 </font></td>
  234.                     <td width="152" align="center"><font class=strong>早退时间</font></td>
  235.                     <td colspan="2" width="137" align="center"><font class=strong>备注</font> 
  236.                     </td>
  237.                   </tr>
  238.           
  239.             
  240.             <%
  241.            
  242.             while (earlyLeaveIter.hasNext())
  243.             {
  244.                 colorNum++;
  245.                 if(colorNum%2==0)
  246.                 {
  247.                     bgColor = "#e0e0e0";
  248.                 }
  249.                 else
  250.                 {
  251.                      bgColor = "#fafafa";
  252.                 }
  253.                 com.vnex.intranet.attendance.statistic.value.AttendanceLateValueBean earlyLeaveBean =
  254.                     (com.vnex.intranet.attendance.statistic.value.AttendanceLateValueBean ) earlyLeaveIter.next();
  255.                 out.println("<tr bgColor="+bgColor+">");
  256.                 workDate = earlyLeaveBean.getWorkDate();
  257.                 workDate = workDate.substring(0,10);
  258.                
  259.                 if ( workDate == null )
  260.                 {
  261.                     workDate = "";
  262.                 }
  263.                 
  264.                 if( earlyLeaveBean.getCheckOffTime() == null )
  265.                 {
  266.                     checkOffTime = "";
  267.                 }
  268.                 else
  269.                 {
  270.                     checkOffTime = earlyLeaveBean.getCheckOffTime().toString().substring(0,16);
  271.                 }
  272.                
  273.                 if( earlyLeaveBean.getEarlyLeaveCount() == null )
  274.                 {
  275.                     leaveCount = "";
  276.                 }
  277.                 else
  278.                 {
  279.                     leaveCount = earlyLeaveBean.getEarlyLeaveCount();
  280.                 }
  281.                
  282.                 if( earlyLeaveBean.getOffNotes()== null ) 
  283.                 {
  284.                    offNote = "";
  285.                 }
  286.                 else
  287.                 {
  288.                     offNote = FieldUtil.filterScriptTag(FieldUtil.filterQuotTag(earlyLeaveBean.getOffNotes()));
  289.                 }
  290.                 if ( !checkOffTime.equals("") && !leaveCount.equals("") )
  291.                 {
  292.                     out.println(" <td  width='23%' align='center'>" + workDate + "</td>");
  293.                     out.println(" <td  width='23%' align='center'>" + checkOffTime + "</td>");
  294.                     out.println(" <td  width='23%' align='center'>" + leaveCount + "</td>");
  295.                     out.println(" <td  width='23%' align='center'>" + offNote + "</td>");
  296.                     out.println("</tr>");
  297.                 }
  298.             }
  299.           }  
  300.             %>
  301.              
  302.           </table>
  303.                 </td>
  304.             </tr>
  305.             
  306.           </table>
  307.           <!--个人信息结束 -->
  308.          
  309.    
  310.           <!--休假事件表结束 -->
  311.           <jsp:include page="/vnex/page/TTOA_HELP.jsp" />
  312. </TD>
  313.     </TR>
  314.   <jsp:include page="/vnex/page/TTOA_TABLE_BOTTOM.jsp" />
  315.     </TABLE>
  316.   <BR>
  317.    <jsp:include page="/vnex/page/TTOA_PRODUCER_LOGO.jsp" />
  318.   </form></DIV>
  319. </BODY></HTML>