wankeda
3 天以前 96f8501cc973232b340e36a61992ec1ad47e4a31
WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Base/LocationInfoService.cs
@@ -216,7 +216,7 @@
                                EnableStatus = EnableStatusEnum.Normal.ObjToInt(),
                                Layer = k + 1,
                                LocationStatus = LocationStatusEnum.Free.ObjToInt(),
                                LocationType = LocationTypeEnum.Cube.ObjToInt(),
                                //LocationType = LocationTypeEnum.Cube.ObjToInt(),
                                RoadwayNo = initializationLocationDTO.Roadway,
                                Row = i + 1,
                            };
@@ -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; }