From f723c6e9087a2110a28572543c7cfd9104e2a4ed Mon Sep 17 00:00:00 2001
From: hutongqing <hutongqing@hnkhzn.com>
Date: 星期一, 23 十二月 2024 20:52:58 +0800
Subject: [PATCH] 1

---
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/LocationInfoService_Common.cs |   55 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 54 insertions(+), 1 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/LocationInfoService_Common.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/LocationInfoService_Common.cs"
index bd6834c..146b0b7 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/LocationInfoService_Common.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/LocationInfoService_Common.cs"
@@ -45,6 +45,28 @@
             };
         }
 
+        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>
@@ -146,7 +168,7 @@
         /// <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);
@@ -169,6 +191,37 @@
             }
             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;
+        }
     }
 
 }

--
Gitblit v1.9.3