|
@@ -56,11 +56,13 @@ public class GetOrgUtils {
|
|
|
* @throws EASBizException
|
|
|
*/
|
|
|
public static int getPersonCount(Context ctx ,String orgId,String checkType) throws BOSException, EASBizException {
|
|
|
- String filterStr = " and topp.FAdminOrgUnitID = '"+orgId+"' ";
|
|
|
+ //权限过滤
|
|
|
+ String permStr = addPermissionFilterSql(ctx);
|
|
|
+ String filterStr = " and topp.FAdminOrgUnitID = '"+orgId+"' "+permStr;
|
|
|
try {
|
|
|
if(!StringUtils.equals("1", checkType)) {
|
|
|
List<String> orgIds = getAllSubOrg(ctx, orgId);
|
|
|
- filterStr = " and topp.FAdminOrgUnitID in ( "+ToolUtils.aryToStr(orgIds,true)+" )";
|
|
|
+ filterStr = " and topp.FAdminOrgUnitID in ( "+ToolUtils.aryToStr(orgIds,true)+" ) "+permStr;
|
|
|
}
|
|
|
String pinSql = pinPersonSql( "count",filterStr);
|
|
|
IRowSet rs = DbUtil.executeQuery(ctx, pinSql);
|
|
@@ -123,16 +125,13 @@ public class GetOrgUtils {
|
|
|
if(StringUtils.equals("1", orgId)){
|
|
|
orgId = getRootOrg(ctx);
|
|
|
}
|
|
|
- IPermission permission = PermissionFactory.getLocalInstance(ctx);
|
|
|
- IObjectPK caller = ctx.getCaller();
|
|
|
- Set authorizedOrgIds = permission.getAuthorizedOrgIds(caller, OrgType.Admin, null, "");
|
|
|
|
|
|
- String filterStr = " and ( pers.fname_l2 like '%"+perName+"%' or pers.fnumber like '%"+perName+"%' ) "
|
|
|
- + " and topp.FAdminOrgUnitID in ("+ToolUtils.aryToStr(authorizedOrgIds,true)+ ") ";
|
|
|
+ //权限过滤
|
|
|
+ String permStr = addPermissionFilterSql(ctx);
|
|
|
+ String filterStr = " and ( pers.fname_l2 like '%"+perName+"%' or pers.fnumber like '%"+perName+"%' ) " + permStr;
|
|
|
if(!StringUtils.isEmpty(orgId)) {
|
|
|
- filterStr = " and ( pers.fname_l2 like '%"+perName+"%' or pers.fnumber like '%"+perName+"%' ) "
|
|
|
- + " and topp.FAdminOrgUnitID = '"+orgId+"' "
|
|
|
- + " and topp.FAdminOrgUnitID in ("+ToolUtils.aryToStr(authorizedOrgIds,true)+ ") ";
|
|
|
+ filterStr = filterStr
|
|
|
+ + " and topp.FAdminOrgUnitID = '"+orgId+"' ";
|
|
|
}
|
|
|
return assemPersonData(ctx, filterStr);
|
|
|
}
|
|
@@ -149,7 +148,10 @@ public class GetOrgUtils {
|
|
|
if(StringUtils.equals("1", orgId)){
|
|
|
orgId = getRootOrg(ctx);
|
|
|
}
|
|
|
- String filterStr = " and topp.FAdminOrgUnitID = '"+orgId+"' ";
|
|
|
+ //权限过滤
|
|
|
+ String permStr = addPermissionFilterSql(ctx);
|
|
|
+ String filterStr = " and topp.FAdminOrgUnitID = '"+orgId+"' "+permStr;
|
|
|
+
|
|
|
if(!StringUtils.equals(checkType, "1")) {
|
|
|
List<String> orgIds = getAllSubOrg(ctx, orgId);
|
|
|
String aryToStr = ToolUtils.aryToStr(orgIds,true);
|
|
@@ -181,10 +183,21 @@ public class GetOrgUtils {
|
|
|
}
|
|
|
return personList;
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 添加权限过滤
|
|
|
+ */
|
|
|
+ public static String addPermissionFilterSql(Context ctx) throws BOSException, EASBizException {
|
|
|
+ //权限过滤
|
|
|
+ IPermission permission = PermissionFactory.getLocalInstance(ctx);
|
|
|
+ IObjectPK caller = ctx.getCaller();
|
|
|
+ Set authorizedOrgIds = permission.getAuthorizedOrgIds(caller, OrgType.Admin, null, "");
|
|
|
+ String filterStr = " and topp.FAdminOrgUnitID in ("+ToolUtils.aryToStr(authorizedOrgIds,true)+ ") ";
|
|
|
+ return filterStr;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
*
|
|
|
* @param type
|