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

📄 bu_stati.jsp

📁 《jsp案例开发》这本书的源代码。包括源代码和相关的具体配置操作步骤。非常不错
💻 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{ Integer planyear = new Integer(request.getParameter("planyear")); Integer unitid = new Integer(request.getParameter("unitid")); String tag = request.getParameter("tag");if(tag.equals("1")){ Context ctx=new InitialContext(); Object ref=ctx.lookup("SchemeplanController"); SchemeplanControllerHome schemeplanControllerHome=(SchemeplanControllerHome) PortableRemoteObject.narrow(ref,SchemeplanControllerHome.class);; SchemeplanController schemeplanController=schemeplanControllerHome.create(); Collection c = new ArrayList(); c = schemeplanController.getPlanByPlanyear(planyear); Collection collect = new ArrayList();Judge jd = new Judge(); Iterator i = c.iterator(); while(i.hasNext()) { SchemeplanStruct sps = (SchemeplanStruct)i.next(); if(sps.upstatus.intValue()>1) { if(jd.decide(unitid,sps.unitid)) { collect.add(sps); } } } Collection collect_d = new ArrayList(); i = collect.iterator(); while(i.hasNext()) {SchemeplanStruct sps = (SchemeplanStruct)i.next();Collection tc = schemeplanController.getPlandetailsByPlanid(sps.planid);Iterator ti = tc.iterator();while(ti.hasNext()){PlandetailsStruct pds = (PlandetailsStruct)ti.next();collect_d.add(pds);} } 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();if(rows>0){ 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())    {   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%>年度申请金额统计表 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;<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><a href="hq_route.jsp?planyear=<%=planyear%>&unitid=<%=oust.unitid%>&tag=<%=tag%>" target="_blank"><%=oust.processname%></a><%}%><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);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>&nbsp;</tr><%}%><tr align=center><td>合计<td>&nbsp;<%  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><%}else{%><font color="red">请确定<%=planyear%>年度的申请下属是否已经上报!</font><br><input type="button" name="Button32" value=" 返  回 " class="file" onClick="javascript:history.go(-1)"><%}%><%}else{  Context ctx=new InitialContext();  Object ref=ctx.lookup("SchemeplanController");  SchemeplanControllerHome schemeplanControllerHome=(SchemeplanControllerHome) PortableRemoteObject.narrow(ref,SchemeplanControllerHome.class);;  SchemeplanController schemeplanController=schemeplanControllerHome.create();  Collection c = new ArrayList();  c = schemeplanController.getPlanByPlanyear(planyear);  Collection collect = new ArrayList(); Judge jd = new Judge();  Iterator i = c.iterator();  while(i.hasNext())  {  SchemeplanStruct sps = (SchemeplanStruct)i.next();  if(sps.downstatus.intValue()==3)  {  if(jd.decide(unitid,sps.unitid))  {  collect.add(sps);  }  }  }  Collection collect_d = new ArrayList();  i = collect.iterator();  while(i.hasNext())  { SchemeplanStruct sps = (SchemeplanStruct)i.next(); Collection tc = schemeplanController.getPlandetailsByPlanid(sps.planid); Iterator ti = tc.iterator(); while(ti.hasNext()) { PlandetailsStruct pds = (PlandetailsStruct)ti.next(); collect_d.add(pds); }  }  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(); if(rows>0) {  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())     {    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%>年度实际金额统计表 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; <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><a href="hq_route.jsp?planyear=<%=planyear%>&unitid=<%=oust.unitid%>&tag=<%=tag%>" target="_blank"><%=oust.processname%></a> <% } %> <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); 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.realamount.intValue(); appmoney = appmoney+pds.realprice.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>&nbsp; </tr> <%}%> <tr align=center> <td>合计 <td>&nbsp; <%   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> <%} else{ %> <font color="red">请确定<%=planyear%>年度的申请下属单位是否已经上报且下达!</font><br> <input type="button" name="Button32" value=" 返  回 " class="file" onClick="javascript:history.go(-1)"><%}%><%}%><%}%>

⌨️ 快捷键说明

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