js、xml获取写死的参数与session里面得到的参数对比,去实体里面获得要的显示数值
blank.jsp显示界面
<%@ page contentType="text/html;charset=GBK"%>
<%@page import="gov.kangaroo.gad.domain.GadDomain"%>
<%@page import="gov.util.spring.SpringContext"%>
<%@page import="gov.kangaroo.gad.common.GadConst"%>
<%@page import="wad2.model.BridgeStructure"%>
<%@page import="net.sf.json.JSONObject"%>
<%@page import="wad2.model.BaseStructure"%>
<%@page import="wad2.model.OutputStructure"%>
<%@page import="wad2.model.ValueSource"%>
<%@page import="wegov2.platform.client.response.UserResponse"%>
<%@page import="wegov2.platform.client.ClientCfgBean"%>
<%@page import="wegov2.platform.client.api.ApiHelper"%>
<%@page import="java.util.List"%>
<%@page import="wegov2.platform.client.response.RoleResponse"%>
<%@page import="com.wonders.pdtzjc.common.PdtzjcConst"%>
<%@page import="wegov2.platform.client.response.MenuResponse"%>
<%@page import="java.util.List"%>
<%@page import="java.util.ArrayList"%>
<%
Boolean result = false;
try{
UserResponse user=(UserResponse)session.getAttribute("currentPerson");
String userId= user.getUserId();
ClientCfgBean jccfb = (ClientCfgBean)SpringContext.getInstance().getBean("jcpm.clientCfgBean");
List<RoleResponse> rolesList=ApiHelper.getAuthorizationApi(jccfb).getRolesByUser(userId);//根据用户Id获取当前用户的角色
for(int i=0;i<rolesList.size();i++){
String id=rolesList.get(i).getId();
if(PdtzjcConst.JLPM_WARN_ROLE.equals(id)){//对比是可以查看预警滚动显示的角色
result=true;
}
}
}catch(Exception e){
result=false;
}
String topImg = request.getParameter("topImg");//头图片
GadDomain gadDomain = (GadDomain) SpringContext.getInstance().getBean(GadConst.SERV_BEAN_GAD_DOMAIN);//kangaroo
BridgeStructure bsXz=new BridgeStructure();
BridgeStructure bsHy=new BridgeStructure();
BridgeStructure bsYb=new BridgeStructure();
//概算
BridgeStructure bsGs=new BridgeStructure();
bsXz.putString("stWarnChildStep","101");
bsXz= gadDomain.executeGadWadFunction("chaxunjianliyujingxinxishumutongji", null, bsXz);//查询监理实施细则预警
bsHy.putString("stWarnChildStep","102");
bsHy= gadDomain.executeGadWadFunction("chaxunjianliyujingxinxishumutongji", null, bsHy);//查询工作交底会议纪要预警
bsYb.putString("stWarnStep","月报阶段");
bsYb= gadDomain.executeGadWadFunction("chaxunjianliyujingxinxishumutongji", null, bsYb);//查询月报预警
BaseStructure actionOutPutBsXz = bsXz.getActionOutput();
OutputStructure osReturnXz = (OutputStructure) actionOutPutBsXz.get(0);
ValueSource vsXz = new ValueSource(osReturnXz, 0);
String xzSumNum = vsXz.getOutputValueString("sumNum");
int xzSum = Integer.valueOf(xzSumNum);
BaseStructure actionOutPutBsHy = bsHy.getActionOutput();
OutputStructure osReturnHy = (OutputStructure) actionOutPutBsHy.get(0);
ValueSource vsHy = new ValueSource(osReturnHy, 0);
String hySumNum =vsHy.getOutputValueString("sumNum");
int hySum =Integer.valueOf(hySumNum);
BaseStructure actionOutPutBsYb = bsYb.getActionOutput();
OutputStructure osReturnYb = (OutputStructure) actionOutPutBsYb.get(0);
ValueSource vsYb = new ValueSource(osReturnYb, 0);
String ybSumNum =vsYb.getOutputValueString("sumNum");
int ybSum = Integer.valueOf(ybSumNum);
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>欢迎页面</title>
<link rel="stylesheet" type="text/css" href="../css/index.css" />
<link rel="stylesheet" href="../css/style.css" type="text/css" />
<link href="../css/info_ii.css" rel="stylesheet" type="text/css" />
<script src="/pdtzjc/script/swfobject_modified.js" type="text/javascript"></script>
<script type="text/javascript" src="/pdtzjc/script/inner_home.js"></script>
<script language="javascript" src="/pdtzjc/script/jquery.min.js"></script>
<script language="javascript" src="/kangaroo/js/common.js"></script>
<script>
$(document).ready(function() {
$(".text_con dt").addClass("Dt_Border");
$(".text_con dt").eq(3).removeClass("Dt_Border");
$(".text_con dt").eq(7).removeClass("Dt_Border");
$(".text_con dt").eq(11).removeClass("Dt_Border");
$(".text_con dt").eq(15).removeClass("Dt_Border");
});
</script>
</head>
<table width="100%" height="30" border="0" cellpadding="0"
cellspacing="0" class="wzdhbj">
<tr>
<td width="18%"><span> <img src="../images/ico/ico8.gif"
width="16" height="16" /> <strong>当前位置:</strong>
</span>首页</td>
<td width="82%">
<%if("3".equals(topImg)&&result) {%> <%if(xzSum>0||hySum>0||ybSum>0){ %>
<div id="notice_bg" width="100%">
<marquee onmouseover=this.stop() onmouseout=this.start()>
<img src="/pdtzjc/css/images/light/light_red.gif" width="16"
height="16" align="absmiddle" /> <font size="2"> 目前项目中有<%if(xzSum>0){%><font
color="red"><%= xzSum%>条监理实施细则</font>
<%}%>
<%if(xzSum>0&&hySum>0){%>、<%}%>
<%if(hySum>0){%><font color="red"><%= hySum%>条会议纪要</font>
<%}%>
<%if(ybSum>0&&hySum>0){%>、<%}%>
<%if(ybSum>0){%><font color="red"><%= ybSum%>条月报</font>
<%} %>已逾期填报,点击菜单中的<b>项目预警</b>查看详细!
</font> </marquee>
</div> <%} }%>
</td>
</tr>
</table>
<body>
<div class="Content_cc">
<h3>待审核事项统计</h3>
<dl class="text_con text_con_bottom">
<dt>
<h2>
<a href="#" id="gssh"><span funId="chaxunjieduanbaodaodaishenheshu" funName="gaisuanshenhe" flag="select">0</span></a>件
</h2>
<p>概算审核</p>
</dt>
<dt>
<h2>
<a href="#" id="yssh"><span funId="chaxunjieduanbaodaodaishenheshu" funName="yusuanshenhe" flag="select">0</span></a>件
</h2>
<p>
预算审核<br />(控制目标)
</p>
</dt>
<dt>
<h2>
<a href="#" id="jssh"><span funId="chaxunjieduanbaodaodaishenheshu" funName="juesuanshenhe" flag="select">0</span></a>件
</h2>
<p>决算审核</p>
</dt>
<dt>
<h2>
<a href="#" id="ztbwjsh"><span funId="chaxunjieduanbaodaodaishenheshu" funName="zhaotoubiaoshenhe" flag="select">0</span></a>件
</h2>
<p>招投标文件审核</p>
</dt>
</dl>
<dl class="text_con">
<dt>
<h2>
<a href="#" id="qzsh"><span funId="chaxunqianzhengshenhedaishenheshu" funName="qianzhengshenhe" flag="select">0</span></a>件
</h2>
<p>签证审核</p>
</dt>
<dt>
<h2>
<a href="#" id="qtsh"><span funId="chaxunqitashenhedaishenheshu" funName="qitashenhe" flag="select">0</span></a>件
</h2>
<p>其他审核</p>
</dt>
<dt>
<h2>
<a href="#" id="ybsh"><span funId="chaxunyuebaoshenhedaishenheshu" funName="yuebaoshenhe" flag="select">0</span></a>件
</h2>
<p>月报审核</p>
</dt>
<dt>
<h2>
<a href="#" id="jldwsh" onclick=""><span funId="chaxunjianlidanweirenyuanweihushenhedaishenheshu" funName="jianlidanweirenyuanweihushenhe" flag="select">0</span></a>件
</h2>
<p>
监理单位<br/>人员维护审核
</p>
</dt>
</dl>
</div>
<div class="Content_cc">
<h3>超期未审核事项</h3>
<dl class="text_con text_con_bottom">
<dt>
<h2>
<span>0</span>件
</h2>
<p>概算审核</p>
</dt>
<dt>
<h2>
<span>0</span>件
</h2>
<p>
预算审核<br />(控制目标)
</p>
</dt>
<dt>
<h2>
<span>0</span>件
</h2>
<p>决算审核</p>
</dt>
<dt>
<h2>
<span>0</span>件
</h2>
<p>招投标文件审核</p>
</dt>
</dl>
<dl class="text_con">
<dt>
<h2>
<span>0</span>件
</h2>
<p>签证审核</p>
</dt>
<dt>
<h2>
<span>0</span>件
</h2>
<p>其他审核</p>
</dt>
<dt>
<h2>
<span>0</span>件
</h2>
<p>月报审核</p>
</dt>
<dt>
<h2>
<span>0</span>件
</h2>
<p>
监理单位<br />人员维护审核
</p>
</dt>
</dl>
</div>
<div class="imgii">
<img src="../css/images/bg_ii1.jpg" alt="" />
</div>
<script type="text/javascript">
$(function() {
$("span[flag='select']").each(function() {
var funId = $(this).attr("funId");
var funName=$(this).attr("funName");
// var href=$("a").attr("href");
$.ajax({
type : "POST",
url : "/pdtzjc/project/action/getEstimateUncheckedNumber.jsp?funId="+funId+"&funName="+funName,
success : function(data) {
var obj=data;
obj = JSON.parse(obj);
$("span[funName="+funName+"]").html(obj.sumNum);
var href = obj.url+"?menuid="+obj.id;
$("span[funName="+funName+"]").parent().attr("href",href);
}
});
});
});
</script>
</body>
</html>
-----------------------------------
getuncheckedEetimateNumber.jsp页面作为action
<%@page import="java.util.Iterator"%>
<%@page import="java.util.List"%>
<%@page import="net.sf.json.JSONArray"%>
<%@page import="net.sf.json.JSONObject"%>
<%@page import="java.util.ArrayList"%>
<%@page import="wad2.model.OutputStructure"%>
<%@page import="wad2.model.BaseStructure"%>
<%@page import="wad2.model.BridgeStructure"%>
<%@page import="gov.kangaroo.gad.bo.param.impl.WadParamObject"%>
<%@page import="gov.kangaroo.gad.common.GadConst"%>
<%@page import="gov.util.spring.SpringContext"%>
<%@page import="gov.kangaroo.gad.domain.GadDomain"%>
<%@page import="org.dom4j.Document"%>
<%@page import="org.dom4j.DocumentException"%>
<%@page import="org.dom4j.Element"%>
<%@page import="org.dom4j.Node"%>
<%@page import="org.dom4j.io.SAXReader"%>
<%@page import="java.io.File"%>
<%@page import="com.wonders.pdtzjc.common.PdtzjcConst"%>
<%@page import="wegov2.platform.client.response.MenuResponse"%>
<%@page language="java" contentType="text/html; charset=GBK" pageEncoding="GBK"%>
<%@page import="java.util.HashMap"%>
<%
String url="";
String grandSonId ="";
String targetId = "";
GadDomain gadDomain = (GadDomain) SpringContext.getInstance().getBean(GadConst.SERV_BEAN_GAD_DOMAIN);
SAXReader reader = new SAXReader();
Document document = reader.read(new File("F:\\workspace\\pdtzjc\\web\\WEB-INF\\classes\\toDoSumNum.xml"));
Element root = document.getRootElement();//获取根节点 即pdtzjc
Element rootchild = root.element("todolist");
List child = rootchild.elements("entity");
WadParamObject param = new WadParamObject(pageContext);
String funId = request.getParameter("funId");
// System.out.print(funId);
String funName = request.getParameter("funName");
// System.out.print(funName);
BridgeStructure bs=null;
String menuId = "c4389e26-d157-4886-b310-1c0a7142719c";
List<MenuResponse> childMenu = new ArrayList<MenuResponse>();
List menuList = (ArrayList) session.getAttribute(PdtzjcConst.SESSION_MENU_LIST);
if (menuList != null && menuList.size() > 0) {
for (int k = 0; k < menuList.size(); k++) {
MenuResponse menuRes = (MenuResponse) menuList.get(k);
if (menuId.equals(menuRes.getId())) {
childMenu = menuRes.getChildren();
System.out.print(childMenu);
if (childMenu.size() != 0) {
for (int i = 0; i < childMenu.size(); i++) {
if ("专报审核".equals(childMenu.get(i).getName())) {
List<MenuResponse> childrenMenus = childMenu.get(i).getChildren();
for (int j = 0; j < childrenMenus.size(); j++) {
grandSonId = childrenMenus.get(j).getId();
//遍历xml
for (Iterator it = child.iterator(); it.hasNext();) {
Element el = (Element) it.next(); //el就是funName
String ee= el.attributeValue("funName");
if((null!=funName&&!"".equals(funName))&&(null!=el&&!"".equals(el))&&(ee.equals(funName))){
List last = el.elements("meunId");
for (Iterator item = last.iterator(); item.hasNext();) {
Element lastel = (Element) item.next();
targetId = lastel.attributeValue("id");
if((null!=grandSonId&&!"".equals(grandSonId))&&(null!=targetId&&!"".equals(targetId))&&(grandSonId.equals(targetId))){
url=lastel.attributeValue("url");
String stReportType = lastel.attributeValue("stReportType");
String stApplyType = lastel.attributeValue("stApplyType");
String stApploveStatus = lastel.attributeValue("stApploveStatus");
bs= new BridgeStructure();
bs.putString("stReportType",stReportType);//这个字段在两个表中都有
bs.putString("stApplyType",stApplyType);
bs.putString("stApploveStatus",stApploveStatus);
bs = gadDomain.executeGadWadFunction(funId,param,bs);
System.out.print(bs);
BaseStructure actionOutPutBs = bs.getActionOutput();
OutputStructure osReturn = (OutputStructure) actionOutPutBs.get(0);
ArrayList arrayList = osReturn.getResultList();
String sumNum = ((HashMap) arrayList.get(0)).get("sumNum").toString();
JSONObject jsonObject = new JSONObject();
jsonObject.put("id", targetId);
jsonObject.put("url", url);
jsonObject.put("sumNum", sumNum);
out.print(jsonObject);
String result = "";
try {
gadDomain.executeGadWadFunction(funId, param,new BridgeStructure());
result = "success";
} catch (Exception ex) {
result = "error";
}
}
}
}
}
}
}
}
}
}
}
}
%>
------------------------------------------------
todoSumNum.jsp为xml文件
<?xml version="1.0" encoding="UTF-8"?>
<pdtzjc>
<todolist>
<entity funName="gaisuanshenhe">
<meunId id="8a81ab874fd5352601504fa9c8240947" url="gadkform/estimateCheckTab" stReportType="106" stApplyType="1" stApploveStatus="1"/>
<!-- 概算审核一级审核 -->
<meunId id="8a81ab875556d632015557c30f04001b" url="gadkform/secondCheckEstimate" stReportType="106" stApplyType="1" stApploveStatus="3"/>
<!-- 概算审核二级审核 -->
<meunId id="8a81ab875556d632015557c40e78001d" url="gadkform/thirdCheckEstimate" stReportType="106" stApplyType="2" stApploveStatus="3"/>
<!-- 概算审核三级审核 -->
</entity>
<entity funName="yusuanshenhe">
<meunId id="8a81ab874fd5352601504faa52ff0948" url="/gadkform/budgetCheckTab" stReportType="109" stApplyType="1" stApploveStatus="1"/>
<!-- 预算审核一级审核 -->
<meunId id="8a81ab875556d632015557c8a1140022" url="/gadkform/secondBudgetReport" stReportType="109" stApplyType="1" stApploveStatus="3"/>
<!-- 预算审核二级审核 -->
<meunId id="8a81ab875556d632015557ca79c60024" url="/gadkform/thirdBudgetReport" stReportType="109" stApplyType="2" stApploveStatus="3"/>
<!-- 预算审核三级审核 -->
</entity>
<entity funName="juesuanshenhe">
<meunId id="8a81ab874fd5352601504faaf2320949" url="/gadkform/completionSettlementTab" stReportType="501" stApplyType="1" stApploveStatus="1"/>
<!-- 决算审核一级审核 -->
<meunId id="8a81ab875556d63201556b724d2c028c" url="/gadkform/secondSettlementList" stReportType="501" stApplyType="1" stApploveStatus="3"/>
<!-- 决算审核二级审核 -->
<meunId id="8a81ab875556d63201556b730ddc028e" url="/gadkform/thirdSettlementList" stReportType="501" stApplyType="2" stApploveStatus="3"/>
<!-- 决算审核三级审核 -->
</entity>
<entity funName="zhaotoubiaoshenhe">
<meunId id="8a81ab874fd5352601504fab5256094a" url="/gadkform/procurementTab" stReportType="501" stApplyType="1" stApploveStatus="1"/>
<!-- 招投标文件审核一级审核 -->
<meunId id="8a81ab875556d63201556b75179b0292" url="/gadkform/firstProcurement" stReportType="501" stApplyType="1" stApploveStatus="3"/>
<!-- 招投标文件审核二级审核 -->
<meunId id="8a81ab875556d63201556b7686440297" url="/gadkform/secondProcurementList" stReportType="501" stApplyType="2" stApploveStatus="3"/>
<!-- 招投标文件审核三级审核 -->
</entity>
<entity funName="qianzhengshenhe">
<meunId id="8a81ab87541894c801545fd7b9870345" url="/gadkform/firstAuditVisaTab" stApplyType="1" stApploveStatus="1"/>
<!-- 签证审核一级审核 -->
<meunId id="8a81ab87541894c801545fdec6320347" url="/gadkform/secondPendingAuditVisa" stApplyType="1" stApploveStatus="3"/>
<!-- 签证审核二级审核 -->
<meunId id="8a81ab87541894c801545fdf52e60349" url="/gadkform/thirdPendingAuditVisa" stApplyType="2" stApploveStatus="3"/>
<!-- 签证审核三级审核 -->
</entity>
<entity funName="qitashenhe">
<meunId id="8a81ab874fd5352601504fabf9c4094c" url="/gadkform/otherCheckTab" stApplyType="1" stApploveStatus="1"/>
<!-- 其他审核一级审核 -->
<meunId id="8a81ab875556d63201556b7d1e4d02a1" url="/gadkform/secondOtherReport" stApplyType="1" stApploveStatus="3"/>
<!-- 其他审核二级审核 -->
<meunId id="8a81ab875556d63201556b7e07e002a3" url="/gadkform/thirdOtherReport" stApplyType="2" stApploveStatus="3"/>
<!-- 其他审核三级审核 -->
</entity>
<entity funName="yuebaoshenhe">
<meunId id="8a81ab87506f41210150897018650024" url="/gadkform/checkMoubthTab" stApplyType="1" stApploveStatus="1"/>
<!-- 月报审核待审核 -->
</entity>
<entity funName="jianlidanweirenyuanweihushenhe">
<meunId id="" />
<!-- 监理单位人员维护审核待审核 -->
</entity>
</todolist>
</pdtzjc>
-----------------------------------------
同一个待审核有三个权限(不同的人看到不同的结果)