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

📄 hbz_up.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")); 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(); Iterator i = c.iterator(); while(i.hasNext()) { SchemeplanStruct sps = (SchemeplanStruct)i.next(); if(sps.unitid.intValue()==unitid.intValue()&&sps.upstatus.intValue()==0) { 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){session.setAttribute("hbzcollect_d",collect_d);session.setAttribute("hbzcollect",collect); 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;%><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=600 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 width=25%>设备名称<td width=30%>设备规格/型号<td width=20%>申请数量<td width=25%>设备总价</tr><%for(int j=0;j<rows;j++){Collection temp = new ArrayList();String devname = d_name.elementAt(j).toString();String devmodel = "";int appamount = 0;double appmoney = 0;Iterator ii = collect_d.iterator();while(ii.hasNext()){PlandetailsStruct pds = (PlandetailsStruct)ii.next();if(pds.devicename.equals(devname)){devmodel = pds.devicemodel;temp.add(pds);}}Iterator di = temp.iterator();while(di.hasNext()){PlandetailsStruct pds = (PlandetailsStruct)di.next();appamount = appamount+pds.appamount.intValue();appmoney = appmoney+pds.deviceprice.doubleValue();}%><tr align=center><td><a href="hbzxg.jsp?devname=<%=devname%>&planyear=<%=planyear%>&unitid=<%=unitid%>"><%=devname%></a><td><%=devmodel%><td><%=appamount%><td><%=appmoney%></tr><%}%></table><table align=center border=0><tr align=center><td align=center><a href="hbz_uped.jsp?planyear=<%=planyear%>&unitid=<%=unitid%>">上  报</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="schemeinput.jsp">返  回</a></td></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 + -