⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fin_result_dep_result.jsp

📁 非常完整的Java开发的网络办公系统
💻 JSP
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<%@ page errorPage="/vnex/ErrorPage.jsp" %>
<%@ page language="java" %>
<%@ page import="java.util.*" %>
<%@ page import="java.lang.*" %>
<%@ page import="com.vnex.intranet.budget.value.*" %>
<%@ page import="java.text.DecimalFormat" %>
<jsp:useBean id="BudgetListProxy" scope="application" class="com.vnex.intranet.budget.proxy.BudgetListProxyBean" />
<jsp:useBean id="BusinessName" scope="session" class="com.vnex.intranet.pub.BusinessSession" />
<%
	String startMonth = request.getParameter("yearStart")+"-"+request.getParameter("monthStart");
	String endMonth = request.getParameter("yearEnd")+"-"+request.getParameter("monthEnd");;					
	int balanceYear = (new Integer(request.getParameter("yearEnd"))).intValue()-(new Integer(request.getParameter("yearStart"))).intValue();
	int balanceMonth = (new Integer(request.getParameter("monthEnd"))).intValue()-(new Integer(request.getParameter("monthStart"))).intValue();
    int balanceYearMonth = balanceYear*12+balanceMonth;
    int id = BusinessName.getDeptId();
    String choose = request.getParameter("choose");
	String divisionName = BudgetListProxy.divisionName(id);
	double oneMonthBudget = 0.0d;				
	double oneMonthActual = 0.0d;		
	int changeMonth = 0;
	DecimalFormat dFormat = new DecimalFormat("##.##");			   
%>
<HTML><jsp:include page="/vnex/page/FORM_HEAD.jsp" />
<script language="JavaScript1.2" src="/vnex/menu/dockmenu_person.js"></script>
<script language="JavaScript1.2" src="/vnex/menu/dockmenu.js"></script>

<BODY text=#000000 vLink=#000000 aLink=#000000 link=#000000 bgColor=#ffffff topMargin=20 leftmargin="0" marginwidth="0" marginheight="0">
<DIV align=center>
<form name="form1" method="post" action="">
  <TABLE class=outter cellSpacing=0 cellPadding=0 width=600 border=0>
    <jsp:include page="/vnex/page/TTOA_TABLE_TOP.jsp" />
    <TR> 
        <TD colSpan=3 align="center" class="iframestyle" valign="top"> <br>
          <table width="600" border="1" cellspacing="1" bordercolor="#666666">
            <tr valign="top"> 
              <td > 
                
                <table width="600" border="0" cellspacing="0" cellpadding="2">
                  <tr> 
                    <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>
                  </tr>
                </table>
                <table class=title width="600" border="0" cellpadding="2" cellspacing="0">
                  <tr bgcolor="#fafafa"> 
                    <td colspan="5"> 
<table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                          <td width="80%"><font class="strong">&nbsp;下面是<%=startMonth%>至<%=endMonth%><%=divisionName%>的预算统计表(
						  <%
						  if(choose.equals("1"))
						  {
						     out.println("类别:预算");
						  }
						  else if(choose.equals("2"))
						  {
						     out.println("类别:实际");
						  }
						  else if(choose.equals("3"))
						  {
						     out.println("类别:预算和实际");
						  }
						  %>
						  ):</font> 
                          </td>
                          <td width="20%">
                            <div align="right"><font class="strong">单位:元&nbsp;&nbsp;&nbsp;&nbsp;</font></div>
                          </td>
                        </tr>
                      </table>					
                    </td>
                  </tr>
                </table>
				<!--列表显示开始-->
 <%
			    int col = 0;
				Collection collItem = BudgetListProxy.allUseItem(startMonth, endMonth, id);
				int allRecord = collItem.size();
				if (allRecord == 0)
                            response.sendRedirect("/mainctrl/budget/resultDepResultFail");
			    if(balanceYearMonth<14)
				{
					 out.println("<div id=\"Layer1\" style=\"width:600px;  height:"+(balanceYearMonth*20+128)+"px; z-index:1; overflow:auto\" >");
				}
				else
				{
					 out.println("<div id=\"Layer1\" style=\"width:600px; height:365px; z-index:1; overflow:auto\" >");
				}
				Iterator iterItem = collItem.iterator();
				BudgetValueBean valueItem = null;
				int theWidth = 0;
				
				if(choose.equals("1"))
				{
		            theWidth = allRecord*50+150;
				}
				else if(choose.equals("2"))
				{
		            theWidth = allRecord*50+150;
				}
				else
				{
		            theWidth = allRecord*100+150;
				}
				
		            //int theWidth = allRecord*100+150;
		theWidth = (theWidth<=600)?600:theWidth;
		out.println("<table class=title width="+theWidth+" border=0 cellpadding=2 cellspacing=1>");
