/// <summary>
        /// 未认领的任务
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="userId">用户Id</param>
        /// <param name="topsize">返回的的记录条数</param>
        /// <returns>未认领的任务列表</returns>
        public DataTable ClaimWorkTask(UserInfo userInfo, string userId, int topsize)
        {
            var parameter = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.WorkFlowInstanceService_ClaimWorkTask);
            var dataTable = new DataTable(WorkTaskInstanceTable.TableName);

            ServiceUtil.ProcessWorkFlowDb(userInfo, parameter, dbProvider =>
            {
                var manager = new WorkFlowInstanceManager(dbProvider, userInfo);
                dataTable   = manager.ClaimWorkTask(userId, topsize);
            });
            return(dataTable);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 是否存在指定主子表单关联
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="ctrlLinkId">关联Id</param>
        /// <returns>
        /// true:存在
        /// false:不存在
        /// </returns>
        public bool ExistsControlsLink(UserInfo userInfo, string ctrlLinkId)
        {
            var parameter   = ParameterUtil.CreateWithOutMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName);
            var returnValue = false;

            ServiceUtil.ProcessWorkFlowDb(userInfo, parameter, dbProvider =>
            {
                var manager = new MainUserControlManager(dbProvider, userInfo);
                returnValue = manager.ExistsControlsLink(ctrlLinkId);
            });
            return(returnValue);
        }
        /// <summary>
        /// 依据主键获得任务授权列表
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="auserId">主键</param>
        /// <returns>任务授权列表</returns>
        public DataTable GetAccreditUserTable(UserInfo userInfo, string auserId)
        {
            var parameter = ParameterUtil.CreateWithOutMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName);
            var dataTable = new DataTable(AccreditUserTable.TableName);

            ServiceUtil.ProcessWorkFlowDb(userInfo, parameter, dbProvider =>
            {
                var manager = new AccreditUserManager(dbProvider, userInfo);
                dataTable   = manager.GetAccreditUserTable(auserId);
            });
            return(dataTable);
        }
Exemplo n.º 4
0
        /// <summary>
        /// 获得流程分类下的所有流程列表
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="classId">流程分类Id</param>
        /// <returns>流程分类列表</returns>
        public DataTable GetWorkFlowsByClassId(UserInfo userInfo, string classId)
        {
            var parameter = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.WorkFlowTemplateService_GetWorkFlowsByClassId);
            var dataTable = new DataTable(WorkTaskCommandsTable.TableName);

            ServiceUtil.ProcessWorkFlowDb(userInfo, parameter, dbProvider =>
            {
                var manager = new WorkFlowClassManager(dbProvider, userInfo);
                dataTable   = manager.GetWorkflowsByClassId(classId);
            });
            return(dataTable);
        }
        /// <summary>
        /// 获得指定处理者策略
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="operatorId">处理者Id</param>
        /// <returns>处理者策略</returns>
        public string GetOperRelation(UserInfo userInfo, string operatorId)
        {
            var parameter   = ParameterUtil.CreateWithOutMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName);
            var returnValue = string.Empty;

            ServiceUtil.ProcessWorkFlowDb(userInfo, parameter, dbProvider =>
            {
                var manager = new OperatorManager(dbProvider, userInfo);
                returnValue = manager.GetOperRelation(operatorId);
            });
            return(returnValue);
        }
Exemplo n.º 6
0
        /// <summary>
        /// 获得流程实例的审批列表
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="workflowInsId">流程实例Id</param>
        /// <returns>审批列表</returns>
        public DataTable GetAuditMessageTableByFlow(UserInfo userInfo, string workflowInsId)
        {
            var parameter = ParameterUtil.CreateWithOutMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName);
            var dataTable = new DataTable(AuditMessageTable.TableName);

            ServiceUtil.ProcessWorkFlowDb(userInfo, parameter, dbProvider =>
            {
                var manager = new AuditMessageManager(dbProvider, userInfo);
                dataTable   = manager.GetDT(AuditMessageTable.FieldWorkflowInsId, workflowInsId, AuditMessageTable.FieldAuditTime + " DESC ");
            });
            return(dataTable);
        }
