| | |
| | | private readonly ILocationInfoService _locationInfoService; |
| | | private readonly IWarehouseService _warehouseService; |
| | | private readonly IRoadWayinfoService _roadWayinfoService; |
| | | private readonly ITask_HtyService _task_HtyService; |
| | | private Timer _timer; |
| | | public IRepository<Dt_Task> Repository => BaseDal; |
| | | |
| | |
| | | public List<int> TaskOutboundTypes => typeof(TaskTypeEnum).GetEnumIndexList(); |
| | | |
| | | public TaskService(ILogger<TaskService> logger, IRepository<Dt_Task> BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IStockInfoService stockInfoService, ILocationInfoService locationInfoService, |
| | | IWarehouseService warehouseService, IRoadWayinfoService roadWayinfoService) : base(BaseDal) |
| | | IWarehouseService warehouseService, IRoadWayinfoService roadWayinfoService, ITask_HtyService task_HtyService) : base(BaseDal) |
| | | { |
| | | _logger = logger; |
| | | _mapper = mapper; |
| | |
| | | _stockInfoService = stockInfoService; |
| | | _locationInfoService = locationInfoService; |
| | | _warehouseService = warehouseService; |
| | | _roadWayinfoService=roadWayinfoService; |
| | | |
| | | _roadWayinfoService = roadWayinfoService; |
| | | _task_HtyService = task_HtyService; |
| | | } |
| | | public string MES_InReporttask = WIDESEA_Core.Helper.AppSettings.Configuration["MES_InReporttask"]; //å
¥åºåé¦ä¿¡æ¯ |
| | | public string MES_OutReporttask = WIDESEA_Core.Helper.AppSettings.Configuration["MES_OutReporttask"]; //åºåºåé¦ä¿¡æ¯ |
| | |
| | | { |
| | | Dt_Task task = BaseDal.QueryFirst(x => x.TaskId == wCSTask.TaskNum && x.PalletCode == wCSTask.PalletCode); |
| | | if (task == null) |
| | | return webResponse.Error("æªæ¾å°ä»»å¡ä¿¡æ¯"); |
| | | return webResponse.Error("æªæ¾å°ä»»å¡ä¿¡æ¯", 404); |
| | | return TaskCompletedtask(task, wCSTask.TaskType); |
| | | } |
| | | catch (Exception ex) |
| | |
| | | return BaseDal.QueryData(x => x.TaskStatus == (int)RelocationTaskStatusEnum.RelocationNew && x.CurrentAddress == LocationCode).FirstOrDefault(); |
| | | } |
| | | |
| | | public Dt_Task GeOutCuTaskQueue(string LocationCode) |
| | | { |
| | | return BaseDal.QueryData(x => x.TaskStatus == (int)OutTaskStatusEnum.OutNew && x.SourceAddress == LocationCode).FirstOrDefault(); |
| | | } |
| | | |
| | | public bool RelocationTaskProgress(string deviceId) |
| | | { |
| | | int taskcount = BaseDal.QueryData(x => x.Roadway == deviceId && (x.TaskStatus == (int)RelocationTaskStatusEnum.RelocationExecuting || x.TaskStatus == (int)RelocationTaskStatusEnum.RelocationNew) ).Count(); |
| | | if (taskcount == 0) return false; |
| | | return true; |
| | | } |
| | | |
| | | //ä»åºå®¹éç¶æ |
| | | public WebResponseContent GetWarehouseCapacity() |
| | | { |
| | | return _locationInfoService.GetWarehouseCapacity(); |
| | | } |
| | | |
| | | //åºå
¥åºç±»ååå¸ |
| | | public WebResponseContent GetInOutTypeStats() |
| | | { |
| | | return _task_HtyService.GetInOutTypeStats(); |
| | | } |
| | | //æµéæ
åµç»è®¡ |
| | | |
| | | public WebResponseContent GetTodayTrafficStats() |
| | | { |
| | | return _task_HtyService.GetTodayInOutStats(); |
| | | } |
| | | //å½åè¿è¡çä»»å¡ |
| | | public WebResponseContent GetCurrentTasks() |
| | | { |
| | | // æ¥è¯¢æä»¥è¿åTaskNumï¼TaskTypeï¼CreateDateï¼TaskStatusï¼ |
| | | var tasks = BaseDal.QueryData() |
| | | .Select(t => new |
| | | { |
| | | WarehouseId = t.Roadway == "1" || t.Roadway == "2" ? 1 : 2, |
| | | PalletType = t.PalletType, |
| | | TaskNum = t.TaskId, |
| | | TaskType = t.TaskType, |
| | | CreateDate = t.CreateDate, |
| | | TaskStatus = t.TaskStatus |
| | | }) |
| | | .ToList(); |
| | | return WebResponseContent.Instance.OK("æå", tasks); |
| | | } |
| | | //æ»ä½è¿åº¦ |
| | | public WebResponseContent GetWarehouseOperationStatistics() |
| | | { |
| | | /// <summary> |
| | | /// åæä»ï¼æ»åºå
¥åºä»»å¡æ°éï¼ä»æ¥å
¥åºï¼ä»æ¥åºåºï¼ä»æ¥å¾
宿ï¼ä»æ¥å¼å¸¸ä»»å¡ï¼æåä»ï¼æ»åºå
¥åºæ°éï¼ä»æ¥å
¥åºï¼ä»æ¥åºåºï¼ä»æ¥å¾
宿 |
| | | /// </summary> |
| | | return _task_HtyService.GetWarehouseOperationStatistics(); |
| | | } |
| | | } |
| | | } |