if((choose.compareTo("3")) == 0)
{
		out.println("<tr align=center bgcolor=#b4b4b4><td width=100  height=2 rowspan=2><font class=strong>月份</font></td>");								
				while(iterItem.hasNext())
				{
				    col++;
				    valueItem = (BudgetValueBean)iterItem.next();
					out.println("<td width=100 colspan=2><font class=strong >"+valueItem.getName()+"</font></td>");
			    }
						out.println("<td width=100 colspan=2><font class=strong >总计</font></td></tr><tr align=center bgcolor=#b4b4b4>");
						for(int i=-1; i<col; i++)
						{
						    out.println("<td width=50>预算</td><td width=50>实际</td>");
					    }
}				
else if (((choose.compareTo("2")) == 0))
{
out.println("<tr align=center bgcolor=#b4b4b4><td align=center width=100> <font class=strong>月份</font></td>");
				while(iterItem.hasNext())
				{
				    col++;
				    valueItem = (BudgetValueBean)iterItem.next();
					out.println("<td width=50><font class=strong >"+valueItem.getName()+"</font></td>");
			    }
				out.println("<td width=100><font class=strong >总计</font></td>");
}
else
{
out.println("<tr align=center bgcolor=#b4b4b4><td width=100> <font class=strong>月份</font></td>");
				while(iterItem.hasNext())
				{
				    col++;
				    valueItem = (BudgetValueBean)iterItem.next();
					out.println("<td width=50><font class=strong >"+valueItem.getName()+"</font></td>");
			    }
				out.println("<td width=100><font class=strong >总计</font></td>");				
}						
%>
					</tr>