Exemplo n.º 7
0
        /// <summary>
        /// 获得一个主表单
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="id">主表单主键</param>
        /// <returns>主表单表</returns>
        public DataTable GetMainUserControl(UserInfo userInfo, string id)
        {
            var parameter = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.WorkFlowUserControlService_GetMainUserControl);
            var dataTable = new DataTable(MainUserControlTable.TableName);

            ServiceUtil.ProcessWorkFlowDb(userInfo, parameter, dbProvider =>
            {
                var manager = new MainUserControlManager(dbProvider, userInfo);
                dataTable   = manager.GetMainUserControl(id);
            });
            return(dataTable);
        }
        /// <summary>
        /// 得到指定流程模版所有的超时设置列表
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="workFlowId">流程模版Id</param>
        /// <returns>超时设置列表</returns>
        public DataTable GetWorkFlowAllOutTimeTable(UserInfo userInfo, string workFlowId)
        {
            var parameter = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.WorkFlowTemplateService_GetWorkFlowAllOutTimeTable);
            var dataTable = new DataTable(WorkOutTimeTable.TableName);

            ServiceUtil.ProcessWorkFlowDb(userInfo, parameter, dbProvider =>
            {
                var manager = new WorkOutTimeManager(dbProvider, userInfo);
                dataTable   = manager.GetWorkFlowAllOutTimeTable(workFlowId);
            });
            return(dataTable);
        }
        /// <summary>
        /// 获得流程变量列表
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="workflowId">流程模板Id</param>
        /// <returns>流程变量列表</returns>
        public DataTable GetWorkFlowAllVar(UserInfo userInfo, string workflowId)
        {
            var parameter = ParameterUtil.CreateWithOutMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName);
            var dataTable = new DataTable(TaskVarTable.TableName);

            ServiceUtil.ProcessWorkFlowDb(userInfo, parameter, dbProvider =>
            {
                var manager = new TaskVarManager(dbProvider, userInfo);
                dataTable   = manager.GetWorkflowAllVar(workflowId);
            });
            return(dataTable);
        }
        /// <summary>
        /// 获得子表单隶属的主表单
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="userControlId">子表单id</param>
        /// <returns>子表单隶属的主表单列表</returns>
        public DataTable GetMainCtrlsOfChild(UserInfo userInfo, string userControlId)
        {
            var parameter = ParameterUtil.CreateWithOutMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName);
            var dataTable = new DataTable(UserControlsTable.TableName);

            ServiceUtil.ProcessWorkFlowDb(userInfo, parameter, dbProvider =>
            {
                var manager = new UserControlsManager(dbProvider, userInfo);
                dataTable   = manager.GetMainCtrlsOfChild(userControlId);
            });
            return(dataTable);
        }
Exemplo n.º 11
0
        /// <summary>
        /// 判断节点是否存在
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="workTaskId">任务模板Id</param>
        /// <returns>true:存在</returns>
        public bool ExistWorkTask(UserInfo userInfo, string workTaskId)
        {
            var returnValue = false;
            var parameter   = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.WorkFlowTemplateService_ExistWorkTask);

            ServiceUtil.ProcessWorkFlowDb(userInfo, parameter, dbProvider =>
            {
                var manager = new WorkTaskManager(dbProvider, userInfo);
                returnValue = manager.ExistTask(workTaskId);
            });
            return(returnValue);
        }
