合同查询权限

This commit is contained in:
liuzhao 2019-01-04 15:59:15 +08:00
parent ddf103146d
commit 6fda75b24c

View File

@ -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<BizObject> roleListObject = manager.createQuery("userid=:userid").setParameter("userid", userid1).getResultList(false);
List<String> roleList = new ArrayList<String>();
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<BizObject> userObjectList = manager.createQuery("roleid=:roleid").setParameter("roleid", roleId).getResultList(false);
String userId = "";
List<String> useridList = new ArrayList<String>();
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+"'");
}