| | |
| | | /// <summary> |
| | | /// åé
è´§ä½ |
| | | /// </summary> |
| | | public Dt_LocationInfo? AssignLocation(string roadwayNo, int palletType, int warehouseId, string beRelocationCode = "", int heightType = 0) |
| | | public Dt_LocationInfo? AssignLocation(string roadwayNo, int palletType, int warehouseId, Dt_StockInfo? stockInfo = null) |
| | | { |
| | | Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseId == warehouseId); |
| | | if (warehouse == null) |
| | |
| | | return warehouse.WarehouseCode switch |
| | | { |
| | | "LLDCP" or "LLDFL" => AssignLocation(roadwayNo), |
| | | "LLDYL" => AssignLocationYL(roadwayNo, palletTypeInfo), |
| | | "LLDYL" => AssignLocationYL(roadwayNo, palletTypeInfo, stockInfo), |
| | | _ => throw new Exception($"æªæ¾å°ä»åºè´§ä½åé
æ¹æ³") |
| | | }; |
| | | } |
| | |
| | | /// åæåé
è´§ä½ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public Dt_LocationInfo? AssignLocationYL(string roadwayNo, Dt_PalletTypeInfo palletTypeInfo) |
| | | public Dt_LocationInfo? AssignLocationYL(string roadwayNo, Dt_PalletTypeInfo palletTypeInfo,Dt_StockInfo stockInfo) |
| | | { |
| | | lock (_AssignLocationYL) |
| | | { |
| | |
| | | { |
| | | { nameof(Dt_LocationInfo.Columns),OrderByType.Desc }, |
| | | { nameof(Dt_LocationInfo.Layer),OrderByType.Asc }, |
| | | { nameof(Dt_LocationInfo.Depth),OrderByType.Desc }, |
| | | { nameof(Dt_LocationInfo.Row),OrderByType.Asc } |
| | | }; |
| | | if (roadwayNo.Contains("YLDual")) |
| | |
| | | Dt_LocationInfo locationInfo = new Dt_LocationInfo(); |
| | | foreach (var item in locationInfosMedium) |
| | | { |
| | | if (item.Layer == 7 || item.Layer == 8) |
| | | { |
| | | locationInfo = item; |
| | | break; |
| | | } |
| | | //è·åæ´æ¹åºä½ |
| | | Dt_LocationInfo? nearLocation1; |
| | | Dt_LocationInfo? nearLocation2; |
| | | |
| | | nearLocation1 = locationInfos.FirstOrDefault(x => x.LocationType == LocationTypeEnum.SmallPallet.ObjToInt() && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.Row == item.Row && x.Layer == item.Layer && x.Depth == item.Depth && x.Columns == item.Columns - 1); |
| | | nearLocation2 = locationInfos.FirstOrDefault(x => x.LocationType == LocationTypeEnum.SmallPallet.ObjToInt() && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.Row == item.Row && x.Layer == item.Layer && x.Depth == item.Depth && x.Columns == item.Columns + 1); |
| | | nearLocation1 = locationInfos.FirstOrDefault(x => x.LocationType == LocationTypeEnum.SmallPallet.ObjToInt() && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.EnableStatus != EnableStatusEnum.Disable.ObjToInt() && x.Row == item.Row && x.Layer == item.Layer && x.Depth == item.Depth && x.Columns == item.Columns - 1); |
| | | nearLocation2 = locationInfos.FirstOrDefault(x => x.LocationType == LocationTypeEnum.SmallPallet.ObjToInt() && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.EnableStatus != EnableStatusEnum.Disable.ObjToInt() && x.Row == item.Row && x.Layer == item.Layer && x.Depth == item.Depth && x.Columns == item.Columns + 1); |
| | | if (nearLocation1!=null && nearLocation2!=null) |
| | | { |
| | | locationInfo = item; |
| | |
| | | } |
| | | else |
| | | { |
| | | return BaseDal.QueryFirst(x => x.RoadwayNo == roadwayNo && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.EnableStatus != EnableStatusEnum.Disable.ObjToInt() && !lockLocations.Contains(x.LocationCode), orderBy);//æ¥è¯¢ç©ºè´§ä½ä¿¡æ¯å¹¶æé¤5åéå
åé
çè´§ä½,æ ¹æ®å±ãåãæ·±åº¦ãè¡æåº |
| | | bool LayerLimit = false; |
| | | if (stockInfo.MaterielThickness > 1300) |
| | | { |
| | | LayerLimit = true; |
| | | } |
| | | return BaseDal.QueryFirst(x => x.RoadwayNo == roadwayNo && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.EnableStatus != EnableStatusEnum.Disable.ObjToInt() && !lockLocations.Contains(x.LocationCode) && (LayerLimit ? x.Columns >= 56 : x.Columns <= 55), orderBy);//æ¥è¯¢ç©ºè´§ä½ä¿¡æ¯å¹¶æé¤5åéå
åé
çè´§ä½,æ ¹æ®å±ãåãæ·±åº¦ãè¡æåº |
| | | } |
| | | |
| | | } |
| | |
| | | { |
| | | List<Dt_LocationInfo> locationInfos = Repository.QueryData(x => x.RoadwayNo == location.RoadwayNo); |
| | | |
| | | List<Dt_PalletTypeInfo> palletTypeInfos = _basicRepository.PalletTypeInfoRepository.QueryData(x => x.WarehouseId == warehouseId); |
| | | Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseId == warehouseId); |
| | | |
| | | Dt_PalletTypeInfo? palletTypeInfo = _basicRepository.PalletTypeInfoRepository.QueryFirst(x => x.PalletType == palletType && x.WarehouseId == warehouseId); |
| | |
| | | } |
| | | } |
| | | |
| | | if (palletTypeInfos.FirstOrDefault(x => x.LocaitonCount == 2) != null) |
| | | if (warehouse.WarehouseCode == WarehouseEnum.LLDYL.ToString() && palletTypeInfo.LocaitonCount == 2 && location.RoadwayNo.Contains("Dual")) |
| | | { |
| | | //è·åæ´æ¹åºä½ |
| | | Dt_LocationInfo? nearLocation1; |
| | |
| | | } |
| | | } |
| | | locations.AddRange(nearLocations); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | for (int i = 0; i < locations.Count; i++) |
| | | { |
| | | if (locations[i].LocationCode == location.LocationCode) |
| | | { |
| | | locations[i].LocationStatus = locationStatus.ObjToInt(); |
| | | } |
| | | else |
| | | { |
| | | if (locationStatus == LocationStatusEnum.Lock) |
| | | { |
| | | if (locations[i].LocationStatus == LocationStatusEnum.InStock.ObjToInt()) |
| | | { |
| | | locations[i].LocationStatus = LocationStatusEnum.InStockLock.ObjToInt(); |
| | | } |
| | | else if (locations[i].LocationStatus == LocationStatusEnum.Free.ObjToInt()) |
| | | { |
| | | locations[i].LocationStatus = LocationStatusEnum.FreeLock.ObjToInt(); |
| | | } |
| | | } |
| | | else if (locationStatus == LocationStatusEnum.Free || locationStatus == LocationStatusEnum.InStock) |
| | | { |
| | | if (locations[i].LocationStatus == LocationStatusEnum.InStockLock.ObjToInt()) |
| | | { |
| | | locations[i].LocationStatus = LocationStatusEnum.InStock.ObjToInt(); |
| | | } |
| | | else if (locations[i].LocationStatus == LocationStatusEnum.FreeLock.ObjToInt()) |
| | | { |
| | | locations[i].LocationStatus = LocationStatusEnum.Free.ObjToInt(); |
| | | } |
| | | } |
| | | } |
| | | if (locations[i].LocationType != palletType.ObjToInt()) |
| | | { |
| | | locations[i].LocationType = palletType.ObjToInt(); |
| | | } |
| | | } |
| | | } |