Exemplo n.º 12
0
        /// <summary>
        /// 获得任务名称
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="workTaskId">任务模板Id</param>
        /// <returns></returns>
        public string GetWorkTaskCaption(UserInfo userInfo, string workTaskId)
        {
            var returnValue = string.Empty;
            var parameter   = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.WorkFlowTemplateService_GetWorkTaskCaption);

            ServiceUtil.ProcessWorkFlowDb(userInfo, parameter, dbProvider =>
            {
                var manager = new WorkTaskManager(dbProvider, userInfo);
                returnValue = manager.GetTaskCaption(workTaskId);
            });
            return(returnValue);
        }
Exemplo n.º 13
0
        /// <summary>
        /// 判断节点实例是否都完成
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="workFlowId">工作流模板Id</param>
        /// <param name="workFlowInstanceId">工作流实例Id</param>
        /// <param name="judgeTaskId">待判断力的节点Id</param>
        /// <param name="taskTypeAndOr">节点类型:and、or</param>
        /// <returns></returns>
        public bool IsPassJudge(UserInfo userInfo, string workFlowId, string workFlowInstanceId, string judgeTaskId, string taskTypeAndOr)
        {
            bool returnValue = false;
            var  parameter   = ParameterUtil.CreateWithOutMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName);

            ServiceUtil.ProcessWorkFlowDb(userInfo, parameter, dbProvider =>
            {
                var manager = new WorkFlowHelperManager(dbProvider, userInfo);
                returnValue = manager.IsPassJudge(workFlowId, workFlowInstanceId, judgeTaskId, taskTypeAndOr);
            });
            return(returnValue);
        }
Exemplo n.º 14
0
        /// <summary>
        /// 判断任务实例是否已完成,以此来判断避免重复提交
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="worktaskInsId">任务实例Id</param>
        /// <returns></returns>
        public bool IsTaskInsCompleted(UserInfo userInfo, string worktaskInsId)
        {
            bool returnValue = false;
            var  parameter   = ParameterUtil.CreateWithOutMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName);

            ServiceUtil.ProcessWorkFlowDb(userInfo, parameter, dbProvider =>
            {
                var manager = new WorkFlowHelperManager(dbProvider, userInfo);
                returnValue = manager.IsTaskInsCompleted(worktaskInsId);
            });
            return(returnValue);
        }
        /// <summary>
        /// 依据主键获得附件列表
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="id">主键</param>
        /// <returns>任务附件列表</returns>
        public DataTable GetAttachmentTable(UserInfo userInfo, string id)
        {
            var parameter = ParameterUtil.CreateWithOutMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName);
            var dataTable = new DataTable(AttachmentTable.TableName);

            ServiceUtil.ProcessWorkFlowDb(userInfo, parameter, dbProvider =>
            {
                var manager = new AttachmentManager(dbProvider, userInfo);
                dataTable   = manager.GetDT(AttachmentTable.FieldId, id, AttachmentTable.FieldDeleteMark, 0);
            });
            return(dataTable);
        }
        /// <summary>
        /// 根据条件获得附件列表
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="names">字段</param>
        /// <param name="values">值</param>
        /// <returns>数据表</returns>
        public DataTable GetAttachmentByValues(UserInfo userInfo, string[] names, string[] values)
        {
            var dataTable = new DataTable(AttachmentTable.TableName);
            var parameter = ParameterUtil.CreateWithOutMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName);

            ServiceUtil.ProcessWorkFlowDb(userInfo, parameter, dbProvider =>
            {
                dataTable           = new AttachmentManager(dbProvider, userInfo).GetDT(names, values);
                dataTable.TableName = AttachmentTable.TableName;
            });
            return(dataTable);
        }
        /// <summary>
        /// 判断用户是否是该任务节点的操作者
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="userId">用户Id</param>
        /// <param name="workFlowId">流程模版Id</param>
        /// <param name="workTaskId">工作任务Id</param>
        /// <returns></returns>
        public bool IsTaskOperator(UserInfo userInfo, string userId, string workFlowId, string workTaskId)
        {
            bool returnValue = false;
            var  parameter   = ParameterUtil.CreateWithOutMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName);

            ServiceUtil.ProcessWorkFlowDb(userInfo, parameter, dbProvider =>
            {
                var manager = new AccreditUserManager(dbProvider, userInfo);
                returnValue = manager.IsTaskOperator(userId, workFlowId, workTaskId);
            });
            return(returnValue);
        }
        /// <summary>
        /// 得到流程模板实体
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="workflowId">流程模板Id</param>
        /// <returns>流程模板实体</returns>
        public WorkFlowTemplateEntity GetWorkFlowInfo(UserInfo userInfo, string workflowId)
        {
            var parameter = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.WorkFlowTemplateService_GetWorkFlowInfo);
            WorkFlowTemplateEntity entity = null;

            ServiceUtil.ProcessWorkFlowDb(userInfo, parameter, dbProvider =>
            {
                var manager = new WorkFlowTemplateManager(dbProvider, userInfo);
                entity      = manager.GetWorkflowInfo(workflowId);
            });
            return(entity);
        }
        /// <summary>
        /// 获得加签处理人
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="workflowId">流程模版id</param>
        /// <param name="worktaskId">任务模版id<</param>
        /// <param name="workflowInsId">流程实例id</param>
        /// <param name="worktaskInsId">任务实例id</param>
        /// <returns></returns>
        public DataTable GetTaskInsNextOperTable(UserInfo userInfo, string workflowId, string worktaskId, string workflowInsId, string worktaskInsId)
        {
            var parameter = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.WorkFlowInstanceService_GetTaskInsNextOperTable);
            var dataTable = new DataTable(WorkTaskInstanceTable.TableName);

            ServiceUtil.ProcessWorkFlowDb(userInfo, parameter, dbProvider =>
            {
                var manager = new WorkTaskInstanceManager(dbProvider, userInfo);
                dataTable   = manager.GetTaskInsNextOperTable(workflowId, worktaskId, workflowInsId, worktaskInsId);
            });
            return(dataTable);
        }
        /// <summary>
        /// 是否存在指定任务实例
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="worktaskInsId">任务实例id</param>
        /// <returns></returns>
        public bool WorkTaskInstanceExist(UserInfo userInfo, string worktaskInsId)
        {
            bool returnValue = false;
            var  parameter   = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.WorkFlowInstanceService_WorkTaskInstanceExist);

            ServiceUtil.ProcessWorkFlowDb(userInfo, parameter, dbProvider =>
            {
                var manager = new WorkTaskInstanceManager(dbProvider, userInfo);
                // 调用方法,并且返回运行结果
                returnValue = manager.Exists(worktaskInsId);
            });
            return(returnValue);
        }
        /// <summary>
        /// 任务任意退回
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="userId">用户Id</param>
        /// <param name="operatorInsId">退回的处理实例Id</param>
        /// <param name="backyy">退回原因</param>
        /// <param name="workflowInsId">上级</param>
        /// <returns></returns>
        public string WorkTaskBackry(UserInfo userInfo, string userId, string operatorInsId, string backyy, string workflowInsId)
        {
            string returnValue = string.Empty;
            var    parameter   = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.WorkFlowInstanceService_WorkTaskBackry);

            ServiceUtil.ProcessWorkFlowDb(userInfo, parameter, dbProvider =>
            {
                var manager = new WorkTaskInstanceManager(dbProvider, userInfo);
                // 调用方法,并且返回运行结果
                returnValue = manager.WorkTaskBackry(userId, operatorInsId, backyy, workflowInsId);
            });
            return(returnValue);
        }
        /// <summary>
        /// 获得任务实例提交后返回信息
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="worktaskInsId">任务实例id</param>
        /// <returns></returns>
        public string GetResultMsg(UserInfo userInfo, string worktaskInsId)
        {
            string returnValue = string.Empty;
            var    parameter   = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.WorkFlowInstanceService_GetResultMsg);

            ServiceUtil.ProcessWorkFlowDb(userInfo, parameter, dbProvider =>
            {
                var manager = new WorkTaskInstanceManager(dbProvider, userInfo);
                // 调用方法,并且返回运行结果
                returnValue = manager.GetResultMsg(worktaskInsId);
            });
            return(returnValue);
        }
        /// <summary>
        /// 我参与的任务
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="userId">用户Id</param>
        /// <param name="recordCount">记录数</param>
        /// <param name="pageIndex">当前页</param>
        /// <param name="pageSize">每页显示</param>
        /// <param name="flag">标志,默认为"All”</param>
        /// <param name="search">条件表达式</param>
        /// <returns>我参与的任务列表</returns>
        public DataTable WorkFlowAllTaskByPage(UserInfo userInfo, string userId, out int recordCount, int pageIndex = 0, int pageSize = 100, string flag = "All", string search = "")
        {
            var parameter     = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.WorkFlowInstanceService_WorkFlowAllTaskByPage);
            var dataTable     = new DataTable(WorkTaskInstanceTable.TableName);
            int myrecordCount = 0;

            ServiceUtil.ProcessWorkFlowDb(userInfo, parameter, dbProvider =>
            {
                var manager = new WorkFlowInstanceManager(dbProvider, userInfo);
                dataTable   = manager.WorkFlowAllTaskByPage(userId, out myrecordCount, pageIndex, pageSize, flag, search);
            });
            recordCount = myrecordCount;
            return(dataTable);
        }
        /// <summary>
        /// 未认领的任务(分页方式)
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="userId">用户Id</param>
        /// <param name="search">查询</param>
        /// <param name="recordCount">记录数</param>
        /// <param name="pageIndex">当前页</param>
        /// <param name="pageSize">每页显示</param>
        /// <param name="order">排序</param>
        /// <returns>未认领的任务列表</returns>
        public DataTable GetUnClaimedTaskByPage(UserInfo userInfo, string userId, string search, out int recordCount, int pageIndex = 0, int pageSize = 100, string order = null)
        {
            var parameter     = ParameterUtil.CreateWithOutMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName);
            var dataTable     = new DataTable(WorkTaskInstanceTable.TableName);
            int myrecordCount = 0;

            ServiceUtil.ProcessWorkFlowDb(userInfo, parameter, dbProvider =>
            {
                var manager = new WorkFlowInstanceManager(dbProvider, userInfo);
                dataTable   = manager.GetUnClaimedTaskByPage(userId, search, out myrecordCount, pageIndex, pageSize, order);
            });
            recordCount = myrecordCount;
            return(dataTable);
        }
Exemplo n.º 25
0
        /// <summary>
        /// 获得主表单分页列表
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="search">查询</param>
        /// <param name="recordCount">记录数</param>
        /// <param name="pageIndex">当前页</param>
        /// <param name="pageSize">每页显示</param>
        /// <param name="order">排序</param>
        /// <returns>数据表</returns>
        public DataTable GetMainUserControlByPage(UserInfo userInfo, string search, out int recordCount, int pageIndex = 0, int pageSize = 50, string order = null)
        {
            var parameter     = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.WorkFlowUserControlService_GetMainUserControlByPage);
            var dataTable     = new DataTable(WorkTaskInstanceTable.TableName);
            int myrecordCount = 0;

            ServiceUtil.ProcessWorkFlowDb(userInfo, parameter, dbProvider =>
            {
                var manager            = new MainUserControlManager(dbProvider, userInfo);
                string whereExpression = MainUserControlTable.FieldDeleteMark + " = 0 ";
                if (!string.IsNullOrEmpty(search))
                {
                    whereExpression += " AND " + search;
                }
                order = string.IsNullOrEmpty(order) ? MainUserControlTable.FieldSortCode : order;

                dataTable = manager.GetDTByPage(out myrecordCount, pageIndex, pageSize, whereExpression, order);
            });
            recordCount = myrecordCount;
            return(dataTable);
        }