diff --git a/WebContent/Tenwa/Lease/Flow/Contract/contractInfoAllView/contractInfoAllViewList.jsp b/WebContent/Tenwa/Lease/Flow/Contract/contractInfoAllView/contractInfoAllViewList.jsp index 8a17625d7..d0b3ac3c4 100644 --- a/WebContent/Tenwa/Lease/Flow/Contract/contractInfoAllView/contractInfoAllViewList.jsp +++ b/WebContent/Tenwa/Lease/Flow/Contract/contractInfoAllView/contractInfoAllViewList.jsp @@ -2,6 +2,7 @@ <%@page import="com.tenwa.comm.dataRightmanager.DataRightManager"%> <%@ page contentType="text/html; charset=GBK"%> <%@ include file="/Frame/resources/include/include_begin_list.jspf"%> +<%@ page import="org.apache.commons.lang.StringUtils" %> <% String InfoForType=CurPage.getParameter("InfoForType"); @@ -30,7 +31,32 @@ //doTemp.appendJboWhere(" and O.distributor_id='"+distributor_id+"'"); } //合同信息查询加权限 - if(!"administrator".equals(userid1)){ + BizObjectManager manager = JBOFactory.getBizObjectManager("jbo.awe.USER_ROLE"); + List roleListObject = manager.createQuery("userid=:userid").setParameter("userid", userid1).getResultList(false); + List roleList = new ArrayList(); + String roleid = ""; + for(BizObject bo : roleListObject){ + roleid = bo.getAttribute("roleid").toString(); + roleList.add(roleid); + } + //roleid:800R00000044 北财合作方 + String roleId = "800R00000044"; + + //roleid:800R00000045 rolename: bccuishou + //如果登录人属于bccuishou角色,可以看到北财下的所有的合同 + if(roleList.contains("800R00000045")){ + List userObjectList = manager.createQuery("roleid=:roleid").setParameter("roleid", roleId).getResultList(false); + String userId = ""; + List useridList = new ArrayList(); + for(BizObject bo : userObjectList){ + userId = bo.getAttribute("userid").toString(); + useridList.add("'"+userId+"'"); + } + String useridStr = StringUtils.join(useridList.toArray(), ","); + doTemp.appendJboWhere(" and O.project_manage in (" + useridStr + ")"); + } + //登录人属于经销商角色 401:经销商roleid + if(roleList.contains("401")){ doTemp.appendJboWhere(" and O.project_manage='"+userid1+"'"); }