using Hotline.FlowEngine; using Hotline.FlowEngine.Definitions; using Hotline.FlowEngine.WorkflowModules; using Hotline.FlowEngine.Workflows; using Hotline.Orders; using Hotline.Share.Dtos; using Hotline.Share.Dtos.File; using Hotline.Share.Dtos.FlowEngine; using Hotline.Share.Dtos.FlowEngine.Definition; using Hotline.Share.Dtos.Order; using Hotline.Share.Dtos.Order.Handle; using Hotline.Share.Dtos.Settings; using Hotline.Share.Enums.FlowEngine; using Microsoft.AspNetCore.Mvc; using XF.Domain.Authentications; namespace Hotline.Application.FlowEngine { public interface IWorkflowApplication { /// /// 开始流程 /// Task StartWorkflowAsync(StartWorkflowDto dto, string externalId, DateTime? expiredTime = null, CancellationToken cancellationToken = default); /// /// 开始流程并停留在开始节点(开始节点作为待办节点) /// Task StartWorkflowToStartStepAsync(StartWorkflowDto dto, string externalId, DateTime? expiredTime = null, CancellationToken cancellationToken = default); /// /// 查询下一节点办理对象类型(user or org)及实际办理对象 /// Task GetNextStepFlowAssignInfoAsync(Workflow workflow, WorkflowStep currentStep, BasicWorkflowDto dto, StepDefine nextStepDefine, bool isNextDynamic, CancellationToken cancellationToken); /// /// 流转至下一节点(节点办理) /// Task NextAsync(NextWorkflowDto dto, DateTime? expiredTime = null, CancellationToken cancellationToken = default); /// /// 退回(返回前一节点) /// Task PreviousAsync(PreviousWorkflowDto dto, CancellationToken cancellationToken); /// /// 工单退回(返回前一节点) /// Task PreviousAsync(PreviousWorkflowDto dto, string applicantId, string applicantOrgId, string[] applicantRoleIds, CancellationToken cancellationToken); /// /// 撤回至任意节点 /// Task RecallAsync(RecallDto dto, DateTime? expiredTime, bool isOrderFiled, EWorkflowTraceType traceType, CancellationToken cancellationToken); /// /// 办理至结束节点(无视流程模板配置,操作人需是当前节点办理对象) /// Task HandleToEndAsync(string workflowId, string opinion, List files, EReviewResult reviewResult = EReviewResult.Unknown, CancellationToken cancellationToken = default); //////// /// /// 查询开始流程的下一步待选节点 /// Task> GetStartStepsAsync(string moduleCode, CancellationToken cancellationToken); /// /// 查询办理流程的下一步待选节点 /// Task> GetNextStepsAsync(string workflowId, CancellationToken cancellationToken); /// /// 查询指定节点的下一步待选节点 /// Task> GetNextStepsAsync(string workflowId, string stepId, CancellationToken cancellationToken); /// /// 跨级指派查询下一步可选节点及办理对象参数 /// Task> GetCrossLevelStepsAsync(GetCrossLevelStepsDto dto, CancellationToken cancellationToken); /// /// 查询撤回可选节点 /// Task> GetRecallStepsAsync(string workflowId, CancellationToken cancellationToken); /// /// 否决 /// Task RejectAsync(RejectDto dto, CancellationToken cancellationToken); /// /// 获取流程模板信息 /// /// /// /// Task GetWorkflowModuleAsync(string code, CancellationToken cancellationToken); /// /// 检查退回节点信息 /// Task<(WorkflowStep currentStep, WorkflowStep prevStep, bool isOrgToCenter, bool isSecondToFirstOrgLevel)> GetPreviousInformationAsync(string workflowId, string operatorId, string operatorOrgId, string[] roles, CancellationToken cancellationToken); /// /// 开启流程直接归档 /// Task StartToEndAsync(StartWorkflowDto dto, string externalId, DateTime? expiredTime = null, CancellationToken cancellationToken = default); /// /// 更新省平台办理结果节点附件 /// Task UpdateProvinceHandleResultFilesAsync(string workflowId, List files, CancellationToken cancellationToken); } }