📄 bfhq_uped.jsp
字号:
<%@ page language="java" contentType="text/html; charset=GBK" import="imis.*,javax.naming.*,javax.rmi.PortableRemoteObject,java.util.*"%><% request.setCharacterEncoding("GBK"); session=request.getSession(); userStruct user=(userStruct)session.getAttribute("user"); if(user==null){ response.sendRedirect("../../login.html"); }else{%><%session=request.getSession();Collection collect = (Collection)session.getAttribute("bfhqcollect");Collection collect_d = (Collection)session.getAttribute("bfhqcollect_d");Integer unitid = new Integer(request.getParameter("unitid"));Integer planyear = new Integer(request.getParameter("planyear"));Context ctx=new InitialContext();Object ref=ctx.lookup("SchemeplanController");SchemeplanControllerHome schemeplanControllerHome=(SchemeplanControllerHome) PortableRemoteObject.narrow(ref,SchemeplanControllerHome.class);;SchemeplanController schemeplanController=schemeplanControllerHome.create();Iterator i = collect.iterator();while(i.hasNext()){SchemeplanStruct sps = (SchemeplanStruct)i.next();sps.upstatus = new Integer(3);sps.planstatus = new Integer(0);schemeplanController.editPlan(sps.planid,sps);}Vector d_name = new Vector(); i = collect_d.iterator(); while(i.hasNext()) { PlandetailsStruct pds = (PlandetailsStruct)i.next(); d_name.addElement(pds.devicename); } for(int l=0;l<d_name.size()-1;l++) for(int k=l+1;k<d_name.size();k++) { if(d_name.elementAt(l).equals(d_name.elementAt(k))) { d_name.remove(k); k--; } } int rows = d_name.size(); 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(); ousc = officeUnitController.getUnitid(unitid); Iterator ousi = ousc.iterator(); officeUnitStruct ous = new officeUnitStruct(); ous = (officeUnitStruct)ousi.next(); String unitname = ous.processname;Vector oc = new Vector();Collection otc = officeUnitController.getAll();Iterator oti = otc.iterator();while(oti.hasNext()){officeUnitStruct oust = (officeUnitStruct)oti.next();if(oust.upunitid.intValue()==unitid.intValue()) { String u_name = oust.processname; String sub = u_name.substring(u_name.length()-3); if(!sub.equals("VTS")) { oc.addElement(oust);} }}%><HTML><HEAD><META http-equiv=Content-Type content="text/html; charset=gb_2312-80"><link rel="stylesheet" href="../../css/stii.css" type="text/css"></HEAD><BODY><form name="myform" method="post" action=""><table width=800 class=title cellspacing=0 cellpadding=0 border=1 align=center ><caption align=right><%=unitname%><%=planyear%>年度上报统计表 <font style="font-size:12px">单位:万元(人民币)</font></caption><tr align=middle><td rowspan=2>设备名称<td rowspan=2>设备规格/型号<%for(int j=0;j<oc.size();j++){officeUnitStruct oust = (officeUnitStruct)oc.elementAt(j);%><td colspan=2><%=oust.processname%><%}%><td rowspan=2>合计总额</tr><tr align=center><%for(int j=0;j<oc.size();j++){%><td>申请数量<td>申请金额<%}%></tr><%Vector amountv = new Vector();Vector pricev = new Vector();for(int j=0;j<oc.size();j++){Integer tamount = new Integer(0);amountv.addElement(tamount);Double tprice = new Double(0);pricev.addElement(tprice);}for(int j=0;j<rows;j++){Collection namec = new ArrayList();String devname = d_name.elementAt(j).toString();String devmodel = "";Iterator ii = collect_d.iterator();while(ii.hasNext()){PlandetailsStruct pds = (PlandetailsStruct)ii.next();if(pds.devicename.equals(devname)){devmodel = pds.devicemodel;namec.add(pds);}}%><tr align=center><td><%=devname%><td><%=devmodel%><% for(int k=0;k<oc.size();k++){officeUnitStruct oust = (officeUnitStruct)oc.elementAt(k);Judge jd = new Judge();Collection nuc = new ArrayList();Iterator nui = namec.iterator();while(nui.hasNext()){PlandetailsStruct pds = (PlandetailsStruct)nui.next();if(jd.decide(oust.unitid,pds.unitid)){nuc.add(pds);}}int appamount = 0;double appmoney = 0;nui = nuc.iterator();while(nui.hasNext()){PlandetailsStruct pds = (PlandetailsStruct)nui.next();appamount = appamount+pds.appamount.intValue();appmoney = appmoney+pds.deviceprice.doubleValue();}amountv.addElement(new Integer(((Integer)amountv.elementAt(0)).intValue()+appamount));amountv.remove(0);pricev.addElement(new Double(((Double)pricev.elementAt(0)).doubleValue()+appmoney));pricev.remove(0);%><td><%=appamount%><td><%=appmoney%><%}%><td> </tr><%}%><tr align=center><td>合计<td> <% for(int j=0;j<oc.size();j++){%><td><%=amountv.elementAt(j)%><td><%=pricev.elementAt(j)%><%}%><%double zongjia = 0;for(int j=0;j<pricev.size();j++){zongjia = zongjia+((Double)pricev.elementAt(j)).doubleValue();}%><td><%=zongjia%></tr></table></form><BODY></HTML><%}%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -