Exemplo n.º 1
0
        /// <summary>
        /// 是否存在指定任务命令
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="commandId">任务命令Id</param>
        /// <returns>true存在</returns>
        public bool ExistsWorkTaskCommands(UserInfo userInfo, string commandId)
        {
            var returnValue = false;
            var parameter   = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.WorkFlowTemplateService_ExistsWorkTaskCommands);

            ServiceUtil.ProcessWorkFlowDbWithTransaction(userInfo, parameter, dbProvider =>
            {
                var manager = new WorkTaskCommandsManager(dbProvider, userInfo);
                returnValue = manager.Exists(commandId);
            });
            return(returnValue);
        }
        /// <summary>
        /// 设置流程模版分类
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="workflowId">流程模板Id</param>
        /// <param name="wfclassid">流程分类Id</param>
        /// <returns>大于0设置成功</returns>
        public int SetWorkFlowClass(UserInfo userInfo, string workflowId, string wfclassid)
        {
            var returnValue = -1;
            var parameter   = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.WorkFlowTemplateService_SetWorkFlowClass);

            ServiceUtil.ProcessWorkFlowDbWithTransaction(userInfo, parameter, dbProvider =>
            {
                var manager = new WorkFlowTemplateManager(dbProvider, userInfo);
                returnValue = manager.SetWorkflowClass(workflowId, wfclassid);
            });
            return(returnValue);
        }
        /// <summary>
        /// 设定处理者实例正常结束
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="userId">用户Id</param>
        /// <param name="operatorInsId">操作者实例id</param>
        /// <returns>大于0成功</returns>
        public int SetOperatorInstanceOver(UserInfo userInfo, string userId, string operatorInsId)
        {
            int returnValue = -1;
            var parameter   = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.WorkFlowInstanceService_SetOperatorInstanceOver);

            ServiceUtil.ProcessWorkFlowDbWithTransaction(userInfo, parameter, dbProvider =>
            {
                var manager = new OperatorInstanceManager(dbProvider, userInfo);
                returnValue = manager.SetOperatorInstanceOver(userId, operatorInsId);
            });
            return(returnValue);
        }
        /// <summary>
        /// 我异常终止的任务个数
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="userId">用户id</param>
        /// <returns>我异常终止的任务数</returns>
        public int GetAbnormalTaskCount(UserInfo userInfo, string userId)
        {
            int returnValue = -1;
            var parameter   = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.WorkFlowInstanceService_GetAbnormalTaskCount);

            ServiceUtil.ProcessWorkFlowDbWithTransaction(userInfo, parameter, dbProvider =>
            {
                var manager = new WorkFlowInstanceManager(dbProvider, userInfo);
                returnValue = manager.GetAbnormalTaskCount(userId);
            });
            return(returnValue);
        }
        /// <summary>
        /// 根据主键删除附件
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="id">主键</param>
        /// <returns>大于0成功</returns>
        public int DeleteAttachment(UserInfo userInfo, string id)
        {
            var returnValue = -1;
            var parameter   = ParameterUtil.CreateWithOutMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName);

            ServiceUtil.ProcessWorkFlowDbWithTransaction(userInfo, parameter, dbProvider =>
            {
                var manager = new AttachmentManager(dbProvider, userInfo);
                returnValue = manager.Delete(id);
            });
            return(returnValue);
        }
        /// <summary>
        /// 更新任务授权
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="entity">实体</param>
        /// <returns>大于0成功</returns>
        public int UpdateAccreditUser(UserInfo userInfo, AccreditUserEntity entity)
        {
            var returnValue = -1;
            var parameter   = ParameterUtil.CreateWithOutMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName);

            ServiceUtil.ProcessWorkFlowDbWithTransaction(userInfo, parameter, dbProvider =>
            {
                var manager = new AccreditUserManager(dbProvider, userInfo);
                returnValue = manager.UpdateAccreditUser(entity);
            });
            return(returnValue);
        }
Exemplo n.º 7
0
        /// <summary>
        /// 修改任务节点
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="entity">任务节点实体</param>
        /// <returns>大于0修改成功</returns>
        public int UpdateWorkTask(UserInfo userInfo, WorkTaskEntity entity)
        {
            var returnValue = -1;
            var parameter   = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.WorkFlowTemplateService_UpdateWorkTask);

            ServiceUtil.ProcessWorkFlowDbWithTransaction(userInfo, parameter, dbProvider =>
            {
                var manager = new WorkTaskManager(dbProvider, userInfo);
                returnValue = manager.UpdateTask(entity);
            });
            return(returnValue);
        }
        /// <summary>
        /// 获得指定子表单
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="userControlId">子表单主键</param>
        /// <returns>子表单列表</returns>
        public DataTable GetChildUserControl(UserInfo userInfo, string userControlId)
        {
            var dataTable = new DataTable(UserControlsTable.TableName);
            var parameter = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.WorkFlowUserControlService_GetChildUserControl);

            ServiceUtil.ProcessWorkFlowDbWithTransaction(userInfo, parameter, dbProvider =>
            {
                var manager = new UserControlsManager(dbProvider, userInfo);
                dataTable   = manager.GetChildUserControl(userControlId);
            });
            return(dataTable);
        }
        /// <summary>
        /// 增加工作任务超时设置
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="entity">工作任务超时实体</param>
        /// <returns>增加成功返回实体主键</returns>
        public string InsertWorkOutTime(UserInfo userInfo, WorkOutTimeEntity entity)
        {
            var returnValue = string.Empty;
            var parameter   = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.WorkFlowTemplateService_InsertWorkOutTime);

            ServiceUtil.ProcessWorkFlowDbWithTransaction(userInfo, parameter, dbProvider =>
            {
                var manager = new WorkOutTimeManager(dbProvider, userInfo);
                returnValue = manager.InsertWorkOutTime(entity);
            });
            return(returnValue);
        }
        /// <summary>
        /// 根据工作任务模版主键删除超时设置记录
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="workTaskId">工作任务Id</param>
        /// <returns>大于0成功</returns>
        public int DeleteWorkOutTime(UserInfo userInfo, string workTaskId)
        {
            var returnValue = -1;
            var parameter   = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.WorkFlowTemplateService_DeleteWorkOutTime);

            ServiceUtil.ProcessWorkFlowDbWithTransaction(userInfo, parameter, dbProvider =>
            {
                var manager = new WorkOutTimeManager(dbProvider, userInfo);
                returnValue = manager.DeleteWorkOutTime(workTaskId);
            });
            return(returnValue);
        }
        /// <summary>
        /// 删除任务变量
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="taskVarId">任务变量主键</param>
        /// <returns>大于0成功</returns>
        public int DeleteTaskVar(UserInfo userInfo, string taskVarId)
        {
            var returnValue = -1;
            var parameter   = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.WorkFlowUserControlService_DeleteTaskVar);

            ServiceUtil.ProcessWorkFlowDbWithTransaction(userInfo, parameter, dbProvider =>
            {
                var manager = new TaskVarManager(dbProvider, userInfo);
                returnValue = manager.DeleteTaskVar(taskVarId);
            });
            return(returnValue);
        }
        /// <summary>
        /// 依据工作任务主键得到超时设置实体
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="worktaskid">工作任务Id</param>
        /// <returns>超时设置实体</returns>
        public WorkOutTimeEntity GetWorkOutTimeInfo(UserInfo userInfo, string worktaskid)
        {
            WorkOutTimeEntity returnValue = null;
            var parameter = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.WorkFlowTemplateService_GetWorkOutTimeInfo);

            ServiceUtil.ProcessWorkFlowDbWithTransaction(userInfo, parameter, dbProvider =>
            {
                var manager = new WorkOutTimeManager(dbProvider, userInfo);
                returnValue = manager.GetWorkOutTimeInfo(worktaskid);
            });
            return(returnValue);
        }
        /// <summary>
        /// 增加任务变量
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="entity">任务变量实体</param>
        /// <returns>增加成功返回实体主键</returns>
        public string InsertTaskVar(UserInfo userInfo, TaskVarEntity entity)
        {
            var returnValue = string.Empty;
            var parameter   = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.WorkFlowUserControlService_InsertTaskVar);

            ServiceUtil.ProcessWorkFlowDbWithTransaction(userInfo, parameter, dbProvider =>
            {
                var manager = new TaskVarManager(dbProvider, userInfo);
                returnValue = manager.InsertTaskVar(entity);
            });
            return(returnValue);
        }
        /// <summary>
        /// 判断任务变量是否存在
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="taskVarId">任务变量Id</param>
        /// <returns>true存在</returns>
        public bool ExistsTaskVar(UserInfo userInfo, string taskVarId)
        {
            var returnValue = false;
            var parameter   = ParameterUtil.CreateWithOutMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName);

            ServiceUtil.ProcessWorkFlowDbWithTransaction(userInfo, parameter, dbProvider =>
            {
                var manager = new TaskVarManager(dbProvider, userInfo);
                returnValue = manager.Exists(taskVarId);
            });
            return(returnValue);
        }
        /// <summary>
        /// 增加附件
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="entity">实体</param>
        /// <returns>增加成功后的主键</returns>
        public string InsertAttachment(UserInfo userInfo, AttachmentEntity entity)
        {
            var returnValue = string.Empty;
            var parameter   = ParameterUtil.CreateWithOutMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName);

            ServiceUtil.ProcessWorkFlowDbWithTransaction(userInfo, parameter, dbProvider =>
            {
                var manager = new AttachmentManager(dbProvider, userInfo);
                returnValue = manager.AddEntity(entity);
            });
            return(returnValue);
        }
Exemplo n.º 16
0
        /// <summary>
        /// 设置任务节点的控制权限
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="powerName">权限名</param>
        /// <param name="workflowid">workflowid</param>
        /// <param name="worktaskId">worktaskId</param>
        /// <returns></returns>
        public string SetWorkTaskPower(UserInfo userInfo, string powerName, string workflowid, string worktaskId)
        {
            var returnValue = string.Empty;
            var parameter   = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.WorkFlowTemplateService_SetWorkTaskPower);

            ServiceUtil.ProcessWorkFlowDbWithTransaction(userInfo, parameter, dbProvider =>
            {
                var manager = new WorkTaskManager(dbProvider, userInfo);
                returnValue = manager.SetTaskPower(powerName, workflowid, worktaskId);
            });
            return(returnValue);
        }
        /// <summary>
        /// 设定流程实例异常终止
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="workflowInsId">实例实例id</param>
        /// <param name="userId">用户id</param>
        /// <param name="msg">信息</param>
        /// <returns></returns>
        public string SetAbnormal(UserInfo userInfo, string workflowInsId, string userId, string msg)
        {
            string returnValue = string.Empty;
            var    parameter   = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.WorkFlowInstanceService_SetAbnormal);

            ServiceUtil.ProcessWorkFlowDbWithTransaction(userInfo, parameter, dbProvider =>
            {
                var manager = new WorkFlowInstanceManager(dbProvider, userInfo);
                returnValue = manager.SetAbnormal(workflowInsId, userId, msg);
            });
            return(returnValue);
        }
Exemplo n.º 18
0
        /// <summary>
        /// 更新主表单知
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="entity">主表单实体</param>
        /// <returns>大于0成功</returns>
        public int UpdateMainUserCtrl(UserInfo userInfo, MainUserControlEntity entity)
        {
            var returnValue = -1;
            var parameter   = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.WorkFlowUserControlService_UpdateMainUserCtrl);

            ServiceUtil.ProcessWorkFlowDbWithTransaction(userInfo, parameter, dbProvider =>
            {
                var manager = new MainUserControlManager(dbProvider, userInfo);
                returnValue = manager.UpdateMainUserCtrl(entity);
            });
            return(returnValue);
        }
Exemplo n.º 19
0
        /// <summary>
        /// 移除所有子表单
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="mainUserCtrlId">主表单id</param>
        /// <returns>大于0成功</returns>
        public int MoveUserControlsOfMain(UserInfo userInfo, string mainUserCtrlId)
        {
            var returnValue = -1;
            var parameter   = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.WorkFlowUserControlService_MoveUserControlsOfMain);

            ServiceUtil.ProcessWorkFlowDbWithTransaction(userInfo, parameter, dbProvider =>
            {
                var manager = new MainUserControlManager(dbProvider, userInfo);
                returnValue = manager.MoveUserControlsOfMain(mainUserCtrlId);
            });
            return(returnValue);
        }
Exemplo n.º 20
0
        /// <summary>
        /// 增加子表单到主表单中
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="mainUserCtrlId">主表单id</param>
        /// <param name="userContrlsId">子表单id</param>
        /// <param name="controlOrder">顺序号,以此排序</param>
        /// <param name="controlState">子表单状态</param>
        /// <returns>增加成功返回主键</returns>
        public string AddUserControls(UserInfo userInfo, string mainUserCtrlId, string userContrlsId, int controlOrder, string controlState)
        {
            var returnValue = string.Empty;
            var parameter   = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.WorkFlowUserControlService_AddUserControls);

            ServiceUtil.ProcessWorkFlowDbWithTransaction(userInfo, parameter, dbProvider =>
            {
                var manager = new MainUserControlManager(dbProvider, userInfo);
                returnValue = manager.AddUserControls(mainUserCtrlId, userContrlsId, controlOrder, controlState);
            });
            return(returnValue);
        }
        /// <summary>
        /// 设定任务实例成功提交信息
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="successMsg">任务提交成功信息</param>
        /// <param name="worktaskInsId">任务实例id</param>
        /// <returns></returns>
        public int SetWorkTaskInstanceSuccessMsg(UserInfo userInfo, string successMsg, string worktaskInsId)
        {
            int returnValue = -1;
            var parameter   = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.WorkFlowInstanceService_SetSuccessMsg);

            ServiceUtil.ProcessWorkFlowDbWithTransaction(userInfo, parameter, dbProvider =>
            {
                var manager = new WorkTaskInstanceManager(dbProvider, userInfo);
                // 调用方法,并且返回运行结果
                returnValue = manager.SetSuccessMsg(successMsg, worktaskInsId);
            });
            return(returnValue);
        }
        /// <summary>
        /// 任务撤回
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="userId">用户Id</param>
        /// <param name="workTaskInsId">任务实例id</param>
        /// <returns></returns>
        public string WorkTaskRevoke(UserInfo userInfo, string userId, string workTaskInsId)
        {
            string returnValue = string.Empty;
            var    parameter   = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.WorkFlowInstanceService_WorkTaskRevoke);

            ServiceUtil.ProcessWorkFlowDbWithTransaction(userInfo, parameter, dbProvider =>
            {
                var manager = new WorkTaskInstanceManager(dbProvider, userInfo);
                // 调用方法,并且返回运行结果
                returnValue = manager.WorkTaskRevoke(userId, workTaskInsId);
            });
            return(returnValue);
        }
Exemplo n.º 23
0
        /// <summary>
        /// 创建所有符合条件的任务实例
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="userId">处理人Id</param>
        /// <param name="workFlowId">工作流模板id</param>
        /// <param name="workTaskId">当前任务Id</param>
        /// <param name="workFlowInstanceId">工作流实例Id</param>
        /// <param name="workTaskInstanceId">原任务实例Id</param>
        /// <param name="operatorInstanceId">处理者实例Id</param>
        /// <param name="commandName">命令</param>
        /// <returns>
        /// 000002:没有配置后续任务
        /// 000000:操作成功
        /// </returns>
        public string CreateNextTaskInstance(UserInfo userInfo, string userId, string workFlowId, string workTaskId, string workFlowInstanceId, string workTaskInstanceId, string operatorInstanceId, string commandName)
        {
            string returnValue = string.Empty;
            var    parameter   = ParameterUtil.CreateWithOutMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName);

            ServiceUtil.ProcessWorkFlowDbWithTransaction(userInfo, parameter, dbProvider =>
            {
                var manager = new WorkFlowHelperManager(dbProvider, userInfo);
                // 调用方法,并且返回运行结果
                returnValue = manager.CreateNextTaskInstance(userId, workFlowId, workTaskId, workFlowInstanceId, workTaskInstanceId, operatorInstanceId, commandName);
            });
            return(returnValue);
        }
        /// <summary>
        /// 动态指定新的任务实例处理人
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="entity">实体-加签处理人、下一处理人(一般用于动态指定)</param>
        /// <returns>主键</returns>
        public string CreateWorkTaskInsNextOper(UserInfo userInfo, WorkTaskInsNextOperEntity entity)
        {
            string returnValue = string.Empty;
            var    parameter   = ParameterUtil.CreateWithMessage(userInfo, MethodBase.GetCurrentMethod(), this.serviceName, RDIFrameworkMessage.WorkFlowInstanceService_CreateWorkTaskInsNextOper);

            ServiceUtil.ProcessWorkFlowDbWithTransaction(userInfo, parameter, dbProvider =>
            {
                var manager = new WorkTaskInsNextOperManager(dbProvider, userInfo);
                // 调用方法,并且返回运行结果
                returnValue = manager.AddEntity(entity);
            });
            return(returnValue);
        }