organizationhelper.java

来自「公司自己开发的工作流引擎」· Java 代码 · 共 169 行

JAVA
169
字号
package cn.com.iaspec.workflow.helper;

import java.util.List;
import cn.com.iaspec.workflow.organize.ejb.OrganizationInfoEJB;
import org.apache.log4j.Logger;
import cn.com.iaspec.workflow.vo.workflow.SelectActorParam;
import cn.com.iaspec.workflow.organize.tree.SelectActorTree;
import java.util.ArrayList;

/**
 * <p>Title: 组织管理助手类</p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2005</p>
 *
 * <p>Company: IASPEC Technologies</p>
 *
 * @author xiesonglin
 * @version 1.0
 */
public class OrganizationHelper{
  private static Logger logger=Logger.getLogger(CaseWorkflowHelper.class);
  public OrganizationHelper(){
  }

  /**
   * 取得选择参与者树
   * @param userId 用户id
   * @param areaId 所属行政区id
   * @param activityId 活动id
   * @return 返回SelectActorTree列表
   * @throws Exception
   */
  public List getSelectActorTree(String userId,String areaId,long activityId)
      throws Exception{
    long startTime=System.currentTimeMillis();
    WorkflowEJBHandle handle=new WorkflowEJBHandle();
    OrganizationInfoEJB ejb=handle.getOrganizationInfoEJB();
    List result=ejb.getSelectActorTree(userId,areaId,activityId);
    logger.info("Execution getSelectActorTree time:"+(System.currentTimeMillis()-
        startTime)+" ms.");
    return result;
  }

  /**
   * 取得选择参与者树
   * @param userId 用户id
   * @param areaId 所属行政区id
   * @param actorParam 选择参与者设置参数
   * @return 返回SelectActorTree列表
   * @throws Exception
   */
  public List getSelectActorTree(String userId,String areaId,
      SelectActorParam actorParam)
      throws Exception{
    long startTime=System.currentTimeMillis();
    WorkflowEJBHandle handle=new WorkflowEJBHandle();
    OrganizationInfoEJB ejb=handle.getOrganizationInfoEJB();
    List result=ejb.getSelectActorTree(userId,areaId,actorParam);
    logger.info("Execution getSelectActorTree time:"+(System.currentTimeMillis()-
        startTime)+" ms.");
    return result;
  }

  /**
   * 根据参与者列表数据取出指定节点的所有子节点
   * @param treeList 参与者列表数据
   * @param id 树节点id
   * @param type 树节点类型
   * @return 子节点列表
   */
  public List getChildTreeByTreeList(List treeList,String id,String type)
      throws Exception{
    long startTime=System.currentTimeMillis();
    WorkflowEJBHandle handle=new WorkflowEJBHandle();
    OrganizationInfoEJB ejb=handle.getOrganizationInfoEJB();
    List result=ejb.getChildTreeByTreeList(treeList,id,type);
    logger.info("Execution getChildTreeByTreeList time:"+
        (System.currentTimeMillis()-startTime)+" ms.");
    return result;
  }

  /**
   * 根据参与者列表数据取出指定节点的信息
   * @param treeList 参与者列表数据
   * @param treeId 树节点id
   * @param treeType 树节点id
   * @return SelectActorTree 参与者信息
   */
  public SelectActorTree getTreeByTreeList(List treeList,String treeId,
      String treeType)
      throws Exception{
    long startTime=System.currentTimeMillis();
    WorkflowEJBHandle handle=new WorkflowEJBHandle();
    OrganizationInfoEJB ejb=handle.getOrganizationInfoEJB();
    SelectActorTree result=ejb.getTreeByTreeList(treeList,treeId,treeType);
    logger.info("Execution getTreeByTreeList time:"+(System.currentTimeMillis()-
        startTime)+" ms.");
    return result;
  }

  /**
   * 根据活动id取得选择参与者参数
   * @param activityId long
   * @return SelectActorParam
   * @throws Exception
   */
  public SelectActorParam getSelectActorParam(long activityId)
      throws Exception{
    long startTime=System.currentTimeMillis();
    WorkflowEJBHandle handle=new WorkflowEJBHandle();
    OrganizationInfoEJB ejb=handle.getOrganizationInfoEJB();
    SelectActorParam result=ejb.getSelectActorParam(activityId);
    logger.info("Execution getSelectActorParam time:"+(System.currentTimeMillis()-
        startTime)+" ms.");
    return result;
  }

  public List getForwardUserTreeList(long workItemId,String areaId,
      String userId)
      throws Exception{
    long startTime=System.currentTimeMillis();
    WorkflowEJBHandle handle=new WorkflowEJBHandle();
    OrganizationInfoEJB ejb=handle.getOrganizationInfoEJB();
    List userList=ejb.getForwardUserTreeList(workItemId,areaId,userId);
    logger.info("Execution getForwardUserTreeList cost time:"+
        (System.currentTimeMillis()-startTime)+" ms.");

    return userList;
  }

  /**
   * 将参与者信息列表排列成树状
   * @param treeList ArrayList
   * @return ArrayList
   */
  public ArrayList arrangeActorTree(ArrayList treeList)
      throws Exception{
    long startTime=System.currentTimeMillis();
    WorkflowEJBHandle handle=new WorkflowEJBHandle();
    OrganizationInfoEJB ejb=handle.getOrganizationInfoEJB();
    ArrayList result=ejb.arrangeActorTree(treeList);
    logger.info("Execution arrangeActorTree cost time:"+
        (System.currentTimeMillis()-startTime)+" ms.");
    return result;
  }

  /**
   * 取出要返回活动的办理人(可能有多个)
   * @param workitemId 当前流程实例id
   * @param returnToActId 要返回的活动定义id
   * @return Vector
   * @throws Exception
   */
  public ArrayList getReturnActorsActorTree(long proInstId,
      long returnToActDefId)
      throws Exception{
    long startTime=System.currentTimeMillis();
    WorkflowEJBHandle handle=new WorkflowEJBHandle();
    OrganizationInfoEJB ejb=handle.getOrganizationInfoEJB();
    ArrayList result=ejb.getReturnActorsActorTree(proInstId,returnToActDefId);
    logger.info("Execution getReturnActorsActorTree cost time:"+
        (System.currentTimeMillis()-startTime)+" ms.");
    return result;
  }

}

⌨️ 快捷键说明

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