|
|
|
using System.Linq.Expressions;
|
|
|
|
using DS.Module.Core;
|
|
|
|
using DS.WMS.Core.Flow.Dtos;
|
|
|
|
using DS.WMS.Core.Flow.Entity;
|
|
|
|
using DS.WMS.Core.Op.Entity;
|
|
|
|
|
|
|
|
namespace DS.WMS.Core.Flow.Interface;
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 租户端工作流
|
|
|
|
/// </summary>
|
|
|
|
public interface IClientFlowInstanceService
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// 确定是否为最后审批人
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="taskType">任务类型</param>
|
|
|
|
/// <param name="bsId">业务ID</param>
|
|
|
|
/// <param name="bsType">业务类型</param>
|
|
|
|
/// <returns></returns>
|
|
|
|
DataResult<bool> IsLastMarker(TaskBaseTypeEnum taskType, long bsId, BusinessType? bsType);
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 确定工作流是否正在运行中
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="type">工作流类型</param>
|
|
|
|
/// <param name="businessType">业务类型</param>
|
|
|
|
/// <param name="ids">业务ID</param>
|
|
|
|
/// <returns></returns>
|
|
|
|
Task<bool> IsRunningAsync(TaskBaseTypeEnum type, BusinessType? businessType = null, params long[] ids);
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 确定工作流是否存在
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="type">工作流类型</param>
|
|
|
|
/// <param name="businessType">业务类型</param>
|
|
|
|
/// <param name="expression">自定义查询条件</param>
|
|
|
|
/// <param name="ids">业务ID</param>
|
|
|
|
/// <returns></returns>
|
|
|
|
Task<bool> ExistsAsync(TaskBaseTypeEnum? type = null, BusinessType? businessType = null, Expression<Func<FlowInstance, bool>>? expression = null, params long[] ids);
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 根据业务ID获取关联工作流
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="type">工作流类型</param>
|
|
|
|
/// <param name="businessType">业务类型</param>
|
|
|
|
/// <param name="ids">业务ID</param>
|
|
|
|
/// <returns></returns>
|
|
|
|
Task<List<FlowInstance>> GetInstancesAsync(TaskBaseTypeEnum type, BusinessType? businessType = null, params long[] ids);
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 获取工作流实例信息
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="businessId">业务ID</param>
|
|
|
|
/// <param name="businessType">业务类型</param>
|
|
|
|
/// <param name="types">审批类型</param>
|
|
|
|
/// <returns></returns>
|
|
|
|
Task<DataResult<List<FlowInstanceRes>>> GetInstancesByBizAsync(long businessId, BusinessType? businessType, params TaskBaseTypeEnum[]? types);
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 列表查询
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="request"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
Task<DataResult<List<FlowInstanceRes>>> GetListAsync(PageRequest request);
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 添加编辑
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="req"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
Task<DataResult> EditAsync(FlowInstanceReq req);
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 获取详情
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="id"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
Task<DataResult<FlowInstanceRes>> GetAsync(long id);
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 启动实例
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="id"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
Task<DataResult> StartAsync(long id);
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 创建工作流实例
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="req"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
Task<DataResult> CreateAsync(CreateFlowInstanceReq req);
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 工作流审批
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="req"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
Task<DataResult> AuditAsync(FlowInstanceAuditReq req);
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 工作流审批
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="info"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
Task<DataResult> AuditAsync(FlowAuditInfo info);
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 撤销工作流
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="ids"></param>
|
|
|
|
/// <param name="note">备注</param>
|
|
|
|
/// <returns></returns>
|
|
|
|
Task<DataResult> WithdrawAsync(long[] ids, string? note = null);
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 撤销审核
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="taskType">任务类型</param>
|
|
|
|
/// <param name="bsIds">业务ID</param>
|
|
|
|
/// <param name="businessType">业务类型</param>
|
|
|
|
/// <param name="note">备注</param>
|
|
|
|
/// <returns></returns>
|
|
|
|
Task<DataResult> WithdrawAsync(TaskBaseTypeEnum taskType, long[] bsIds,
|
|
|
|
BusinessType? businessType = null, string? note = null);
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 运行回调更新
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="taskType">审核类型</param>
|
|
|
|
/// <param name="bsId">业务ID</param>
|
|
|
|
/// <param name="businessType">业务类型</param>
|
|
|
|
/// <param name="callbackURL">回调URL</param>
|
|
|
|
/// <returns></returns>
|
|
|
|
Task<DataResult> RunCallbackAsync(TaskBaseTypeEnum taskType, long bsId, BusinessType? businessType = null, string? callbackURL = null);
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 获取流程操作历史
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="bsId">业务ID</param>
|
|
|
|
/// <param name="bsType">bsType</param>
|
|
|
|
/// <returns></returns>
|
|
|
|
Task<DataResult<List<FlowInstanceHistoryRes>>> GetHistoriesAsync(long bsId, BusinessType? bsType);
|
|
|
|
}
|