| | |
| | | using WIDESEAWCS_ITaskInfoService; |
| | | using WIDESEAWCS_Model.Models; |
| | | using WIDESEAWCS_QuartzJob.Models; |
| | | using WIDESEAWCS_QuartzJob.Repository; |
| | | using WIDESEAWCS_QuartzJob.Service; |
| | | |
| | | namespace WIDESEAWCS_TaskInfoService |
| | |
| | | public partial class TaskService : ServiceBase<Dt_Task, ITaskRepository>, ITaskService |
| | | { |
| | | private readonly IRouterService _routerService; |
| | | private readonly IRouterRepository _routerRepository; |
| | | private readonly ITaskExecuteDetailService _taskExecuteDetailService; |
| | | private readonly ITaskExecuteDetailRepository _taskExecuteDetailRepository; |
| | | private readonly ITaskHtyService _taskHtyService; |
| | |
| | | |
| | | public List<int> TaskRelocationTypes => typeof(TaskRelocationTypeEnum).GetEnumIndexList(); |
| | | |
| | | public TaskService(ITaskRepository BaseDal, IRouterService routerService, ITaskExecuteDetailService taskExecuteDetailService, ITaskExecuteDetailRepository taskExecuteDetailRepository, ITaskHtyService taskHtyService, IMapper mapper) : base(BaseDal) |
| | | public TaskService(ITaskRepository BaseDal, IRouterService routerService, IRouterRepository routerRepository, ITaskExecuteDetailService taskExecuteDetailService, ITaskExecuteDetailRepository taskExecuteDetailRepository, ITaskHtyService taskHtyService, IMapper mapper) : base(BaseDal) |
| | | { |
| | | _routerService = routerService; |
| | | _routerRepository = routerRepository; |
| | | _taskExecuteDetailService = taskExecuteDetailService; |
| | | _taskExecuteDetailRepository = taskExecuteDetailRepository; |
| | | _taskHtyService = taskHtyService; |
| | |
| | | { |
| | | if (BaseDal.QueryFirst(x => x.TaskNum == item.TaskNum || x.PalletCode == item.PalletCode) != null) |
| | | { |
| | | continue; |
| | | throw new Exception($"ä»»å¡å·ã{item.TaskNum}å·²åå¨ä»»å¡ã"); |
| | | } |
| | | Dt_Task task = _mapper.Map<Dt_Task>(item); |
| | | task.Creater = "WMS"; |
| | |
| | | //æä¸èèå¤è·¯å¾ |
| | | if (routers.Count > 0) |
| | | { |
| | | task.TaskState = (int)TaskOutStatusEnum.OutNew; |
| | | |
| | | task.TaskState = item.SourceIsPickPlace ? TaskOutStatusEnum.Car_OutFinish.ObjToInt() : TaskOutStatusEnum.OutNew.ObjToInt(); |
| | | task.CurrentAddress = item.SourceAddress; |
| | | task.NextAddress = routers.FirstOrDefault().ChildPosi; |
| | | } |
| | |
| | | /// <returns></returns> |
| | | public Dt_Task QueryExecutingConveyorLineTask(int taskNum, string nextAddress) |
| | | { |
| | | return BaseDal.QueryFirst(x => x.TaskNum == taskNum && x.NextAddress == nextAddress && (x.TaskState == (int)TaskInStatusEnum.Line_InExecuting || x.TaskState == (int)TaskOutStatusEnum.Line_OutExecuting), TaskOrderBy); |
| | | return BaseDal.QueryFirst(x => x.TaskNum == taskNum && x.NextAddress == nextAddress && (x.TaskState == (int)TaskInStatusEnum.Line_InExecuting || x.TaskState == (int)TaskOutStatusEnum.SC_OutFinish), TaskOrderBy); |
| | | } |
| | | |
| | | /// <summary> |