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

📄 equipmentdetails.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 if(user.userAccess.intValue()==12){%><%String deviceid=request.getParameter("deviceid");EquipmentJBean eqj = new EquipmentJBean();EquipmentDetailsStruct eqd = new EquipmentDetailsStruct();malfunctionreportStruct mfs = null;circscollectionStruct ccs = null;MaintenanceStruct mas = null;Collection mfc = new ArrayList();Collection ccc = new ArrayList();Collection mac = new ArrayList();  Context ctx=new InitialContext();  Object ref=ctx.lookup("EquipmentControllerEJB");  EquipmentControllerEJBHome eqHome=(EquipmentControllerEJBHome) PortableRemoteObject.narrow(ref,EquipmentControllerEJBHome.class);  EquipmentControllerEJB eqController = eqHome.create();  eqj = eqController.getEquipmentByDeviceid(deviceid);  eqd = eqController.getEqdetailsByDeviceid(deviceid);  mfc = eqController.getMalByDeviceid(eqj.getDeviceid());  ccc = eqController.getCircsByDeviceId(eqj.getDeviceid());  mac = eqController.getMainByDeviceid(eqj.getDeviceid());Context psctx=new InitialContext();Object psref=psctx.lookup("OfficeUnitController");OfficeUnitControllerHome officeUnitControllerHome=(OfficeUnitControllerHome) PortableRemoteObject.narrow(psref,OfficeUnitControllerHome.class);;OfficeUnitController officeUnitController=officeUnitControllerHome.create();Collection ousc=new ArrayList();officeUnitStruct ous = new officeUnitStruct();Iterator ousi;Collection officec = new ArrayList();officec = officeUnitController.getUnitid(eqj.getUnitid());ousi = officec.iterator();String uname="";if(ousi.hasNext()){officeUnitStruct offices = new officeUnitStruct();offices=(officeUnitStruct)ousi.next();uname=offices.processname;}%>  <!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="Microsoft FrontPage 4.0" name=GENERATOR>   <link rel="stylesheet" href="../../css/msa.css" type="text/css">   <script language="JavaScript" src="../../public/js/cehui_menu.js"></script>   <SCRIPT>   window.onload=init   </SCRIPT>   </STYLE>   </HEAD>   <BODY class="bg" 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=500 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"><br>   <table width="500" border="1" cellspacing="1" bordercolor="#666666">               <tr bgcolor="#FAFAFA">                 <td>                   <table width="500" border="0" cellspacing="0" cellpadding="2">                     <tr bgcolor="#fafafa">                       <td colspan="3">设备管理&gt;&gt; 设备详细信息</td>                     </tr>                   </table>                   <table class=title width="500" border="0" cellspacing="1" cellpadding="2">                     <tr bgcolor="#fafafa">                       <td width="30%"> <font class="strong" > 设备类型:</font>   <%   String devtype="";if(eqd.getType()!=null){   if(eqd.getType().intValue()==1)     devtype="VTS备件";   if(eqd.getType().intValue()==2)     devtype="航标设备及备件";   if(eqd.getType().intValue()==3)     devtype="AIS系统及备件";   if(eqd.getType().intValue()==4)     devtype="测绘设备及备件";   if(eqd.getType().intValue()==5)     devtype="其他";}   %>              <%=devtype%></td>   <td > <font  class="strong"> 设备名称:</font>                       <%=eqd.getName()%></td>   <td > <font  class="strong"> 设备型号:</font>                       <%=eqd.getModel()%>                      </td>                     </tr>                     <tr bgcolor="#e0e0e0">                       <td ><font  class="strong"> 生产厂商:</font>   <% String a="";   if(eqd.getCompany()!=null)     a=eqd.getCompany(); %>                      <%=a%></td> <td ><font  class="strong"> 引进日期:</font><%a=""; if(eqd.getIntime()!=null)   a=eqd.getIntime().toString();%>                       <%=a%>                       </td> <td ><font  class="strong"> 合同编号:</font>                       <%=eqj.getContractid()%></td>                     </tr>                     <tr bgcolor="#fafafa">                       <td > <font  class="strong"> 性能参数:</font><%a="";if(eqd.getParameter()!=null)  a=eqd.getParameter();%>                    <%=a%>                       </td>                       <td ><font  class="strong"> 所属单位:</font>                    <%=uname%>                     </td>                      <td ><font  class="strong"> 验收日期:</font><%a="";if(eqd.getChecktime()!=null)  a=eqd.getChecktime().toString();%>                       <%=a%>                       </td>                     </tr>                     <tr bgcolor="#e0e0e0">                       <td colspan=3> <font  class="strong"> 设备机号:</font><%a="";if(eqd.devicesn!=null)  a=eqd.devicesn;%>                       <%=a%></td>                     </tr>           <tr bgcolor="#e0e0e0">           <td><font  class="strong"> 使用汇总:</font></td>           <td><font  class="strong"> 日常维护记录:</font></td>           <td><font  class="strong"> 重大故障记录:</font></td>           </tr>           <tr bgcolor="#e0e0e0">           <td><textarea cols="40" rows="10" readonly><%Iterator ccci = ccc.iterator(); while(ccci.hasNext()) { ccs = new circscollectionStruct(); ccs = (circscollectionStruct)ccci.next(); ousc = officeUnitController.getUnitid(ccs.unitid); ousi = ousc.iterator(); String unitname=""; if(ousi.hasNext()) { ous=(officeUnitStruct)ousi.next(); unitname=ous.processname; } %>安装地点:<%=ccs.address%>&nbsp;&nbsp;安装时间:<%=ccs.installtime.toString()%>填表人单位:<%=unitname%>&nbsp;&nbsp;填表人:<%=ccs.person%>填表时间:<%=ccs.time.toString()%>使用情况:<%=ccs.usething%>------------------------------------- <% }%>           </textarea></td>           <td><textarea cols="40" rows="10" readonly><%Iterator maci = mac.iterator(); while(maci.hasNext()) { mas = new MaintenanceStruct();mas = (MaintenanceStruct)maci.next(); ousc = officeUnitController.getUnitid(mas.unitid); ousi = ousc.iterator(); String unitname=""; if(ousi.hasNext()) { ous=(officeUnitStruct)ousi.next(); unitname=ous.processname; } %> <%String pa=""; if(mas.type.intValue()==1)   pa="安装"; if(mas.type.intValue()==2)   pa="保养"; if(mas.type.intValue()==3)   pa="维修"; if(mas.type.intValue()==4)   pa="报废"; if(mas.type.intValue()==5)   pa="其他";%>维护类型:<%=pa%>&nbsp;&nbsp;维护日期:<%=mas.timeM.toString()%>维护人单位:<%=unitname%>&nbsp;&nbsp;维护人:<%=mas.personM%><%pa="";if(mas.feeM!=null)  pa=mas.feeM.toString();%>维护费用:<%=pa%>处理情况:<%=mas.maintenance%><%pa="";if(mas.malfunc!=null)  pa=mas.malfunc;%>故障情况:<%=pa%><%pa="";if(mas.reason!=null)  pa=mas.reason;%>故障原因:<%=pa%>----------------------------------------- <% }%></textarea></td>           <td><textarea cols="40" rows="10" readonly><%Iterator mfci = mfc.iterator(); while(mfci.hasNext()) { mfs = new malfunctionreportStruct();mfs = (malfunctionreportStruct)mfci.next(); ousc = officeUnitController.getUnitid(mfs.unitid); ousi = ousc.iterator(); String unitname=""; if(ousi.hasNext()) { ous=(officeUnitStruct)ousi.next(); unitname=ous.processname; } %> <%String mfsa=""; if(mfs.installtime!=null)   mfsa=mfs.installtime.toString();%>安装日期:<%=mfsa%>&nbsp;&nbsp;<%mfsa="";if(mfs.firsttime!=null)  mfsa=mfs.firsttime.toString();%>发现故障日期:<%=mfsa%><%mfsa="";if(mfs.address!=null)  mfsa=mfs.address;%>故障地点:<%=mfsa%>记录人单位:<%=unitname%>&nbsp;&nbsp;记录人:<%=mfs.person%><%mfsa="";if(mfs.malreason!=null)  mfsa = mfs.malreason;%>故障原因:<%=mfsa%><%mfsa="";if(mfs.malcontent!=null)  mfsa = mfs.malcontent;%>故障情况:<%=mfsa%><%mfsa="";if(mfs.malduty!=null)  mfsa = mfs.malduty;%>处理情况:<%=mfsa%>----------------------------------------- <% }%></textarea></td>           </tr><tr bgcolor="#fafafa"><td colspan="5"><font  class="strong"><%=eqd.getName()%></font>设备数量的统计:</td></tr><%  Context ctxh=new InitialContext();  Object refh=ctxh.lookup("HandtakeController");  HandtakeControllerHome handtakeControllerHome=(HandtakeControllerHome) PortableRemoteObject.narrow(refh,HandtakeControllerHome.class);  HandtakeController hController = handtakeControllerHome.create();Integer hbzid=eqd.getUnitid();String hbzname=uname;officec = new ArrayList();ous = new officeUnitStruct();officec = officeUnitController.getUnitid(eqj.getUnitid());ousi = officec.iterator();if(ousi.hasNext()) { ous = (officeUnitStruct)ousi.next();}Integer hbcid=ous.upunitid;officec = new ArrayList();ous = new officeUnitStruct();officec = officeUnitController.getUnitid(hbcid);ousi = officec.iterator();if(ousi.hasNext()) { ous = (officeUnitStruct)ousi.next();}Integer hqid=ous.upunitid;String hbcname = ous.processname;officec = new ArrayList();ous = new officeUnitStruct();officec = officeUnitController.getUnitid(hqid);ousi = officec.iterator();if(ousi.hasNext()){ ous = (officeUnitStruct)ousi.next();}String hqname = ous.processname;Integer buid=new Integer(1);String buname="部海事局";int hbzzong = 0;int hbzb = 0;int hbzs = 0;int hbzw = 0;int hbzd = 0;int hbzy = 0;int hbczong = 0;int hbcb = 0;int hbcs = 0;int hbcw = 0;int hbcd = 0;int hbcy = 0;int hqzong = 0;int hqb = 0;int hqs = 0;int hqw = 0;int hqd = 0;int hqy = 0;int buzong = 0;int bub = 0;int bus = 0;int buw = 0;int bud = 0;int buy = 0;if(user.unitid.intValue()==hbzid.intValue()){Collection hbztc = new ArrayList();hbztc = eqController.getEqdetailsByName(eqd.getName());Collection hbzc = new ArrayList();Iterator hbzi = hbztc.iterator();while(hbzi.hasNext()){EquipmentDetailsStruct hbzeqd = (EquipmentDetailsStruct)hbzi.next();EquipmentJBean hbzeqj = eqController.getEquipmentByDeviceid(hbzeqd.getDeviceid());Judge jd = new Judge();if(jd.decide(user.unitid,hbzeqj.getUnitid())){hbzc.add(hbzeqj);}}hbzi = hbzc.iterator();while(hbzi.hasNext()){EquipmentJBean hbzeqj = (EquipmentJBean)hbzi.next();if(hbzeqj.getStatus().intValue()==1)  hbzb++;if(hbzeqj.getStatus().intValue()==2)  hbzs++;if(hbzeqj.getStatus().intValue()==3)  hbzw++;if(hbzeqj.getStatus().intValue()==4)  hbzd++;if(hbzeqj.getStatus().intValue()==5)  hbzy++;}hbzzong = hbzzong+hbzb+hbzs+hbzw+hbzd+hbzy;}if(user.unitid.intValue()==hbcid.intValue()){  Collection hbztc = new ArrayList();hbztc = eqController.getEqdetailsByName(eqd.getName());Collection hbzc = new ArrayList();Iterator hbzi = hbztc.iterator();while(hbzi.hasNext()){EquipmentDetailsStruct hbzeqd = (EquipmentDetailsStruct)hbzi.next();EquipmentJBean hbzeqj = eqController.getEquipmentByDeviceid(hbzeqd.getDeviceid());Judge jd = new Judge();if(jd.decide(user.unitid,hbzeqj.getUnitid())){hbzc.add(hbzeqj);}}hbzi = hbzc.iterator();while(hbzi.hasNext()){EquipmentJBean hbzeqj = (EquipmentJBean)hbzi.next();if(hbzeqj.getStatus().intValue()==1)  hbzb++;if(hbzeqj.getStatus().intValue()==2)  hbzs++;if(hbzeqj.getStatus().intValue()==3)  hbzw++;if(hbzeqj.getStatus().intValue()==4)  hbzd++;if(hbzeqj.getStatus().intValue()==5)  hbzy++;}hbzzong = hbzzong+hbzb+hbzs+hbzw+hbzd+hbzy;  Collection hbctc = new ArrayList();  hbctc = eqController.getEqdetailsByName(eqd.getName());  Collection hbcc = new ArrayList();  Iterator hbci = hbctc.iterator();  while(hbci.hasNext())  {  EquipmentDetailsStruct hbceqd = (EquipmentDetailsStruct)hbci.next();  EquipmentJBean hbceqj = eqController.getEquipmentByDeviceid(hbceqd.getDeviceid());  Judge jd = new Judge();  if(jd.decide(user.unitid,hbceqj.getUnitid()))  {  hbcc.add(hbceqj);  }  }  hbci = hbcc.iterator();  while(hbci.hasNext())  {  EquipmentJBean hbceqj = (EquipmentJBean)hbci.next();  if(hbceqj.getStatus().intValue()==1)    hbcb++;  if(hbceqj.getStatus().intValue()==2)    hbcs++;  if(hbceqj.getStatus().intValue()==3)    hbcw++;  if(hbceqj.getStatus().intValue()==4)    hbcd++;  if(hbceqj.getStatus().intValue()==5)    hbcy++;}Collection jiaojiec = new ArrayList();Collection diaoboc = new ArrayList();jiaojiec = hController.getHandByName(eqd.getName());diaoboc = hController.getRechangeByName(eqd.getName());Iterator jiaojiei = jiaojiec.iterator();while(jiaojiei.hasNext()){HandtakeJBean hjb = (HandtakeJBean)jiaojiei.next();Judge jd = new Judge();if(jd.decide(user.unitid,hjb.unitid)){hbcb = hbcb+hjb.hamount.intValue();}}Iterator diaoboi = diaoboc.iterator();while(diaoboi.hasNext()){rechangeStruct rcs = (rechangeStruct)diaoboi.next();Judge jd = new Judge();if(jd.decide(user.unitid,rcs.unitid)){hbcb = hbcb+rcs.hamount.intValue();}}hbczong = hbcb+hbcs+hbcw+hbcd+hbcy;}if(user.unitid.intValue()==hqid.intValue()){  Collection hbztc = new ArrayList();hbztc = eqController.getEqdetailsByName(eqd.getName());Collection hbzc = new ArrayList();Iterator hbzi = hbztc.iterator();while(hbzi.hasNext()){EquipmentDetailsStruct hbzeqd = (EquipmentDetailsStruct)hbzi.next();EquipmentJBean hbzeqj = eqController.getEquipmentByDeviceid(hbzeqd.getDeviceid());Judge jd = new Judge();

⌨️ 快捷键说明

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