yuanzhi_kuang пре 7 месеци
родитељ
комит
d139fc24ba

+ 0 - 12
websrc/com/kingdee/shr/affair/web/handler/hrman/FlucInBizBillHrManEditHandlerEx.java

@@ -1,12 +0,0 @@
-package com.kingdee.shr.affair.web.handler.hrman;
-
-/**
- * µ÷¶¯µ¥ µ¥ÈË
- * @author Administrator
- *
- */
-public class FlucInBizBillHrManEditHandlerEx extends FlucInBizBillHrManEditHandler {
-
-	
-	
-}

+ 0 - 30
websrc/com/kingdee/shr/affair/web/handler/hrman/ResignBizBillHrManEditHandlerEx.java

@@ -1,30 +0,0 @@
-package com.kingdee.shr.affair.web.handler.hrman;
-
-import java.io.IOException;
-
- import com.kingdee.shr.custom.sendfile.GetElectronFile;
- import org.springframework.http.ResponseEntity;
-  import org.springframework.core.io.Resource ;
-  import java.util.Base64;
-  import java.io.InputStream;
-  import java.io.ByteArrayOutputStream;
-  import java.io.IOException;
-
-
-public class ResignBizBillHrManEditHandlerEx extends ResignBizBillHrManEditHandler {
-
-//
-//    public void submitEffectAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException {
-//        super.submitEffectAction(request, response, modelMap);
-//		Context ctx = SHRContext.getInstance().getContext();
-//		SendMsg sendMsg = new SendMsg();
-//		try {
-//			sendMsg.getAttFile(ctx, "G5zN4EV1QU+aocca+f8bNvSvTwM , "111");
-//		} catch (IOException e) {
-//			e.printStackTrace();
-//		}
-//    }
-
-
-
-}

+ 20 - 20
websrc/com/kingdee/shr/custom/service/GetAdminInfoService.java

@@ -1,23 +1,9 @@
 package com.kingdee.shr.custom.service;
 
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 import com.kingdee.bos.BOSException;
 import com.kingdee.bos.Context;
 import com.kingdee.bos.bsf.service.app.IHRMsfService;
-import com.kingdee.bos.metadata.entity.EntityViewInfo;
-import com.kingdee.bos.metadata.entity.FilterInfo;
-import com.kingdee.bos.metadata.entity.FilterItemInfo;
-import com.kingdee.bos.metadata.entity.SelectorItemCollection;
-import com.kingdee.bos.metadata.entity.SorterItemCollection;
-import com.kingdee.bos.metadata.entity.SorterItemInfo;
+import com.kingdee.bos.metadata.entity.*;
 import com.kingdee.bos.metadata.query.util.CompareType;
 import com.kingdee.eas.basedata.org.AdminOrgUnitCollection;
 import com.kingdee.eas.basedata.org.AdminOrgUnitFactory;
@@ -27,6 +13,14 @@ import com.kingdee.eas.common.EASBizException;
 import com.kingdee.eas.util.app.DbUtil;
 import com.kingdee.jdbc.rowset.IRowSet;
 import com.kingdee.util.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
 public class GetAdminInfoService implements IHRMsfService {
 	private static final Logger logger = LoggerFactory.getLogger(GetAdminInfoService.class);
@@ -34,7 +28,7 @@ public class GetAdminInfoService implements IHRMsfService {
 	 /**
      * 组织下属组织
      * @param ctx
-     * @param adminOrgId
+     * @param param
      * @return
      * @throws BOSException
      * @throws SQLException
@@ -96,8 +90,10 @@ public class GetAdminInfoService implements IHRMsfService {
         		map.put("count",0);
         	}
         	int totalCount = GetOrgUtils.getPersonCount (ctx, adminInfo.getId().toString(),"0");
-        	map.put("totalCount",totalCount);
-        	maplist.add(map);
+			if(totalCount > 0  ){
+				map.put("totalCount",totalCount);
+				maplist.add(map);
+			}
         }
         return maplist;
 		
@@ -107,7 +103,9 @@ public class GetAdminInfoService implements IHRMsfService {
 	public  HashMap<String, Integer>  getDirectSubCol(Context ctx) throws BOSException {
 		HashMap<String, Integer> admPersonMap = new HashMap ();
 		try {
-	        String filterStr = " and admOrg.fisSealUp <> 1 ";
+			//权限
+			String perStr = GetOrgUtils.addPermissionFilterSql(ctx);
+			String filterStr = " and admOrg.fisSealUp <> 1 " +perStr;
 	        String pinSql = GetOrgUtils.pinPersonSql( "adminPerson",filterStr);
 			IRowSet rs = DbUtil.executeQuery(ctx, pinSql);
 			while(rs.next()) {
@@ -117,7 +115,9 @@ public class GetAdminInfoService implements IHRMsfService {
 			}
 		} catch (SQLException e) {
 			e.printStackTrace();
-		} 
+		} catch (EASBizException e) {
+			throw new RuntimeException(e);
+		}
 		return admPersonMap;
 	}
 }

+ 28 - 15
websrc/com/kingdee/shr/custom/service/GetOrgUtils.java

@@ -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