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

📄 i_year_stati.jsp

📁 《jsp案例开发》这本书的源代码。包括源代码和相关的具体配置操作步骤。非常不错
💻 JSP
字号:
<%@ page    language="java"    contentType="text/html; charset=GBK"    import="imis.*,javax.naming.*,javax.rmi.PortableRemoteObject,java.util.*,java.text.*"%><%  request.setCharacterEncoding("GBK");  session=request.getSession();  userStruct user=(userStruct)session.getAttribute("user");  if(user==null){  response.sendRedirect("../../login.html");  }else{  %><HTML><HEAD><META http-equiv=Content-Type content="text/html; charset=gb_2312-80"><link rel="stylesheet" href="../../css/sti.css" type="text/css"></HEAD><BODY><table width=800 class=title cellspacing=0 cellpadding=0 border=1 align=center ><tr align=middle><td width="5%">序&nbsp;号</td><td width="13%">设备名称</td><td width="14%">规格/型号</td><td width="8%">计量单位</td><td width="9%">数&nbsp;量</td><td width="15%">投资金额</td><td width="15%">内容及用途</td><td width="21%">备&nbsp;&nbsp;&nbsp;&nbsp;注</td></tr><%  Vector unitname=new Vector();  int year=Integer.parseInt(request.getParameter("year"));  Context ctx = new InitialContext();    //look up jndi name    Object ref = ctx.lookup("ScheController");    //cast to Home interface    ScheControllerHome scheControllerHome = (ScheControllerHome) PortableRemoteObject.narrow(ref, ScheControllerHome.class);    ScheController scheController = scheControllerHome.create();    Collection c=new ArrayList();    schemeStruct ss=null;    ss=new schemeStruct();    scdStruct scd=null;    scd=new scdStruct();    Collection sch=scheController.getHqreplied(new Integer(1));    Iterator j=sch.iterator();    while(j.hasNext())       {      ss=(schemeStruct)j.next();      Judge jd=new Judge();      if(jd.decide(user.unitid,ss.unitid))      {   int appyear=ss.apptime.getYear()+1900;          if(appyear==year)            {            c.add(ss);            unitname.addElement(ss.unit);           }        }}for(int l=0;l<unitname.size()-1;l++)  for(int k=l+1;k<unitname.size();k++)    {    if(unitname.elementAt(l).equals(unitname.elementAt(k)))             {             unitname.remove(k);             k--;               }     }for(int b=0;b<unitname.size();b++){ int amount=0; double money=0.00; String order=""; if(b==0) order="一"; if(b==1) order="二"; if(b==2) order="三"; if(b==3) order="四"; if(b==4) order="五"; if(b==5) order="六"; if(b==6) order="七"; if(b==7) order="八"; if(b==8) order="九"; if(b==9) order="十"; if(b==10) order="十一"; if(b==11) order="十二"; if(b==12) order="十三"; if(b==13) order="十四"; if(b==14) order="十五";Vector eqname=new Vector();Collection scd_c=new ArrayList(); j=c.iterator(); while(j.hasNext())   {   ss=(schemeStruct)j.next();   if(ss.unit.equals(unitname.elementAt(b)))          {         scd=scheController.getHqsd(ss.schid);         scd_c.add(scd);         eqname.addElement(scd.name);         amount=amount+scd.r_amount.intValue();         money=money+Double.parseDouble(scd.price)*scd.r_amount.intValue();           }   }%><tr align=middle><td><%=order%></td><td><b><%=unitname.elementAt(b)%></b></td><td>&nbsp;</td><td>套</td><td><%=amount%></td><td><%=money%></td><td>&nbsp;</td><td>&nbsp;</td></tr><%  for(int l=0;l<eqname.size()-1;l++)    for(int k=l+1;k<eqname.size();k++)      {      if(eqname.elementAt(l).equals(eqname.elementAt(k)))               {               eqname.remove(k);               k--;                 }     }for(int z=0;z<eqname.size();z++){    int samount=0;    double smoney=0.0;    String demos="";    j=scd_c.iterator();    while(j.hasNext())      {      scd=(scdStruct)j.next();      if(scd.name.equals(eqname.elementAt(z)))         {         samount=samount+scd.r_amount.intValue();         smoney=smoney+Double.parseDouble(scd.price)*scd.r_amount.intValue();         demos=demos+scd.reason+"<br>";          }      }%><tr align=middle><td><%=z+1%></td><td><%=eqname.elementAt(z)%></td><td><%=scd.model%></td><td>套</td><td><%=samount%></td><td><%=smoney%></td><td><%=unitname.elementAt(b)%></td><td><%=demos%></td></tr><%}}%><%String uni="";if(user.unitid.equals(new Integer(2)))  uni="北方海区";if(user.unitid.equals(new Integer(3)))  uni="东海海区";if(user.unitid.equals(new Integer(4)))  uni="南海海区";if(user.unitid.equals(new Integer(5)))  uni="海南海事局";%><caption align=right><%=uni%><%=year%>年进口设备批复统计表 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font size=1>单位:万元</font></caption></table><table align=center><tr>&nbsp;</tr><tr>&nbsp;</tr><tr align=middle><td><SCRIPT LANGUAGE="JavaScript">if (window.print) {document.write('<input type=button name=print class=file value=" 打  印 " '+ 'onClick="javascript:window.print()">');}</script></td><td><input type="button" name="haha" value=" 返  回 " class="file" onClick="location='year_stati.jsp'"></td></tr></table></BODY></HTML><%}%>

⌨️ 快捷键说明

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