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

电子政务应用

开发平台:

Java

  1. <%
  2. /**
  3.  * $RCSfile: employee_stipend_statistic.jsp,v $
  4.  * $Revision: 1.0 $
  5.  * $Date: 2001/05/17 20:57:46 $
  6.  * /mainctrl/intranet/hr/salary_statistic
  7.  */
  8. %>
  9. <%@ page errorPage="/vnex/ErrorPage.jsp" %>
  10. <%@ page import="com.vnex.intranet.hr.employer_info.value.*"%>
  11. <%@ page import="com.vnex.intranet.hr.employer_info.process.*"%>
  12. <%@ page import="com.vnex.intranet.hr.util.*"%>
  13. <%@ page import="java.util.*" %>
  14. <%@ page import="java.sql.Timestamp" %>
  15. <%@ page import="java.text.DecimalFormat" %>
  16. <%@ taglib uri="/vnex.tld" prefix="vnex" %>
  17. <%@ taglib uri="/vnex_organization.tld" prefix="org" %>
  18. <%@ taglib uri="/vnex_hr.tld" prefix="hr" %>
  19. <jsp:useBean id="salaryProxyBean" class="com.vnex.intranet.hr.employer_info.proxy.SalaryProxyBean" scope="application" />
  20. <jsp:useBean id="hrProxyBean" class="com.vnex.intranet.hr.employer_info.proxy.MemberInfoProxyBean" scope="application" />
  21. <%
  22.     String sDate = request.getParameter("sYear") + "-" + request.getParameter("sMonth") + "-01";
  23.     Collection pageAllColl = new ArrayList();
  24.     int emp_id = -1;
  25.     int deIdTemp = -1;
  26.     DecimalFormat dFormat = new DecimalFormat("##.##");
  27.     if ( request.getParameter("emp_id") != null )
  28.     {
  29.         emp_id = Integer.parseInt( request.getParameter("emp_id") );
  30.     }
  31. //    if ( request.getParameter("doChange") != null )
  32. //    {
  33.     if ( request.getParameter("devisionId") != null )
  34.         deIdTemp = Integer.parseInt( request.getParameter("devisionId") );
  35. //    }
  36.     String emp_name = request.getParameter("emp_name");
  37.     MemberDateSalary pageColl = new MemberDateSalary();
  38.     //String sDate = request.getParameter("sDate");
  39.     //查询员工单月工资单
  40.     if ( sDate != null && sDate.length()>0 && emp_id >0 && request.getParameter("doSearch") != null )
  41.     {
  42.         pageColl = salaryProxyBean.dateFind( emp_id, sDate );
  43.         if ( pageColl.getComponent().size() > 0 )
  44.         {
  45.             pageAllColl.add( pageColl );
  46.         }
  47.     }
  48.     //查询部门所有员工单月工资情况
  49.     else if ( sDate != null && emp_id == -1 && deIdTemp > 0 && request.getParameter("doSearch") != null )
  50.     {
  51.         pageAllColl = salaryProxyBean.dateFindByDep( deIdTemp, sDate );
  52.     }
  53.     //查询员工所有月份工资单情况,暂时不会执行
  54.     else if ( emp_id >0 && request.getParameter("doSearch") != null )
  55.     {
  56.         pageAllColl = salaryProxyBean.dateFind( emp_id );
  57.     }
  58.     //查询公司所有员工的工资单情况
  59.     else if ( sDate != null && deIdTemp == 0 && sDate.length()>0 && emp_id <0 && request.getParameter("doSearch") != null )
  60.     {
  61.         pageAllColl = salaryProxyBean.dateFind( sDate );
  62.     }
  63. %>
  64. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  65. <HTML>
  66. <jsp:include page="/vnex/page/FORM_HEAD.jsp" />
  67. <script language="JavaScript1.2" src="/vnex/menu/dockmenu_hr.js"></script>
  68. <script language="JavaScript" src="/vnex/menu/dockmenu.js"></script>
  69. <script language="JavaScript" src="/vnex/validate.js"></script>
  70. <script language=JavaScript>
  71. function change(select)
  72. {
  73.     form1.action="/mainctrl/intranet/hr/salary_statistic?doChange=1";
  74.     form1.submit();
  75. }
  76. </script>
  77. <BODY text=#000000 vLink=#000000 aLink=#000000 link=#000000 bgColor=#ffffff topMargin=20 leftmargin="0" marginwidth="0" marginheight="0">
  78. <DIV align=center>
  79. <form name="form1" method="post" action="/mainctrl/intranet/hr/salary_statistic?doSearch=1">
  80.   <TABLE class=outter cellSpacing=0 cellPadding=0 width=600 border=0>
  81.     <TBODY>
  82.     <jsp:include page="/vnex/page/TTOA_TABLE_TOP.jsp" />
  83.     <TR> 
  84.         <TD colSpan=3 align="center"> 
  85.           <br>
  86.  <table width="600" border="1" cellspacing="1" bordercolor="#666666">
  87.             <tr>
  88.               <td bgcolor="#fafafa">  
  89.                 <table class=title cellspacing=1 width="600" border=0>
  90.                   <tr bgcolor="#666666"> 
  91.                     <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/salary_statistic_main"><font color="#FFFFFF">薪酬统计</font></a>&gt;&gt;部门薪酬统计</font></td>
  92.                   </tr>
  93.                   <tr bgcolor="#e0e0e0"> 
  94.                     <td width="113"><font class="strong">&nbsp;工资年月:</font></td>
  95.                     <td width="478"> 
  96.                       <%
  97.                       //在此四个下拉框分别输出起止年月.
  98.                       //得到当前日期年月日
  99.                       Calendar nowTime=Calendar.getInstance();
  100.                       int nowYear = nowTime.get( Calendar.YEAR);
  101.                       int nowMonth = nowTime.get(Calendar.MONTH)+1;
  102.                       String ifSelect = "";
  103.                       //输出起始年下拉框并默认选中当前年.
  104.                     
  105.                     %>
  106.                       <select name = "sYear">
  107.                         <%
  108.                       for(int sYear = 1930;sYear < 2099 ; sYear++ )
  109.                       {
  110.                           if (sYear == nowYear)
  111.                           {
  112.                               ifSelect = "selected";
  113.                           }
  114.                           else
  115.                           {
  116.                               ifSelect = "";
  117.                           }
  118.                       %>
  119.                         <option value = "<%=sYear%>"  <%=ifSelect%>><%=sYear%></option>
  120.                         <%
  121.                       }
  122.                       %>
  123.                       </select>
  124.                       年 
  125.                       <select name = "sMonth">
  126.                         <%
  127.                       //按照两位的格式输出起始月下拉框并默认选中当前月.
  128.                       String strSMonth = "";
  129.                      
  130.                       for(int sMonth = 1;sMonth <= 12 ; sMonth++ )
  131.                       {
  132.                         if(sMonth < 10)
  133.                         {
  134.                             strSMonth = "0"+String.valueOf(sMonth);
  135.                         }
  136.                         else
  137.                         {
  138.                             strSMonth = String.valueOf(sMonth);
  139.                         }
  140.                         if (sMonth == nowMonth)
  141.                         {
  142.                             ifSelect = "selected";
  143.                         }
  144.                         else
  145.                         {
  146.                             ifSelect = "";
  147.                         }
  148.                        %>
  149.                         <option value = "<%=strSMonth%>"  <%=ifSelect%>><%=strSMonth%></option>
  150.                         <%
  151.                       }
  152.                       %>
  153.                       </select>
  154.                       月</td>
  155.                   </tr>
  156.                   <tr bgcolor="#fafafa"> 
  157.                     <td width="113"><font class="strong">&nbsp;选择部门:</font></td>
  158.                     <td width="478"> 
  159.                     <!--部门列表开始-->
  160.                     <select name="devisionId" class=choice onChange=change(this)>
  161.                     <org:DivisionList>
  162.                     <option value='0'>全部部门</option>
  163.                     <vnex:items select='<%= deIdTemp+"" %>' >
  164.                     <option value=<org:DivisionAttribute attribute="id"/> <org:DivisionAttribute attribute="isSelected"/> >
  165.                     <org:DivisionAttribute attribute="levelStr"/>+<org:DivisionAttribute attribute="name"/></option>
  166.                     </vnex:items>
  167.                     </org:DivisionList>
  168.                     </select>
  169.                     </td>
  170.                   </tr>
  171.                   <tr bgcolor="#e0e0e0"> 
  172.                     <td width="113" height="12"><font class="strong">&nbsp;选择员工:</font></td>
  173.                     <td width="478" height="12"> 
  174.                     <select name="emp_id">
  175.                       <option value=-1>--全部--</option>
  176.                     <hr:EmployeeList divisionId='<%= deIdTemp %>'>                          
  177.             <vnex:items >
  178.             <option value="<hr:EmployeeAttribute attribute="id" />"  >
  179.             <hr:EmployeeAttribute attribute='<%= null %>' /></option>
  180.             </vnex:items>            
  181.             </hr:EmployeeList>             
  182.             </select>
  183.                     </td>
  184.                   </tr>
  185.                   <tr bgcolor="#fafafa" align="center"> 
  186.                     <td colspan="2" height="30"> 
  187.                       <input type="submit" value="统计" name="Submit" class=text>&nbsp;&nbsp; 
  188.                       <input type="button" value="返回" name="B2" onClick="location='/mainctrl/intranet/hr/salary_statistic_main'"  class=text>
  189.                     </td>
  190.                   </tr>
  191.                 </table>
  192.                           <table class=title cellspacing=1 cellpadding=2 border=0>
  193. <%
  194.     String bgcolor = null;
  195.     int color_i = 0;
  196.     double totalCount = 0;
  197.     double sCount = 0;
  198.     boolean doComList = false;
  199.     Iterator iterAll = pageAllColl.iterator();
  200.     Iterator iter = null;
  201.     while ( iterAll.hasNext() )
  202.     {
  203.         pageColl = (MemberDateSalary)iterAll.next();
  204.         color_i++;
  205.         if( color_i%2==0 )
  206.         {
  207.             bgcolor = "#e0e0e0";
  208.         }
  209.         else
  210.         {
  211.             bgcolor = "#fafafa";
  212.         }
  213. %>
  214.     <%
  215.         if ( !doComList )
  216.         {
  217.     %>
  218.                 <tr> 
  219.                   <td  align="center" ><font class=strong>姓名</font></td>
  220.                   <td  align="center" ><font class=strong>时间</font></td>
  221.         <%
  222.             iter = pageColl.getComponent().iterator();
  223.             while ( iter.hasNext() )
  224.             {
  225.                 doComList = true;
  226.                 DateComponentBean sc = (DateComponentBean)iter.next();
  227.         %>
  228.                   <td align="center"><font class=strong><%= sc.getName() %><input type=hidden name=component_id value=<%= sc.getId() %>></font></td>
  229.         <%
  230.             }
  231.         %>
  232.                   <td  align="center"><font class=strong>总额</font></td>
  233.                 </tr>
  234.     <%
  235.         }
  236.     %>
  237.             <tr bgcolor="<%= bgcolor %>"> 
  238.               <td align="center"><%= pageColl.getEmpName() %></td>
  239.               <td align="center"><%= pageColl.getSDate() %></td>
  240.     <%
  241.         sCount = 0;
  242.         iter = pageColl.getComponent().iterator();
  243.         while ( iter.hasNext() )
  244.         {
  245.             DateComponentBean sc = (DateComponentBean)iter.next();
  246.             sCount += sc.getCount();
  247.     %>
  248.               <td align="center"><%= sc.getCount() %></td>
  249.     <%
  250.         }
  251.         totalCount +=sCount;
  252.        // System.out.println("******************total is:"+totalCount);
  253.     %>
  254.               <td align="center"><%= dFormat.format(sCount) %></td>
  255.             </tr>
  256. <%
  257.     }
  258. %>
  259. <%
  260.     if ( doComList )
  261.     {
  262. %>
  263.             <tr bgcolor="#e0e0e0"> 
  264.               <td align="center">合计:</td>
  265.               <td align="center"><%= dFormat.format(totalCount) %>&nbsp;&nbsp;(元)</td>
  266.             </tr>
  267. <%
  268.     }
  269. %>
  270.           </table>
  271.               </td>
  272.             </tr>
  273.           </table>
  274.           <br>
  275.           <br>
  276.           <jsp:include page="/vnex/page/TTOA_HELP.jsp" />
  277. </TD>
  278.     </TR>
  279.      <jsp:include page="/vnex/page/TTOA_TABLE_BOTTOM.jsp" />
  280.     </TBODY> 
  281.     </TABLE>
  282.   <BR>
  283.   <jsp:include page="/vnex/page/TTOA_PRODUCER_LOGO.jsp" />
  284.   </form></DIV>
  285. </BODY></HTML>