📄 areastati.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{%><%Integer unitid=new Integer(request.getParameter("unitid"));Context ctxx = new InitialContext(); //look up jndi name Object reff = ctxx.lookup("UpreportController"); //cast to Home interface UpreportControllerHome upreportControllerHome = (UpreportControllerHome) PortableRemoteObject.narrow(reff, UpreportControllerHome.class); UpreportController upreportController = upreportControllerHome.create(); Integer l=new Integer(0); UpreportStruct ups=null; ups=new UpreportStruct(); Collection o=new ArrayList(); Collection tc=upreportController.getAll(); Iterator i=tc.iterator(); while(i.hasNext()) { ups=(UpreportStruct)i.next(); Judge jd=new Judge(); if(jd.decide(unitid,ups.unitid)) o.add(ups); } i=o.iterator(); while(i.hasNext()) { ups=(UpreportStruct)i.next(); if (ups.sortid.intValue()>l.intValue()) {l=ups.sortid;} }%><%int times=0;String ti=request.getParameter("ti");if(ti==null) times=l.intValue();else times=Integer.parseInt(ti);%><%int amount=0;double money=0.0;Vector ename=new Vector();Collection clct=new ArrayList(); i=o.iterator(); while(i.hasNext()) { ups=(UpreportStruct)i.next(); if(ups.sortid.intValue()==times) { clct.add(ups); ename.addElement(ups.devname); amount=amount+ups.devnum.intValue(); money=money+ups.devmoney.doubleValue(); } }%><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="4%">序 号</td><td width="13%">设备名称</td><td width="13%">规格/型号</td><td width="9%">性 质</td><td width="8%">计量单位</td><td width="5%">数 量</td><td width="12%">投资金额</td><td width="15%">内容及用途</td><td width="21%">备 注</td></tr><tr align=middle><td> </td><%String unit="";if(unitid.equals(new Integer(2))) unit="北方海区";if(unitid.equals(new Integer(3))) unit="东海海区";if(unitid.equals(new Integer(4))) unit="南海海区";if(unitid.equals(new Integer(5))) unit="海南海事局";%><td><b><%=unit%></b></td><td> </td><td> </td><td>套</td><td><%=amount%></td><td><%=money%></td><td> </td><td> </td></tr><% for(int ll=0;ll<ename.size()-1;ll++) for(int k=ll+1;k<ename.size();k++) { if(ename.elementAt(ll).equals(ename.elementAt(k))) { ename.remove(k); k--; } }for(int cs=0;cs<ename.size();cs++){ int samount=0; double smoney=0.0; String kinds=""; String uses=""; String demos="";Iterator j=clct.iterator();while(j.hasNext()) { ups=(UpreportStruct)j.next(); if(ups.devname.equals(ename.elementAt(cs))) { officeUnitStruct ous = new officeUnitStruct(); OfficeUnitControllerHome officeUnitControllerHome = null; OfficeUnitController officeUnitController = null; Context ctx1 = new InitialContext(); //look up jndi name Object ref1 = ctx1.lookup("OfficeUnitController"); //cast to Home interface officeUnitControllerHome = (OfficeUnitControllerHome) PortableRemoteObject.narrow(ref1, OfficeUnitControllerHome.class); officeUnitController=officeUnitControllerHome.create(); Collection ccc=officeUnitController.getUnitid(ups.unitid); Iterator aaaa=ccc.iterator(); ous=(officeUnitStruct)aaaa.next(); samount=samount+ups.devnum.intValue(); smoney=smoney+ups.devmoney.doubleValue(); kinds=kinds+ous.processname+":"+ups.devkind+"<br>"; uses=uses+ups.devuse+"<br>"; demos=demos+ups.devdemo+"<br>"; } }%><tr align=middle><td><%=cs+1%></td><td><%=ename.elementAt(cs)%></td><%if(ups.devtype!=null){%><td><%=ups.devtype%></td><%}else {%><td> </td><%}%><%if(!kinds.equals("")){%><td><%=kinds%></td><%}else {%><td> </td><%}%><td>套</td><td><%=samount%></td><td><%=smoney%></td><%if(!uses.equals("")){%><td><p><%=uses%></p></td> <%}else{%> <td> </td> <%}if(!demos.equals("")){%> <td><p><%=demos%></p></td> <%}else{%> <td> </td> <%}%></tr><%}%><caption align=right><%=ups.year%>年<%=unit%>进口设备申请统计表 <font size=1>单位:万元</font></caption></table><table align=center><tr> </tr><tr> </tr><tr align=middle><td><%int pre=times-1;if(pre<=0) pre=1;%><input type="button" name="haha" value=" 上一次 " class="file" onClick="location='areastati.jsp?unitid=<%=unitid%>&ti=<%=pre%>'"></td><td><input type="button" name="haha" value="最近一次" class="file" onClick="location='areastati.jsp?unitid=<%=unitid%>&ti=<%=l.intValue()%>'"></td><td><%int nex=times+1; if(nex>=l.intValue()) nex=l.intValue();%><input type="button" name="haha" value=" 下一次 " class="file" onClick="location='areastati.jsp?unitid=<%=unitid%>&ti=<%=nex%>'"></td><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='hsj_stat_condi.jsp'"></td></tr></table></BODY></HTML><%}%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -