|
@@ -47,7 +47,7 @@ public class GetOrgUtils {
|
|
/**
|
|
/**
|
|
* 获取人数
|
|
* 获取人数
|
|
* checkType不等于1的时候,则查询所有下级组织;
|
|
* checkType不等于1的时候,则查询所有下级组织;
|
|
- * 否则,只查询直接下级组织;
|
|
|
|
|
|
+ * 否则,1,只查询直接下级组织;
|
|
* @param ctx
|
|
* @param ctx
|
|
* @param orgId
|
|
* @param orgId
|
|
* @param checkType
|
|
* @param checkType
|
|
@@ -55,15 +55,21 @@ public class GetOrgUtils {
|
|
* @throws BOSException
|
|
* @throws BOSException
|
|
* @throws EASBizException
|
|
* @throws EASBizException
|
|
*/
|
|
*/
|
|
- public static int getPersonCount(Context ctx ,String orgId,String checkType) throws BOSException, EASBizException {
|
|
|
|
|
|
+ public static int getPersonCount(Context ctx ,String checkType,Map <String,String> paramMap ) throws BOSException, EASBizException {
|
|
|
|
+ String orgId = paramMap.get("orgId");
|
|
|
|
+ String isOfficer = paramMap.get("isOfficer");
|
|
//权限过滤
|
|
//权限过滤
|
|
String permStr = addPermissionFilterSql(ctx);
|
|
String permStr = addPermissionFilterSql(ctx);
|
|
String filterStr = " and topp.FAdminOrgUnitID = '"+orgId+"' "+permStr;
|
|
String filterStr = " and topp.FAdminOrgUnitID = '"+orgId+"' "+permStr;
|
|
|
|
+
|
|
try {
|
|
try {
|
|
if(!StringUtils.equals("1", checkType)) {
|
|
if(!StringUtils.equals("1", checkType)) {
|
|
List<String> orgIds = getAllSubOrg(ctx, orgId);
|
|
List<String> orgIds = getAllSubOrg(ctx, orgId);
|
|
filterStr = " and topp.FAdminOrgUnitID in ( "+ToolUtils.aryToStr(orgIds,true)+" ) "+permStr;
|
|
filterStr = " and topp.FAdminOrgUnitID in ( "+ToolUtils.aryToStr(orgIds,true)+" ) "+permStr;
|
|
}
|
|
}
|
|
|
|
+ if(StringUtils.equals("1", isOfficer)) {
|
|
|
|
+ filterStr += " and pers.CFIsCadre = 1 ";
|
|
|
|
+ }
|
|
String pinSql = pinPersonSql( "count",filterStr);
|
|
String pinSql = pinPersonSql( "count",filterStr);
|
|
IRowSet rs = DbUtil.executeQuery(ctx, pinSql);
|
|
IRowSet rs = DbUtil.executeQuery(ctx, pinSql);
|
|
while(rs.next()) {
|
|
while(rs.next()) {
|
|
@@ -121,11 +127,14 @@ public class GetOrgUtils {
|
|
* @throws BOSException
|
|
* @throws BOSException
|
|
* @throws EASBizException
|
|
* @throws EASBizException
|
|
*/
|
|
*/
|
|
- public static List getPersonFromName(Context ctx ,String orgId,String perName) throws BOSException, EASBizException {
|
|
|
|
|
|
+ public static List getPersonFromName(Context ctx ,HashMap<String,String> paraMap ) throws BOSException, EASBizException {
|
|
|
|
+ String orgId = paraMap.get("orgId");
|
|
if(StringUtils.equals("1", orgId)){
|
|
if(StringUtils.equals("1", orgId)){
|
|
orgId = getRootOrg(ctx);
|
|
orgId = getRootOrg(ctx);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ String perName = paraMap.get("perName");
|
|
|
|
+ //是否干部
|
|
|
|
+ String isOfficer = paraMap.get("isOfficer");
|
|
//权限过滤
|
|
//权限过滤
|
|
String permStr = addPermissionFilterSql(ctx);
|
|
String permStr = addPermissionFilterSql(ctx);
|
|
String filterStr = " and ( pers.fname_l2 like '%"+perName+"%' or pers.fnumber like '%"+perName+"%' ) " + permStr;
|
|
String filterStr = " and ( pers.fname_l2 like '%"+perName+"%' or pers.fnumber like '%"+perName+"%' ) " + permStr;
|
|
@@ -133,6 +142,9 @@ public class GetOrgUtils {
|
|
filterStr = filterStr
|
|
filterStr = filterStr
|
|
+ " and topp.FAdminOrgUnitID = '"+orgId+"' ";
|
|
+ " and topp.FAdminOrgUnitID = '"+orgId+"' ";
|
|
}
|
|
}
|
|
|
|
+ if(StringUtils.equals(isOfficer, "1")) {
|
|
|
|
+ filterStr += " and pers.CFIsCadre = 1 ";
|
|
|
|
+ }
|
|
return assemPersonData(ctx, filterStr);
|
|
return assemPersonData(ctx, filterStr);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -144,19 +156,25 @@ public class GetOrgUtils {
|
|
* @throws BOSException
|
|
* @throws BOSException
|
|
* @throws EASBizException
|
|
* @throws EASBizException
|
|
*/
|
|
*/
|
|
- public static List getPersonFromOrg(Context ctx ,String orgId,String checkType) throws BOSException, EASBizException {
|
|
|
|
|
|
+ public static List getPersonFromOrg(Context ctx ,String checkType,Map<String,String> paraMap ) throws BOSException, EASBizException {
|
|
|
|
+ String orgId = paraMap.get("orgId");
|
|
if(StringUtils.equals("1", orgId)){
|
|
if(StringUtils.equals("1", orgId)){
|
|
orgId = getRootOrg(ctx);
|
|
orgId = getRootOrg(ctx);
|
|
}
|
|
}
|
|
//权限过滤
|
|
//权限过滤
|
|
String permStr = addPermissionFilterSql(ctx);
|
|
String permStr = addPermissionFilterSql(ctx);
|
|
String filterStr = " and topp.FAdminOrgUnitID = '"+orgId+"' "+permStr;
|
|
String filterStr = " and topp.FAdminOrgUnitID = '"+orgId+"' "+permStr;
|
|
-
|
|
|
|
|
|
+
|
|
if(!StringUtils.equals(checkType, "1")) {
|
|
if(!StringUtils.equals(checkType, "1")) {
|
|
List<String> orgIds = getAllSubOrg(ctx, orgId);
|
|
List<String> orgIds = getAllSubOrg(ctx, orgId);
|
|
String aryToStr = ToolUtils.aryToStr(orgIds,true);
|
|
String aryToStr = ToolUtils.aryToStr(orgIds,true);
|
|
filterStr = " and topp.FAdminOrgUnitID in ("+aryToStr+") ";
|
|
filterStr = " and topp.FAdminOrgUnitID in ("+aryToStr+") ";
|
|
}
|
|
}
|
|
|
|
+ //是否干部
|
|
|
|
+ String isOfficer = paraMap.get("isOfficer");
|
|
|
|
+ if(StringUtils.equals(isOfficer, "1")) {
|
|
|
|
+ filterStr += " and pers.CFIsCadre = 1 ";
|
|
|
|
+ }
|
|
return assemPersonData(ctx, filterStr);
|
|
return assemPersonData(ctx, filterStr);
|
|
|
|
|
|
}
|
|
}
|