📄 down_query_hbz.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{ 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) { 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; */ 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();//////////////////////单位名称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();//存放详细申请的idif(nRow>0){%><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()%>年度下达表 <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);%> <%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> <%String shu = ljq.detailsid.toString()+"amount"; String qian = ljq.detailsid.toString()+"money"; total = new Double(total.doubleValue()+ljq.deviceprice.doubleValue()); %> <td width="15%"><input type="text" name="<%=shu%>" class="file" size="8" value="<%=ljq.realamount%>"></td> <td width="15%"><input type="text" name="<%=qian%>" class="file" size="8" value="<%=ljq.realprice%>"></td> </tr> <%}//session.setAttribute("idVector",detail_id);%> <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"><%=total.toString()%></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> </table> <table class=title cellspacing=1 cellpadding=2 width="100%" border=1><tr align=center><td align=left width=50%>航标处下达金额<%double buDownPrice = 0;Integer priceid = new Integer(0);Collection pc = schemeplancontroller.getPlanpriceByPlanyear(whichyear);Iterator pi = pc.iterator();while(pi.hasNext()){PlanpriceStruct prs = (PlanpriceStruct)pi.next();if(prs.unitid.intValue()==session_us.unitid.intValue()){if(prs.priceid.intValue()>priceid.intValue()){priceid = prs.priceid;}}}PlanpriceStruct pprs = new PlanpriceStruct();pprs = schemeplancontroller.getPlanpriceByPriceid(priceid);if(pprs!=null){if(pprs.totalprice!=null){buDownPrice = pprs.totalprice.doubleValue();}}%><td align=right><%=buDownPrice%></tr></table> <table class=title cellspacing=1 cellpadding=2 width="100%" border=0> <tr align=center > <td><input type="submit" name="Submit" value="确 定" class="file" onClick="return confirm('请确认实际数量和实际金额输入正确!')">  <input type="button" name="Button3222" value=" 返 回 " class="file" onClick="javascript:history.go(-1)"></td> </tr> </table> </form></BODY></HTML><%} else{ %> <font color="red">请确定<%=whichyear%>年度航标处已经下达</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 + -