| | |
| | | }; |
| | | } |
| | | |
| | | public bool LittleDepthLocationIsEmpty(Dt_LocationInfo locationInfo, PalletTypeEnum palletType) |
| | | { |
| | | Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseId == locationInfo.WarehouseId); |
| | | if (warehouse == null) |
| | | { |
| | | throw new Exception($"æªæ¾å°ä»åºä¿¡æ¯"); |
| | | } |
| | | |
| | | return warehouse.WarehouseName switch |
| | | { |
| | | "æ¿æä»" => false, |
| | | "PPä»" => false, |
| | | "å¹²èä»" => false, |
| | | "æµè¯æ¶ä»" => LittleDepthLocationIsEmpty_CSJ(locationInfo, palletType), |
| | | "é»çä»" => false, |
| | | "油墨ä»" => true, |
| | | "æåä»" => true, |
| | | "è¾
æä»" => true, |
| | | _ => throw new Exception($"æªæ¾å°ä»åºè´§ä½åé
æ¹æ³") |
| | | }; |
| | | } |
| | | |
| | | private readonly static object _locker = new object(); |
| | | private static List<LocationCache> locationCaches = new List<LocationCache>(); |
| | | /// <summary> |
| | |
| | | /// <param name="locationInfos"></param> |
| | | /// <param name="location"></param> |
| | | /// <returns></returns> |
| | | private List<Dt_LocationInfo> GetGroupLocations(List<Dt_LocationInfo> locationInfos, Dt_LocationInfo location) |
| | | public List<Dt_LocationInfo> GetGroupLocations(List<Dt_LocationInfo> locationInfos, Dt_LocationInfo location) |
| | | { |
| | | List<Dt_LocationInfo> groupLocations = new List<Dt_LocationInfo>() { location }; |
| | | int maxDepth = locationInfos.Max(x => x.Depth); |
| | |
| | | } |
| | | return groupLocations; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åä¸å深度çåç»è´§ä½ä¿¡æ¯ |
| | | /// </summary> |
| | | /// <param name="location"></param> |
| | | /// <returns></returns> |
| | | public List<Dt_LocationInfo> GetGroupLocations(Dt_LocationInfo location) |
| | | { |
| | | List<Dt_LocationInfo> locationInfos = Repository.QueryData(x => x.RoadwayNo == location.RoadwayNo && x.WarehouseId == location.WarehouseId); |
| | | |
| | | List<Dt_LocationInfo> groupLocations = new List<Dt_LocationInfo>() { location }; |
| | | int maxDepth = locationInfos.Max(x => x.Depth); |
| | | for (int j = location.Depth + 1; j <= maxDepth; j++) |
| | | { |
| | | Dt_LocationInfo? locationInfo = locationInfos.FirstOrDefault(x => x.Depth == j && x.Column == location.Column && x.Layer == location.Layer); |
| | | if (locationInfo != null) |
| | | { |
| | | groupLocations.Add(locationInfo); |
| | | } |
| | | } |
| | | |
| | | for (int j = location.Depth - 1; j >= 1; j--) |
| | | { |
| | | Dt_LocationInfo? locationInfo = locationInfos.FirstOrDefault(x => x.Depth == j && x.Column == location.Column && x.Layer == location.Layer); |
| | | if (locationInfo != null) |
| | | { |
| | | groupLocations.Add(locationInfo); |
| | | } |
| | | } |
| | | return groupLocations; |
| | | } |
| | | } |
| | | |
| | | } |