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

电子政务应用

开发平台:

Java

  1. <%
  2. /**
  3.  * $RCSfile: employee_training_index.jsp $
  4.  * $Revision: 1.0 $
  5.  * Date: 2001/05/17 16:59:46 $
  6.  * /training/index
  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="com.vnex.intranet.budget.process.BudgetListDAO " %>
  14. <%@ page import="com.vnex.intranet.budget.process.*" %>
  15. <%@ page import="java.util.*" %>
  16. <jsp:useBean id="divAttTimeProxy" class="com.vnex.intranet.hr.employer_info.proxy.DivAttTimeProxy" scope="application" />
  17. <jsp:useBean id="businessSession" class="com.vnex.intranet.pub.BusinessSession" scope="session" />
  18. <jsp:useBean id="divUtil" class="com.vnex.intranet.budget.process.BudgetListDAO" scope="page" />
  19. <%
  20.    //处理同步与T_Division表的数据
  21.    System.out.println("nnnEnter jsp*********");
  22.    divAttTimeProxy.synchronizeWithDivision();
  23.    String strDivisionId = "";
  24.    
  25.  
  26.    
  27.    //处理保存修改上下班时间的提交
  28.    
  29.    if(request.getParameter("doStore") != null)
  30.    {
  31.         System.out.println("n**********in jsp Store mehtod");
  32.         Collection beforeStoreColDivAttTime = divAttTimeProxy.getAllDivAttTime();
  33.         Iterator beforeStoreIterAll = beforeStoreColDivAttTime.iterator();  
  34.          
  35.     Collection storeAllDivAttTime = new ArrayList();
  36.    
  37.     while( beforeStoreIterAll.hasNext() )
  38.     {
  39.     System.out.println("nn***********Enter while loop");
  40.     DivAttTimeValueBean oldDatValue= (DivAttTimeValueBean) beforeStoreIterAll.next();
  41.     DivAttTimeValueBean storeDatValue= new DivAttTimeValueBean();
  42.     storeDatValue.setDivisionId(oldDatValue.getDivisionId());
  43.     String reqStr = "odh"+oldDatValue.getDivisionId();
  44.     storeDatValue.setOnDutyHour(new Integer(request.getParameter(reqStr)).intValue());
  45.   reqStr = "odm"+oldDatValue.getDivisionId();
  46.     storeDatValue.setOnDutyMinute(new Integer(request.getParameter(reqStr)).intValue());
  47.     reqStr = "fdh"+oldDatValue.getDivisionId();
  48.     storeDatValue.setOffDutyHour(new Integer(request.getParameter(reqStr)).intValue());
  49.     reqStr = "fdm"+oldDatValue.getDivisionId();
  50.     storeDatValue.setOffDutyMinute(new Integer(request.getParameter(reqStr)).intValue());
  51.     storeAllDivAttTime.add(storeDatValue);
  52.     }//end while
  53. divAttTimeProxy.storeAllDivAttTime(storeAllDivAttTime);
  54.    }
  55.    
  56.    
  57.    //处理修改上下班模式的提交
  58.    if( request.getParameter("changeMode")!= null)
  59.    {
  60.     System.out.println("*****Enter changMode jsp");
  61.     divAttTimeProxy.setOnDutyMode(request.getParameter("onDutyMode"));
  62.     divAttTimeProxy.setOffDutyMode(request.getParameter("offDutyMode"));
  63.    }
  64.    
  65.    //得到T_Division表的数据列表 Collection.
  66.    
  67.     Collection colDivAttTime = divAttTimeProxy.getAllDivAttTime();
  68.     Iterator iterAll = colDivAttTime.iterator();   
  69.    
  70. %>
  71. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  72. <HTML>
  73. <jsp:include page="/vnex/page/FORM_HEAD.jsp" />
  74. <script language ="javascript" >
  75. function submitStore(strDivisionId)
  76. {
  77. //alert(strDivisionId);
  78. checkData();
  79. form1.action = "/mainctrl/hr/divAttTimeSeting?doStore=1";
  80. form1.submit();
  81. }
  82. function checkData()
  83. {
  84. }
  85. function changeDutyMode()
  86. {
  87. form1.action = "/mainctrl/hr/divAttTimeSeting?changeMode=1";
  88. form1.submit();
  89. }
  90. </script>
  91. <BODY text=#000000 vLink=#000000 aLink=#000000 link=#000000 bgColor=#ffffff topMargin=20 leftmargin="0" marginwidth="0" marginheight="0">
  92. <script language="JavaScript" src="/vnex/menu/dockmenu_hr.js"></script>
  93. <script language="JavaScript" src="/vnex/menu/dockmenu.js"></script>
  94. <DIV align=center>
  95. <form name="form1" method=POST>
  96.   <TABLE class=outter cellSpacing=0 cellPadding=0 width=600 border=0>
  97.     <tbody>
  98.     <jsp:include page="/vnex/page/TTOA_TABLE_TOP.jsp" />
  99.     <TR> 
  100.         <TD colSpan=3 align="center"> 
  101.           <br>
  102.           <!--休假事件表开始 -->
  103.            <table width="600" border="1" cellspacing="1" bordercolor="#666666">
  104.              <tr bgcolor="#666666"> 
  105.                     <td colspan="3"><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;部门考勤时间设置</font></td>
  106.              </tr>
  107.             <tr>
  108.               <td> 
  109.               <table class=title cellspacing=1 cellpadding=2 border=0 width="600">
  110.               <tr bgcolor = "#e0e0e0">
  111.               <td width = "300">
  112.               当一个员工同时在多个部门担任职务时其规定的上班时间应该是:
  113.               </td>
  114.               <td width = "300">
  115.               当一个员工同时在多个部门担任职务时而且其中有几个部门的上班时间相等,其相应的下班时间应该是:
  116.               </td>
  117.               </tr>
  118.               <tr bgcolor = "#fafafa">
  119.               <td width = "300" align = "center">
  120.               标准模式:<input type = radio name = "onDutyMode" value = "MIN" onclick = changeDutyMode() <%=divAttTimeProxy.getOnDutyMode().equalsIgnoreCase("MIN")?"checked":""%>>&nbsp;&nbsp;宽松模式:<input type = radio name = "onDutyMode" onclick = changeDutyMode() value = "MAX" <%=divAttTimeProxy.getOnDutyMode().equalsIgnoreCase("MAX")?"checked":""%>>
  121.               </td>
  122.               <td width = "300" align = "center">
  123.               标准模式:<input type = radio name = "offDutyMode"  value = "MAX" onclick = changeDutyMode() <%=divAttTimeProxy.getOffDutyMode().equalsIgnoreCase("MAX")?"checked":""%>>&nbsp;&nbsp;宽松模式:<input type = radio name = "offDutyMode" onclick = changeDutyMode() value = "MIN" <%=divAttTimeProxy.getOffDutyMode().equalsIgnoreCase("MIN")?"checked":""%>>
  124.               </td>
  125.               </tr>
  126.               <tr bgcolor = "#e0e0e0">
  127.               <td colspan = 2>
  128.               注:<font class = strong>标准模式</font>为选择多部门的上班时间中较早的上班时间做为员工的规定上班时间,或选择下班时间中的较晚时间做为员工规定的下班时间.<br>
  129.               &nbsp;&nbsp;&nbsp;<font class = strong>宽松模式</font>为选择多部门的上班时间中较晚的上班时间做为员工的规定上班时间,或选择下班时间中的较早时间做为员工规定的下班时间.<br>
  130.               此设置对所有员工有效.
  131.               </td>
  132.               </tr>
  133.               
  134.               </table>
  135.                 <table class=title cellspacing=1 cellpadding=2 border=0 width="600">
  136.               <tr> 
  137.                     <td width="200" align="center"><font class=strong>部门</font></td>
  138.                     <td width="100" align="center"><font class=strong>上班小时</font></td>
  139.                     <td width="100" align="center"><font class=strong>上班分钟</font></td>
  140.                     <td width="100" align="center"><font class=strong>下班小时</font></td>
  141.                     <td width="100" align="center"> <font class=strong>下班分钟</font></td>
  142.             </tr>
  143.             <%
  144.             String color = "";
  145.             int intColor = 0;
  146.             while(iterAll.hasNext())
  147.             {
  148.              DivAttTimeValueBean daValue =(DivAttTimeValueBean)  iterAll.next();
  149.              intColor++;
  150.              if( intColor%2 == 0 )
  151.              {
  152.              color = "#e0e0e0";
  153.              }
  154.              else
  155.              {
  156.              color = "#fafafa";
  157.              }
  158.             %>
  159.                     <tr bgcolor = "<%=color%>">
  160.                     <td width="200" align="center">
  161.                     <%
  162.                     try
  163.                     {
  164.                      out.print(divUtil.divisionName( daValue.getDivisionId()));
  165.                      strDivisionId += daValue.getDivisionId()+"_";
  166.                     }
  167.                     catch(BudgetProcessException e) 
  168.                     {
  169.                      System.out.println("Exception in jsp:" + e.getMessage());
  170.                     }
  171.                     %>
  172.                     </td>
  173.                     <td width="100" align="center">
  174.                     <select name = "odh<%=daValue.getDivisionId()%>">
  175.                     <%
  176.                     for(int i = 0; i<= 23 ; i++)
  177.                     {
  178.                      if(i == daValue.getOnDutyHour())
  179.                      {
  180.                      %>
  181.                      <option value = '<%=i%>' selected><%=i%></option>
  182.                      <%
  183.                      }
  184.                      else
  185.                      {
  186.                      %>
  187.                      <option value = '<%=i%>' ><%=i%></option>
  188.                      <%
  189.                      }
  190.                     }
  191.                     %>
  192.                     </select>
  193.                     </td>
  194.                     <td width="100" align="center">
  195.                     <select name = "odm<%=daValue.getDivisionId()%>">
  196.                     <%
  197.                     for(int i = 0; i<= 59 ; i++)
  198.                     {
  199.                      if(i == daValue.getOnDutyMinute())
  200.                      {
  201.                      %>
  202.                      <option value = '<%=i%>' selected><%=i%></option>
  203.                      <%
  204.                      }
  205.                      else
  206.                      {
  207.                      %>
  208.                      <option value = '<%=i%>' ><%=i%></option>
  209.                      <%
  210.                      }
  211.                     }
  212.                     %>
  213.                     </select>
  214.                     </td>
  215.                     <td width="100" align="center">
  216.                     <select name = "fdh<%=daValue.getDivisionId()%>">
  217.                     <%
  218.                     for(int i = 0; i<= 23 ; i++)
  219.                     {
  220.                      if(i == daValue.getOffDutyHour())
  221.                      {
  222.                      %>
  223.                      <option value = '<%=i%>' selected><%=i%></option>
  224.                      <%
  225.                      }
  226.                      else
  227.                      {
  228.                      %>
  229.                      <option value = '<%=i%>' ><%=i%></option>
  230.                      <%
  231.                      }
  232.                     }
  233.                     %>
  234.                     </select>
  235.                     </td>
  236.                     <td width="100" align="center">
  237.                     <select name = "fdm<%=daValue.getDivisionId()%>">
  238.                     <%
  239.                     for(int i = 0; i<= 59 ; i++)
  240.                     {
  241.                      if(i == daValue.getOffDutyMinute())
  242.                      {
  243.                      %>
  244.                      <option value = '<%=i%>' selected><%=i%></option>
  245.                      <%
  246.                      }
  247.                      else
  248.                      {
  249.                      %>
  250.                      <option value = '<%=i%>' ><%=i%></option>
  251.                      <%
  252.                      }
  253.                     }
  254.                     %>
  255.                     </select>
  256.                     </td>
  257.                     </tr>
  258.             <%
  259.             }
  260.             %>
  261.              <tr> 
  262.                     <td bgcolor="#fafafa" colspan="5" height="30" align="center"> 
  263.                     <input type="button" value="保存" name="B3" onClick=submitStore("<%=strDivisionId%>") class=text>&nbsp;&nbsp;
  264.                     <input type="reset" value="重置" name="B2" class=text>&nbsp;&nbsp;
  265.                     </td>
  266.                   </tr>
  267.                </table>
  268.              </td>
  269.             </tr>
  270.           </table>  
  271.           <jsp:include page="/vnex/page/TTOA_HELP.jsp" />
  272.         </TD>
  273.     </TR>
  274.      <jsp:include page="/vnex/page/TTOA_TABLE_BOTTOM.jsp" />
  275.     </TBODY> 
  276.     </TABLE>
  277.   <BR>
  278.   <jsp:include page="/vnex/page/TTOA_PRODUCER_LOGO.jsp" />
  279.   </form></DIV>
  280. </BODY></HTML>