You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

90 lines
3.5 KiB
C#

using DS.Module.Core;
using DS.WMS.Core.Op.Entity;
using DS.WMS.Core.TaskInteraction.Dtos;
using DS.WMS.Core.TaskInteraction.Entity;
namespace DS.WMS.Core.TaskInteraction.Interface
{
/// <summary>
/// 交互任务
/// </summary>
public interface ITaskService
{
/// <summary>
/// 返回任务交互模块是否已授权
/// </summary>
/// <returns>如果已授权则为<c>true</c>,否则为<c>false</c></returns>
Task<bool> HasAuthorizedAsync();
/// <summary>
/// 获取业务的任务信息
/// </summary>
/// <param name="id">业务ID</param>
/// <param name="businessType">业务类型</param>
/// <param name="withSubTask">是否获取子任务</param>
/// <param name="types">任务类型</param>
/// <returns></returns>
Task<DataResult<List<BusinessTask>>> GetTasks(long id, BusinessType? businessType, bool withSubTask, params TaskBaseTypeEnum[] types);
/// <summary>
/// 返回指定类型的任务是否已存在
/// </summary>
/// <param name="id">业务ID</param>
/// <param name="businessType">业务类型</param>
/// <param name="type">任务类型</param>
/// <returns></returns>
Task<DataResult<bool>> ExistsAsync(long id, BusinessType businessType, TaskBaseTypeEnum type);
/// <summary>
/// 批量创建关联任务
/// </summary>
/// <param name="request"></param>
/// <param name="useTransaction">是否使用事务</param>
/// <returns></returns>
Task<DataResult> CreateMultipleTaskAsync(TaskCreationRequest request, bool useTransaction = true);
/// <summary>
/// 创建关联任务
/// </summary>
/// <param name="request"></param>
/// <param name="useTransaction">是否使用事务</param>
/// <returns></returns>
Task<DataResult> CreateTaskAsync(TaskCreationRequest request, bool useTransaction = true);
/// <summary>
/// 设置任务状态
/// </summary>
/// <param name="request"></param>
/// <param name="useTransaction">是否使用事务</param>
/// <returns></returns>
Task<DataResult> SetTaskStatusAsync(TaskUpdateRequest request, bool useTransaction = true);
/// <summary>
/// 设置任务步骤
/// </summary>
/// <param name="request"></param>
/// <param name="useTransaction">是否使用事务</param>
/// <returns></returns>
Task<DataResult> SetStepsAsync(TaskRequest request, bool useTransaction = true);
/// <summary>
/// 更新任务台描述
/// </summary>
/// <returns></returns>
/// <param name="id">业务ID</param>
/// <param name="taskType">任务类型</param>
/// <param name="description">描述信息</param>
Task SetTaskBaseDescription(long id, TaskBaseTypeEnum taskType, string description);
/// <summary>
/// 删除任务
/// </summary>
/// <param name="id">业务ID</param>
/// <param name="businessType">业务类型</param>
/// <param name="remark">备注</param>
/// <param name="taskTypes">任务类型,不指定任务类型则删除全部任务</param>
/// <returns></returns>
Task<DataResult> DeleteAsync(long id, BusinessType? businessType, string? remark = null, params TaskBaseTypeEnum[] taskTypes);
}
}