From b55d324f4b7465f9a7dc50e999346697f5cc35a2 Mon Sep 17 00:00:00 2001 From: wankeda <Administrator@DESKTOP-HAU3ST3> Date: 星期五, 07 三月 2025 15:17:19 +0800 Subject: [PATCH] 1 --- WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Base/LocationInfoService.cs | 32 ++++++++++++++++++++++++++++++++ 1 files changed, 32 insertions(+), 0 deletions(-) diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Base/LocationInfoService.cs b/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Base/LocationInfoService.cs index 6fad4e6..d6dbb0b 100644 --- a/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Base/LocationInfoService.cs +++ b/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; } -- Gitblit v1.9.3