123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- using Hotline.FlowEngine.Definitions;
- using Hotline.FlowEngine.WorkflowModules;
- using Hotline.Share.Dtos;
- using Hotline.Share.Dtos.FlowEngine;
- using Hotline.Share.Dtos.Settings;
- using Hotline.Share.Enums.FlowEngine;
- using Hotline.Share.Enums.Settings;
- using XF.Domain.Entities;
- namespace Hotline.FlowEngine.Workflows
- {
- public interface IWorkflowDomainService
- {
- /// <summary>
- /// 创建流程
- /// </summary>
- Task<Workflow> CreateWorkflowAsync(WorkflowModule wfModule, string title, string userId, string userCode,
- string? externalId = null, string? timelimitText = null, DateTime? expiredTime = null,
- CancellationToken cancellationToken = default);
- /// <summary>
- /// 进行流程的开始节点
- /// </summary>
- Task StartAsync(Workflow workflow, WorkflowStep startStep, BasicWorkflowDto dto, StepDefine firstStepDefine,
- FlowAssignInfo flowAssignInfo, CancellationToken cancellationToken);
- /// <summary>
- /// 查询工作流
- /// </summary>
- Task<Workflow> GetWorkflowAsync(string workflowId, bool withDefine = false, bool withSteps = false, bool withTraces = false,
- bool withSupplements = false, bool withCountersigns = false, CancellationToken cancellationToken = default);
- /// <summary>
- /// 查询工作流包含当前用户办理权限(是否可办理)
- /// </summary>
- Task<(Workflow, bool)> GetWorkflowHandlePermissionAsync(string workflowId,
- string userId, string orgCode, bool withDefine = false, bool withSteps = false, bool withTraces = false,
- bool withSupplements = false, bool withCountersigns = false, CancellationToken cancellationToken = default);
- /// <summary>
- /// 受理,接办
- /// </summary>
- Task AcceptAsync(Workflow workflow,
- string userId, string? userName,
- string orgId, string? orgName,
- string? orgAreaCode, string? orgAreaName,
- CancellationToken cancellationToken);
- /// <summary>
- /// 办理(流转至下一节点)
- /// </summary>
- Task NextAsync(Workflow workflow, WorkflowStep currentStep, NextWorkflowDto dto, StepDefine nextStepDefine, FlowAssignInfo flowAssignInfo, CancellationToken cancellationToken);
- /// <summary>
- /// 退回(返回前一节点)
- /// </summary>
- /// <returns></returns>
- Task PreviousAsync(Workflow workflow, PreviousWorkflowDto dto, CancellationToken cancellationToken);
- /// <summary>
- /// 撤回(返回到之前任意节点)
- /// </summary>
- Task RecallAsync(Workflow workflow, RecallDto dto, StepDefine targetStepDefine, FlowAssignInfo flowAssignInfo, CancellationToken cancellationToken);
- /// <summary>
- /// 跳转(直接将流程跳转至任意节点)
- /// </summary>
- Task JumpAsync(Workflow workflow, RecallDto dto, StepDefine targetStepDefine, FlowAssignInfo flowAssignInfo, CancellationToken cancellationToken);
- /// <summary>
- /// 重办
- /// </summary>
- Task RedoAsync(Workflow workflow, RecallDto dto, StepDefine targetStepDefine, FlowAssignInfo flowAssignInfo, CancellationToken cancellationToken);
- /// <summary>
- /// 否决(审批流程不通过)
- /// </summary>
- /// <returns></returns>
- Task RejectAsync(Workflow workflow, BasicWorkflowDto dto, CancellationToken cancellationToken);
- /// <summary>
- /// 补充
- /// </summary>
- /// <returns></returns>
- Task SupplementAsync(Workflow workflow, EndWorkflowDto dto, CancellationToken cancellationToken);
- /// <summary>
- /// 终止流程
- /// </summary>
- Task TerminateAsync(TerminateDto dto, CancellationToken cancellationToken);
- StepDefine GetStepDefine(WorkflowDefinition workflowDefinition, string stepCode);
- /// <summary>
- /// 查询当前待办理节点
- /// </summary>
- WorkflowStep FindCurrentStepWaitForHandle(Workflow workflow);
- /// <summary>
- /// 查询待回访部门
- /// </summary>
- Task<(Kv, IReadOnlyList<Kv>)> GetUnvisitOrgsAsync(string workflowId,
- CancellationToken cancellationToken);
- /// <summary>
- /// 依据配置过滤下一节点
- /// </summary>
- List<StepDefine> NextStepDefineFilter(EPathPolicy pathPolicy, List<StepDefine> nextStepDefines);
- /// <summary>
- /// 撤销流程
- /// </summary>
- Task CancelAsync(CancelDto dto, CancellationToken cancellationToken);
- /// <summary>
- /// 更新期满时间
- /// </summary>
- Task UpdateExpiredTimeAsync(DateTime expiredTime, string timelimitText, int? timelimie,
- ETimeType? timelimitUnit, CancellationToken cancellationToken);
- }
- }
|