📄 down_query.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(); Integer whichyear = new Integer(request.getParameter("whichyear")); session.setAttribute("whichyear",whichyear); userStruct session_us=(userStruct)session.getAttribute("user"); if(session_us==null) response.sendRedirect("../../login.html"); else if(session_us.userAccess.intValue() == 6)//海区 response.sendRedirect("down_query_hq.jsp"); else if(session_us.userAccess.intValue() == 3)//航标处 response.sendRedirect("down_query_hbc.jsp"); else if(session_us.userAccess.intValue() == 11)//航标站 response.sendRedirect("down_query_hbz.jsp"); else if(session_us.userAccess.intValue() == 12)//海测大队 response.sendRedirect("down_query_zh.jsp"); else{ 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(); Judge judge = new Judge(); officeUnitStruct ous=new officeUnitStruct(); while(ii.hasNext()) { SchemeplanStruct schplanstruct = new SchemeplanStruct(); schplanstruct = (SchemeplanStruct)ii.next(); ////符合下达条件的 if(schplanstruct.downstatus.intValue()==0&&schplanstruct.planstatus.intValue()==0&&schplanstruct.upstatus.intValue()==3) { Collection ttt = new ArrayList(); ttt = officeUnitController.getUnitid(schplanstruct.unitid); Iterator it = ttt.iterator(); if(it.hasNext()) ous = (officeUnitStruct)it.next(); //if(ous.upunitid.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.add(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();System.out.println(nRow); /* 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--; } }//////////得到下属单位集 */Collection pro = officeUnitController.getAll();Iterator qq = pro.iterator();while(qq.hasNext()){ officeUnitStruct polo = new officeUnitStruct(); polo = (officeUnitStruct)qq.next(); if(polo.upunitid.intValue() == session_us.unitid.intValue()) danwei.addElement(polo.unitid);}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();//////////////////////单位名称session.setAttribute("unitCollection_bu",danwei);//单位session.setAttribute("planCollection_bu",vector);//申请session.setAttribute("plandetailCol_bu",detail_coll);//详细session.setAttribute("subunitColl_bu",rongqi);if(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_bu.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 rowspan="2"><div align="center"><font class="strong">设备名称</font></div></td> <td rowspan="2"><div align="center"><font class="strong">设备规格</font></div></td> <%for(int ll = 0;ll<danwei.size();ll++){ Integer aaa = (Integer)danwei.elementAt(ll); Collection tempcoll=officeUnitController.getUnitid(aaa); Iterator kk = tempcoll.iterator(); if(kk.hasNext()) ous = (officeUnitStruct)kk.next(); String processname = ous.getProcessname();%> <td colspan="2"> <%=processname%><%}%> <td rowspan="2"><div align="center"><font class="strong">合计</font></div></td> </tr> <tr align=middle> <%for(int c=0;c<danwei.size();c++){%> <td >申请数量</td> <td >申请金额</td> <%}%> </tr> <%for(int nn=0;nn<nRow;nn++){%> <tr align=middle> <%String dname = (String)rongqi.elementAt(nn);%> <td><%=dname%></td> <% Iterator iter = detail_coll.iterator(); PlandetailsStruct detail = new PlandetailsStruct(); if (iter.hasNext()) detail = (PlandetailsStruct)iter.next(); String guige = detail.devicetype; %> <td><%=guige%></td> <% Iterator myit = detail_coll.iterator(); Vector detailvec = new Vector(); PlandetailsStruct ppdetail = new PlandetailsStruct(); while(myit.hasNext()) { ppdetail = (PlandetailsStruct)myit.next(); if(ppdetail.devicename.equals(dname)) detailvec.addElement(ppdetail);//得到该名字的记录集合 } Integer shuliang=new Integer(0); Double jine = new Double(0); Double total_row = new Double(0); // for(int m_m = 0;m_m<detailvec.size();m_m++) //{ PlandetailsStruct pp = new PlandetailsStruct(); Judge myjudge = new Judge(); for(int m=0;m<danwei.size();m++) { Integer int_danwei = (Integer)danwei.elementAt(m); for(int m_m = 0;m_m<detailvec.size();m_m++) { pp = (PlandetailsStruct)detailvec.elementAt(m_m); if(myjudge.decide(int_danwei,pp.unitid)) //if(pp.unitid.intValue() == int_danwei.intValue()) { shuliang = new Integer(pp.appamount.intValue()+shuliang.intValue()); jine = new Double(pp.deviceprice.doubleValue()+jine.doubleValue()); } } %> <td><%=shuliang%></td> <td><%=jine%> <% total_row = new Double(total_row.doubleValue()+jine.doubleValue()); shuliang = new Integer(0); jine = new Double(0); } //total_row = new Double(total_row.doubleValue()+pp.deviceprice.doubleValue()); //}%> <td><%=total_row.doubleValue()%></td> </tr> <%}%> <%Double total_col = new Double(0); Double total_all = new Double(0); %> <tr align=middle> <td>合计</td> <td> </td> <%for(int b = 0;b<danwei.size();b++) { Integer gg = (Integer)danwei.elementAt(b); Iterator xulie = detail_coll.iterator(); PlandetailsStruct hh = new PlandetailsStruct(); Judge ju = new Judge(); while(xulie.hasNext()) { hh = (PlandetailsStruct)xulie.next(); //if(hh.unitid.intValue()==gg.intValue()) if(ju.decide(gg,hh.unitid)) total_col = new Double(total_col.doubleValue()+hh.deviceprice.doubleValue()); } total_all = new Double(total_all.doubleValue()+total_col.doubleValue()); %> <td> </td> <td><input type="text" name="<%=gg.intValue()%>" class="file" size="8" value="<%=total_col.doubleValue()%>"></td><% total_col = new Double(0); }%> <td><%=total_all.doubleValue()%></td></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> </td> </tr> </table></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 + -