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

📄 stati_dy.jsp

📁 这是一个学习jsp的基本程序
💻 JSP
📖 第 1 页 / 共 2 页
字号:
<%@ page    language="java"    contentType="text/html; charset=GBK"    import="imis.*,javax.naming.*,javax.rmi.PortableRemoteObject,java.util.*,java.sql.*,java.io.*"%><%    request.setCharacterEncoding("GBK");    session=request.getSession();    userStruct user=(userStruct)session.getAttribute("user");    if(user==null){    response.sendRedirect("../../login.html");    }  else if(user.userAccess.intValue()==0||user.userAccess.intValue()==1)          response.sendRedirect("../../error/access.html");  else{    %><%String haiquname=request.getParameter("hqname");    Context ctx1=new InitialContext();    Object ref1=ctx1.lookup("EquipmentControllerEJB");    EquipmentControllerEJBHome eqHome=(EquipmentControllerEJBHome) PortableRemoteObject.narrow(ref1,EquipmentControllerEJBHome.class);    EquipmentControllerEJB eqController = eqHome.create();    Collection eqc = new ArrayList();    eqc = eqController.getEqdDetailsAll();    Context psctx=new InitialContext();    Object psref=psctx.lookup("OfficeUnitController");    OfficeUnitControllerHome officeUnitControllerHome=(OfficeUnitControllerHome) PortableRemoteObject.narrow(psref,OfficeUnitControllerHome.class);;    OfficeUnitController officeUnitController=officeUnitControllerHome.create();    Vector hqname = new Vector();    Vector hqid = new Vector();    if((user.unitid.intValue() ==12)||(user.unitid.intValue() ==1026)||(user.unitid.intValue() ==2038)){      Collection hhh = officeUnitController.getUnitid(user.unitid);      Iterator hhhi = hhh.iterator();      while(hhhi.hasNext()){        officeUnitStruct hhhs = (officeUnitStruct)hhhi.next();        hqname.addElement(hhhs.processname);        hqid.addElement(user.unitid);      }    }    else{Collection hqc = new ArrayList();hqc = officeUnitController.getAll();Iterator hqi = hqc.iterator();while(hqi.hasNext()){officeUnitStruct ofus = (officeUnitStruct)hqi.next();if(ofus.upunitid.intValue()==user.unitid.intValue())   {  hqname.addElement(ofus.processname);  hqid.addElement(ofus.unitid);   }}//查出用户自身的上级单位Collection c413 = new ArrayList();c413 = officeUnitController.getUnitid(user.unitid);Iterator i413 = c413.iterator();officeUnitStruct ous_4_13 = (officeUnitStruct)i413.next();////如果用户是航标站,那么把自己加进去if(ous_4_13.upunitid.intValue()>5){hqname.addElement(ous_4_13.processname);hqid.addElement(ous_4_13.unitid);}//    }Context ctx = new InitialContext();       Object ref = ctx.lookup("OtherController");       OtherControllerHome otherControllerHome = (OtherControllerHome) PortableRemoteObject.narrow(ref, OtherControllerHome.class);       OtherController otherController = otherControllerHome.create();%>  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">  <HTML><HEAD>  <TITLE>MSA Office</TITLE>  <META http-equiv=Content-Type content="text/html; charset=gb_2312-80">  <META content="MSHTML 5.50.4134.600" name=GENERATOR>  <link rel="stylesheet" href="../../css/msa.css" type="text/css">  <script language="JavaScript" src="../../public/js/table_display.js"></script>  <script language="JavaScript" src="../../public/js/stati_menu.js"></script>  <script language="javascript" src="../../public/util/openSelect.js"></script>  <script language="javascript" src="../../public/js/getdate.js"></script>   <script language="javascript">  init1();  </script>  <SCRIPT>  window.onload=init  </SCRIPT>  </HEAD>  <BODY class="bg" topMargin=20 leftmargin="0" marginwidth="0" marginheight="0" onclick="h_cele_date()">  <DIV align=center>      <TABLE class=outter cellSpacing=0 cellPadding=0 width=700 border=0>        <TR>          <TD><IMG height=4 src="../../MacOS/lefttop.gif" width=6></TD>          <TD background=../../MacOS/top.gif colSpan=3><IMG height=4        src="../../MacOS/top.gif" width=1></TD>          <TD><IMG height=4 src="../../MacOS/righttop.gif"></TD>        </TR>        <TR>          <TD vAlign=top background=../../MacOS/lwing.gif rowSpan=3><IMG height=18        src="../../MacOS/left.gif" width=6></TD>          <TD vAlign=top background=../../MacOS/titlebg.gif width="16"> <DIV><img src="../../MacOS/logo.gif" width="16" height="16" border="0" ></DIV></TD>          <TD vAlign=top noWrap align=center width="100%"      background=../../MacOS/titlebg.gif><SPAN        style="BACKGROUND-COLOR: #cecece"><FONT class=strong> MSA - OFFICE </font></SPAN></TD>          <TD><IMG height=18 src="../../MacOS/right_b2.gif" width=18 border="0"></TD>          <TD vAlign=top background=../../MacOS/rwing.gif rowSpan=3><IMG height=18        src="../../MacOS/right.gif" width=7></TD>        </TR>        <TR>          <TD background=../../MacOS/hr.gif colSpan=3><IMG height=2        src="../../MacOS/hr.gif" width=1></TD>        </TR>        <TR>          <TD colSpan=3 align="center" valign="top"><br> <table width="700" border="1" cellspacing="1" bordercolor="#666666">              <tr bgcolor="#FAFAFA">                <td valign="top">                <table class=title cellspacing=1 cellpadding=2 width="100%" border=0>                  <form name="formdd" method="post" action="stati_dy.jsp">                  <tr bgcolor="#e0e0e0">                  <td>设备动态</td>                  </tr>                  <tr align="center" bgcolor="#fafafa">                   <td>下属单位名称:                   &nbsp;&nbsp;&nbsp;&nbsp;<select name="hqname">                   <option value="-1">----请选择----</option>  <%for(int z=0;z<hqname.size();z++){%><option value="<%=hqid.elementAt(z)%>"><%=hqname.elementAt(z)%></option><%}%>                   </select>                   &nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" value="  查  看  " class="file">                    </td>                  </tr>                   </form>                 </table>                 <hr>                  <table class=title cellspacing=1 cellpadding=2 width="100%" border=0>                  <form name="form5" method="post" action="">                    <caption align=right><font size="4" >固定资产统计</font>&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;&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>                    <tr align=middle bgcolor="#fafafa">                      <td width="15%"><strong><font  class="strong">设备类型</font></strong></td>                      <td width="15%"><strong><font  class="strong">设备名称</font></strong></td>                      <td width="15%"><strong><font  class="strong">设备型号</font></strong></td>                      <td width="10%"><strong><font  class="strong">设备状态</font></strong></td>                      <td width="10%"><strong><font  class="strong">设备价值</font></strong></td>                      <td width="10%"><strong><font  class="strong">入账价值</font></strong></td>                      <td width="15%"><strong><font  class="strong">入账时间</font></strong></td>                      <td width="10%"><strong><font  class="strong">入账人</font></strong></td>                    </tr><%if(haiquname!=null){if(haiquname.equals("-1")){double zongshe = 0;double zongru = 0; for(int k=0;k<hqid.size();k++)   {Iterator eqi = eqc.iterator(); double heshe=0; double heru=0;%><tr bgcolor="#fafafa"> <td><font size=2 color=red><%=hqname.elementAt(k)%></font></td>  <td></td>   <td></td>    <td></td>     <td></td>      <td></td>       <td></td>        <td></td> </tr><%   Collection eqtc = new ArrayList();   while(eqi.hasNext())     {     EquipmentDetailsStruct eqds = new EquipmentDetailsStruct();     eqds = (EquipmentDetailsStruct)eqi.next();     Judge jd = new Judge();     if(jd.decide((Integer)hqid.elementAt(k),eqds.getUnitid()))              {           eqtc.add(eqds);               }     }for(int l=1;l<=5;l++){  double xiaoshe=0;  double xiaoru=0;Collection eqtcc = new ArrayList();eqi = eqtc.iterator();while(eqi.hasNext()){ EquipmentDetailsStruct eqds = new EquipmentDetailsStruct(); eqds = (EquipmentDetailsStruct)eqi.next(); if(eqds.getType().intValue()==l)    {   eqtcc.add(eqds);     }}eqi = eqtcc.iterator();while(eqi.hasNext())  {  EquipmentDetailsStruct eqds = new EquipmentDetailsStruct();  eqds = (EquipmentDetailsStruct)eqi.next();EquipmentJBean eqj = new EquipmentJBean();eqj = eqController.getEquipmentByDeviceid(eqds.getDeviceid());InaccountJBean ijb = new InaccountJBean();try{ijb = otherController.getInaccountByDeviceid(eqds.getDeviceid());}catch(Exception e){ijb = new InaccountJBean();}xiaoshe=xiaoshe+eqds.price.doubleValue();heshe=heshe+eqds.price.doubleValue();if(ijb.price_in!=null)  {  xiaoru=xiaoru+ijb.price_in.doubleValue();  heru=heru+ijb.price_in.doubleValue();  }%><tr bgcolor="#fafafa"><%String a="";if(l==1)  a="VTS备件";if(l==2)  a="航标设备及备件";if(l==3)  a="AIS系统及备件";if(l==4)  a="航测设备及备件";if(l==5)  a="其他";%><td><%=a%></td><td><%=eqds.getName()%></td><td><%=eqds.getModel()%></td><%a="";if(eqj.getStatus().intValue()==1)  a="未使用";if(eqj.getStatus().intValue()==2)  a="正常使用";if(eqj.getStatus().intValue()==3)  a="维修";if(eqj.getStatus().intValue()==4)  a="待报废";if(eqj.getStatus().intValue()==5)  a="已报废";if(eqj.getStatus().intValue()==6)  a="其他";%><td><%=a%></td><td><%=eqds.price%></td><%a="";if(ijb.price_in!=null)

⌨️ 快捷键说明

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