using MapsterMapper;
using SqlSugar;
using System.Diagnostics.CodeAnalysis;
using WIDESEA_Core;
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.BaseServices;
using WIDESEAWCS_Core.Enums;
using WIDESEAWCS_DTO;
using WIDESEAWCS_DTO.Stock;
using WIDESEAWCS_DTO.TaskInfo;
using WIDESEAWCS_ITaskInfoRepository;
using WIDESEAWCS_ITaskInfoService;
using WIDESEAWCS_Model.Models;
using WIDESEAWCS_QuartzJob;
using WIDESEAWCS_QuartzJob.DeviceBase;
using WIDESEAWCS_QuartzJob.DTO;
using WIDESEAWCS_QuartzJob.Models;
using WIDESEAWCS_QuartzJob.Service;
namespace WIDESEAWCS_TaskInfoService;
///
/// 任务服务 - 核心业务逻辑
///
public partial class TaskService : ServiceBase, ITaskService
{
private readonly IRouterService _routerService;
private readonly ITaskExecuteDetailService _taskExecuteDetailService;
private readonly ITaskExecuteDetailRepository _taskExecuteDetailRepository;
private readonly IMapper _mapper;
private readonly IOutboundTaskFlowService _outboundTaskFlowService;
private readonly IInboundTaskFlowService _inboundTaskFlowService;
private readonly IRelocationTaskFlowService _relocationTaskFlowService;
private readonly IRobotTaskFlowService _robotTaskFlowService;
private Dictionary _taskOrderBy = new()
{
{nameof(Dt_Task.Grade),OrderByType.Desc },
{nameof(Dt_Task.CreateDate),OrderByType.Asc},
};
public Dictionary TaskOrderBy
{ get { return _taskOrderBy; } set { _taskOrderBy = value; } }
public List TaskInboundTypes => typeof(TaskInboundTypeEnum).GetEnumIndexList();
public List TaskOutboundTypes => typeof(TaskOutboundTypeEnum).GetEnumIndexList();
public List TaskRelocationTypes => typeof(TaskRelocationTypeEnum).GetEnumIndexList();
public List TaskRobotTypes => typeof(TaskOtherTypeEnum).GetEnumIndexList();
public TaskService(
ITaskRepository BaseDal,
IRouterService routerService,
ITaskExecuteDetailService taskExecuteDetailService,
ITaskExecuteDetailRepository taskExecuteDetailRepository,
IMapper mapper,
IOutboundTaskFlowService outboundTaskFlowService,
IInboundTaskFlowService inboundTaskFlowService,
IRelocationTaskFlowService relocationTaskFlowService,
IRobotTaskFlowService robotTaskFlowService) : base(BaseDal)
{
_routerService = routerService;
_taskExecuteDetailService = taskExecuteDetailService;
_taskExecuteDetailRepository = taskExecuteDetailRepository;
_mapper = mapper;
_outboundTaskFlowService = outboundTaskFlowService;
_inboundTaskFlowService = inboundTaskFlowService;
_relocationTaskFlowService = relocationTaskFlowService;
_robotTaskFlowService = robotTaskFlowService;
}
}