?? rolemanagecontrol.java
字號:
package cn.com.iaspec.workflow.manage.business;
import java.sql.*;
import java.util.*;
import cn.com.iaspec.workflow.db.*;
import cn.com.iaspec.workflow.manage.*;
import cn.com.iaspec.workflow.manage.dao.*;
import cn.com.iaspec.workflow.vo.workflow.*;
/**
* <p>Title: 角色信息控制</p>
*
* <p>Description: 深圳市勞動仲裁信息管理系統(tǒng)</p>
*
* <p>Copyright: Copyright (c) 2005</p>
*
* <p>Company: 永泰軟件工程有限公司</p>
*
* @author syj
* @version 1.0
*/
public class RoleManageControl{
GetRoleManageDAO roleManageDAO=new GetRoleManageDAO();
PurviewManageControl manageControl=new PurviewManageControl();
/**
*
* @return ArrayList
*/public ArrayList getCollectionInfo(String area_id)
throws RoleManageException{
ArrayList list1=new ArrayList();
ArrayList list2=new ArrayList();
ArrayList list=new ArrayList();
list1=roleManageDAO.getUserInfo(area_id);
list2=roleManageDAO.getRoleManageInfo();
list.addAll(list1);
list.addAll(list2);
return list;
}
public ArrayList getCollectionInfo(String area_id,String userId)
throws RoleManageException{
ArrayList list1=new ArrayList();
ArrayList list2=new ArrayList();
ArrayList list=new ArrayList();
list1=roleManageDAO.getUserInfo(area_id,userId);
list2=roleManageDAO.getRoleManageInfo(userId);
list.addAll(list1);
list.addAll(list2);
return list;
}
/**
* 添加角色信息
* @param roleinfo RoleInfo
* @return int
* @throws RoleManageException
*/
public int insertRole(RoleInfo roleinfo)
throws RoleManageException{
int i=0;
i=roleManageDAO.check_role(roleinfo);
if(i!=2){
i=roleManageDAO.insertRole(roleinfo);
}
return i;
}
/**
* 更新角色信息
* @param roleinfo RoleInfo
* @return int
* @throws RoleManageException
*/
public int updateRoleInfo(RoleInfo roleinfo)
throws RoleManageException{
int i=0;
i=roleManageDAO.updateRoleInfo(roleinfo);
return i;
}
/**
* 刪除角色信息
* @param role_id String
* @return int
* @throws RoleManageException
*/
public int deleteRole(String role_id)
throws RoleManageException{
int i=0;
i=roleManageDAO.deleteRole(role_id);
return i;
}
/**
* 刪除該用戶和該角色的關(guān)系
* @param user_id String
* @param role_id String
* @param role_value String
* @return int
* @throws RoleManageException
*/
public int updateLa_user_role(String user_id,String role_id,String role_value)
throws RoleManageException{
int i=0;
i=roleManageDAO.updatewf_role_user(user_id,role_id,role_value);
return i;
}
/**
* 根據(jù)角色查詢
* @param role_id String
* @return RoleInfo
* @throws RoleManageException
*/
public RoleInfo getRoleInfo(String role_id)
throws RoleManageException{
return roleManageDAO.getRoleInfo(role_id);
}
/**
* 添加多個(gè)用戶到角色中
* @param role_id String
* @param userinfo String
* @return int
*/
public int addwf_role_user(String role_id,String userinfo)
throws RoleManageException{
int i=0;
Connection conn=null;
try{
conn=WorkflowDBConnectionManager.getInstance().getConnection();
String[] array1=userinfo.split("&");
for(int j=0;j<array1.length;j++){
String[] array2=array1[j].toString().split("|");
// System.out.println("---role_id="+role_id+"--array2[ 0 ]=="+array2[ 0 ]+"---array2[ 3 ]="+array2[ 3 ]);
i=roleManageDAO.addwf_role_user(conn,role_id,array2[0],array2[3]);
}
}
catch(Exception e){
e.printStackTrace();
throw new RoleManageException();
}
finally{
WorkflowDBConnectionManager.getInstance().close(conn);
}
return i;
}
public String StringTool(String st){
return "'"+st+"'";
}
/**
* 獲取登陸用戶對管理權(quán)限范圍內(nèi)的指定部門的操作權(quán)限集合
* @param String orgId,String userId
* @throws SQLException
* @return Hashtable
*/
public Hashtable getManagedRoleOperationAuthorization(String managedRoleId,
String userId)
throws SQLException{
return roleManageDAO.getManagedRoleOperationAuthorization(managedRoleId,
userId);
}
/**
* 判斷指定角色是否是登陸用戶創(chuàng)建
* @param String userId,String OrgId
* @throws SQLException
* @return boolean
*/
public boolean isLoginUserCreateRole(String userId,String roleId)
throws SQLException{
return roleManageDAO.isLoginUserCreateRole(userId,roleId);
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -