using Ewide.Core; using Microsoft.Extensions.Localization; using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace RoadFlow.Data { public interface IFlowTask : IRoadFlowRepository { // /// 根据组ID查询列表 /// /// /// List GetListByGroupId(string groupId); /// /// 得到获取动态步骤的任务实体 /// /// 组ID /// 当前任务ID,如果为空,则返回的Model.FlowTask当前任务实体也为空 /// (动态任务, 当前任务, 任务组List) public (Model.rf_flowtask, Model.rf_flowtask, List) GetDynamicTask(string groupId, string? taskId = null); /// /// 判断人员是否可以打开任务 /// /// /// 返回 -1表示不能打开 0任务为空 1任务处理人 2实例管理人 public int IsOpenTask(string userId, Model.rf_flowtask flowTaskModel, Model.FlowRun flowRunModel = null); /// /// 更新状态 /// /// 任务id /// 状态 /// 处理类型 int.MinValue表示不更新 /// 打开时间 null表示不更新 /// public int UpdateStatus(string taskId, int status, int executeType = int.MinValue, DateTime? openTime = null); /// /// 判断一个任务是否可以催办 /// /// /// 是否可以收回 /// isWithdraw 是否可以收回 public bool IsHasten(string taskId, out bool isWithdraw); /// /// 得到当前任务的后续接收步骤选择HTML /// /// 流程运行时实体 /// 步骤ID /// 组ID /// 任务ID /// 实例ID /// 当前人员ID /// 可以发送的步骤 /// 是否是自由发送 /// 是否是移动端 /// 组任务集合,为空则在方法中查询 /// 多语言包 /// 步骤选择html, 提醒信息, 可以发送的步骤集合 public (string html, string message, List sendSteps) GetNextSteps(Model.FlowRun flowRunModel, Guid stepId, string groupId, string taskId, string instanceId, string userId, bool isFreeSend, bool isMobile = false, List groupTasks = null, IStringLocalizer localizer = null); /// /// 从字段值得到动态步骤 /// 字段值格式:{flowtype:0 流转类型0并且 1串行,runedit:0 是否运行时编辑,steps:[{name:'test1',members:'u_EB03262C-AB60-4BC6-A4C0-96E66A4229FE'},{name:'test2',members:'u_954DC69A-30FF-4484-9234-3C9272B6893F'}]} /// /// /// /// /// public JObject GetDynamicStepFromFieldValue(Model.FlowRun flowRunModel, Model.FlowRunModel.Step step, string instanceId); /// /// 抄送任务 /// /// 当前任务 /// 接收人 /// 语言包 /// 返回1表示成功,其它为错误信息 public string CopyFor(Model.rf_flowtask currentTask, List users, IStringLocalizer localizer = null); /// /// 征求意见 /// /// /// /// 意见可见性 20自己可见 21流程参与人可见 /// 备注 /// public string SolicitOpinion(Model.rf_flowtask currentTask, List users, int visibility, string note = "", IStringLocalizer localizer = null); /// /// 查询待办事项 /// /// /// /// /// /// 是否批量 0不是,1是 /// public List GetWaitTask(int size, int number, string userId, string flowId, string title, string startDate, string endDate, string order, out int count, int isBatch = 0); /// /// 判断一个任务是否可以作废 /// /// /// public bool IsDelete(string taskId, Model.FlowRun flowRunModel = null); /// /// 得到任务类型标题 /// /// 任务类型 /// 语言包 /// public string GetTaskTypeTitle(int taskType, IStringLocalizer localizer = null); /// /// 查询已办事项 /// /// /// /// /// /// public List GetCompletedTask(int size, int number, string userId, string flowId, string title, string startDate, string endDate, string order, out int count); /// /// 查询我发起的流程 /// /// /// /// /// /// ""全部 "0"未完成 "1" 已完成 /// public List GetMyStartList(int size, int number, string userId, string flowId, string title, string startDate, string endDate, string status, string order, out int count); /// /// 查询已委托事项 /// /// /// /// /// /// public List GetEntrustTask(int size, int number, string userId, string flowId, string title, string startDate, string endDate, string order, out int count); /// /// 得到处理类别显示标题 /// /// /// 语言包 /// public string GetExecuteTypeTitle(int executeType, IStringLocalizer localizer = null); /// /// 自动执行一个任务 /// /// /// 执行类型 /// 处理意见 /// public Model.FlowRunModel.ExecuteResult AutoSubmit(Guid taskId, string type = "submit", string comment = ""); /// /// 删除 /// /// 任务实体 /// public int DeleteByGroupId(string groupid); /// /// 更新任务 /// /// 要删除的列表 /// 要更新的列表 /// 要添加的列表 /// 要执行的sql列表(sql,参数,0提交退回前 1提交退回后) /// public int Update(List removeTasks, List updateTasks, List addTasks, List<(string, object[], int)> executeSqls); /// /// 发送待办消息 /// /// /// /// 发送方式 0站内短信 1手机短信 2微信 3公众号 4邮件 /// 消息内容 public void SendMessage(List nextTasks, SysUser sender, string sendModel = "", string contents = "", IStringLocalizer localizer = null); /// /// 判断人员是否可以查看处理过程 /// /// /// 组任务列表 /// 返回 -1表示不能打开 1任务参与人 2实例管理人 public int IsOpenProcess(string userId, List groupTasks, Model.FlowRun flowRunModel = null); /// /// 得到步骤由流程处理人设置的后续步骤处理人员 /// /// 实例组列表 /// public Dictionary GetNextStepsHandle(List groupTasks); /// /// 根据子流程组ID查询主流程任务 /// /// /// public List GetListBySubFlowGroupId(string groupId); /// /// 查询实例列表 /// /// /// /// /// /// /// /// /// /// /// public List GetInstanceList(int size, int number, string flowId, string title, string receiveId, string receiveDate1, string receiveDate2, string order, out int count); /// /// 指派任务 /// /// 当前任务 /// 要指派的人员 /// 语言包 /// 返回1表示成功,其它为错误信息 public string Designate(Model.rf_flowtask currentTask, List users, IStringLocalizer localizer = null); /// /// 跳转任务 /// /// 当前任务 /// 要跳转到的步骤 /// 语言包 /// 返回1表示成功,其它为错误信息 public string GoTo(Model.rf_flowtask currentTask, Dictionary> steps, IStringLocalizer localizer = null); /// /// 根据JSON字符串参数执行流程 /// /// /// {id:'任务id',flowId:'流程ID',instanceId:'实例id',title:'任务标题',comment:'处理意见',type:'处理类型',note:'备注', /// senderId:'发送人id',sign:'是否签章 0|1',steps:[{id:'接收步骤id',name:'接收步骤名称',member:'接收人',completedtime:'要求完成时间'}]} /// /// 语言包 /// public Model.FlowRunModel.ExecuteResult ExecuteFromJSON(string json, IStringLocalizer localizer = null); } }