⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rolemanagecontrol.java

📁 公司自己开发的工作流引擎
💻 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: 深圳市劳动仲裁信息管理系统</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;

  }

  /**
   * 删除该用户和该角色的关系
   * @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;
  }

  /**
   * 根据角色查询
   * @param role_id String
   * @return RoleInfo
   * @throws RoleManageException
   */
  public RoleInfo getRoleInfo(String role_id)
      throws RoleManageException{
    return roleManageDAO.getRoleInfo(role_id);
  }

  /**
   * 添加多个用户到角色中
   * @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+"'";
  }

  /**
   * 获取登陆用户对管理权限范围内的指定部门的操作权限集合
   * @param String orgId,String userId
   * @throws SQLException
   * @return Hashtable
   */
  public Hashtable getManagedRoleOperationAuthorization(String managedRoleId,
      String userId)
      throws SQLException{
    return roleManageDAO.getManagedRoleOperationAuthorization(managedRoleId,
        userId);
  }

  /**
   * 判断指定角色是否是登陆用户创建
   * @param String userId,String OrgId
   * @throws SQLException
   * @return boolean
   */
  public boolean isLoginUserCreateRole(String userId,String roleId)
      throws SQLException{
    return roleManageDAO.isLoginUserCreateRole(userId,roleId);
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -