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

📄 down_result_zh.jsp

📁 《jsp案例开发》这本书的源代码。包括源代码和相关的具体配置操作步骤。非常不错
💻 JSP
字号:
<%@ page    language="java"    contentType="text/html; charset=GBK"    import="imis.*,javax.naming.*,javax.rmi.PortableRemoteObject,java.util.*,java.sql.*,java.io.*"%><%    request.setCharacterEncoding("GBK");    session=request.getSession();    userStruct session_us=(userStruct)session.getAttribute("user");    if(session_us==null){      response.sendRedirect("../../login.html");    }    else{       try{        Integer whichyear = (Integer)session.getAttribute("whichyear");        Context ctx = new InitialContext();        Object ref = ctx.lookup("SchemeplanController");        SchemeplanControllerHome schemeplanControllerHome = (SchemeplanControllerHome) PortableRemoteObject.narrow(ref, SchemeplanControllerHome.class);        SchemeplanController schemeplancontroller = schemeplanControllerHome.create();        Context psctx=new InitialContext();        Object psref=psctx.lookup("OfficeUnitController");        OfficeUnitControllerHome officeUnitControllerHome=(OfficeUnitControllerHome) PortableRemoteObject.narrow(psref,OfficeUnitControllerHome.class);        OfficeUnitController officeUnitController=officeUnitControllerHome.create();/*        Collection plan_collect = schemeplancontroller.getPlanByPlanyear(whichyear);//根据年度取得数据        Iterator ii = plan_collect.iterator();        Vector rongqi = new Vector(); //存放设备名称        Vector vector = new Vector(); //存放符合下达条件的schemeplan    //    Vector danwei = new Vector(); //存放单位id        //Collection detail_coll = new ArrayList(); //存放符合条件的details集合        Vector detail_coll = new Vector(); //存放符合条件的details集合        Judge judge = new Judge();        officeUnitStruct ous=new officeUnitStruct();        while(ii.hasNext())        {          SchemeplanStruct schplanstruct = new SchemeplanStruct();          schplanstruct = (SchemeplanStruct)ii.next();          ////符合下达条件的          if(schplanstruct.downstatus.intValue()==3&&schplanstruct.planstatus.intValue()==1&&schplanstruct.upstatus.intValue()==0)          {            Collection ttt = new ArrayList();                ttt = officeUnitController.getUnitid(schplanstruct.unitid);            Iterator it = ttt.iterator();            if(it.hasNext())              ous = (officeUnitStruct)it.next();            if(ous.unitid.intValue()==session_us.unitid.intValue())            {//              danwei.addElement(schplanstruct.unitid);              vector.addElement(schplanstruct);//符合下达条件的plan的集合              Integer nTemp = schplanstruct.planid;              Collection devicecollect1 = new ArrayList();              devicecollect1 = schemeplancontroller.getPlandetailsByPlanid(nTemp);              Iterator jj = devicecollect1.iterator();              while(jj.hasNext())              {                 PlandetailsStruct str = new PlandetailsStruct();                 str = (PlandetailsStruct)jj.next();                 detail_coll.addElement(str);                 String aa = str.devicename;                 rongqi.addElement(aa);              }            }          }        }        */        /*        for(int l=0;l<rongqi.size()-1;l++)         for(int k=l+1;k<rongqi.size();k++)         {           if(rongqi.elementAt(l).equals(rongqi.elementAt(k)))           {              rongqi.remove(k);              k--;           }          }///////////得到名称不相同设备集        int nRow = rongqi.size();        */        /*        for(int l=0;l<danwei.size()-1;l++)         for(int k=l+1;k<danwei.size();k++)         {            if(danwei.elementAt(l).equals(danwei.elementAt(k)))            {              danwei.remove(k);              k--;             }         }//////////得到下属单位集         int nCol = danwei.size()*2;        */        /*int nRow = detail_coll.size();//session.setAttribute("unitCollection_hbc",danwei);//单位//session.setAttribute("planCollection_hbz",vector);//申请//session.setAttribute("detailVector_hbz",detail_coll);session.setAttribute("whichyear",whichyear);session.setAttribute("xxxVec",detail_coll);//Vector detail_id = new Vector();//存放详细申请的id*/        Collection myunit_Coll = officeUnitController.getUnitid(session_us.unitid);/////得到登录人所在单位名称        Iterator iterator_unit = myunit_Coll.iterator();        officeUnitStruct danweiStruct = new officeUnitStruct();        if(iterator_unit.hasNext())          danweiStruct = (officeUnitStruct)iterator_unit.next();        String UnitName = danweiStruct.getProcessname();//////////////////////单位名称Vector detail_coll = new Vector();detail_coll = (Vector)session.getAttribute("mydetail_zh");int nRow = detail_coll.size();%><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="form2" method="post" action="downpro_hbz.jsp">              <table class=title cellspacing=1 cellpadding=2 width="100%" border=1>   <caption align=right><%=UnitName%><%=whichyear.toString()%>年度下达表 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&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="20%"><div align="center"><font  class="strong">设备名称</font></div></td>                    <td width="20%"><div align="center"><font  class="strong">设备规格</font></div></td>                    <td width="15%"><div align="center"><font  class="strong">申请数量</font></div></td>                    <td width="15%"><div align="center"><font  class="strong">总    价</font></div></td>                    <td width="15%"><div align="center"><font  class="strong">实际数量</font></div></td>                    <td width="15%"><div align="center"><font  class="strong">实际金额</font></div></td>                  </tr>                <%Double total = new Double(0);                  Double realmoney = new Double(0);%>                <%for(int nn=0;nn<nRow;nn++){                   PlandetailsStruct ljq = new PlandetailsStruct();                   ljq = (PlandetailsStruct)detail_coll.elementAt(nn);                   //detail_id.addElement(ljq.detailsid);%>                  <tr align=middle>                   <%String dname = ljq.devicename;%>                   <td width="20%"><%=dname%></td>                  <%                  String guige = ljq.devicetype;  %>                  <td width="20%"><%=guige%></td>                  <%                    Integer shuliang=new Integer(0);                    Double jine = new Double(0);                    Double total_row = new Double(0);                         %>                         <td width="15%"><%=ljq.appamount.intValue()%></td>                         <td width="15%"><%=ljq.deviceprice.doubleValue()%></td>                         <%                            total = new Double(total.doubleValue()+ljq.deviceprice.doubleValue());                            realmoney = new Double(ljq.realprice.doubleValue()+realmoney.doubleValue());                       %>                  <td width="15%"><%=ljq.realamount.toString()%></td>                  <td width="15%"><%=ljq.realprice.toString()%></td>                  </tr>                  <%}//session.setAttribute("idVector",detail_id);%>                  </tr>                  <tr align=middle>                    <td width="20%"><div align="center"><font  class="strong">合计</font></div></td>                    <td width="20%"><div align="center"><font  class="strong">&nbsp;</font></div></td>                    <td width="15%"><div align="center"><font  class="strong">&nbsp;</font></div></td>                    <td width="15%"><div align="center"><font  class="strong"><%=total.toString()%></font></div></td>                    <td width="15%"><div align="center"><font  class="strong">&nbsp;</font></div></td>                    <td width="15%"><div align="center"><font  class="strong"><%=realmoney%></font></div></td>                  </tr>            </table>          </form></BODY></HTML><%      }  catch(Exception e)  {    e.printStackTrace();  }  session.removeAttribute("mydetail_zh");}%>

⌨️ 快捷键说明

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