<%
			try
			{
			    int blue=0;
		        String rowColor="";
				int column = 0;				
				Collection collAll = BudgetListProxy.getParseBudget(startMonth, endMonth, id);
				Iterator iterAll = collAll.iterator();
if((choose.compareTo("3")) == 0)
{						
				while(iterAll.hasNext())
				{
					    column++;
						rowColor = ((column%2)==0)?"#fafafa":"#e0e0e0";									
%>
                        <tr bgcolor=<%=rowColor%> align="center"> 
<%
				    Collection coll = (Collection)iterAll.next();
					Iterator iter = coll.iterator();
					while(iter.hasNext())
					{
					    BudgetListValueBean budgetListValueBean = (BudgetListValueBean)iter.next();
						if(blue==0)
						{
						    out.println("<td>"+budgetListValueBean.getMonth()+"</td>");
						    blue = 1;
						 }
						  if (budgetListValueBean.getDivision() == -1)
						  {
						      out.println("<td></td><td></td>");
						  }
						  else
						  {
						      out.println("<td>"+budgetListValueBean.getBudget()+"</td>");
	 						if(budgetListValueBean.getActual() != -1f)
		 					{
							  out.println("<td>"+budgetListValueBean.getActual()+"</td>");
							  oneMonthActual += budgetListValueBean.getActual();
 	 						}
		 					else
			 				{
				 			    out.println("<td></td>");
					 		}
							  
							  oneMonthBudget += budgetListValueBean.getBudget();
							  changeMonth = 1;
						  }
					 }
					 blue = 0;
					 if (changeMonth == 1)
					 {
					 out.println("<td>"+dFormat.format(oneMonthBudget)+"</td><td>"+dFormat.format(oneMonthActual)+"</td></tr>");
				     }
					 else
					 {
					 out.println("<td></td><td></td></tr>");
					 }
					 oneMonthBudget = 0.0d;
					 oneMonthActual = 0.0d;
					 changeMonth = 0;
			    }
}				
else if (((choose.compareTo("2")) == 0))
{
				while(iterAll.hasNext())
				{
					    column++;
						rowColor = ((column%2)==0)?"#fafafa":"#e0e0e0";									
%>
                        <tr bgcolor=<%=rowColor%> align="center"> 
<%
				    Collection coll = (Collection)iterAll.next();
					Iterator iter = coll.iterator();
					while(iter.hasNext())
					{
					    BudgetListValueBean budgetListValueBean = (BudgetListValueBean)iter.next();
						if(blue==0)
						{
						    out.println("<td>"+budgetListValueBean.getMonth()+"</td>");
						    blue = 1;
						 }
						  if (budgetListValueBean.getDivision() == -1)
						  {
						      out.println("<td></td>");
						  }
						  else
						  {
	 						if(budgetListValueBean.getActual() != -1f)
		 					{
							  out.println("<td>"+budgetListValueBean.getActual()+"</td>");
							  oneMonthActual += budgetListValueBean.getActual();
 	 						}
		 					else
			 				{
				 			    out.println("<td></td>");
					 		}
							  changeMonth = 1;
						  }
					 }
					 blue = 0;
					 if (changeMonth == 1)
					 {
					 out.println("<td>"+dFormat.format(oneMonthActual)+"</td></tr>");
				     }
					 else
					 {
					 out.println("<td></td></tr>");
					 }
					 oneMonthActual = 0.0d;
					 changeMonth = 0;
			    }
}
else
{
				while(iterAll.hasNext())
				{
					    column++;
						rowColor = ((column%2)==0)?"#fafafa":"#e0e0e0";									
%>
                        <tr bgcolor=<%=rowColor%> align="center"> 
<%
				    Collection coll = (Collection)iterAll.next();
					Iterator iter = coll.iterator();
					while(iter.hasNext())
					{
					    BudgetListValueBean budgetListValueBean = (BudgetListValueBean)iter.next();
						if(blue==0)
						{
						    out.println("<td>"+budgetListValueBean.getMonth()+"</td>");
						    blue = 1;
						 }
						  if (budgetListValueBean.getDivision() == -1)
						  {
						      out.println("<td></td>");
						  }
						  else
						  {
						      out.println("<td>"+budgetListValueBean.getBudget()+"</td>");
							  oneMonthBudget += budgetListValueBean.getBudget();
							  changeMonth = 1;							  
						  }
					 }
					 blue = 0;
					 if (changeMonth == 1)
					 {
					 out.println("<td>"+dFormat.format(oneMonthBudget)+"</td></tr>");
				     }
					 else
					 {
					 out.println("<td></td></tr>");
					 }
					 oneMonthBudget = 0.0d;
					 changeMonth = 0;
			    }
}
%>
   <!--列表显示结束-->
   <!--总计显示开始-->
<%
    Collection collTotal = BudgetListProxy.getDepTotal(startMonth, endMonth, id);
	Iterator iterTotal = collTotal.iterator();
	if(rowColor.equals("#fafafa")) rowColor = "#e0e0e0";
	else rowColor = "#fafafa";
if((choose.compareTo("3")) == 0)
{
                double budgetTotal = 0.0d;
				double actualTotal = 0.0d;
                out.println("<tr align=center bgcolor="+rowColor+"><td><font class=strong>总计:</font></td>");
				while(iterTotal.hasNext())
				{
				    BudgetListValueBean budgetListValueBean = (BudgetListValueBean)iterTotal.next();
					budgetTotal += budgetListValueBean.getBudget();
					actualTotal += budgetListValueBean.getActual();
					out.println("<td>"+budgetListValueBean.getBudget()+"</td><td>"+budgetListValueBean.getActual()+"</td>");
				}
				out.println("<td>"+dFormat.format(budgetTotal)+"</td><td>"+dFormat.format(actualTotal)+"</td></tr>");
}
else if (((choose.compareTo("2")) == 0))
{
				double actualTotal = 0.0d;
                out.println("<tr align=center bgcolor="+rowColor+"><td><font class=strong>总计</font></td>");
				while(iterTotal.hasNext())
				{
				    BudgetListValueBean budgetListValueBean = (BudgetListValueBean)iterTotal.next();
					actualTotal += budgetListValueBean.getActual();
					out.println("<td>"+budgetListValueBean.getActual()+"</td>");
				}
				out.println("<td>"+dFormat.format(actualTotal)+"</td></tr>");
}
else if (((choose.compareTo("1")) == 0))
{
                double budgetTotal = 0.0d;
                out.println("<tr align=center bgcolor="+rowColor+"><td><font class=strong>总计</font></td>");
				while(iterTotal.hasNext())
				{
				    BudgetListValueBean budgetListValueBean = (BudgetListValueBean)iterTotal.next();
					budgetTotal += budgetListValueBean.getBudget();
					out.println("<td>"+budgetListValueBean.getBudget()+"</td>");
				}
				out.println("<td>"+dFormat.format(budgetTotal)+"</td></tr>");
}
%>   
   <!--总计显示结束-->   
<%
			}
			catch(Exception e)
			{
			    out.println(e);
			}
%>					

                </table></div>
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr  align="center"> 
                    <td  bgcolor="#fafafa" height="30" align="center"> 
                      <input type="button" name="Button22" value="返回" onClick="location='/mainctrl/budget/resultDep'" class="text">
                    </td>
                  </tr>
				  
                </table>
              </td>
            </tr>
          </table>
         <jsp:include page="/vnex/page/TTOA_HELP.jsp" />
       </TD>
    </TR>
     <jsp:include page="/vnex/page/TTOA_TABLE_BOTTOM.jsp" />
    </TABLE>
    <BR>
    <jsp:include page="/vnex/page/TTOA_PRODUCER_LOGO.jsp" />
	</form>
  </DIV>
 </BODY>
</HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -