Fin_Result_Dep_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.budget.value.*" %>
  7. <%@ page import="java.text.DecimalFormat" %>
  8. <jsp:useBean id="BudgetListProxy" scope="application" class="com.vnex.intranet.budget.proxy.BudgetListProxyBean" />
  9. <%
  10. String startMonth = request.getParameter("yearStart")+"-"+request.getParameter("monthStart");
  11. String endMonth = request.getParameter("yearEnd")+"-"+request.getParameter("monthEnd");;
  12. int balanceYear = (new Integer(request.getParameter("yearEnd"))).intValue()-(new Integer(request.getParameter("yearStart"))).intValue();
  13. int balanceMonth = (new Integer(request.getParameter("monthEnd"))).intValue()-(new Integer(request.getParameter("monthStart"))).intValue();
  14.     int balanceYearMonth = balanceYear*12+balanceMonth;
  15.     int id = Integer.parseInt(request.getParameter("id"));
  16.     String choose = request.getParameter("choose");
  17. String divisionName = BudgetListProxy.divisionName(id);
  18. double oneMonthBudget = 0.0d;
  19. double oneMonthActual = 0.0d;
  20. int changeMonth = 0;    
  21. DecimalFormat dFormat = new DecimalFormat("##.##");    
  22. %>
  23. <HTML><jsp:include page="/vnex/page/FORM_HEAD.jsp" />
  24. <script language="JavaScript1.2" src="/vnex/menu/dockmenu_finance.js"></script><script language="JavaScript1.2" src="/vnex/menu/dockmenu.js"></script>
  25. <BODY text=#000000 vLink=#000000 aLink=#000000 link=#000000 bgColor=#ffffff topMargin=20 leftmargin="0" marginwidth="0" marginheight="0">
  26. <DIV align=center>
  27. <form name="form1" method="post" action="">
  28.   <TABLE class=outter cellSpacing=0 cellPadding=0 width=600 border=0>
  29.      
  30.     <jsp:include page="/vnex/page/TTOA_TABLE_TOP.jsp" />
  31.     <TR> 
  32.         <TD colSpan=3 align="center" class="iframestyle" valign="top"> <br>
  33.           <table width="600" border="1" cellspacing="1" bordercolor="#666666">
  34.             <tr valign="top"> 
  35.               <td > 
  36.                 
  37.                 <table width="600" border="0" cellspacing="0" cellpadding="2">
  38.                   <tr> 
  39.                     <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/resultDep"><font color="#FFFFFF">单个部门</font></a>&gt;&gt;统计结果</font></td>
  40.                   </tr>
  41.                 </table>
  42.                 <table class=title width="600" border="0" cellpadding="2" cellspacing="0">
  43.                   <tr bgcolor="#fafafa"> 
  44.                     <td colspan="5"> 
  45. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  46.                         <tr>
  47.                           <td width="80%"><font class="strong">&nbsp;下面是<%=startMonth%>至<%=endMonth%><%=divisionName%>的预算统计表(
  48.   <%
  49.   if(choose.equals("1"))
  50.   {
  51.      out.println("类别:预算");
  52.   }
  53.   else if(choose.equals("2"))
  54.   {
  55.      out.println("类别:实际");
  56.   }
  57.   else if(choose.equals("3"))
  58.   {
  59.      out.println("类别:预算和实际");
  60.   }
  61.   %>
  62.   ):</font>
  63.                           </td>
  64.                           <td width="20%">
  65.                             <div align="right"><font class="strong">单位:元&nbsp;&nbsp;&nbsp;&nbsp;</font></div>
  66.                           </td>
  67.                         </tr>
  68.                       </table>
  69.                     </td>
  70.                   </tr>
  71.                 </table>
  72. <!--列表显示开始-->
  73. <%
  74.                 //列出各个项目开始
  75.     int col = 0;
  76. Collection collItem = BudgetListProxy.allUseItem(startMonth, endMonth, id);
  77. int allRecord = collItem.size();
  78. if (allRecord == 0)
  79.                             response.sendRedirect("/mainctrl/financial/resultDepResultFail");
  80.     if(balanceYearMonth<14)
  81. {
  82.  out.println("<div id="Layer1" style="width:600px; height:"+(balanceYearMonth*20+128)+"px; z-index:1; overflow:auto" >");
  83. }
  84. else
  85. {
  86.  out.println("<div id="Layer1" style="width:600px; height:365px; z-index:1; overflow:auto" >");
  87. }
  88. Iterator iterItem = collItem.iterator();
  89. BudgetValueBean valueItem = null;
  90. int theWidth = 0;
  91. if(choose.equals("1"))
  92. {
  93.             theWidth = allRecord*50+150;
  94. }
  95. else if(choose.equals("2"))
  96. {
  97.             theWidth = allRecord*50+150;
  98. }
  99. else
  100. {
  101.             theWidth = allRecord*100+150;
  102. }
  103.             //int theWidth = allRecord*100+150;
  104. theWidth = (theWidth<=600)?600:theWidth;
  105. out.println("<table class=title width="+theWidth+" border=0 cellpadding=2 cellspacing=1>");
  106. if((choose.compareTo("3")) == 0)
  107. {
  108. out.println("<tr align=center bgcolor=#b4b4b4><td width=150  height=2 rowspan=2><font class=strong>月份</font></td>");
  109. while(iterItem.hasNext())
  110. {
  111.     col++;
  112.     valueItem = (BudgetValueBean)iterItem.next();
  113. out.println("<td width=100 colspan=2><font class=strong >"+valueItem.getName()+"</font></td>");
  114.     }
  115. out.println("<td width=100 colspan=2><font class=strong >总计</font></td></tr><tr align=center bgcolor=#b4b4b4>");
  116. for(int i=-1; i<col; i++)
  117. {
  118.     out.println("<td width=50>预算</td><td width=50>实际</td>");
  119.     }
  120. }
  121. else if (((choose.compareTo("2")) == 0))
  122. {
  123. out.println("<tr align=center bgcolor=#b4b4b4><td align=center width=150> <font class=strong>月份</font></td>");
  124. while(iterItem.hasNext())
  125. {
  126.     col++;
  127.     valueItem = (BudgetValueBean)iterItem.next();
  128. out.println("<td width=50><font class=strong >"+valueItem.getName()+"</font></td>");
  129.     }
  130. out.println("<td width=100><font class=strong >总计</font></td>");
  131. }
  132. else
  133. {
  134. out.println("<tr align=center bgcolor=#b4b4b4><td width=150> <font class=strong>月份</font></td>");
  135. while(iterItem.hasNext())
  136. {
  137.     col++;
  138.     valueItem = (BudgetValueBean)iterItem.next();
  139. out.println("<td width=50><font class=strong >"+valueItem.getName()+"</font></td>");
  140.     }
  141. out.println("<td width=100><font class=strong >总计</font></td>");
  142. }
  143.                 //列出项目结束.
  144. %>
  145. </tr>
  146. <%
  147. try
  148. {
  149.     //列出数据开始.
  150.     int blue=0;
  151.         String rowColor="";
  152. int column = 0;
  153. Collection collAll = BudgetListProxy.getParseBudget(startMonth, endMonth, id);
  154. Iterator iterAll = collAll.iterator();
  155. if((choose.compareTo("3")) == 0)
  156. {
  157. while(iterAll.hasNext())
  158. {
  159.     column++;
  160. rowColor = ((column%2)==0)?"#fafafa":"#e0e0e0";
  161. %>
  162.                         <tr bgcolor=<%=rowColor%> align="center"> 
  163. <%
  164.     Collection coll = (Collection)iterAll.next();
  165. Iterator iter = coll.iterator();
  166. while(iter.hasNext())
  167. {
  168.     BudgetListValueBean budgetListValueBean = (BudgetListValueBean)iter.next();
  169. if(blue==0)
  170. {
  171.     out.println("<td>"+budgetListValueBean.getMonth()+"</td>");
  172.     blue = 1;
  173.  }
  174.   if (budgetListValueBean.getDivision() == -1)
  175.   {
  176.       out.println("<td></td><td></td>");
  177.   }
  178.   else
  179.   {
  180.       out.println("<td>"+budgetListValueBean.getBudget()+"</td>");
  181.   if(budgetListValueBean.getActual() != -1f)
  182.   {
  183.   out.println("<td>"+budgetListValueBean.getActual()+"</td>");
  184.   oneMonthActual += budgetListValueBean.getActual();
  185.     }
  186.   else
  187.   {
  188.       out.println("<td></td>");
  189.   }
  190.   
  191.   oneMonthBudget += budgetListValueBean.getBudget();
  192.   changeMonth = 1;
  193.   }
  194.  }
  195.  blue = 0;
  196.  if (changeMonth == 1)
  197.  {
  198.  out.println("<td>"+dFormat.format(oneMonthBudget)+"</td><td>"+dFormat.format(oneMonthActual)+"</td></tr>");
  199.      }
  200.  else
  201.  {
  202.  out.println("<td></td><td></td></tr>");
  203.  }
  204.  oneMonthBudget = 0.0d;
  205.  oneMonthActual = 0.0d;
  206.  changeMonth = 0;
  207.     }
  208. }
  209. else if (((choose.compareTo("2")) == 0))
  210. {
  211. while(iterAll.hasNext())
  212. {
  213.     column++;
  214. rowColor = ((column%2)==0)?"#fafafa":"#e0e0e0";
  215. %>
  216.                         <tr bgcolor=<%=rowColor%> align="center"> 
  217. <%
  218.     Collection coll = (Collection)iterAll.next();
  219. Iterator iter = coll.iterator();
  220. while(iter.hasNext())
  221. {
  222.     BudgetListValueBean budgetListValueBean = (BudgetListValueBean)iter.next();
  223. if(blue==0)
  224. {
  225.     out.println("<td>"+budgetListValueBean.getMonth()+"</td>");
  226.     blue = 1;
  227.  }
  228.   if (budgetListValueBean.getDivision() == -1)
  229.   {
  230.       out.println("<td></td>");
  231.   }
  232.   else
  233.   {
  234.   if(budgetListValueBean.getActual() != -1f)
  235.   {
  236.   out.println("<td>"+budgetListValueBean.getActual()+"</td>");
  237.   oneMonthActual += budgetListValueBean.getActual();
  238.     }
  239.   else
  240.   {
  241.       out.println("<td></td>");
  242.   }
  243.   changeMonth = 1;
  244.   }
  245.  }
  246.  blue = 0;
  247.  if (changeMonth == 1)
  248.  {
  249.  out.println("<td>"+dFormat.format(oneMonthActual)+"</td></tr>");
  250.      }
  251.  else
  252.  {
  253.  out.println("<td></td></tr>");
  254.  }
  255.  oneMonthActual = 0.0d;
  256.  changeMonth = 0;
  257.     }
  258. }
  259. else
  260. {
  261. while(iterAll.hasNext())
  262. {
  263.     column++;
  264. rowColor = ((column%2)==0)?"#fafafa":"#e0e0e0";
  265. %>
  266.                         <tr bgcolor=<%=rowColor%> align="center"> 
  267. <%
  268.     Collection coll = (Collection)iterAll.next();
  269. Iterator iter = coll.iterator();
  270. while(iter.hasNext())
  271. {
  272.     BudgetListValueBean budgetListValueBean = (BudgetListValueBean)iter.next();
  273. if(blue==0)
  274. {
  275.     out.println("<td>"+budgetListValueBean.getMonth()+"</td>");
  276.     blue = 1;
  277.  }
  278.   if (budgetListValueBean.getDivision() == -1)
  279.   {
  280.       out.println("<td></td>");
  281.   }
  282.   else
  283.   {
  284.       out.println("<td>"+budgetListValueBean.getBudget()+"</td>");
  285.   oneMonthBudget += budgetListValueBean.getBudget();
  286.   changeMonth = 1;   
  287.   }
  288.  }
  289.  blue = 0;
  290.  if (changeMonth == 1)
  291.  {
  292.  out.println("<td>"+dFormat.format(oneMonthBudget)+"</td></tr>");
  293.      }
  294.  else
  295.  {
  296.  out.println("<td></td></tr>");
  297.  }
  298.  oneMonthBudget = 0.0d;
  299.  changeMonth = 0;
  300.     }
  301. }
  302.                 //列出数据结束.
  303. %>
  304.    <!--列表显示结束-->
  305.    <!--总计显示开始-->
  306. <%
  307.     Collection collTotal = BudgetListProxy.getDepTotal(startMonth, endMonth, id);
  308. Iterator iterTotal = collTotal.iterator();
  309. if(rowColor.equals("#fafafa")) rowColor = "#e0e0e0";
  310. else rowColor = "#fafafa";
  311. if((choose.compareTo("3")) == 0)
  312. {
  313.                 double budgetTotal = 0.0d;
  314. double actualTotal = 0.0d;
  315.                 out.println("<tr align=center bgcolor="+rowColor+"><td><font class=strong>总计:</font></td>");
  316. while(iterTotal.hasNext())
  317. {
  318.     BudgetListValueBean budgetListValueBean = (BudgetListValueBean)iterTotal.next();
  319. budgetTotal += budgetListValueBean.getBudget();
  320. actualTotal += budgetListValueBean.getActual();
  321. out.println("<td>"+budgetListValueBean.getBudget()+"</td><td>"+budgetListValueBean.getActual()+"</td>");
  322. }
  323. out.println("<td>"+dFormat.format(budgetTotal)+"</td><td>"+dFormat.format(actualTotal)+"</td></tr>");
  324. }
  325. else if (((choose.compareTo("2")) == 0))
  326. {
  327. double actualTotal = 0.0d;
  328.                 out.println("<tr align=center bgcolor="+rowColor+"><td><font class=strong>总计</font></td>");
  329. while(iterTotal.hasNext())
  330. {
  331.     BudgetListValueBean budgetListValueBean = (BudgetListValueBean)iterTotal.next();
  332. actualTotal += budgetListValueBean.getActual();
  333. out.println("<td>"+budgetListValueBean.getActual()+"</td>");
  334. }
  335. out.println("<td>"+dFormat.format(actualTotal)+"</td></tr>");
  336. }
  337. else if (((choose.compareTo("1")) == 0))
  338. {
  339.                 double budgetTotal = 0.0d;
  340.                 out.println("<tr align=center bgcolor="+rowColor+"><td><font class=strong>总计</font></td>");
  341. while(iterTotal.hasNext())
  342. {
  343.     BudgetListValueBean budgetListValueBean = (BudgetListValueBean)iterTotal.next();
  344. budgetTotal += budgetListValueBean.getBudget();
  345. out.println("<td>"+budgetListValueBean.getBudget()+"</td>");
  346. }
  347. out.println("<td>"+dFormat.format(budgetTotal)+"</td></tr>");
  348. }
  349. %>   
  350.    <!--总计显示结束-->
  351. <%
  352. }
  353. catch(Exception e)
  354. {
  355.     out.println(e);
  356. }
  357. %>
  358.                 </table></div>
  359.                 <table width="100%" border="0" cellspacing="0" cellpadding="0">
  360.                   <tr  align="center"> 
  361.                     <td  bgcolor="#fafafa" height="30" align="center"> 
  362.                       <input type="button" name="Button22" value="返回" onClick="location='/mainctrl/financial/resultDep'" class="text">
  363.                     </td>
  364.                   </tr>
  365.   
  366.                 </table>
  367.               </td>
  368.             </tr>
  369.           </table>
  370.           <jsp:include page="/vnex/page/TTOA_HELP.jsp" />
  371.        </TD>
  372.     </TR>
  373.      <jsp:include page="/vnex/page/TTOA_TABLE_BOTTOM.jsp" />
  374.     </TABLE>
  375.     <BR>
  376.     <jsp:include page="/vnex/page/TTOA_PRODUCER_LOGO.jsp" />
  377. </form>
  378.   </DIV>
  379.  </BODY>
  380. </HTML>