|
@@ -36,6 +36,7 @@ public class GetAdminInfoService implements IHRMsfService {
|
|
|
public Object process(Context ctx, Map<String, Object> param) throws EASBizException, BOSException {
|
|
|
String orgId = StringUtils.cnulls(param.get("orgId"));
|
|
|
String checkType = StringUtils.cnulls(param.get("checkType"));
|
|
|
+ String isOfficer = StringUtils.cnulls(param.get("isOfficer"));
|
|
|
if(StringUtils.equals("1", orgId)){
|
|
|
orgId = GetOrgUtils.getRootOrg(ctx);
|
|
|
}
|
|
@@ -43,7 +44,10 @@ public class GetAdminInfoService implements IHRMsfService {
|
|
|
logger.error("查询到orgId为空");
|
|
|
return new ArrayList();
|
|
|
}
|
|
|
- return getSubOrgAndPerson(ctx, orgId,checkType);
|
|
|
+ Map <String,String> map = new HashMap();
|
|
|
+ map.put("orgId", orgId);
|
|
|
+ map.put("isOfficer", isOfficer);
|
|
|
+ return getSubOrgAndPerson(ctx,checkType,map);
|
|
|
}
|
|
|
|
|
|
|
|
@@ -58,7 +62,9 @@ public class GetAdminInfoService implements IHRMsfService {
|
|
|
* @throws BOSException
|
|
|
* @throws EASBizException
|
|
|
*/
|
|
|
- private List getSubOrgAndPerson(Context ctx,String orgId,String checkType) throws BOSException, EASBizException {
|
|
|
+ private List getSubOrgAndPerson(Context ctx, String checkType,Map <String,String> paramMap ) throws BOSException, EASBizException {
|
|
|
+ String orgId = paramMap.get("orgId");
|
|
|
+ String isOfficer = paramMap.get("isOfficer");
|
|
|
List<Map> maplist = new ArrayList();
|
|
|
IAdminOrgUnit iAdminOrgUnit = AdminOrgUnitFactory.getLocalInstance(ctx);
|
|
|
EntityViewInfo view = new EntityViewInfo();
|
|
@@ -77,19 +83,22 @@ public class GetAdminInfoService implements IHRMsfService {
|
|
|
view.setSorter(sc);
|
|
|
AdminOrgUnitCollection col = iAdminOrgUnit.getAdminOrgUnitCollection(view);
|
|
|
|
|
|
- HashMap<String, Integer> admPersonMap = getDirectSubCol(ctx);
|
|
|
+ HashMap<String, Integer> admPersonMap = getDirectSubCol(ctx,isOfficer);
|
|
|
for(int i =0; i < col.size(); i++) {
|
|
|
AdminOrgUnitInfo adminInfo = col.get(i);
|
|
|
Map map = new HashMap();
|
|
|
map.put("id", adminInfo.getId().toString());
|
|
|
map.put("name", adminInfo.getName().toString());
|
|
|
String adminId = adminInfo.getId().toString();
|
|
|
+
|
|
|
if(admPersonMap.containsKey(adminId)) {
|
|
|
map.put("count",admPersonMap.get(adminId));
|
|
|
}else {
|
|
|
map.put("count",0);
|
|
|
}
|
|
|
- int totalCount = GetOrgUtils.getPersonCount (ctx, adminInfo.getId().toString(),"0");
|
|
|
+ //传参
|
|
|
+ paramMap.put("orgId", adminId);
|
|
|
+ int totalCount = GetOrgUtils.getPersonCount (ctx, "0" ,paramMap);
|
|
|
if(totalCount > 0 ){
|
|
|
map.put("totalCount",totalCount);
|
|
|
maplist.add(map);
|
|
@@ -100,12 +109,15 @@ public class GetAdminInfoService implements IHRMsfService {
|
|
|
}
|
|
|
|
|
|
//获取所有的组织与组织的直接人数
|
|
|
- public HashMap<String, Integer> getDirectSubCol(Context ctx) throws BOSException {
|
|
|
+ public HashMap<String, Integer> getDirectSubCol(Context ctx,String isOfficer) throws BOSException {
|
|
|
HashMap<String, Integer> admPersonMap = new HashMap ();
|
|
|
try {
|
|
|
//权限
|
|
|
String perStr = GetOrgUtils.addPermissionFilterSql(ctx);
|
|
|
String filterStr = " and admOrg.fisSealUp <> 1 " +perStr;
|
|
|
+ if(StringUtils.equals(isOfficer, "1")) {
|
|
|
+ filterStr += " and pers.CFIsCadre = 1 ";
|
|
|
+ }
|
|
|
String pinSql = GetOrgUtils.pinPersonSql( "adminPerson",filterStr);
|
|
|
IRowSet rs = DbUtil.executeQuery(ctx, pinSql);
|
|
|
while(rs.next()) {
|