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

电子政务应用

开发平台:

Java

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  2. <HTML><jsp:include page="/vnex/page/FORM_HEAD.jsp" />
  3. <%@ page import="java.util.*"%>
  4. <%@ page import="java.sql.*"%>
  5. <%@ page import="com.vnex.intranet.util.*"%>
  6. <%@ page import="com.vnex.intranet.equipment.value.*"%>
  7. <%@ page import="com.vnex.intranet.equipment.process.*"%>
  8. <jsp:useBean id="SearchCondition" class="com.vnex.intranet.equipment.value.EquipmentConditionBean" scope="Session" />
  9. <jsp:useBean id="AdvancedSearchProxy" class="com.vnex.intranet.equipment.proxy.EquipmentProxyBean" scope="Application" />
  10. <jsp:useBean id="equipmentValueView" class="com.vnex.intranet.equipment.value.EquipmentValueBean" scope="session" /> 
  11. <jsp:setProperty name="equipmentValueView" property="*" />
  12. <%
  13. HttpSession sess;
  14. String navBar;
  15. int start = 1;
  16. int rows = 10;
  17. EquipmentListValueBean equipmentlist;
  18. Collection eList;
  19. String action; 
  20. int categoryId=-1;
  21. String categoryName=""; 
  22. String keyword = "";
  23. if (request.getParameter("categoryId") != null )
  24. {
  25. categoryId = (new Integer(request.getParameter("categoryId")).intValue());
  26. keyword = request.getParameter("categoryId");
  27. }
  28. if (request.getParameter("categoryName") != null)
  29. categoryName = (request.getParameter("categoryName"));
  30. sess = request.getSession( false );
  31. if ("true".equals(request.getParameter("cache")))
  32. {
  33. equipmentlist = (EquipmentListValueBean)sess.getAttribute("equipmentlist");
  34.     start = Integer.parseInt(request.getParameter("start"));
  35. }
  36. else
  37. {
  38. if (request.getParameter("start") != null)
  39. {
  40. start = Integer.parseInt(request.getParameter("start"));
  41. }
  42. int categoryid;
  43. String name;
  44. String purpose;
  45. String model;
  46. String configure;
  47. String equipmentcode;
  48. double minprice;
  49. double maxprice;
  50. int usedeptid;
  51. int usepersonid;
  52. Timestamp begindate = null;
  53. Timestamp enddate = null;
  54. int buydeptid;
  55. int buypersonid;
  56. String supplier;
  57. String place;
  58. int term;
  59. int quantity;
  60. int repaired;
  61. try 
  62. {
  63. categoryid  = Integer.parseInt(request.getParameter("categoryId"));
  64. }
  65. catch (Exception e)
  66. {
  67. categoryid = -1;
  68. }
  69. name = request.getParameter("equipmentName");
  70. if (name == null)
  71. name = "";
  72. purpose = request.getParameter("purpose");
  73. if (purpose == null)
  74. purpose = "";
  75.     model = request.getParameter("model");
  76. if (model == null)
  77. model = "";
  78. configure = request.getParameter("configure");
  79. if (configure == null)
  80. configure = "";
  81. equipmentcode = request.getParameter("equipmentCode");
  82. if (equipmentcode == null)
  83. equipmentcode = "";
  84. try
  85. {
  86. minprice = Double.parseDouble(request.getParameter("minPrice"));
  87. }
  88. catch (Exception e)
  89. {
  90. minprice = -1;
  91. }
  92. try
  93. {
  94. maxprice = Double.parseDouble(request.getParameter("maxPrice"));
  95. }
  96. catch (Exception e)
  97. {
  98. maxprice = -1;
  99. }
  100. try
  101. {
  102. usedeptid = Integer.parseInt(request.getParameter("useDeptId"));
  103. }
  104. catch (Exception e)
  105. {
  106. usedeptid = -1;
  107. }
  108. try
  109. {
  110.     usepersonid = Integer.parseInt(request.getParameter("usePersonId"));
  111. }
  112. catch (Exception e)
  113. {
  114. usepersonid = -1;
  115. }
  116. try
  117. {
  118. if (request.getParameter("beginDay").length() > 0 )
  119. begindate = TimeStamp.toTimestamp(request.getParameter("beginDay")+" 00:00:00.0");
  120. }
  121. catch (Exception e)
  122. {
  123. begindate = null;
  124. }
  125. try
  126. {
  127. if (request.getParameter("endDay").length() > 0 )
  128. enddate = TimeStamp.toTimestamp(request.getParameter("endDay")+" 00:00:00.0");
  129. }
  130. catch (Exception e)
  131. {
  132. enddate = null;
  133. }
  134. try
  135. {
  136. buydeptid = Integer.parseInt(request.getParameter("buyDeptId"));
  137. //out.println("buydeptid="+buydeptid);
  138. }
  139. catch (Exception e)
  140. {
  141. buydeptid = -1;
  142. }
  143. try
  144. {
  145. buypersonid = Integer.parseInt(request.getParameter("buyPersonId"));
  146. //out.println("buypersonid="+buypersonid);
  147. }
  148. catch (Exception e)
  149. {
  150. buypersonid = -1;
  151. }
  152. supplier = request.getParameter("supplier");
  153. if (supplier == null)
  154. supplier = "";
  155. place = request.getParameter("place");
  156. if (place == null)
  157. place = "";
  158. try
  159. {
  160. term = Integer.parseInt(request.getParameter("STerm"));
  161. }
  162. catch (Exception e)
  163. {
  164. term = -1;
  165. }
  166. try
  167. {
  168. quantity = Integer.parseInt(request.getParameter("SQuantity"));
  169. }
  170. catch (Exception e)
  171. {
  172. quantity = -1;
  173. }
  174. if ("1".equals(request.getParameter("repaired")))
  175. repaired = 1;
  176. else if ("0".equals(request.getParameter("repaired")))
  177.   repaired = 0; 
  178. else
  179. repaired = -1;
  180. if (request.getParameter("set") != null && request.getParameter("set").equals("1"))
  181. {//set conditionbean
  182. SearchCondition.setCategoryId(categoryid); 
  183. SearchCondition.setEquipmentName(name); 
  184. SearchCondition.setPurpose(purpose); 
  185. SearchCondition.setModel(model); 
  186. SearchCondition.setConfigure(configure); 
  187. SearchCondition.setEquipmentCode(equipmentcode); 
  188. SearchCondition.setMinPrice(minprice); 
  189. SearchCondition.setMaxPrice(maxprice); 
  190. SearchCondition.setBuyDeptId(buydeptid); 
  191. SearchCondition.setBuyPersonId(buypersonid); 
  192. SearchCondition.setUseDeptId(usedeptid); 
  193. SearchCondition.setUsePersonId(usepersonid); 
  194. SearchCondition.setBeginBuyDate(begindate); 
  195. SearchCondition.setEndBuyDate(enddate); 
  196. SearchCondition.setSupplier(supplier); 
  197. SearchCondition.setPlace(place); 
  198. SearchCondition.setTerm(term); 
  199. SearchCondition.setQuantity(quantity); 
  200. SearchCondition.setRepaired(repaired); 
  201. }
  202. equipmentlist = AdvancedSearchProxy.equipmentAdvancedSearch(SearchCondition);
  203. sess.setAttribute("equipmentlist",equipmentlist);
  204. }
  205. eList = equipmentlist.getEquipmentList();
  206. if (eList.size() < start && start > 10)
  207. start = start - 10;
  208. categoryName="";
  209. %>
  210. <script language= JavaScript>
  211. function toDelete()
  212. {
  213. if (<%=eList.size()%> == 0)
  214. {
  215. alert ("没有要删除的项!");
  216. return false;
  217. }
  218. var items=searchForm.check1.length; 
  219. var j = -1;
  220. var sign = 1;
  221. if (items>1)
  222. {
  223. for (i=0;i < items;i++)
  224. if (searchForm.check1[i].checked)
  225. j = i;
  226. }
  227. if (j == -1)
  228. {
  229. alert ("没有可供删除的选项!" );
  230. sign = 0;
  231. }
  232. }
  233. else
  234. {
  235. if (searchForm.check1.checked)
  236. sign = 1;
  237. else
  238. {
  239. alert ("没有可供删除的选项!" );
  240. sign = 0
  241. }
  242. }
  243. if (sign == 1)
  244. {
  245. if (!confirm("真的删除这些记录吗?"))
  246. return false;
  247. searchForm.action="/mainctrl/equipmentsAdvancedDeleteSuccess"
  248. searchForm.submit();
  249. }
  250. }
  251. function checkAll(checkbox_select,checkbox_names)
  252. {
  253.     var items=checkbox_names.length;          
  254.     if(items>1)
  255.     {
  256.        for(i=0;i<items;i++) checkbox_names[i].checked=checkbox_select.checked;      
  257.     }
  258.     else
  259.     {
  260.         checkbox_names.checked=checkbox_select.checked;
  261.     }
  262. }
  263. function toCategory(form)
  264. {
  265. form.action="/mainctrl/categoryList?pageName=equipmentSearchResult";
  266. form.submit();
  267. }
  268. </script>
  269. <BODY text=#000000 vLink=#000000 aLink=#000000 link=#000000 bgColor=#ffffff topMargin=20 leftmargin="0" marginwidth="0" marginheight="0">
  270. <script language="JavaScript1.2" src="/vnex/menu/dockmenu_office.js"></script>
  271. <script language="JavaScript1.2" src="/vnex/menu/dockmenu.js"></script>
  272. <form name="searchForm" method="post" action="/mainctrl/equipmentSearchResult">
  273. <DIV align=center>   
  274.     <TABLE class=outter cellSpacing=0 cellPadding=0 width=600 border=0>
  275.     <TBODY> 
  276.     <TBODY> 
  277.     <jsp:include page="/vnex/page/TTOA_TABLE_TOP.jsp" />
  278.     <TR> 
  279.         <TD colSpan=3 align="center"><br>
  280.          <table width="600" border="1" cellspacing="1" bordercolor="#666666">
  281.             <tr bgcolor="#fafafa"> 
  282.               <td> 
  283.                
  284.                 <table width="600" border="0" cellspacing="0" cellpadding="2">
  285.                    <tr bgcolor="#666666"> 
  286.                       <td colspan="2" height="15"><font class="strongw"><a href="/mainctrl/home/index"><font color="#FFFFFF">首页</font></a>&gt;&gt;<a href="/mainctrl/office/main"><font color="#FFFFFF">办公室管理</font></a>&gt;&gt;固定资产管理</font></td>
  287.                    </tr>  
  288.                    <tr> 
  289.                       <td colspan="2" height="30"><font class="strong" >&nbsp;类别:</font>&nbsp; 
  290.                       <input type="hidden" name="keyword" class="file" value="<%=categoryId%>">&nbsp;
  291.                       <input type="test" name="categoryName" class="file" readonly value="<%=categoryName%>">&nbsp;
  292.                       <input type="button" name="Submit2" value="选择" class="file" onClick="toCategory(searchForm)")>&nbsp;&nbsp; 
  293.                       <input type="button" name="SubmitA" value="高级查询" class="file" style="width:60px" onClick="location='/mainctrl/equipmentAdvancedSearch'">&nbsp;&nbsp; 
  294.                       <input type="button" name="SubmitS" value="统计汇总" class="file" style="width:60px" onClick="location='/mainctrl/equipmentStat'">
  295.                     </td>
  296.                   </tr>
  297.                 </table>
  298.             
  299.             <table class=title cellspacing=1 cellpadding=2 width="600" border=0>
  300.             <tr bgcolor="#FFFFFF"> 
  301.                     <td colspan="7" height="30">&nbsp; 
  302.                      <input type="button" name="bAdd" value="新建" class="file" onClick="location='/mainctrl/equipmentAdd'">&nbsp;&nbsp;
  303.                         <input type="button" name="bDelete" value="删除" class="file" onClick=toDelete()>&nbsp;&nbsp;                          
  304.                         <input type="button" name="bBatch" value="批量增加" class="file" style="width:60" onClick="location='/mainctrl/equipmentBatchAdd'">&nbsp;&nbsp; 
  305.                         <input type="button" name="bBatchUse" value="批量增加使用者" class="file" style="width: 95" onClick="location='/mainctrl/equipmentBatchSearchResult'">
  306.                     </td>
  307.             </tr>
  308.             <tr align=middle > 
  309.               <td width="7%"><font  class="strong">选择</font></td>
  310.               <td width="10%"><font  class="strong"> 编号 </font></td>
  311.               <td width="19%"><font  class="strong">名称</font></td>
  312.               <td width="23%"><font  class="strong">资产编号 </font></td>
  313.               <td width="18%"><font  class="strong">类别 </font></td>
  314.               <td width="23%"><font  class="strong">购入时间 </font></td>
  315.             </tr>
  316.             <%
  317.             
  318.              int i = 0;
  319.              int r;
  320.       if (start > eList.size() - (eList.size() % rows))
  321.       r = eList.size() % rows;
  322.       else
  323.         r = 10;
  324.    Iterator it = eList.iterator();
  325. while(i < start - 1) 
  326. {
  327. it.next();
  328. i ++;
  329. }
  330. i = 0;
  331.          while(i < r)
  332.             {
  333.             EquipmentValueBean eInfo= (EquipmentValueBean)it.next();
  334.             if (i % 2 == 0)
  335.             {
  336.             %>  
  337.             <tr align=middle bgColor="#fafafa" colspan="7"> 
  338.             <%
  339.             }
  340.             else
  341.             {
  342.             %>
  343.             <tr align=middle bgColor="#e0e0e0" colspan="7"> 
  344.             <%
  345.             }
  346.             %>
  347.               <td width="7%"> 
  348.                 <input type="checkbox" name="check1" value=<%=eInfo.getId()%>>
  349.                 <br>
  350.               </td>
  351.               <td width="10%"><a href="equipmentDetail?equipmentId=<%=eInfo.getId()%>&simple=false&start=<%=start%>"><%=eInfo.getId()%></a></td>
  352.               <td width="19%"><%=FieldUtil.shortenString(FieldUtil.filterScriptTag(eInfo.getEquipmentName()),15)%><br>
  353.               </td>
  354.               <td width="23%"><%=FieldUtil.shortenString(FieldUtil.filterScriptTag(eInfo.getEquipmentCode()),15)%></td>
  355.               <td width="18%"><%=FieldUtil.filterScriptTag(eInfo.getCategoryName())%></td>
  356.               <td width="23%"><%
  357.               if (eInfo.getBuyDate() != null) out.print(eInfo.getBuyDate().toString().substring(0,10));
  358.               %>
  359.               </td>
  360.             </tr>        
  361.             <%
  362.             i ++;
  363.             }
  364.             
  365.             %>
  366.             <%
  367.             if (eList.size() > 0)
  368.             {
  369.             %>
  370.             <tr align=middle>
  371.               <td colspan="6" bgcolor="#e0e0e0"> 
  372.                 <div align="left">
  373.                   &nbsp;&nbsp;<input type="checkbox" name="check2" value="checkbox" onClick = checkAll(check2,check1)>
  374.                   全选</div>
  375.               </td>
  376.             </tr>
  377.             <%}%>
  378.             <%
  379.                 action = "/mainctrl/equipmentAdvancedSearchResult?cache=true";
  380. navBar = NavBar.makeNavbar(start,eList.size(),rows,action);  
  381.             %>
  382.             
  383.             <tr align=middle> 
  384.               <td colspan="6" bgcolor="#fafafa"> 
  385.                 <div align="left">&nbsp;<%=navBar%> 
  386.                 </div>
  387.               </td>
  388.             </tr>
  389.             
  390.           </table>  
  391.           
  392.           </td>
  393.           </tr>
  394.           </table>
  395.           <jsp:include page="/vnex/page/TTOA_HELP.jsp" />
  396.        </TD>
  397.      </TR>
  398.      <jsp:include page="/vnex/page/TTOA_TABLE_BOTTOM.jsp" />
  399.     </TBODY> 
  400.   </TABLE>
  401.     <BR>
  402.   <jsp:include page="/vnex/page/TTOA_PRODUCER_LOGO.jsp" />
  403.   </form>
  404. </DIV>
  405. </BODY>
  406. </HTML>