From 37467bfe3d2be2b5e253548397f215258dddd214 Mon Sep 17 00:00:00 2001 From: liuzhao Date: Mon, 14 Jan 2019 17:51:00 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=84=E9=87=91=E5=AE=9E=E6=94=B6=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rentcollection/FundIncomeReport.jsp | 66 +++++++++++++------ 1 file changed, 47 insertions(+), 19 deletions(-) diff --git a/WebContent/Tenwa/Lease/Flow/RentCollection/rentcollection/FundIncomeReport.jsp b/WebContent/Tenwa/Lease/Flow/RentCollection/rentcollection/FundIncomeReport.jsp index 902344cbf..4c55bffbf 100644 --- a/WebContent/Tenwa/Lease/Flow/RentCollection/rentcollection/FundIncomeReport.jsp +++ b/WebContent/Tenwa/Lease/Flow/RentCollection/rentcollection/FundIncomeReport.jsp @@ -1,23 +1,53 @@ <%@ page contentType="text/html; charset=GBK"%> -<%@ include file="/Frame/resources/include/include_begin_list.jspf"%><% +<%@ include file="/Frame/resources/include/include_begin_list.jspf"%> +<%@ page import="org.apache.commons.lang.StringUtils" %> +<% /* Author: undefined 2018-10-30 Content: History Log: */ String userid=CurUser.getUserID(); - String username = CurUser.getUserName(); - BizObject useRole = JBOFactory.createBizObjectQuery("jbo.sys.USER_ROLE", "userid=:userid") - .setParameter("userid", userid).getSingleResult(false); - String roleid = useRole.getAttribute("roleid").toString(); ASObjectModel doTemp = new ASObjectModel("FundIncomeReport"); - //099 超级管理员 - //299 平台管理员 - //399 系统管理员 - //800R00000020 资管负责人 - if(!("099".equals(roleid) || "299".equals(roleid) || "399".equals(roleid) || "800R00000020".equals(roleid))){ - doTemp.appendJboWhere(" and ui.userid='"+userid+"'"); - } + + //加权限 + BizObjectManager manager = JBOFactory.getBizObjectManager("jbo.awe.USER_ROLE"); + List roleListObject = manager.createQuery("userid=:userid").setParameter("userid", userid).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 + ")"); + } */ + + //导出模板编号 + String template = ""; + + //登录人属于经销商角色 401:经销商roleid + if(roleList.contains("401")){ + doTemp.appendJboWhere(" and lci.project_manage='"+userid+"'"); + //导出有权限 + template = "2cd25a9b1c6248c8abacaeeaf7cda303"; + }else{ + //导出无权限 + template = "a87e9bea25694013b9cc39216cac831e"; + } ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request); dwTemp.Style="1"; //--设置为Grid风格-- @@ -41,15 +71,13 @@ var tempParam={}; var sparam=""; - var roleid="<%=roleid%>"; + var templa = "<%=template%>"; + + //param["templateNo"]="a87e9bea25694013b9cc39216cac831e"; //模板号 - if(roleid=="099" || roleid=="299" || roleid=="399"){ - param["templateNo"]="a87e9bea25694013b9cc39216cac831e"; - - }else{ - param["templateNo"]="2cd25a9b1c6248c8abacaeeaf7cda303";//权限 - } + //param["templateNo"]="2cd25a9b1c6248c8abacaeeaf7cda303";//权限 + param["templateNo"]=templa;//权限 //生成文件关联关系 tempParam["OBJECTTYPE"]="资金实收报表导出"; tempParam["FLOW_UNID"]="<%=new java.util.Date().getTime()%>";