| | |
| | | } |
| | | else |
| | | { |
| | | Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.QueryFirst(x => x.LocationCode == needRelocationItem.LocationCode); |
| | | Dt_StockInfo stockInfo = _stockService.StockInfoService.Db.Queryable<Dt_StockInfo>().Where(x => x.LocationCode == needRelocationItem.LocationCode).Includes(x => x.Details).First(); |
| | | if (stockInfo == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"鏈壘鍒板搴旇揣浣嶇殑搴撳瓨淇℃伅"); |
| | |
| | | int heightType = 0; |
| | | if(needRelocationItem.Layer == 5) |
| | | { |
| | | heightType = 3; |
| | | } |
| | | else if(needRelocationItem.Layer == 4) |
| | | { |
| | | heightType = 2; |
| | | } |
| | | else if(needRelocationItem.Layer <= 3 && needRelocationItem.Layer >= 1) |
| | | //else if(needRelocationItem.Layer == 4) |
| | | //{ |
| | | // heightType = 2; |
| | | //} |
| | | else if(needRelocationItem.Layer <= 4 && needRelocationItem.Layer >= 1) |
| | | { |
| | | heightType = 1; |
| | | } |
| | |
| | | TaskStatus = 0, |
| | | TaskType = TaskTypeEnum.Relocation.ObjToInt() |
| | | }; |
| | | |
| | | string MaterielCode = stockInfo.Details?.Where(x => x.StockId == stockInfo.Id).FirstOrDefault()?.MaterielCode; |
| | | float Quantity = (float)stockInfo.Details?.Where(x => x.StockId == stockInfo.Id).Sum(x => x.StockQuantity); |
| | | string BatchNo = stockInfo.Details?.Where(x => x.StockId == stockInfo.Id).FirstOrDefault()?.BatchNo; |
| | | if (MaterielCode != null && Quantity != null && BatchNo != null) |
| | | { |
| | | newTask.MaterielCode = MaterielCode; |
| | | newTask.Quantity = Quantity; |
| | | newTask.BatchNo = BatchNo; |
| | | } |
| | | if (stockInfo.StockLength>0) |
| | | { |
| | | newTask.TaskLength = stockInfo.StockLength; |