1
wankeda
2025-03-07 b55d324f4b7465f9a7dc50e999346697f5cc35a2
WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Base/LocationInfoService.cs
@@ -255,6 +255,38 @@
            }
        }
                /// <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);
            int row = location.Row;
            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 && (x.Row == row + 1 || x.Row == row - 1));
                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 && (x.Row == row + 1 || x.Row == row - 1));
                if (locationInfo != null)
                {
                    groupLocations.Add(locationInfo);
                }
            }
            return groupLocations;
        }
        public class LocationCache
        {
            public string LocationCode { get; set; }