| | |
| | | if (task != null) |
| | | { |
| | | //PushTasksToWCS(new List<Dt_Task> { task }); |
| | | _hubContext.Clients.All.SendAsync("ReceiveMessage", $"该托盘{palletCode}已生成任务"); |
| | | |
| | | return WebResponseContent.Instance.Error($"该托盘{palletCode}已生成任务"); |
| | | } |
| | | Dt_StockInfo stockInfo = _stockRepository.StockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletCode == palletCode).Includes(x => x.Details).First(); |
| | | |
| | | if (stockInfo == null) |
| | | { |
| | | _hubContext.Clients.All.SendAsync("ReceiveMessage", $"未找到组盘信息"); |
| | | |
| | | return WebResponseContent.Instance.Error($"未找到组盘信息"); |
| | | } |
| | | if (stockInfo.StockStatus == StockStatusEmun.合托出库完成.ObjToInt()) |
| | |
| | | } |
| | | if (stockInfo.StockStatus == StockStatusEmun.盘点出库完成.ObjToInt()) |
| | | { |
| | | _hubContext.Clients.All.SendAsync("ReceiveMessage", $"该托盘{palletCode}已生成任务"); |
| | | |
| | | return WebResponseContent.Instance.Error($"该托盘{palletCode}未盘点"); |
| | | } |
| | | ///判断是否存在回库单,进行回原库位逻辑 |
| | |
| | | Dt_LocationInfo locationInfo1 = _locationInfoService.Repository.QueryFirst(x => x.LocationCode == returnOrder.LocationCode); |
| | | if (locationInfo1 == null) |
| | | { |
| | | _hubContext.Clients.All.SendAsync("ReceiveMessage", $"回库单中该库位{returnOrder.LocationCode}未找到"); |
| | | |
| | | return WebResponseContent.Instance.Error($"回库单中该库位{returnOrder.LocationCode}未找到"); |
| | | } |
| | | returnRoadwayInfo = _basicRepository.RoadwayInfoRepository.QueryFirst(x => x.RoadwayNo == locationInfo1.RoadwayNo); |
| | |
| | | |
| | | if (Repository.QueryFirst(x => x.SourceAddress == (returnRoadwayInfo.InStationCode != null ? returnRoadwayInfo.InStationCode : stationCode) && x.TaskStatus == TaskStatusEnum.New.ObjToInt()) != null) |
| | | { |
| | | _hubContext.Clients.All.SendAsync("ReceiveMessage", $"该站点已有未执行的任务"); |
| | | |
| | | return WebResponseContent.Instance.Error($"该站点已有未执行的任务"); |
| | | } |
| | | |
| | | var details = stockInfo.Details.FirstOrDefault(); |
| | | if (!string.IsNullOrEmpty(stockInfo.LocationCode)) |
| | | { |
| | | _hubContext.Clients.All.SendAsync("ReceiveMessage", $"该托盘已绑定货位"); |
| | | |
| | | return WebResponseContent.Instance.Error($"该托盘已绑定货位"); |
| | | } |
| | | Dt_RoadwayInfo roadwayInfo = _basicRepository.RoadwayInfoRepository.QueryFirst(x => x.InStationCode == (returnRoadwayInfo.InStationCode != null ? returnRoadwayInfo.InStationCode : stationCode)); |
| | | if (roadwayInfo == null) |
| | | { |
| | | _hubContext.Clients.All.SendAsync("ReceiveMessage", $"未找到该入库站台地址"); |
| | | |
| | | return WebResponseContent.Instance.Error($"未找到该入库站台地址"); |
| | | } |
| | | Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseCode == roadwayInfo.RoadwayNo); |
| | | if (warehouse == null) |
| | | { |
| | | _hubContext.Clients.All.SendAsync("ReceiveMessage", $"未找到该仓库"); |
| | | |
| | | return WebResponseContent.Instance.Error("未找到该仓库"); |
| | | } |
| | | Dt_LocationInfo? locationInfo = new Dt_LocationInfo(); |
| | |
| | | locationInfo = _locationInfoService.Repository.QueryFirst(x => x.LocationCode == returnOrder.LocationCode); |
| | | if (locationInfo.LocationStatus != LocationStatusEnum.Lock.ObjToInt() || locationInfo.EnableStatus == EnableStatusEnum.Disable.ObjToInt() || locationInfo.EnableStatus == EnableStatusEnum.OnlyOut.ObjToInt()) |
| | | { |
| | | _hubContext.Clients.All.SendAsync("ReceiveMessage", $"该回库单货位{locationInfo.LocationCode}非锁定状态或货位启用状态不正确,请检查"); |
| | | |
| | | return WebResponseContent.Instance.Error($"该回库单货位{locationInfo.LocationCode}非锁定状态或货位启用状态不正确,请检查"); |
| | | } |
| | | } |
| | |
| | | locationInfo = _basicService.LocationInfoService.AssignLocation(roadwayInfo.RoadwayNo, stockInfo.PalletType, warehouse.WarehouseId, "", heightType);//, stockInfo.WarehouseId |
| | | if (locationInfo == null) |
| | | { |
| | | _hubContext.Clients.All.SendAsync("ReceiveMessage", $"货位分配失败,未找到可分配货位"); |
| | | |
| | | return WebResponseContent.Instance.Error($"货位分配失败,未找到可分配货位"); |
| | | } |
| | | } |
| | |
| | | catch (Exception ex) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | _hubContext.Clients.All.SendAsync("ReceiveMessage", $"{ex.Message}"); |
| | | |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | |
| | | catch (Exception ex) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | _hubContext.Clients.All.SendAsync("ReceiveMessage", $"{ex.Message}"); |
| | | |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |