| | |
| | | |
| | | 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 = "System", |
| | | // ProductionLine = result.ProductionLine, |
| | | // ProcessCode = result.ProcessCode, |
| | | //}; |
| | | //return taskNG; |
| | | List<string> strings = new List<string>() { "2036","2038","2084","2086"}; |
| | | if (input.Position.Contains(strings)) |
| | | { |
| | | Console.WriteLine($"{result.MOMMessage}"); |
| | | return null; |
| | | } |
| | | 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 = "System", |
| | | ProductionLine = result.ProductionLine, |
| | | ProcessCode = result.ProcessCode, |
| | | }; |
| | | return taskNG; |
| | | |
| | | } |
| | | |
| | | if (result.SerialNos.Count <= 0) |
| | |
| | | taskHty.Creater = App.User.UserName != null ? App.User.UserName : "System"; |
| | | |
| | | var location = _locationRepository.QueryFirst(x => x.LocationCode == task.SourceAddress && x.RoadwayNo == task.Roadway); |
| | | |
| | | if(location != null) |
| | | { |
| | | int lastStatus = location.LocationStatus; |
| | | location.LocationStatus = (int)LocationEnum.Free; |
| | | _locationStatusChangeRecordRepository.AddLocationStatusChangeRecord(location, lastStatus, (int)StatusChangeTypeEnum.AutomaticDelivery, task.TaskNum); |
| | | } |
| | | |
| | | task.TaskState = (int)TaskOutStatusEnum.OutFinish; |
| | | |
| | | _locationStatusChangeRecordRepository.AddLocationStatusChangeRecord(location, lastStatus, (int)StatusChangeTypeEnum.AutomaticDelivery, task.TaskNum); |
| | | |
| | | // 事务处理 |
| | | await _unitOfWorkManage.UseTranAsync(async () => |
| | | { |
| | |
| | | await DeleteStockInfoDetailsAsync(stock.StockInfoDetails); |
| | | await AddStockInfoHtyAsync(stockInfo_Hty); |
| | | } |
| | | |
| | | if (location != null) |
| | | { |
| | | await UpdateLocationAsync(location); |
| | | } |
| | | await DeleteTaskAsync(task.TaskId); |
| | | await AddTaskHtyAsync(taskHty); |
| | | }); |