| | |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | var task = BaseDal.QueryFirst(x => x.PalletCode == taskDto.PalletCode); |
| | | if (task != null) |
| | | { |
| | | return content.Error("该æçå·²ç»åå¨ä»»å¡ï¼è¯·å¿éå¤ä¸å"); |
| | | } |
| | | |
| | | var boxingInfo = await _boxingInfoRepository.QueryFirstNavAsync(x => x.PalletCode == taskDto.PalletCode && x.StockStatus == (int)StockStateEmun.ç»çæå); |
| | | |
| | | if (boxingInfo == null) |
| | |
| | | } |
| | | if (!LocationIsOutBound(StartAddress)) |
| | | { |
| | | throw new Exception($"èµ·ç¹åºä½{StartAddress.LocationCode}åºåºè·¯å¾è¢«å ç¨ï¼è¯·äººå·¥ç¡®è®¤åä¸åä»»å¡"); |
| | | throw new Exception($"èµ·ç¹åºä½{StartAddress.LocationCode}åºåºè·¯å¾è¢«å ç¨ï¼è¯·ç¨åéè¯"); |
| | | } |
| | | DtLocationInfo location = null; |
| | | if (taskDto.AreaId != 0) |
| | |
| | | //todoæ¥è¯¢å
ä¾§åºåä¿¡æ¯ |
| | | var stock = await _stockInfoRepository.QueryFirstAsync(x => x.LocationCode == locationLateral.LocationCode); |
| | | |
| | | if (stock == null) |
| | | { |
| | | return content.Error($"æªæ¾å°æµ
ä½{locationLateral.LocationCode}åºåä¿¡æ¯"); |
| | | } |
| | | Dt_Task taskNew = new Dt_Task |
| | | { |
| | | Grade = 1, |
| | |
| | | var taskDTO = CreateListTaskDTO(taskNew); |
| | | |
| | | var isResult = await AddTaskAsync(taskNew, locationLateral, TargetAddress); |
| | | //UpdateLocationStatus(TargetAddress, LocationEnum.Lock); |
| | | UpdateLocationStatus(TargetAddress, LocationEnum.Lock, taskNew.TaskNum.Value, (int)StatusChangeTypeEnum.AutomaticRelocation); |
| | | if (!isResult) |
| | | { |
| | |
| | | return content.Error("èµ·ç¹æªå®ä¹æç»ç¹åºåæªæ¾å°ç©ºé²åºä½"); |
| | | } |
| | | //todoæ¥è¯¢ç§»åºåºåä¿¡æ¯ |
| | | |
| | | Dt_Task taskNew = new Dt_Task |
| | | var stock = _stockInfoRepository.QueryFirst(x => x.LocationCode == item.LocationCode); |
| | | if (stock == null) |
| | | { |
| | | Grade = item.Column, |
| | | Roadway = "AGV", |
| | | TargetAddress = Targetlocation.LocationCode, |
| | | Dispatchertime = DateTime.Now, |
| | | MaterialNo = "", |
| | | NextAddress = Targetlocation.LocationCode, |
| | | OrderNo = null, |
| | | PalletCode = _random.Next(0, 10000).ToString(), |
| | | SourceAddress = item.LocationCode, |
| | | CurrentAddress = item.LocationCode, |
| | | TaskState = (int)TaskAGVCarryStatusEnum.CarryNew, |
| | | TaskType = (int)TaskRelocationTypeEnum.Relocation, |
| | | TaskNum = BaseDal.GetTaskNo().Result, |
| | | CreateDate = DateTime.Now, |
| | | TaskId = 0, |
| | | AGVTaskNum = GenerateUniqueId(), |
| | | Floor = item.Floor, |
| | | Remark = item.AreaId.ToString(), |
| | | }; |
| | | return content.Error($"æªæ¾å°æµ
ä½{item.LocationCode}åºåä¿¡æ¯"); |
| | | } |
| | | var Relocationtask = BaseDal.QueryFirst(x => x.PalletCode == stock.PalletCode && x.TaskType == (int)TaskRelocationTypeEnum.Relocation); |
| | | Dt_Task taskNew = new Dt_Task(); |
| | | if (Relocationtask != null) |
| | | { |
| | | taskDTO.Add(CreateTaskDTO(Relocationtask)); |
| | | //return content.OK(data:taskDTO); |
| | | continue; |
| | | } |
| | | else |
| | | { |
| | | taskNew = new Dt_Task |
| | | { |
| | | Grade = item.Column, |
| | | Roadway = "AGV", |
| | | TargetAddress = Targetlocation.LocationCode, |
| | | Dispatchertime = DateTime.Now, |
| | | MaterialNo = "", |
| | | NextAddress = Targetlocation.LocationCode, |
| | | OrderNo = null, |
| | | PalletCode = stock.PalletCode, |
| | | SourceAddress = item.LocationCode, |
| | | CurrentAddress = item.LocationCode, |
| | | TaskState = (int)TaskAGVCarryStatusEnum.CarryNew, |
| | | TaskType = (int)TaskRelocationTypeEnum.Relocation, |
| | | TaskNum = BaseDal.GetTaskNo().Result, |
| | | CreateDate = DateTime.Now, |
| | | TaskId = 0, |
| | | AGVTaskNum = GenerateUniqueId(), |
| | | Floor = item.Floor, |
| | | Remark = item.AreaId.ToString(), |
| | | }; |
| | | } |
| | | taskDTO.Add(CreateTaskDTO(taskNew)); |
| | | |
| | | var isResult = await AddTaskAsync(taskNew, item, Targetlocation); |
| | |
| | | TaskState = task.TaskState, |
| | | Id = 0, |
| | | TaskType = task.TaskType, |
| | | Floor =task.Floor, |
| | | AGVTaskNum = task.AGVTaskNum, |
| | | } }; |
| | | } |
| | |
| | | Id = 0, |
| | | TaskType = task.TaskType, |
| | | AGVTaskNum = task.AGVTaskNum, |
| | | Remark= task.Remark |
| | | Remark = task.Remark, |
| | | Floor = task.Floor, |
| | | }; |
| | | } |
| | | |
| | |
| | | TaskNum = task.TaskNum.Value, |
| | | LocationId = StartAddress.Id, |
| | | LocationCode = StartAddress.LocationCode, |
| | | ChangeType = (int)StatusChangeTypeEnum.AutomaticInbound, |
| | | ChangeType = (int)StatusChangeTypeEnum.AutomaticRelocation, |
| | | }, |
| | | new LocationChangeRecordDto() |
| | | { |
| | |
| | | TaskNum = task.TaskNum.Value, |
| | | LocationId = EndAddress.Id, |
| | | LocationCode = EndAddress.LocationCode, |
| | | ChangeType = (int)StatusChangeTypeEnum.AutomaticInbound, |
| | | ChangeType = (int)StatusChangeTypeEnum.AutomaticRelocation, |
| | | }, |
| | | }; |
| | | |