📄 stati_num.jsp
字号:
<%@ page language="java" contentType="text/html; charset=GBK" import="imis.*,javax.naming.*,javax.rmi.PortableRemoteObject,java.util.*,java.sql.*,java.io.*"%><%String name = "wmj";String pass = "197555";String url=new String();//url="jdbc:db2://127.0.0.1:6789/imis";//Class.forName("COM.ibm.db2.jdbc.net.DB2Driver");url="jdbc:sybase:Tds:172.16.0.1:4000/imis"; Class.forName("com.sybase.jdbc2.jdbc.SybDriver"); response.setHeader("Pragma","No-cache"); response.setHeader("Cache-Control","no-cache"); response.setDateHeader("Expires", 0); 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{ Context psctx=new InitialContext(); Object psref=psctx.lookup("OfficeUnitController"); OfficeUnitControllerHome officeUnitControllerHome=(OfficeUnitControllerHome) PortableRemoteObject.narrow(psref,OfficeUnitControllerHome.class);; OfficeUnitController officeUnitController=officeUnitControllerHome.create(); Iterator ousi; Collection officec = new ArrayList(); officeUnitStruct offices = new officeUnitStruct(); officec = officeUnitController.getUnitid(user.unitid); ousi = officec.iterator(); String uname="";String ys=""; if(ousi.hasNext()) { offices=(officeUnitStruct)ousi.next(); uname=offices.processname; ys = uname;} Integer temp = offices.upunitid; Integer temp1 = new Integer(-111); if(temp.intValue()!=-1) { Collection ofc = officeUnitController.getUnitid(temp); Iterator ofi = ofc.iterator(); officeUnitStruct ofs = (officeUnitStruct)ofi.next(); temp1 = ofs.upunitid; }String unitn=request.getParameter("unit");String dtype=request.getParameter("devtype");String devmode=request.getParameter("devmod");//Vector devmod = new Vector();Context ctx=new InitialContext();Object ref=ctx.lookup("HandtakeController");HandtakeControllerHome handtakeControllerHome=(HandtakeControllerHome) PortableRemoteObject.narrow(ref,HandtakeControllerHome.class);HandtakeController handtakeController = handtakeControllerHome.create();CheckReportJBean crj = new CheckReportJBean();HandtakeJBean hjb = new HandtakeJBean();Collection cc=new ArrayList();Collection hc=new ArrayList();Context ctx1=new InitialContext();Object ref1=ctx1.lookup("EquipmentControllerEJB");EquipmentControllerEJBHome eqHome=(EquipmentControllerEJBHome) PortableRemoteObject.narrow(ref1,EquipmentControllerEJBHome.class); EquipmentControllerEJB eqController = eqHome.create(); EquipmentDetailsStruct eqd = new EquipmentDetailsStruct();Collection ec = new ArrayList();if(unitn!=null&&dtype!=null){//cc = handtakeController.getCheckAll();//Iterator i = cc.iterator();//while(i.hasNext())//{//crj = (CheckReportJBean)i.next();//devmod.addElement(crj.dev_model);//}//ec = eqController.getEqdDetailsAll();//i.remove();//i=ec.iterator();//while(i.hasNext())//{//eqd = (EquipmentDetailsStruct)i.next();//devmod.addElement(eqd.getModel());//} // Connection con=DriverManager.getConnection(url,"adlin","adlin1106"); // Statement stmt=con.createStatement(); // ResultSet rs=null; // String sqls="select DEV_MODEL from RECHANGE"; // rs=stmt.executeQuery(sqls); // rs.close(); // stmt.close(); // con.close(); //for(int l=0;l<devmod.size()-1;l++) //for(int k=l+1;k<devmod.size();k++) // { // if(devmod.elementAt(l).equals(devmod.elementAt(k))) // { // devmod.remove(k);// k--;// }// }}%> <!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=800 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="800" border="1" cellspacing="1" bordercolor="#666666"> <tr bgcolor="#FAFAFA"> <td valign="top"> <table width="800" border="0" cellspacing="0" cellpadding="2"> <form name="form1" method="post" action="stati_num.jsp"> <tr> <td colspan="3" height="15" bgcolor="#666666"><font class="strongw">查询设备数量</font></td> </tr> <tr bgcolor="#fafafa"> <td><%if(user.userAccess.intValue()!=11){%><font class="strong" > 单位名称:</font><input name="unit" type="text" class="file" size="25" readonly><input type="hidden" name="planTypeId" readonly value="" ><input type="button" value=" " name="Submit323" class="button_select" onClick="javascript:addList( new Array(document.form1.planTypeId,document.form1.unit),'uunit.jsp' )"><%}%> <font class="strong" > 设备类型:</font> <select name="devtype"> <option value="-1">---请选择---</option> <option value="1">VTS备件</option> <option value="2">航标设备及备件</option> <option value="3">AIS系统及备件</option> <option value="4">测绘设备及备件</option> <option value="5">其他</option> </select><font class="strong" > 设备型号:</font><input name="devmod" type="text" class="file" size="20" readonly><input type="hidden" name="planTypeId" readonly value="" ><input type="button" value=" " name="Submit323" class="button_select" onClick="javascript:addList( new Array(document.form1.planTypeId,document.form1.devmod),'mod.jsp' )"> <input type="submit" name="Submit" value="查 询" class="file" > </td> </tr> </form> </table><hr> <table class=title cellspacing=1 cellpadding=2 width="100%" border=0><%if(unitn!=null){if(!unitn.equals("")) { uname=unitn; }}%> <caption><font> <%=uname%>设备情况一览表 </font></caption> <tr align=middle bgcolor="#fafafa"> <td width="10%"><strong><font class="strong">单位</font></strong></td> <td width="13%"><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="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="10%"><strong><font class="strong">已报废数量</font></strong></td> <td width="7%"><strong><font class="strong">合计</font></strong></td> </tr><%//部海事局统计********************************************************************************************************if(user.unitid.intValue()==1){if(unitn!=null&&dtype!=null&&devmode!=null){ Integer devtype = new Integer(dtype);if(unitn.equals("")&&devtype.intValue()==-1){Vector hqname = new Vector();Vector hqid = new Vector();Collection hqc = new ArrayList();hqc = officeUnitController.getAll();Iterator hqi = hqc.iterator();while(hqi.hasNext()){officeUnitStruct ofus = (officeUnitStruct)hqi.next();if(ofus.upunitid.intValue()==1) { hqname.addElement(ofus.processname); hqid.addElement(ofus.unitid); }}int hbeiyong=0;int hshiyong=0;int hweixiu=0;int hdaibaofei=0;int hyibaofei=0;int hheji=0;for(int l=0;l<hqid.size();l++){ String haiqun=(String)hqname.elementAt(l); Vector devmod = new Vector(); cc = handtakeController.getCheckAll(); Iterator i = cc.iterator(); while(i.hasNext()) { crj = (CheckReportJBean)i.next(); Judge jd = new Judge(); if(jd.decide((Integer)hqid.elementAt(l),crj.unitid)) devmod.addElement(crj.dev_model);}ec = eqController.getEqdDetailsAll();i.remove();i=ec.iterator();while(i.hasNext()){eqd = (EquipmentDetailsStruct)i.next();Judge jd = new Judge();if(jd.decide((Integer)hqid.elementAt(l),eqd.getUnitid()))devmod.addElement(eqd.getModel());}for(int p=0;p<devmod.size()-1;p++) for(int k=p+1;k<devmod.size();k++) { if(devmod.elementAt(p).equals(devmod.elementAt(k))) { devmod.remove(k); k--; } }if(!devmode.equals("")){ String devname=""; Integer det = new Integer(-1);cc=handtakeController.getCheckByModel(devmode);Iterator ii=cc.iterator();if(ii.hasNext()) { crj = (CheckReportJBean)ii.next(); devname=crj.dev_name; det = crj.dev_type; }if(devname.equals("")){ec = eqController.getEqdetailsByModel(devmode);Iterator iii=ec.iterator();if(iii.hasNext()){eqd = (EquipmentDetailsStruct)iii.next();devname=eqd.getName();det = eqd.getType();}}String devty="";if(det.intValue()!=-1){if(det.intValue()==1) devty="VTS备件";if(det.intValue()==2) devty="航标设备及备件";if(det.intValue()==3) devty="AIS系统及备件";if(det.intValue()==4) devty="测绘设备及备件";if(det.intValue()==5) devty="其他";}Integer beiyong=new Integer(0);Integer shiyong=new Integer(0);Integer weixiu=new Integer(0);Integer daibaofei=new Integer(0);Integer yibaofei=new Integer(0);Integer heji = new Integer(0);Collection ect = new ArrayList();EquipmentJBean eqj = new EquipmentJBean();ect = eqController.getEqdetailsByModel(devmode);Iterator equipi = ect.iterator();while(equipi.hasNext()){eqd = (EquipmentDetailsStruct)equipi.next();eqj = eqController.getEquipmentByDeviceid(eqd.getDeviceid());Judge jd = new Judge();if(jd.decide((Integer)hqid.elementAt(l),eqj.getUnitid())){if(eqj.getStatus().intValue()==1) {beiyong=new Integer(beiyong.intValue()+1);}if(eqj.getStatus().intValue()==2) {shiyong=new Integer(shiyong.intValue()+1);}if(eqj.getStatus().intValue()==3) {weixiu=new Integer(weixiu.intValue()+1);}if(eqj.getStatus().intValue()==4) {daibaofei=new Integer(daibaofei.intValue()+1);}if(eqj.getStatus().intValue()==5) {yibaofei=new Integer(yibaofei.intValue()+1);}}}Collection crc = new ArrayList();crc = handtakeController.getCheckByModel(devmode);Iterator cri = crc.iterator();while(cri.hasNext()){crj = (CheckReportJBean)cri.next();Judge jd = new Judge();if(jd.decide((Integer)hqid.elementAt(l),crj.unitid)){beiyong=new Integer(beiyong.intValue()+crj.lastamount.intValue());}}Collection htc = new ArrayList();htc = handtakeController.getHandByModel(devmode);Iterator hti = htc.iterator();while(hti.hasNext()){ Judge jd = new Judge();hjb = (HandtakeJBean)hti.next();if(jd.decide((Integer)hqid.elementAt(l),hjb.unitid)){beiyong=new Integer(beiyong.intValue()+hjb.hamount.intValue());}}Collection rcc = new ArrayList();rechangeStruct rcs = new rechangeStruct();rcc = handtakeController.getRechangeByModel(devmode);Iterator rci = rcc.iterator();while(rci.hasNext()){rcs = (rechangeStruct)rci.next();Judge jd = new Judge();if(jd.decide((Integer)hqid.elementAt(l),rcs.unitid)){beiyong = new Integer(beiyong.intValue()+rcs.hamount.intValue());}}/*Connection con=DriverManager.getConnection(url,name,pass);Statement stmt=con.createStatement();ResultSet rs=null;String sqls="select HAMOUNT from RECHANGE where DEV_MODEL='"+devmode+"'";rs=stmt.executeQuery(sqls);while(rs.next()){int hamount=rs.getInt("HAMOUNT");beiyong = new Integer(beiyong.intValue()+hamount);}*/heji = new Integer(beiyong.intValue()+shiyong.intValue()+weixiu.intValue()+daibaofei.intValue()+yibaofei.intValue());hbeiyong = hbeiyong+beiyong.intValue();hshiyong = hshiyong+shiyong.intValue();hweixiu = hweixiu+weixiu.intValue();hdaibaofei = hdaibaofei+daibaofei.intValue();hyibaofei = hyibaofei+yibaofei.intValue();hheji = hheji+heji.intValue();%><tr bgcolor="#fafafa"><td><%=hqname.elementAt(l)%><td><%=devty%><td><%=devmode%><td><%=devname%><td><%=beiyong%><td><%=shiyong%><td><%=weixiu%><td><%=daibaofei%><td><%=yibaofei%><td><%=heji%><tr><%}else{ for(int p=0;p<devmod.size();p++) { String devname=""; Integer det = new Integer(-1); cc=handtakeController.getCheckByModel((String)devmod.elementAt(p)); Iterator ii=cc.iterator(); if(ii.hasNext()) { crj = (CheckReportJBean)ii.next(); devname=crj.dev_name; det = crj.dev_type; } if(devname.equals("")) { ec = eqController.getEqdetailsByModel((String)devmod.elementAt(p)); Iterator iii=ec.iterator(); if(iii.hasNext()) { eqd = (EquipmentDetailsStruct)iii.next(); devname=eqd.getName(); det = eqd.getType(); } } String devty=""; if(det.intValue()!=-1){ if(det.intValue()==1) devty="VTS备件"; if(det.intValue()==2) devty="航标设备及备件"; if(det.intValue()==3) devty="AIS系统及备件"; if(det.intValue()==4) devty="测绘设备及备件"; if(det.intValue()==5) devty="其他"; } Integer beiyong=new Integer(0); Integer shiyong=new Integer(0); Integer weixiu=new Integer(0); Integer daibaofei=new Integer(0); Integer yibaofei=new Integer(0);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -