From a3bcb8b2424715aca4fe6fcfabb081efce890f1d Mon Sep 17 00:00:00 2001 From: liuzhao Date: Fri, 4 Jan 2019 16:46:15 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=9F=E9=87=91=E5=82=AC=E6=94=B6=E6=9D=83?= =?UTF-8?q?=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../GeneratedReminderLetterList.jsp | 52 +++++++++++-------- .../overduedunning/OverdueDunningList.jsp | 47 ++++++++++------- .../rentcollection/rentCollectionList.jsp | 37 ++++++++----- 3 files changed, 82 insertions(+), 54 deletions(-) diff --git a/WebContent/Tenwa/Lease/Flow/RentCollection/generatedreminderletter/GeneratedReminderLetterList.jsp b/WebContent/Tenwa/Lease/Flow/RentCollection/generatedreminderletter/GeneratedReminderLetterList.jsp index 8580c38cf..9da19ac25 100644 --- a/WebContent/Tenwa/Lease/Flow/RentCollection/generatedreminderletter/GeneratedReminderLetterList.jsp +++ b/WebContent/Tenwa/Lease/Flow/RentCollection/generatedreminderletter/GeneratedReminderLetterList.jsp @@ -14,28 +14,38 @@ String now=df.format(new Date(d.getTime()));//yyyy/MM/dd格式 ASObjectModel doTemp = new ASObjectModel("GeneratedReminderLetterList"); - //如果登录的不是超级管理员,那么需要拼接给模板拼接where条件 - if(!"administrator".equals(userid)){ - //如果登录的人员是北财催收员,那么他需要看到所有北财经销商逾期的合同 - //北财催款员id,需要修改为对应环境上的id - if("8009U00000024".equals(userid)){ - //查询出所有北财的经销商 - //北财角色id 需要修改为对应环境上的id - String roleId = "800R00000044"; - BizObjectManager manager = JBOFactory.getBizObjectManager("jbo.awe.USER_ROLE"); - List objectList = manager.createQuery("roleid=:roleid").setParameter("roleid", roleId).getResultList(false); - String userId = ""; - List useridList = new ArrayList(); - for(BizObject bo : objectList){ - userId = bo.getAttribute("userid").toString(); - useridList.add("'"+userId+"'"); - } - String useridStr = StringUtils.join(useridList.toArray(), ","); - doTemp.appendJboWhere(" and O.project_manage in (" + useridStr + ")"); - }else{ - doTemp.appendJboWhere(" and O.project_manage='"+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 + ")"); + } + //登录人属于经销商角色 401:经销商roleid + if(roleList.contains("401")){ + doTemp.appendJboWhere(" and O.project_manage='"+userid+"'"); + } + + /* String sCondtion=DataRightManager.getRightCondition(CurUser,"O", "contract"); doTemp.appendJboWhere(sCondtion); */ diff --git a/WebContent/Tenwa/Lease/Flow/RentCollection/overduedunning/OverdueDunningList.jsp b/WebContent/Tenwa/Lease/Flow/RentCollection/overduedunning/OverdueDunningList.jsp index 83dab7857..087823363 100644 --- a/WebContent/Tenwa/Lease/Flow/RentCollection/overduedunning/OverdueDunningList.jsp +++ b/WebContent/Tenwa/Lease/Flow/RentCollection/overduedunning/OverdueDunningList.jsp @@ -13,27 +13,34 @@ //String sCondtion=DataRightManager.getRightCondition(CurUser,"O", "contract"); //doTemp.appendJboWhere(sCondtion); - //如果登录的不是超级管理员,那么需要拼接给模板拼接where条件 - if(!"administrator".equals(userid)){ - //如果登录的人员是北财催收员,那么他需要看到所有北财经销商逾期的合同 - //北财催款员id,需要修改为对应环境上的id(测试环境:8009U00000024)(101:8009011U00000021) - if("8009U00000024".equals(userid)){ - //查询出所有北财的经销商 - //北财角色id 需要修改为对应环境上的id - String roleId = "800R00000044"; - BizObjectManager manager = JBOFactory.getBizObjectManager("jbo.awe.USER_ROLE"); - List objectList = manager.createQuery("roleid=:roleid").setParameter("roleid", roleId).getResultList(false); - String userId = ""; - List useridList = new ArrayList(); - for(BizObject bo : objectList){ - userId = bo.getAttribute("userid").toString(); - useridList.add("'"+userId+"'"); - } - String useridStr = StringUtils.join(useridList.toArray(), ","); - doTemp.appendJboWhere(" and O.project_manage in (" + useridStr + ")"); - }else{ - doTemp.appendJboWhere(" and O.project_manage='"+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 + ")"); + } + //登录人属于经销商角色 401:经销商roleid + if(roleList.contains("401")){ + doTemp.appendJboWhere(" and O.project_manage='"+userid+"'"); } diff --git a/WebContent/Tenwa/Lease/Flow/RentCollection/rentcollection/rentCollectionList.jsp b/WebContent/Tenwa/Lease/Flow/RentCollection/rentcollection/rentCollectionList.jsp index 2dadc9b8c..d98312672 100644 --- a/WebContent/Tenwa/Lease/Flow/RentCollection/rentcollection/rentCollectionList.jsp +++ b/WebContent/Tenwa/Lease/Flow/RentCollection/rentcollection/rentCollectionList.jsp @@ -11,28 +11,39 @@ */ String userid=CurUser.getUserID(); ASObjectModel doTemp = new ASObjectModel("RentCollectionList"); - //如果登录的不是超级管理员,那么需要拼接给模板拼接where条件 - if(!"administrator".equals(userid)){ - //如果登录的人员是北财催收员,那么他需要看到所有北财经销商逾期的合同 - //北财催款员id,需要修改为对应环境上的id - if("8009011U00000021".equals(userid)){ - //查询出所有北财的经销商 - //北财角色id 需要修改为对应环境上的id - String roleId = "800R00000044"; - BizObjectManager manager = JBOFactory.getBizObjectManager("jbo.awe.USER_ROLE"); - List objectList = manager.createQuery("roleid=:roleid").setParameter("roleid", roleId).getResultList(false); + + //加权限 + 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 : objectList){ + 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 + ")"); - }else{ + } + //登录人属于经销商角色 401:经销商roleid + if(roleList.contains("401")){ doTemp.appendJboWhere(" and O.project_manage='"+userid+"'"); } - } + + + //String sCondtion=DataRightManager.getRightCondition(CurUser,"O", "contract"); //doTemp.appendJboWhere(sCondtion); ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request);