📄 sysmanageejbbean.java
字号:
package cn.com.iaspec.workflow.sysmanage.ejb;
import javax.ejb.SessionBean;
import javax.ejb.SessionContext;
import javax.ejb.CreateException;
import java.util.List;
import cn.com.iaspec.workflow.sysmanage.business.OrgUserManageService;
import cn.com.iaspec.workflow.vo.db.WfUser;
import cn.com.iaspec.workflow.organize.dao.WfUserDAO;
import cn.com.iaspec.workflow.vo.db.WfOrganization;
import cn.com.iaspec.workflow.organize.dao.WfOrganizationDAO;
import cn.com.iaspec.workflow.vo.db.WfRole;
import cn.com.iaspec.workflow.organize.dao.WfRoleDAO;
import cn.com.iaspec.workflow.sysmanage.business.SysManageService;
import java.util.Hashtable;
import cn.com.iaspec.workflow.sysmanage.dao.WfManageRoleAuthorizationDAO;
import cn.com.iaspec.workflow.sysmanage.business.ManagingRoleAuthService;
import java.rmi.RemoteException;
import cn.com.iaspec.workflow.client.web.formbean.RoleNodeFormbean;
import java.util.Map;
import cn.com.iaspec.workflow.sysmanage.dao.ManagingRoleDAO;
import cn.com.iaspec.workflow.sysmanage.business.RoleManageService;
public class SysManageEJBBean
implements SessionBean{
SessionContext sessionContext;
public void ejbCreate()
throws CreateException{
}
public void ejbRemove(){
}
public void ejbActivate(){
}
public void ejbPassivate(){
}
public void setSessionContext(SessionContext sessionContext){
this.sessionContext=sessionContext;
}
public List getOrgUserTree(String upOrgId,String areaId)
throws Exception{
OrgUserManageService service=new OrgUserManageService();
return service.getOrgUserTree(upOrgId,areaId);
}
public List queryUser(WfUser user)
throws Exception{
WfUserDAO dao=new WfUserDAO();
return dao.query(user);
}
public List queryOrg(WfOrganization org)
throws Exception{
WfOrganizationDAO dao=new WfOrganizationDAO();
return dao.query(org);
}
public void saveOrg(WfOrganization org)
throws Exception{
OrgUserManageService service=new OrgUserManageService();
service.saveOrg(org);
}
public void saveUser(WfUser user,String orgId)
throws Exception{
OrgUserManageService service=new OrgUserManageService();
service.saveUser(user,orgId);
}
public void addUserToOrg(List userList,String orgId)
throws Exception{
OrgUserManageService service=new OrgUserManageService();
service.addUserToOrg(userList,orgId);
}
public void deleteUser(String userId)
throws Exception{
OrgUserManageService service=new OrgUserManageService();
service.deleteUser(userId);
}
public List queryFreeUser()
throws Exception{
WfUserDAO dao=new WfUserDAO();
return dao.queryFreeUser();
}
public void deleteUserFromOrg(String userId,String orgId)
throws Exception{
OrgUserManageService service=new OrgUserManageService();
service.deleteUserFromOrg(userId,orgId);
}
public List querySelectParentOrgList(String upOrgId,String orgId,String areaId)
throws Exception{
WfOrganizationDAO dao=new WfOrganizationDAO();
return dao.querySelectParentOrgList(upOrgId,orgId,areaId);
}
public List queryRole(WfRole role) throws Exception{
WfRoleDAO dao=new WfRoleDAO();
return dao.query(role);
}
public void saveRole(WfRole role) throws Exception{
SysManageService service = new SysManageService();
service.saveRole(role);
}
public void addUserToRole(List userList,String roleId) throws Exception{
SysManageService service = new SysManageService();
service.addUserToRole(userList,roleId);
}
public void deleteUserFromRole(String userId,String roleId) throws Exception{
SysManageService service=new SysManageService();
service.deleteUserFromRole(userId,roleId);
}
public List getOrgUserTree(String upOrgId,String areaId,String userId) throws Exception{
OrgUserManageService service=new OrgUserManageService();
return service.getOrgUserTree(upOrgId,areaId,userId);
}
public List querySelectParentOrgList(String upOrgId,String orgId, String areaId,String userId) throws Exception{
WfOrganizationDAO dao=new WfOrganizationDAO();
return dao.querySelectParentOrgList(upOrgId,orgId,areaId,userId);
}
public Hashtable getOrgOperationAuthorization(String orgId,String userId) throws Exception{
WfOrganizationDAO dao=new WfOrganizationDAO();
return dao.getOrgOperationAuthorization(orgId,userId);
}
public Hashtable getManagedUserOperationAuthorization(String managedUserId,String userId) throws Exception{
WfUserDAO dao=new WfUserDAO();
return dao.getManagedUserOperationAuthorization(managedUserId,userId);
}
public boolean isLoginUserCreateOrg(String userId,String OrgId) throws Exception{
WfOrganizationDAO dao=new WfOrganizationDAO();
return dao.isLoginUserCreateOrg(userId,OrgId);
}
public boolean isLoginUserCreateUser(String loginUserId,String managedUserId) throws Exception{
WfUserDAO dao=new WfUserDAO();
return dao.isLoginUserCreateUser(loginUserId,managedUserId);
}
public List getRoleOrgUserTree(String parentId,String areaId,String roleId,
String parentType,String userId,boolean isAdmin) throws Exception{
OrgUserManageService service=new OrgUserManageService();
return service.getRoleOrgUserTree(parentId,areaId,roleId,parentType,userId,isAdmin);
}
public void addOrgUserToRole(List orgList,List userList,String roleId,
List orgOperationList,List userOperationList) throws Exception{
OrgUserManageService service=new OrgUserManageService();
service.addOrgUserToRole(orgList,userList,roleId,orgOperationList,userOperationList);
}
public void moveOrgFromRole(String orgId,String roleId) throws Exception{
SysManageService service=new SysManageService();
service.moveOrgFromRole(orgId,roleId);
}
public void moveUserFromRole(String userId,String roleId) throws Exception{
SysManageService service=new SysManageService();
service.moveUserFromRole(userId,roleId);
}
public Hashtable getManagedRoleOrgOperationAuthorization(String manageRoleId,
String orgId) throws Exception{
WfManageRoleAuthorizationDAO dao = new WfManageRoleAuthorizationDAO();
return dao.getManagedRoleOrgOperationAuthorization(manageRoleId,orgId);
}
public void updateOrgOperation(String orgId,String roleId,
String selectOrgOperations) throws Exception{
SysManageService service=new SysManageService();
service.updateOrgOperation(orgId,roleId,selectOrgOperations);
}
public Hashtable getManagedRoleUserOperationAuthorization(String manageRoleId,
String userId) throws Exception{
WfManageRoleAuthorizationDAO dao = new WfManageRoleAuthorizationDAO();
return dao.getManagedRoleUserOperationAuthorization(manageRoleId,userId);
}
public void updateUserOperation(String userId,String roleId,
String selectUserOperations) throws Exception{
SysManageService service=new SysManageService();
service.updateUserOperation(userId,roleId,selectUserOperations);
}
/**
*查询当前用户能管理的管理角色
*
* @param areaId String 区域ID
* @param roleId String 选中角色的ID
* @param roleType String 选中角色的类型
* @param userId String 用户ID
* @param isAdmin boolean 是否是管理员,管理员能见所有角色
* @return List
* @throws Exception
*/
public List getManagingRoleRoleTree(String areaId,String roleId,
String managingRoleId,String roleType,String userId,boolean isAdmin)
throws Exception{
ManagingRoleAuthService service = new ManagingRoleAuthService();
return service.getManagingRoleRoleTree(areaId,roleId,managingRoleId,
roleType,userId,isAdmin);
}
/**
* 查询角色的详细信息
*
* @param roleId String 角色ID
* @return RoleNodeFormbean
* @throws Exception
*/
public RoleNodeFormbean getRoleInfo(String roleId)
throws RemoteException,Exception{
ManagingRoleAuthService service = new ManagingRoleAuthService();
return service.getRoleInfo(roleId);
}
/**
* 查询附属在某管理角色下的普通角色的操作权限
*
* @param roleId String 普通角色ID
* @param managingRoleId String 管理角色ID
* @return Map
* @throws Exception
*/
public Map getRoleGrantedOprMap(String roleId,String managingRoleId)
throws Exception{
ManagingRoleAuthService service=new ManagingRoleAuthService();
return service.getRoleGrantedOprMap(roleId,managingRoleId);
}
//
// public void addRoleOperation(String roleId,String managingRoleId,List operationList)
// throws Exception{
// ManagingRoleAuthService service=new ManagingRoleAuthService();
//
// service.addRoleOperation(roleId,managingRoleId,operationList);
// }
//
/**
* 更新附属在某管理角色下的普通角色的操作权限
*
* @param roleId String 普通角色ID
* @param managingRoleId String 管理角色ID
* @param oprList List 操作权限列表(String..)
* @throws Exception
*/
public void updateRoleOperation(String roleId,String managingRoleId,List operationList)
throws Exception{
ManagingRoleAuthService service=new ManagingRoleAuthService();
service.updateRoleOperation(roleId,managingRoleId,operationList);
}
/**
* 根据用户ID和角色ID,查询所有下级角色
*
* @param areaId String
* @param roleId String 角色ID
* @param userId String 用户ID
* @param isAdmin boolean 是否是管理员,管理员能见所有角色
* @return List
* @throws Exception
*/
public List getRoleTree(String areaId,String roleId,String userId, boolean isAdmin)
throws Exception{
ManagingRoleAuthService service=new ManagingRoleAuthService();
return service.getRoleTree(areaId,roleId,userId,isAdmin);
}
/**
* 为某个管理角色增加管辖的普通角色及在这些角色上的操作权限
*
* @param managingRoleId String 管理角色ID
* @param roleIdList List 角色列表(String...)
* @param operationList List 操作权限列表(String...)
* @throws Exception
*/
public void addRole2ManagingRole(String managingRoleId,List roleIdList,List operationList)
throws Exception{
ManagingRoleAuthService service=new ManagingRoleAuthService();
service.addRole2ManagingRole(managingRoleId,roleIdList,operationList);
}
public List getExtFieldList(String caller)throws Exception{
List extFieldList = null;
if("org".equals(caller)){
OrgUserManageService orgUserSvc = new OrgUserManageService();
extFieldList = orgUserSvc.getOrgExtFieldList();
}else if("role".equals(caller)){
RoleManageService roleSvc = new RoleManageService();
extFieldList = roleSvc.getRoleExtFieldList();
}else if("user".equals(caller)){
OrgUserManageService orgUserSvc = new OrgUserManageService();
extFieldList = orgUserSvc.getUserExtFieldList();
}
return extFieldList;
}
/**
* 根据组织ID查询组织信息
*
* @param orgId String
* @return WfOrganization
* @throws Exception
*/
public WfOrganization queryOrgById(String orgId)throws Exception{
OrgUserManageService orgService = new OrgUserManageService();
WfOrganization orgInfo = orgService.queryOrgById(orgId);
return orgInfo;
}
/**
* 根据角色ID查询角色信息
*
* @param roleId String
* @return WfRole
* @throws Exception
*/
public WfRole queryRoleById(String roleId)throws Exception{
RoleManageService roleService = new RoleManageService();
WfRole roleInfo = roleService.queryRoleById(roleId);
return roleInfo;
}
/**
* 根据用户ID查询用户信息
*
* @param userId String
* @return WfUser
* @throws Exception
*/
public WfUser queryUserById(String userId)throws Exception{
OrgUserManageService userService = new OrgUserManageService();
WfUser userInfo = userService.queryUserById(userId);
return userInfo;
}
public List queryOrgTreeList(String orgId,String areaId,String userId)throws Exception{
OrgUserManageService orgService = new OrgUserManageService();
List orgTreeList = orgService.queryOrgTreeList(orgId,areaId,userId);
return orgTreeList;
}
public List queryOrgTreeList(String orgId,String areaId)throws Exception{
OrgUserManageService orgService = new OrgUserManageService();
List orgTreeList = orgService.queryOrgTreeList(orgId,areaId);
return orgTreeList;
}
public void transferUser(String originalOrgId,String destinationOrgId,String userId)throws Exception{
OrgUserManageService userService = new OrgUserManageService();
userService.transferUser(originalOrgId,destinationOrgId,userId);
}
public void removeManagedRel(String managingRoleId,String roleId)throws Exception{
ManagingRoleAuthService userService = new ManagingRoleAuthService();
userService.removeManagedRel(managingRoleId,roleId);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -