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

📄 stati_modeled1.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{%><%int count=0;String model = request.getParameter("model");Context ctx=new InitialContext();Object ref=ctx.lookup("EquipmentControllerEJB");EquipmentControllerEJBHome eqHome=(EquipmentControllerEJBHome) PortableRemoteObject.narrow(ref,EquipmentControllerEJBHome.class);EquipmentControllerEJB eqController = eqHome.create();Context ctx1=new InitialContext();Object ref1=ctx1.lookup("HandtakeController");HandtakeControllerHome handtakeControllerHome=(HandtakeControllerHome) PortableRemoteObject.narrow(ref1,HandtakeControllerHome.class);HandtakeController handtakeController = handtakeControllerHome.create();Integer upunitid = null;Context psctx=new InitialContext();Object psref=psctx.lookup("OfficeUnitController");OfficeUnitControllerHome officeUnitControllerHome=(OfficeUnitControllerHome) PortableRemoteObject.narrow(psref,OfficeUnitControllerHome.class);;OfficeUnitController officeUnitController=officeUnitControllerHome.create();Collection c = officeUnitController.getUnitid(user.unitid);Iterator i = c.iterator();while(i.hasNext()){officeUnitStruct ous = new officeUnitStruct();ous = (officeUnitStruct)i.next();upunitid = ous.upunitid;}%>  <!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="form5" method="post" action="">                     <caption align=center><font size="4"><%=model%>设备情况一览表</font>                    </caption>                     <tr align=middle bgcolor="#fafafa">                       <td rowspan=2><strong><font  class="strong">型号</font></strong></td>                       <td colspan=5><strong><font  class="strong">数量</font></strong></td>                       <td rowspan=2><strong><font  class="strong">引进日期</font></strong></td>                       <td rowspan=2><strong><font  class="strong">设备名称</font></strong></td>                       <td rowspan=2><strong><font  class="strong">安装地点</font></strong></td>                       <td rowspan=2><strong><font  class="strong">所属单位</font></strong></td>                       <td rowspan=2><strong><font  class="strong">安装时间</font></strong></td>                       <td rowspan=2><strong><font  class="strong">设备状态</font></strong></td>                       <td rowspan=2><strong><font  class="strong">备注</font></strong></td>                    </tr>                    <tr align=middle bgcolor="#fafafa">                    <td><strong><font  class="strong">总数</font></strong></td>                    <td><strong><font  class="strong">北方</font></strong></td>                    <td><strong><font  class="strong">东海</font></strong></td>                    <td><strong><font  class="strong">南海</font></strong></td>                    <td><strong><font  class="strong">海南</font></strong></td>                    </tr><%//////////////////////////////////////部海事局//////////////////////////////////////if(upunitid.intValue()==-1){int num = 0;int checknum = 0;int handnum = 0;int changenum = 0;  Collection checkc0 = new ArrayList();  Collection checkc1 = handtakeController.getCheckByModel(model);  Iterator checki1 = checkc1.iterator();  while(checki1.hasNext())  {  CheckReportJBean crj = (CheckReportJBean)checki1.next();  if(crj.lastamount.intValue()>0)  {  num=num+crj.lastamount.intValue();  checknum=crj.lastamount.intValue();  for(int p=0;p<checknum;p++)  {  checkc0.add(crj);  }  }  }  Collection handc0 = new ArrayList();  Collection handc1 = handtakeController.getHandByModel(model);  Iterator handi1 = handc1.iterator();  while(handi1.hasNext())  {  HandtakeJBean hjb = (HandtakeJBean)handi1.next();  if(hjb.hamount.intValue()>0)  {    num=num+hjb.hamount.intValue();    handnum=hjb.hamount.intValue();    for(int p=0;p<handnum;p++)    {    handc0.add(hjb);    }  }  }  Collection changec0 = new ArrayList();  Collection changec1 = handtakeController.getRechangeByModel(model);  Iterator changei1 = changec1.iterator();  while(changei1.hasNext())  {  rechangeStruct rcs = (rechangeStruct)changei1.next();  if(rcs.hamount.intValue()>0)  {    num=num+rcs.hamount.intValue();    changenum=rcs.hamount.intValue();    for(int p=0;p<changenum;p++)    {    changec0.add(rcs);    }  }  }  Vector eqstatus = new Vector();  eqstatus.removeAllElements();  Collection eqdc0 = new ArrayList();  Collection eqc1 = eqController.getEqdetailsByModel(model);  Iterator eqi1 = eqc1.iterator();  while(eqi1.hasNext())  {  EquipmentDetailsStruct eqd = (EquipmentDetailsStruct)eqi1.next();  EquipmentJBean eqj = eqController.getEquipmentByDeviceid(eqd.getDeviceid());  eqdc0.add(eqd);  eqstatus.addElement(eqj.getStatus());}num=num+eqdc0.size();count = num;int beifang = 0;int donghai = 0;int nanhai = 0;int hainan = 0;Judge jd = new Judge();Iterator checkit = checkc0.iterator();while(checkit.hasNext()){CheckReportJBean crj = (CheckReportJBean)checkit.next();if(jd.decide((new Integer(2)),crj.unitid))  beifang++;if(jd.decide((new Integer(3)),crj.unitid))  donghai++;if(jd.decide((new Integer(4)),crj.unitid))  nanhai++;if(jd.decide((new Integer(5)),crj.unitid))  hainan++;}Iterator handit = handc0.iterator();while(handit.hasNext()){HandtakeJBean hjb = (HandtakeJBean)handit.next();if(jd.decide((new Integer(2)),hjb.unitid))  beifang++;if(jd.decide((new Integer(3)),hjb.unitid))  donghai++;if(jd.decide((new Integer(4)),hjb.unitid))  nanhai++;if(jd.decide((new Integer(5)),hjb.unitid))  hainan++;}Iterator changeit = changec0.iterator();while(changeit.hasNext()){rechangeStruct rcs = (rechangeStruct)changeit.next();if(jd.decide((new Integer(2)),rcs.unitid))  beifang++;if(jd.decide((new Integer(3)),rcs.unitid))  donghai++;if(jd.decide((new Integer(4)),rcs.unitid))  nanhai++;if(jd.decide((new Integer(5)),rcs.unitid))  hainan++;}Iterator eqdit = eqdc0.iterator();while(eqdit.hasNext()){EquipmentDetailsStruct eqd = (EquipmentDetailsStruct)eqdit.next();if(jd.decide((new Integer(2)),eqd.getUnitid()))  beifang++;if(jd.decide((new Integer(3)),eqd.getUnitid()))  donghai++;if(jd.decide((new Integer(4)),eqd.getUnitid()))  nanhai++;if(jd.decide((new Integer(5)),eqd.getUnitid()))  hainan++;}Iterator checki0 = checkc0.iterator();Iterator handi0 = handc0.iterator();Iterator changei0 = changec0.iterator();Iterator eqdi0 =eqdc0.iterator();%><tr bgcolor="#fafafa"><%if(num>0){%><td rowspan=<%=num%>><%=model%><td rowspan=<%=num%>><%=num%><td rowspan=<%=num%>><%=beifang%><td rowspan=<%=num%>><%=donghai%><td rowspan=<%=num%>><%=nanhai%><td rowspan=<%=num%>><%=hainan%><%}%><%  if(checki0.hasNext())  {  CheckReportJBean cjb = (CheckReportJBean)checki0.next();  String beunit="&nbsp;";  c = officeUnitController.getUnitid(cjb.unitid);  i = c.iterator();  while(i.hasNext())  {  officeUnitStruct ous = new officeUnitStruct();  ous = (officeUnitStruct)i.next();  beunit = ous.processname;}String yinjin = "&nbsp;";String beizhu = "&nbsp;";if(cjb.time_land!=null)  yinjin = cjb.time_land.toString();if(cjb.opinion!=null)  beizhu = cjb.opinion;%><td><%=yinjin%><td><%=cjb.dev_name%><td><%=beunit%><td><%=beunit%><td>&nbsp;<td>备用<td><%=beizhu%><%}else if(handi0.hasNext()){HandtakeJBean hjb = (HandtakeJBean)handi0.next();String yinjin = "&nbsp;";String beizhu = "&nbsp;";if(hjb.time_introduce!=null)  yinjin = hjb.time_introduce.toString();if(hjb.manufacturer!=null)  beizhu = hjb.manufacturer;%><td><%=yinjin%><td><%=hjb.dev_name%><td><%=hjb.unit%><td><%=hjb.unit%><td>&nbsp;<td>备用<td><%=beizhu%><%}  else if(changei0.hasNext())  {rechangeStruct rcs = (rechangeStruct)changei0.next();String yinjin = "&nbsp;";String beizhu = "&nbsp;";if(rcs.time_introduce!=null)  yinjin=rcs.time_introduce.toString();if(rcs.manufacturer!=null)  beizhu = rcs.manufacturer;%><td><%=yinjin%><td><%=rcs.dev_name%><td><%=rcs.unit%><td><%=rcs.unit%><td>&nbsp;<td>备用<td><%=beizhu%><%}  else if(eqdi0.hasNext())  {  EquipmentDetailsStruct eqd = (EquipmentDetailsStruct)eqdi0.next();  Integer devstatus = (Integer)eqstatus.elementAt(0);  eqstatus.remove(0);  String devs = "其他";  if(devstatus.intValue()==1)    devs="备用";  if(devstatus.intValue()==2)    devs="正常使用";  if(devstatus.intValue()==3)    devs="维修";  if(devstatus.intValue()==4)    devs="待报废";  if(devstatus.intValue()==5)    devs="已报废";  String beunit = "&nbsp";  c = officeUnitController.getUnitid(eqd.getUnitid());  i = c.iterator();  while(i.hasNext())  {  officeUnitStruct ous = new officeUnitStruct();  ous = (officeUnitStruct)i.next();  beunit = ous.processname;  }  String disunit = beunit;  String install = "&nbsp;";  if(devstatus.intValue()!=1)  {  Collection circ = eqController.getCircsByDeviceId(eqd.getDeviceid());  Iterator ciri = circ.iterator();  while(ciri.hasNext())  {  circscollectionStruct ccs = (circscollectionStruct)ciri.next();  if(ccs.installtime!=null)    install = ccs.installtime.toString();  if(ccs.address!=null)    disunit=ccs.address;  }}String yinjin = "&nbsp;";String beizhu = "&nbsp;";if(eqd.getIntime()!=null)  yinjin = eqd.getIntime().toString();if(eqd.getCompany()!=null)  beizhu = eqd.getCompany();%><td><%=yinjin%><td><%=eqd.getName()%><td><%=disunit%><td><%=beunit%><td><%=install%><td><%=devs%><td><%=beizhu%><%}%></tr><%  while(eqdi0.hasNext())    {    EquipmentDetailsStruct eqd = (EquipmentDetailsStruct)eqdi0.next();    Integer devstatus = (Integer)eqstatus.elementAt(0);    eqstatus.remove(0);    String devs = "其他";    if(devstatus.intValue()==1)      devs="备用";    if(devstatus.intValue()==2)      devs="正常使用";    if(devstatus.intValue()==3)      devs="维修";    if(devstatus.intValue()==4)      devs="待报废";    if(devstatus.intValue()==5)      devs="已报废";    String beunit = "&nbsp";    c = officeUnitController.getUnitid(eqd.getUnitid());    i = c.iterator();    while(i.hasNext())    {    officeUnitStruct ous = new officeUnitStruct();    ous = (officeUnitStruct)i.next();    beunit = ous.processname;    }    String disunit = beunit;    String install = "&nbsp;";    if(devstatus.intValue()!=1)    {    Collection circ = eqController.getCircsByDeviceId(eqd.getDeviceid());    Iterator ciri = circ.iterator();    while(ciri.hasNext())    {    circscollectionStruct ccs = (circscollectionStruct)ciri.next();    if(ccs.installtime!=null)      install = ccs.installtime.toString();    if(ccs.address!=null)      disunit=ccs.address;    }  }  String yinjin = "&nbsp;";  String beizhu = "&nbsp;";  if(eqd.getIntime()!=null)    yinjin = eqd.getIntime().toString();  if(eqd.getCompany()!=null)    beizhu = eqd.getCompany();  %>  <tr bgcolor="#fafafa">  <td><%=yinjin%>  <td><%=eqd.getName()%>  <td><%=disunit%>  <td><%=beunit%>  <td><%=install%>  <td><%=devs%>  <td><%=beizhu%>  </tr><%}%><%  while(checki0.hasNext())    {    CheckReportJBean cjb = (CheckReportJBean)checki0.next();    String beunit="&nbsp;";    c = officeUnitController.getUnitid(cjb.unitid);    i = c.iterator();    while(i.hasNext())    {    officeUnitStruct ous = new officeUnitStruct();    ous = (officeUnitStruct)i.next();    beunit = ous.processname;  }  String yinjin = "&nbsp;";  String beizhu = "&nbsp;";  if(cjb.time_land!=null)    yinjin = cjb.time_land.toString();  if(cjb.opinion!=null)    beizhu = cjb.opinion;  %>  <tr bgcolor="#fafafa">  <td><%=yinjin%>  <td><%=cjb.dev_name%>  <td><%=beunit%>  <td><%=beunit%>  <td>&nbsp;  <td>备用  <td><%=beizhu%>  </tr><%}%><%  while(handi0.hasNext())  {  HandtakeJBean hjb = (HandtakeJBean)handi0.next();  String yinjin = "&nbsp;";  String beizhu = "&nbsp;";  if(hjb.time_introduce!=null)    yinjin = hjb.time_introduce.toString();  if(hjb.manufacturer!=null)    beizhu = hjb.manufacturer;  %>  <tr bgcolor="#fafafa">  <td><%=yinjin%>  <td><%=hjb.dev_name%>  <td><%=hjb.unit%>  <td><%=hjb.unit%>  <td>&nbsp;  <td>备用  <td><%=beizhu%>  </tr><%}%><%  while(changei0.hasNext())    {  rechangeStruct rcs = (rechangeStruct)changei0.next();

⌨️ 快捷键说明

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