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

电子政务应用

开发平台:

Java

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  2. <%@ page errorPage="/vnex/ErrorPage.jsp" %>
  3. <%@ page language="java" %>
  4. <%@ page import="java.util.*" %>
  5. <%@ page import="java.lang.*" %>
  6. <%@ page import="com.vnex.intranet.util.*"%>
  7. <%@ page import="com.vnex.intranet.budget.value.*" %>
  8. <%@ page import="java.text.DecimalFormat" %>
  9. <jsp:useBean id="BudgetListProxy" scope="application" class="com.vnex.intranet.budget.proxy.BudgetListProxyBean" />
  10. <%
  11.     String month = request.getParameter("month");
  12.     String year = request.getParameter("year");
  13.     String choose = request.getParameter("choose");
  14. double oneDivisionBudget = 0.0d;
  15. double oneDivisionActual = 0.0d;
  16. int useOneDivisionId = -1;
  17. DecimalFormat dFormat = new DecimalFormat("##.##");    
  18. %>
  19. <HTML><jsp:include page="/vnex/page/FORM_HEAD.jsp" />
  20. <script language="JavaScript1.2" src="/vnex/menu/dockmenu_finance.js"></script><script language="JavaScript1.2" src="/vnex/menu/dockmenu.js"></script>
  21. <BODY text=#000000 vLink=#000000 aLink=#000000 link=#000000 bgColor=#ffffff topMargin=20 leftmargin="0" marginwidth="0" marginheight="0">
  22. <DIV align=center>
  23. <form name="form1" method="post" action="">
  24.   <TABLE class=outter cellSpacing=0 cellPadding=0 width=600 border=0>
  25.      
  26.     <jsp:include page="/vnex/page/TTOA_TABLE_TOP.jsp" />
  27.     <TR> 
  28.         <TD colSpan=3 align="center" class="iframestyle" valign="top"> 
  29.           <br>
  30.           <table width="600" border="1" cellspacing="1" bordercolor="#666666" class="iframestyle">
  31.             <tr valign="top"> 
  32.               <td > 
  33.                 
  34.                 <table width="600" border="0" cellspacing="0" cellpadding="2">
  35.                   <tr> 
  36.                     <td bgcolor="#666666"><font class="strongw"><a href="/mainctrl/home/index"><font color="#FFFFFF">首页</font></a>&gt;&gt;<a href="/mainctrl/finance/main"><font color="#FFFFFF">财务</font></a>&gt;&gt;<a href="/mainctrl/financial/finIndex"><font color="#FFFFFF">统计查看</font></a>&gt;&gt;<a href="/mainctrl/financial/resultAll"><font color="#FFFFFF">全部部门</font></a>&gt;&gt;统计结果</font></td>
  37.                   </tr>
  38.                 </table>
  39.                 <table class=title width="100%" border="0" cellspacing="0" cellpadding="0">
  40.                   <tr bgcolor="#fafafa"> 
  41.                     <td >
  42. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  43.                         <tr>
  44.                           <td width="80%"><font class="strong">&nbsp;下面是全部部门<%=year%>-<%=month%>预算统计表(
  45.   <%
  46.   if(choose.equals("1"))
  47.   {
  48.      out.println("类别:预算");
  49.   }
  50.   else if(choose.equals("2"))
  51.   {
  52.      out.println("类别:实际");
  53.   }
  54.   else if(choose.equals("3"))
  55.   {
  56.      out.println("类别:预算和实际");
  57.   }
  58.   %>
  59.   ):</font>
  60.                           </td>
  61.                           <td width="20%">
  62.                             <div align="right"><font class="strong">单位:元&nbsp;&nbsp;&nbsp;&nbsp;</font></div>
  63.                           </td>
  64.                         </tr>
  65.                       </table>
  66. </td>
  67.                   </tr>
  68.  </table>
  69.     
  70.   
  71.                   <!--列表显示开始-->          
  72.                   <%
  73. String parameterMonth = year+"-"+month;
  74.     int col = 0;
  75. int column = 0;
  76. int blue =0;
  77. int twice = 0;
  78. String rowColor="";
  79. //Collection collAll = BudgetListProxy.showAllDivision("2001-01");
  80. Collection collAll = BudgetListProxy.showAllDivision(parameterMonth);
  81. int allDiv = collAll.size();
  82. if(allDiv==0)
  83. {
  84.                             response.sendRedirect("/mainctrl/financial/resultAllResultFail");
  85. }
  86. else if(allDiv<18)
  87. {
  88.     out.println("<div id="Layer1" style="width:600px; height:"+(allDiv*20+128)+"px; z-index:1; overflow:auto" >");
  89. }
  90. else
  91. {
  92.     out.println("<div id="Layer1" style="width:600px; height:365px; z-index:1; overflow:auto" >");
  93. }
  94. Iterator iterAll = collAll.iterator();
  95. if((choose.compareTo("3")) == 0)
  96. {
  97. while(iterAll.hasNext()) 
  98. {
  99.     column++;
  100.     Collection coll = (Collection)iterAll.next();
  101. int theWidth = coll.size()*100+250;
  102. theWidth = (theWidth<=600)?600:theWidth;
  103. //out.println(theWidth);
  104. Iterator iter = coll.iterator();
  105. if (twice == 0)
  106. {
  107. out.println("<table class=title width="+theWidth+" border=0 cellpadding=2 cellspacing=1>");
  108.     out.println("<tr align=center bgcolor=#b4b4b4><td width=150  height=2 rowspan=2><font class=strong>部门</font></td>");
  109. while(iter.hasNext())
  110. {
  111.         col++;
  112.     BudgetListValueBean budgetListValueBeanW = (BudgetListValueBean)iter.next();
  113. useOneDivisionId = budgetListValueBeanW.getDivision();
  114. out.println("<td colspan=2 width=100 height=2 > <font class=strong>"+budgetListValueBeanW.getComponentName()+"</font></td>");
  115.     }
  116.     out.println("<td colspan=2 height=2 width=100 > <font class=strong>总计</font></td></tr>");
  117. out.println("<tr bgcolor=#b4b4b4 align=center>");
  118. for (int i=-1; i<col; i++)
  119. {
  120.     out.println("<td width=50 height=2 >预算</td>");
  121.     out.println("<td height=2 width=50 >实际</td>");
  122. }
  123. out.println("</tr>");
  124. twice = 1;
  125. }
  126. else
  127. {
  128. rowColor = ((column%2)==0)?"#fafafa":"#e0e0e0";
  129. out.println("<tr align=center bgcolor="+rowColor+">");
  130. while(iter.hasNext())
  131. {
  132.     BudgetListValueBean budgetListValueBean = (BudgetListValueBean)iter.next();
  133. if (blue==0)
  134. {
  135.         out.println("<td height=5>"+budgetListValueBean.getDivisionName()+"</td>");
  136. blue++;
  137. }
  138.     out.println("<td width=50 height=5>"+budgetListValueBean.getBudget()+"</td>");
  139.   if(budgetListValueBean.getActual() != -1f)
  140.   {
  141.       out.println("<td width=50 height=5>"+budgetListValueBean.getActual()+"</td>");
  142.        oneDivisionActual += budgetListValueBean.getActual();
  143.     }
  144.   else
  145.   {
  146.       out.println("<td width=50 height=5></td>");
  147.   }
  148.     oneDivisionBudget += budgetListValueBean.getBudget();
  149.     }
  150.             blue = 0; 
  151.     out.println("<td width=50 height=5 >"+dFormat.format(oneDivisionBudget)+"</td><td width=50 height=5 >"+dFormat.format(oneDivisionActual)+"</td></tr>");
  152.     oneDivisionBudget = 0.0d;
  153. oneDivisionActual = 0.0d;
  154. }   
  155.    }
  156.    
  157. }
  158. else if (((choose.compareTo("2")) == 0))
  159. {
  160. while(iterAll.hasNext()) 
  161. {
  162.     column++;
  163.     Collection coll = (Collection)iterAll.next();
  164. int theWidth = coll.size()*50+250;
  165. theWidth = (theWidth<=600)?600:theWidth;
  166. Iterator iter = coll.iterator();
  167. if (twice == 0)
  168. {
  169. out.println("<table class=title width="+theWidth+" border=0 cellpadding=2 cellspacing=1>");
  170.     out.println("<tr align=center bgcolor=#b4b4b4><td  height=2 ><font class=strong>部门</font></td>");
  171. while(iter.hasNext())
  172. {
  173.         col++;
  174.     BudgetListValueBean budgetListValueBeanW = (BudgetListValueBean)iter.next();
  175. useOneDivisionId = budgetListValueBeanW.getDivision();
  176. out.println("<td  height=2 > <font class=strong>"+budgetListValueBeanW.getComponentName()+"</font></td>");
  177.     }
  178.     out.println("<td  height=2 > <font class=strong>总计</font></td></tr>");
  179. twice = 1;
  180. }
  181. else
  182. {
  183. rowColor = ((column%2)==0)?"#fafafa":"#e0e0e0";
  184. out.println("<tr align=center bgcolor="+rowColor+">");
  185. while(iter.hasNext())
  186. {
  187.     BudgetListValueBean budgetListValueBean = (BudgetListValueBean)iter.next();
  188. %>
  189.                     <%
  190. if (blue==0)
  191. {
  192. %>
  193.                     <td ><%=budgetListValueBean.getDivisionName()%></td>
  194.                     <%
  195. blue++;
  196. }
  197.   if(budgetListValueBean.getActual() != -1f)
  198.   {
  199.       out.println("<td width=50 height=5>"+budgetListValueBean.getActual()+"</td>");
  200.        oneDivisionActual += budgetListValueBean.getActual();
  201.     }
  202.   else
  203.   {
  204.       out.println("<td width=50 height=5></td>");
  205.   }
  206.     }
  207.             blue = 0; 
  208.     out.println("<td>"+dFormat.format(oneDivisionActual)+"</td></tr>");
  209. oneDivisionActual = 0.0d;
  210.     }   
  211.    }       
  212. }
  213. else if (((choose.compareTo("1")) == 0))
  214. {
  215. while(iterAll.hasNext()) 
  216. {
  217.     column++;
  218.     Collection coll = (Collection)iterAll.next();
  219. int theWidth = coll.size()*50+250;
  220. theWidth = (theWidth<=600)?600:theWidth;
  221. Iterator iter = coll.iterator();
  222. if (twice == 0)
  223. {
  224. out.println("<table class=title width="+theWidth+" border=0 cellpadding=2 cellspacing=1>");
  225.     out.println("<tr align=center bgcolor=#b4b4b4><td height=2 ><font class=strong>部门</font></td>");
  226. while(iter.hasNext())
  227. {
  228.         col++;
  229.     BudgetListValueBean budgetListValueBeanW = (BudgetListValueBean)iter.next();
  230. useOneDivisionId = budgetListValueBeanW.getDivision();
  231. out.println("<td  height=2 > <font class=strong>"+budgetListValueBeanW.getComponentName()+"</font></td>");
  232.     }
  233.     out.println("<td  height=2 > <font class=strong>总计</font></td></tr>");
  234. twice = 1;
  235. }
  236. else
  237. {
  238. rowColor = ((column%2)==0)?"#fafafa":"#e0e0e0";
  239. out.println("<tr align=center bgcolor="+rowColor+">");
  240. while(iter.hasNext())
  241. {
  242.     BudgetListValueBean budgetListValueBean = (BudgetListValueBean)iter.next();
  243. %>
  244.                     <%
  245. if (blue==0)
  246. {
  247. %>
  248.                     <td ><%=budgetListValueBean.getDivisionName()%></td>
  249.                     <%
  250. blue++;
  251. }
  252. %>
  253.                     <td  ><%=budgetListValueBean.getBudget()%></td>
  254.                     <%
  255.     oneDivisionBudget += budgetListValueBean.getBudget();
  256.     }
  257.             blue = 0; 
  258.     out.println("<td>"+dFormat.format(oneDivisionBudget)+"</td></tr>");
  259. oneDivisionBudget = 0.0d;
  260.     }   
  261.    }
  262. }
  263.                   %>
  264.                   <!--列表显示结束-->
  265.   <!--总计显示开始-->
  266.   <%
  267.     Collection collTotal = BudgetListProxy.showAllDivisionTotal(parameterMonth, useOneDivisionId);
  268. Iterator iterTotal = collTotal.iterator();
  269. if(rowColor.equals("#fafafa")) rowColor = "#e0e0e0";
  270. else rowColor = "#fafafa";
  271. if((choose.compareTo("3")) == 0)
  272. {
  273.                 double budgetTotal = 0.0d;
  274. double actualTotal = 0.0d;
  275.                 out.println("<tr align=center bgcolor="+rowColor+"><td><font class=strong>总计:</font></td>");
  276. while(iterTotal.hasNext())
  277. {
  278.     BudgetListValueBean budgetListValueBean = (BudgetListValueBean)iterTotal.next();
  279. budgetTotal += budgetListValueBean.getBudget();
  280. actualTotal += budgetListValueBean.getActual();
  281. out.println("<td width=50>"+budgetListValueBean.getBudget()+"</td><td width=50>"+budgetListValueBean.getActual()+"</td>");
  282. }
  283. out.println("<td width=50>"+dFormat.format(budgetTotal)+"</td><td width=50>"+dFormat.format(actualTotal)+"</td></tr>");
  284. }
  285. else if (((choose.compareTo("2")) == 0))
  286. {
  287. double actualTotal = 0.0d;
  288.                 out.println("<tr align=center bgcolor="+rowColor+"><td><font class=strong>总计</font></td>");
  289. while(iterTotal.hasNext())
  290. {
  291.     BudgetListValueBean budgetListValueBean = (BudgetListValueBean)iterTotal.next();
  292. actualTotal += budgetListValueBean.getActual();
  293. out.println("<td>"+budgetListValueBean.getActual()+"</td>");
  294. }
  295. out.println("<td>"+dFormat.format(actualTotal)+"</td></tr>");
  296. }
  297. else if (((choose.compareTo("1")) == 0))
  298. {
  299.                 double budgetTotal = 0.0d;
  300.                 out.println("<tr align=center bgcolor="+rowColor+"><td><font class=strong>总计</font></td>");
  301. while(iterTotal.hasNext())
  302. {
  303.     BudgetListValueBean budgetListValueBean = (BudgetListValueBean)iterTotal.next();
  304. budgetTotal += budgetListValueBean.getBudget();
  305. out.println("<td>"+budgetListValueBean.getBudget()+"</td>");
  306. }
  307. out.println("<td>"+dFormat.format(budgetTotal)+"</td></tr>");
  308. }   
  309.   %>
  310.   <!--总计显示结束-->
  311.   <%
  312.    if(allDiv != 0) out.println("</table></div>");
  313.       %>
  314.      
  315.                 <table class=title width="100%" border="0" cellspacing="0" cellpadding="0" height="30" >
  316.                   <tr bgcolor="#fafafa" > 
  317.                     <td align="center" > 
  318.                       <input type="button" name="Button22" value="返回" onclick="location='/mainctrl/financial/resultAll'" class="text">
  319.                     </td>
  320.                   </tr>
  321.                 </table>
  322.               </td>
  323.             </tr>
  324.           </table>
  325.                     <jsp:include page="/vnex/page/TTOA_HELP.jsp" />
  326.        </TD>
  327.     </TR>
  328.      <jsp:include page="/vnex/page/TTOA_TABLE_BOTTOM.jsp" />
  329.     </TABLE>
  330.     <BR>
  331.     <jsp:include page="/vnex/page/TTOA_PRODUCER_LOGO.jsp" />
  332. </form>
  333.   </DIV>
  334.  </BODY>
  335. </HTML>