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. <jsp:useBean id="BusinessName" scope="session" class="com.vnex.intranet.pub.BusinessSession" />
  10. <%
  11. String startMonth = request.getParameter("yearStart")+"-"+request.getParameter("monthStart");
  12. String endMonth = request.getParameter("yearEnd")+"-"+request.getParameter("monthEnd");;
  13. int balanceYear = (new Integer(request.getParameter("yearEnd"))).intValue()-(new Integer(request.getParameter("yearStart"))).intValue();
  14. int balanceMonth = (new Integer(request.getParameter("monthEnd"))).intValue()-(new Integer(request.getParameter("monthStart"))).intValue();
  15.     int balanceYearMonth = balanceYear*12+balanceMonth;
  16.     int id = BusinessName.getDeptId();
  17.     String choose = request.getParameter("choose");
  18. String divisionName = BudgetListProxy.divisionName(id);
  19. double oneMonthBudget = 0.0d;
  20. double oneMonthActual = 0.0d;
  21. int changeMonth = 0;
  22. DecimalFormat dFormat = new DecimalFormat("##.##");    
  23. %>
  24. <HTML><jsp:include page="/vnex/page/FORM_HEAD.jsp" />
  25. <script language="JavaScript1.2" src="/vnex/menu/dockmenu_person.js"></script>
  26. <script language="JavaScript1.2" src="/vnex/menu/dockmenu.js"></script>
  27. <BODY text=#000000 vLink=#000000 aLink=#000000 link=#000000 bgColor=#ffffff topMargin=20 leftmargin="0" marginwidth="0" marginheight="0">
  28. <DIV align=center>
  29. <form name="form1" method="post" action="">
  30.   <TABLE class=outter cellSpacing=0 cellPadding=0 width=600 border=0>
  31.     <jsp:include page="/vnex/page/TTOA_TABLE_TOP.jsp" />
  32.     <TR> 
  33.         <TD colSpan=3 align="center" class="iframestyle" valign="top"> <br>
  34.           <table width="600" border="1" cellspacing="1" bordercolor="#666666">
  35.             <tr valign="top"> 
  36.               <td > 
  37.                 
  38.                 <table width="600" border="0" cellspacing="0" cellpadding="2">
  39.                   <tr> 
  40.                     <td bgcolor="#666666"><font class="strongw"><a href="/mainctrl/home/index"><font color="#FFFFFF">首页</font></a>&gt;&gt;<a href="/mainctrl/personal/main"><font color="#FFFFFF">个人办公</font></a>&gt;&gt;<a href="/mainctrl/budget/index"><font color="#FFFFFF">部门预算</font></a>&gt;&gt;<a href="/mainctrl/budget/resultDep"><font color="#FFFFFF">统计查询</font></a>&gt;&gt;<font color="#FFFFFF">查询结果</font></font></td>
  41.                   </tr>
  42.                 </table>
  43.                 <table class=title width="600" border="0" cellpadding="2" cellspacing="0">
  44.                   <tr bgcolor="#fafafa"> 
  45.                     <td colspan="5"> 
  46. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  47.                         <tr>
  48.                           <td width="80%"><font class="strong">&nbsp;下面是<%=startMonth%>至<%=endMonth%><%=divisionName%>的预算统计表(
  49.   <%
  50.   if(choose.equals("1"))
  51.   {
  52.      out.println("类别:预算");
  53.   }
  54.   else if(choose.equals("2"))
  55.   {
  56.      out.println("类别:实际");
  57.   }
  58.   else if(choose.equals("3"))
  59.   {
  60.      out.println("类别:预算和实际");
  61.   }
  62.   %>
  63.   ):</font> 
  64.                           </td>
  65.                           <td width="20%">
  66.                             <div align="right"><font class="strong">单位:元&nbsp;&nbsp;&nbsp;&nbsp;</font></div>
  67.                           </td>
  68.                         </tr>
  69.                       </table>
  70.                     </td>
  71.                   </tr>
  72.                 </table>
  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/budget/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=100  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=100> <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=100> <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. </tr>
  145. <%
  146. try
  147. {
  148.     int blue=0;
  149.         String rowColor="";
  150. int column = 0;
  151. Collection collAll = BudgetListProxy.getParseBudget(startMonth, endMonth, id);
  152. Iterator iterAll = collAll.iterator();
  153. if((choose.compareTo("3")) == 0)
  154. {
  155. while(iterAll.hasNext())
  156. {
  157.     column++;
  158. rowColor = ((column%2)==0)?"#fafafa":"#e0e0e0";
  159. %>
  160.                         <tr bgcolor=<%=rowColor%> align="center"> 
  161. <%
  162.     Collection coll = (Collection)iterAll.next();
  163. Iterator iter = coll.iterator();
  164. while(iter.hasNext())
  165. {
  166.     BudgetListValueBean budgetListValueBean = (BudgetListValueBean)iter.next();
  167. if(blue==0)
  168. {
  169.     out.println("<td>"+budgetListValueBean.getMonth()+"</td>");
  170.     blue = 1;
  171.  }
  172.   if (budgetListValueBean.getDivision() == -1)
  173.   {
  174.       out.println("<td></td><td></td>");
  175.   }
  176.   else
  177.   {
  178.       out.println("<td>"+budgetListValueBean.getBudget()+"</td>");
  179.   if(budgetListValueBean.getActual() != -1f)
  180.   {
  181.   out.println("<td>"+budgetListValueBean.getActual()+"</td>");
  182.   oneMonthActual += budgetListValueBean.getActual();
  183.     }
  184.   else
  185.   {
  186.       out.println("<td></td>");
  187.   }
  188.   
  189.   oneMonthBudget += budgetListValueBean.getBudget();
  190.   changeMonth = 1;
  191.   }
  192.  }
  193.  blue = 0;
  194.  if (changeMonth == 1)
  195.  {
  196.  out.println("<td>"+dFormat.format(oneMonthBudget)+"</td><td>"+dFormat.format(oneMonthActual)+"</td></tr>");
  197.      }
  198.  else
  199.  {
  200.  out.println("<td></td><td></td></tr>");
  201.  }
  202.  oneMonthBudget = 0.0d;
  203.  oneMonthActual = 0.0d;
  204.  changeMonth = 0;
  205.     }
  206. }
  207. else if (((choose.compareTo("2")) == 0))
  208. {
  209. while(iterAll.hasNext())
  210. {
  211.     column++;
  212. rowColor = ((column%2)==0)?"#fafafa":"#e0e0e0";
  213. %>
  214.                         <tr bgcolor=<%=rowColor%> align="center"> 
  215. <%
  216.     Collection coll = (Collection)iterAll.next();
  217. Iterator iter = coll.iterator();
  218. while(iter.hasNext())
  219. {
  220.     BudgetListValueBean budgetListValueBean = (BudgetListValueBean)iter.next();
  221. if(blue==0)
  222. {
  223.     out.println("<td>"+budgetListValueBean.getMonth()+"</td>");
  224.     blue = 1;
  225.  }
  226.   if (budgetListValueBean.getDivision() == -1)
  227.   {
  228.       out.println("<td></td>");
  229.   }
  230.   else
  231.   {
  232.   if(budgetListValueBean.getActual() != -1f)
  233.   {
  234.   out.println("<td>"+budgetListValueBean.getActual()+"</td>");
  235.   oneMonthActual += budgetListValueBean.getActual();
  236.     }
  237.   else
  238.   {
  239.       out.println("<td></td>");
  240.   }
  241.   changeMonth = 1;
  242.   }
  243.  }
  244.  blue = 0;
  245.  if (changeMonth == 1)
  246.  {
  247.  out.println("<td>"+dFormat.format(oneMonthActual)+"</td></tr>");
  248.      }
  249.  else
  250.  {
  251.  out.println("<td></td></tr>");
  252.  }
  253.  oneMonthActual = 0.0d;
  254.  changeMonth = 0;
  255.     }
  256. }
  257. else
  258. {
  259. while(iterAll.hasNext())
  260. {
  261.     column++;
  262. rowColor = ((column%2)==0)?"#fafafa":"#e0e0e0";
  263. %>
  264.                         <tr bgcolor=<%=rowColor%> align="center"> 
  265. <%
  266.     Collection coll = (Collection)iterAll.next();
  267. Iterator iter = coll.iterator();
  268. while(iter.hasNext())
  269. {
  270.     BudgetListValueBean budgetListValueBean = (BudgetListValueBean)iter.next();
  271. if(blue==0)
  272. {
  273.     out.println("<td>"+budgetListValueBean.getMonth()+"</td>");
  274.     blue = 1;
  275.  }
  276.   if (budgetListValueBean.getDivision() == -1)
  277.   {
  278.       out.println("<td></td>");
  279.   }
  280.   else
  281.   {
  282.       out.println("<td>"+budgetListValueBean.getBudget()+"</td>");
  283.   oneMonthBudget += budgetListValueBean.getBudget();
  284.   changeMonth = 1;   
  285.   }
  286.  }
  287.  blue = 0;
  288.  if (changeMonth == 1)
  289.  {
  290.  out.println("<td>"+dFormat.format(oneMonthBudget)+"</td></tr>");
  291.      }
  292.  else
  293.  {
  294.  out.println("<td></td></tr>");
  295.  }
  296.  oneMonthBudget = 0.0d;
  297.  changeMonth = 0;
  298.     }
  299. }
  300. %>
  301.    <!--列表显示结束-->
  302.    <!--总计显示开始-->
  303. <%
  304.     Collection collTotal = BudgetListProxy.getDepTotal(startMonth, endMonth, id);
  305. Iterator iterTotal = collTotal.iterator();
  306. if(rowColor.equals("#fafafa")) rowColor = "#e0e0e0";
  307. else rowColor = "#fafafa";
  308. if((choose.compareTo("3")) == 0)
  309. {
  310.                 double budgetTotal = 0.0d;
  311. double actualTotal = 0.0d;
  312.                 out.println("<tr align=center bgcolor="+rowColor+"><td><font class=strong>总计:</font></td>");
  313. while(iterTotal.hasNext())
  314. {
  315.     BudgetListValueBean budgetListValueBean = (BudgetListValueBean)iterTotal.next();
  316. budgetTotal += budgetListValueBean.getBudget();
  317. actualTotal += budgetListValueBean.getActual();
  318. out.println("<td>"+budgetListValueBean.getBudget()+"</td><td>"+budgetListValueBean.getActual()+"</td>");
  319. }
  320. out.println("<td>"+dFormat.format(budgetTotal)+"</td><td>"+dFormat.format(actualTotal)+"</td></tr>");
  321. }
  322. else if (((choose.compareTo("2")) == 0))
  323. {
  324. double actualTotal = 0.0d;
  325.                 out.println("<tr align=center bgcolor="+rowColor+"><td><font class=strong>总计</font></td>");
  326. while(iterTotal.hasNext())
  327. {
  328.     BudgetListValueBean budgetListValueBean = (BudgetListValueBean)iterTotal.next();
  329. actualTotal += budgetListValueBean.getActual();
  330. out.println("<td>"+budgetListValueBean.getActual()+"</td>");
  331. }
  332. out.println("<td>"+dFormat.format(actualTotal)+"</td></tr>");
  333. }
  334. else if (((choose.compareTo("1")) == 0))
  335. {
  336.                 double budgetTotal = 0.0d;
  337.                 out.println("<tr align=center bgcolor="+rowColor+"><td><font class=strong>总计</font></td>");
  338. while(iterTotal.hasNext())
  339. {
  340.     BudgetListValueBean budgetListValueBean = (BudgetListValueBean)iterTotal.next();
  341. budgetTotal += budgetListValueBean.getBudget();
  342. out.println("<td>"+budgetListValueBean.getBudget()+"</td>");
  343. }
  344. out.println("<td>"+dFormat.format(budgetTotal)+"</td></tr>");
  345. }
  346. %>   
  347.    <!--总计显示结束-->   
  348. <%
  349. }
  350. catch(Exception e)
  351. {
  352.     out.println(e);
  353. }
  354. %>
  355.                 </table></div>
  356.                 <table width="100%" border="0" cellspacing="0" cellpadding="0">
  357.                   <tr  align="center"> 
  358.                     <td  bgcolor="#fafafa" height="30" align="center"> 
  359.                       <input type="button" name="Button22" value="返回" onClick="location='/mainctrl/budget/resultDep'" class="text">
  360.                     </td>
  361.                   </tr>
  362.   
  363.                 </table>
  364.               </td>
  365.             </tr>
  366.           </table>
  367.          <jsp:include page="/vnex/page/TTOA_HELP.jsp" />
  368.        </TD>
  369.     </TR>
  370.      <jsp:include page="/vnex/page/TTOA_TABLE_BOTTOM.jsp" />
  371.     </TABLE>
  372.     <BR>
  373.     <jsp:include page="/vnex/page/TTOA_PRODUCER_LOGO.jsp" />
  374. </form>
  375.   </DIV>
  376.  </BODY>
  377. </HTML>