From 96f8501cc973232b340e36a61992ec1ad47e4a31 Mon Sep 17 00:00:00 2001 From: wankeda <Administrator@DESKTOP-HAU3ST3> Date: 星期六, 12 七月 2025 11:10:34 +0800 Subject: [PATCH] Merge branch 'master' of http://115.159.85.185:8098/r/MeiRuiAn/JiAnLiKu --- WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Base/LocationInfoService.cs | 34 +++++++++++++++++++++++++++++++++- 1 files changed, 33 insertions(+), 1 deletions(-) diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Base/LocationInfoService.cs b/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Base/LocationInfoService.cs index 6fad4e6..394da79 100644 --- a/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Base/LocationInfoService.cs +++ b/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; } -- Gitblit v1.9.3