| | |
| | | WMSTaskDTO taskDTO = new WMSTaskDTO() |
| | | { |
| | | TaskNum = task.TaskNum.Value, |
| | | Grade = 1, |
| | | Grade = task.Grade.Value, |
| | | PalletCode = task.PalletCode, |
| | | RoadWay = task.Roadway, |
| | | SourceAddress = task.SourceAddress, |
| | |
| | | // 组盘信息 |
| | | // 将content.Data转换为ResultTrayCellsStatus对象 |
| | | var result = JsonConvert.DeserializeObject<ResultTrayCellsStatus>(content.Data.ToString()); |
| | | |
| | | if (!result.Success) |
| | | { |
| | | var taskNG = new Dt_Task |
| | | { |
| | | CurrentAddress = input.Position, |
| | | Grade = 1, |
| | | Roadway = input.Roadways, |
| | | TargetAddress = stationManager.stationNGLocation, |
| | | Dispatchertime = DateTime.Now, |
| | | MaterialNo = "", |
| | | NextAddress = stationManager.stationNGChildCode, |
| | | OrderNo = null, |
| | | PalletCode = input.PalletCode, |
| | | SourceAddress = stationManager.stationLocation, |
| | | TaskState = (int)TaskInStatusEnum.Line_InFinish, |
| | | TaskType = (int)TaskOutboundTypeEnum.InToOut, |
| | | TaskNum = await BaseDal.GetTaskNo(), |
| | | Creater = "Systeam" |
| | | }; |
| | | return taskNG; |
| | | } |
| | | |
| | | if (result.SerialNos.Count <= 0) |
| | | { |
| | | ConsoleHelper.WriteErrorLine(result.MOMMessage); |
| | |
| | | } |
| | | |
| | | // 处理异常电芯情况 |
| | | var serialNosError = result.SerialNos.Where(x => x.SerialNoStatus != 1).ToList(); |
| | | var serialNosError = result.SerialNos.Where(x => x.SerialNoStatus != 1 && x.SerialNoStatus != 4).ToList(); |
| | | if (serialNosError.Count > 0) |
| | | { |
| | | if (stationManager.stationType != 3) |
| | |
| | | |
| | | if (stationManager.stationType == 1) |
| | | { |
| | | #region |
| | | // 创建一个TrayCellsStatusDto对象,并赋值 |
| | | TrayCellsStatusDto trayCells = new TrayCellsStatusDto() |
| | | { |
| | |
| | | ////// 调用GetProcessResponseAsync方法,获取工艺响应 |
| | | ////var processResponse = await GetProcessResponseAsync(process, input.Position); |
| | | var isBox = await _boxingInfoRepository.AddDataNavAsync(boxing); |
| | | #endregion |
| | | } |
| | | |
| | | var task = new Dt_Task |
| | |
| | | TaskNum = await BaseDal.GetTaskNo(), |
| | | Creater = "Systeam" |
| | | }; |
| | | ConsoleHelper.WriteSuccessLine($"修改前:" + locationInfo.LocationStatus.ToString()); |
| | | int lastStatus = locationInfo.LocationStatus; |
| | | ConsoleHelper.WriteSuccessLine($"修改前:" + lastStatus.ToString()); |
| | | locationInfo.LocationStatus = (int)LocationEnum.FreeDisable; |
| | | ConsoleHelper.WriteSuccessLine($"修改后:" + locationInfo.LocationStatus.ToString()); |
| | | await UpdateLocationAsync(locationInfo); |
| | | |
| | | _locationStatusChangeRecordRepository.AddLocationStatusChangeRecord(locationInfo, lastStatus, (int)StatusChangeTypeEnum.AutomaticStorage, task.TaskNum); |
| | | |
| | | return task; |
| | | } |
| | |
| | | var task = new Dt_Task |
| | | { |
| | | CurrentAddress = input.Position, |
| | | Grade = 1, |
| | | Grade = 2, |
| | | Roadway = input.Roadways, |
| | | TargetAddress = stationManager.stationLocation, |
| | | Dispatchertime = DateTime.Now, |
| | |
| | | |
| | | var isBox = await _boxingInfoRepository.AddDataNavAsync(boxing); |
| | | |
| | | ConsoleHelper.WriteSuccessLine($"修改前:" + locationInfo.LocationStatus.ToString()); |
| | | int lastStatus = locationInfo.LocationStatus; |
| | | |
| | | ConsoleHelper.WriteSuccessLine($"修改前:" + lastStatus.ToString()); |
| | | locationInfo.LocationStatus = (int)LocationEnum.FreeDisable; |
| | | ConsoleHelper.WriteSuccessLine($"修改后:" + locationInfo.LocationStatus.ToString()); |
| | | await UpdateLocationAsync(locationInfo); |
| | | |
| | | _locationStatusChangeRecordRepository.AddLocationStatusChangeRecord(locationInfo, lastStatus, (int)StatusChangeTypeEnum.AutomaticStorage, task.TaskNum); |
| | | |
| | | return task; |
| | | } |
| | | catch (Exception ex) |
| | |
| | | var content = JsonConvert.DeserializeObject<WebResponseContent>(result); |
| | | if (content.Status) |
| | | { |
| | | int lastStatus = item.LocationInfo.LocationStatus; |
| | | await BaseDal.AddDataAsync(task); |
| | | // 更新库存位置状态为不可用 |
| | | item.LocationInfo.LocationStatus = (int)LocationEnum.InStockDisable; |
| | | await _locationRepository.UpdateDataAsync(item.LocationInfo); |
| | | |
| | | _locationStatusChangeRecordRepository.AddLocationStatusChangeRecord(item.LocationInfo, lastStatus, (int)StatusChangeTypeEnum.AutomaticDelivery, task.TaskNum); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | var location = locations.OrderBy(x => x.Layer).ThenBy(x => x.Column).ThenBy(x => x.Row).FirstOrDefault(); |
| | | |
| | | var stockInfo = await QueryStockInfoForEmptyTrayAsync("CWSC1"); |
| | | var stockInfo = await QueryStockInfoForEmptyTrayAsync("CWSC1","10086"); |
| | | |
| | | if (stockInfo != null) |
| | | { |
| | |
| | | WMSTaskDTO wmsTask = CreateTaskDTO(task); |
| | | |
| | | // 更新库存位置状态为不可用 |
| | | int lastStatus = location.LocationStatus; |
| | | stockInfo.LocationInfo.LocationStatus = (int)LocationEnum.InStockDisable; |
| | | location.LocationStatus = (int)LocationEnum.Distribute; |
| | | await _unitOfWorkManage.UseTranAsync(async () => |
| | |
| | | await _locationRepository.UpdateDataAsync(stockInfo.LocationInfo); |
| | | await _locationRepository.UpdateDataAsync(location); |
| | | }); |
| | | |
| | | _locationStatusChangeRecordRepository.AddLocationStatusChangeRecord(location, lastStatus, (int)StatusChangeTypeEnum.AutomaticDelivery, task.TaskNum); |
| | | |
| | | // 返回成功响应 |
| | | return content.OK(data: wmsTask); |
| | |
| | | { |
| | | Dt_StationManager station = _stationManagerRepository.QueryFirst(x => x.stationChildCode == json.Position && x.stationType == 12 && x.stationArea == "Call"); |
| | | |
| | | DtStockInfo stockInfo = _stockInfoRepository.QueryFirst(X => X.IsFull && X.AreaCode == "CWSC3" && X.ProductionLine == station.productLine); |
| | | var stockInfo = _stockInfoRepository.Db.Queryable<DtStockInfo>() |
| | | .Includes(x => x.LocationInfo) // 预加载LocationInfo |
| | | .Where(x => x.AreaCode == "CWSC3" && x.IsFull == true) // 过滤条件 |
| | | .Where(x => x.LocationInfo.LocationStatus == (int)LocationEnum.InStock) // 过滤条件 |
| | | .OrderBy(x => x.OutboundTime) // 排序 |
| | | .First(); // 获取第一个元素 |
| | | |
| | | //DtStockInfo stockInfo = _stockInfoRepository.QueryFirst(X => X.IsFull && X.AreaCode == "CWSC3" && X.ProductionLine == station.productLine); |
| | | if (stockInfo == null) throw new Exception("库内无满足条件的库存可出库"); |
| | | |
| | | DtLocationInfo locationInfo = _locationRepository.QueryFirst(x => x.AreaId == 5 && x.LocationCode == stockInfo.LocationCode); |
| | |
| | | // 创建新任务实例 |
| | | var task = new Dt_Task |
| | | { |
| | | CurrentAddress = locationInfo.RoadwayNo, |
| | | CurrentAddress = stockInfo.LocationCode, |
| | | Grade = 1, |
| | | Roadway = locationInfo.RoadwayNo, |
| | | TargetAddress = json.Position, |
| | |
| | | |
| | | WMSTaskDTO taskDTO = CreateTaskDTO(task); |
| | | |
| | | int lastStatus = locationInfo.LocationStatus; |
| | | |
| | | BaseDal.AddData(task); |
| | | stockInfo.LocationInfo.LocationStatus = (int)LocationEnum.InStockDisable; |
| | | _locationRepository.UpdateData(stockInfo.LocationInfo); |
| | | |
| | | _locationStatusChangeRecordRepository.AddLocationStatusChangeRecord(stockInfo.LocationInfo, lastStatus, (int)StatusChangeTypeEnum.AutomaticDelivery, task.TaskNum); |
| | | |
| | | return content.OK(data: taskDTO); |
| | | } |
| | |
| | | |
| | | if (emergencyTask == null) throw new Exception("火警参数为空"); |
| | | |
| | | DtLocationInfo locationInfo = _locationRepository.QueryFirst(x => x.Row == emergencyTask.row && x.Column == emergencyTask.column && x.Layer == emergencyTask.layer && x.RoadwayNo == emergencyTask.Roadway); |
| | | DtLocationInfo locationInfo = _locationRepository.QueryFirst(x => x.Row == emergencyTask.row && x.Column == emergencyTask.column && x.Layer == emergencyTask.layer && x.AreaId == emergencyTask.zone); |
| | | if (locationInfo == null) |
| | | { |
| | | throw new Exception("未知库位"); |