IWorkflowApplication.cs 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. using Hotline.FlowEngine;
  2. using Hotline.FlowEngine.Definitions;
  3. using Hotline.FlowEngine.WorkflowModules;
  4. using Hotline.FlowEngine.Workflows;
  5. using Hotline.Orders;
  6. using Hotline.Share.Dtos;
  7. using Hotline.Share.Dtos.File;
  8. using Hotline.Share.Dtos.FlowEngine;
  9. using Hotline.Share.Dtos.FlowEngine.Definition;
  10. using Hotline.Share.Dtos.FlowEngine.Workflow;
  11. using Hotline.Share.Dtos.Order;
  12. using Hotline.Share.Dtos.Order.Handle;
  13. using Hotline.Share.Dtos.Settings;
  14. using Hotline.Share.Enums.FlowEngine;
  15. using Microsoft.AspNetCore.Mvc;
  16. using SqlSugar;
  17. using XF.Domain.Authentications;
  18. namespace Hotline.Application.FlowEngine
  19. {
  20. public interface IWorkflowApplication
  21. {
  22. // /// <summary>
  23. // /// 开始流程
  24. // /// </summary>
  25. // Task<string> StartWorkflowAsync(StartWorkflowDto dto, string externalId, DateTime? expiredTime = null,
  26. // CancellationToken cancellationToken = default);
  27. /// <summary>
  28. /// 开始流程并停留在开始节点(开始节点作为待办节点)
  29. /// </summary>
  30. Task<string> StartWorkflowToStartStepAsync(StartWorkflowDto dto, string externalId, DateTime? expiredTime = null,
  31. CancellationToken cancellationToken = default);
  32. /// <summary>
  33. /// 查询下一节点办理对象类型(user or org)及实际办理对象
  34. /// </summary>
  35. Task<FlowAssignInfo> GetNextStepFlowAssignInfoAsync(Workflow workflow, WorkflowStep currentStep,
  36. BasicWorkflowDto dto, StepDefine nextStepDefine, bool isNextDynamic, CancellationToken cancellationToken);
  37. ///// <summary>
  38. ///// 流转至下一节点(节点办理)
  39. ///// </summary>
  40. //Task<Workflow> NextAsync(NextWorkflowDto dto, DateTime? expiredTime = null, CancellationToken cancellationToken = default);
  41. /// <summary>
  42. /// 退回(返回前一节点)
  43. /// </summary>
  44. Task<(Workflow workflow, WorkflowStep currentStep, StepDefine prevDefine,
  45. WorkflowStep prevStep, WorkflowStep newStep, EFlowDirection flowDirection)>
  46. PreviousAsync(PreviousWorkflowDto dto,
  47. Action<Workflow, WorkflowStep, StepDefine, WorkflowStep, WorkflowStep>? newStepConfig = null,
  48. CancellationToken cancellationToken = default);
  49. /// <summary>
  50. /// 工单退回(返回前一节点)
  51. /// </summary>
  52. Task<(Workflow workflow, WorkflowStep currentStep, StepDefine prevDefine,
  53. WorkflowStep prevStep, WorkflowStep newStep, EFlowDirection flowDirection)>
  54. PreviousAsync(PreviousWorkflowDto dto, string applicantId, string applicantOrgId, string[] applicantRoleIds,
  55. Action<Workflow, WorkflowStep, StepDefine, WorkflowStep, WorkflowStep>? newStepConfig = null,
  56. CancellationToken cancellationToken = default);
  57. ///// <summary>
  58. ///// 撤回至任意节点
  59. ///// </summary>
  60. //Task RecallAsync(RecallDto dto, FlowAssignInfo flowAssignInfo, DateTime? expiredTime, bool isOrderFiled, EWorkflowTraceType traceType, CancellationToken cancellationToken);
  61. /// <summary>
  62. /// 办理至结束节点(无视流程模板配置,操作人需是当前节点办理对象)
  63. /// </summary>
  64. Task HandleToEndAsync(string workflowId, string opinion, List<FileDto> files, DateTime? expiredTime = null,
  65. EReviewResult reviewResult = EReviewResult.Unknown, CancellationToken cancellationToken = default);
  66. ////////
  67. /// <summary>
  68. /// 查询开始流程的下一步待选节点
  69. /// </summary>
  70. Task<NextStepsDto<NextStepOption>> GetStartStepsAsync(string moduleCode, CancellationToken cancellationToken);
  71. /// <summary>
  72. /// 查询办理流程的下一步待选节点
  73. /// </summary>
  74. Task<NextStepsWithOpinionDto<NextStepOption>> GetNextStepsAsync(string workflowId, CancellationToken cancellationToken);
  75. /// <summary>
  76. /// 查询指定节点的下一步待选节点
  77. /// </summary>
  78. Task<NextStepsWithOpinionDto<NextStepOption>> GetNextStepsAsync(string workflowId, string stepId, CancellationToken cancellationToken);
  79. /// <summary>
  80. /// 跨级指派查询下一步可选节点及办理对象参数
  81. /// </summary>
  82. Task<NextStepsDto<NextStepOption>> GetCrossLevelStepsAsync(GetCrossLevelStepsDto dto, CancellationToken cancellationToken);
  83. /// <summary>
  84. /// 查询撤回可选节点
  85. /// </summary>
  86. Task<NextStepsDto<RecallStepOption>> GetRecallStepsAsync(string workflowId, CancellationToken cancellationToken);
  87. /// <summary>
  88. /// 否决
  89. /// </summary>
  90. Task RejectAsync(RejectDto dto, CancellationToken cancellationToken);
  91. /// <summary>
  92. /// 获取流程模板信息
  93. /// </summary>
  94. /// <param name="code"></param>
  95. /// <param name="cancellationToken"></param>
  96. /// <returns></returns>
  97. Task<WorkflowModule> GetWorkflowModuleAsync(string code, CancellationToken cancellationToken);
  98. /// <summary>
  99. /// 检查退回节点信息
  100. /// </summary>
  101. Task<(WorkflowStep currentStep, WorkflowStep prevStep,List<WorkflowStep> steps, bool isOrgToCenter, bool isSecondToFirstOrgLevel)>
  102. GetPreviousInformationAsync(string workflowId, string operatorId, string operatorOrgId, string[] roles,
  103. CancellationToken cancellationToken);
  104. /// <summary>
  105. /// 更新省平台办理结果节点附件
  106. /// </summary>
  107. Task UpdateProvinceHandleResultFilesAsync(string workflowId, List<FileDto> files, CancellationToken cancellationToken);
  108. /// <summary>
  109. /// 查询会签信息
  110. /// </summary>
  111. /// <param name="dto"></param>
  112. /// <param name="_sessionContext"></param>
  113. /// <returns></returns>
  114. ISugarQueryable<WorkflowCountersign, Workflow, Order> QueryOrderCountersigns(QueryOrderCountersignDto dto,
  115. ISessionContext _sessionContext);
  116. }
  117. }