From 4d83bc8431bb1fda7b3cef959e2505b2402285d2 Mon Sep 17 00:00:00 2001
From: hutongqing <hutongqing@hnkhzn.com>
Date: 星期四, 26 十二月 2024 21:53:14 +0800
Subject: [PATCH] ·

---
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_CSJ.cs |   49 +++++++++++++++++++++++++++++++++++--------------
 1 files changed, 35 insertions(+), 14 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_CSJ.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_CSJ.cs"
index 31aed3f..c3c44a5 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_CSJ.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_CSJ.cs"
@@ -24,21 +24,22 @@
         /// <summary>
         /// 娴嬭瘯鏋朵粨璐т綅鍒嗛厤 <br/>
         /// 鎵樼洏绫诲瀷锛� <br/>
-        /// 1锛氭渶闀� <br/>
-        /// 2锛氶暱 <br/>
-        /// 3锛氫腑绛� <br/>
-        /// 4锛氱煭 <br/>
-        /// 3鍜�4閮芥槸3娣憋紝涓斿彲浠ユ贩鏀俱�� <br/>
-        /// 1鍜�2閮芥槸2娣憋紝涓斿彲浠ユ贩鏀俱�� <br/>
-        /// 绉诲簱鏃跺彧鑳芥槸鍚屼晶璐т綅銆�
+        /// 1锛氱煭 <br/>
+        /// 2锛氫腑绛� <br/>
+        /// 3锛氶暱 <br/>
+        /// 4锛氱壒闀� <br/>
+        /// 1鍜�2閮芥槸3娣憋紝涓斿彲浠ユ贩鏀俱�� <br/>
+        /// 3鍜�4閮芥槸2娣憋紝涓斿彲浠ユ贩鏀俱�� <br/>
+        /// 绉诲簱鏃跺彧鑳芥槸鍚屼晶璐т綅銆� <br/>
+        /// 6鎺�43鍒�13灞�---13灞備笉鍙敤
         /// </summary>
         /// <param name="roadwayNo">宸烽亾鍙�</param>
         /// <param name="palletType">
         /// 鎵樼洏绫诲瀷 <br/>
-        /// 1锛氭渶闀� <br/>
-        /// 2锛氶暱 <br/>
-        /// 3锛氫腑绛� <br/>
-        /// 4锛氱煭 
+        /// 1锛氱煭 <br/>
+        /// 2锛氫腑绛� <br/>
+        /// 3锛氶暱 <br/>
+        /// 4锛氱壒闀� 
         /// </param>
         /// <returns></returns>
         public Dt_LocationInfo? AssignLocation_CSJ(string roadwayNo, PalletTypeEnum palletType, string beRelocationCode = "")
@@ -99,7 +100,6 @@
                         Dt_LocationInfo? locationInfo = GetUsableLocation_CSJ(locationInfos, undefinedTypeEmptyLocation, palletType);
                         if (locationInfo != null)
                         {
-                            UpdateLocationStatus(locationInfo, palletType, LocationStatusEnum.Lock, 3);
                             locationCaches_CSJ.Add(new LocationCache { LocationCode = locationInfo.LocationCode, DateTime = DateTime.Now });
                             return locationInfo;
                         }
@@ -113,7 +113,6 @@
                         Dt_LocationInfo? locationInfo = GetUsableLocation_CSJ(locationInfos, definedTypeEmptyLocation, palletType);
                         if (locationInfo != null)
                         {
-                            UpdateLocationStatus(locationInfo, palletType, LocationStatusEnum.Lock, 3);
                             locationCaches_CSJ.Add(new LocationCache { LocationCode = locationInfo.LocationCode, DateTime = DateTime.Now });
                             return locationInfo;
                         }
@@ -150,6 +149,28 @@
             return null;
         }
 
+        private bool LittleDepthLocationIsEmpty_CSJ(Dt_LocationInfo locationInfo, PalletTypeEnum palletType)
+        {
+            List<Dt_LocationInfo> locations = GetGroupLocations(locationInfo);
+
+            switch (palletType)
+            {
+                case PalletTypeEnum.LargestPallet:
+                case PalletTypeEnum.LargePallet:
+                    {
+                        List<Dt_LocationInfo> littleDepth = locations.Where(x => x.Depth <= locationInfo.Depth).ToList();
+                        return littleDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.Free.ObjToInt() && x.EnableStatus != EnableStatusEnum.OnlyIn.ObjToInt() && x.EnableStatus != EnableStatusEnum.Normal.ObjToInt()) == null; //鏌ヨ灏忎簬褰撳墠璐т綅娣卞害鐨勯泦鍚堥噷鏄惁鏈夌姸鎬佷笉涓虹┖锛屼笖绂佺敤鐘舵�佷笉涓虹鐢ㄤ互鍙婂彧鍏ョ殑璐т綅锛屽鏋滄槸true锛屽垯琛ㄧず娴呰揣浣嶈浣跨敤鎴栬�呰绂佺敤鐨勬儏鍐�
+                    }
+                case PalletTypeEnum.MediumPallet:
+                case PalletTypeEnum.SmallPallet:
+                    {
+                        List<Dt_LocationInfo> littleDepth = locations.Where(x => x.Depth <= locationInfo.Depth).ToList();
+                        return littleDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.Free.ObjToInt() && x.EnableStatus != EnableStatusEnum.OnlyIn.ObjToInt() && x.EnableStatus != EnableStatusEnum.Normal.ObjToInt()) == null; //鏌ヨ灏忎簬褰撳墠璐т綅娣卞害鐨勯泦鍚堥噷鏄惁鏈夌姸鎬佷笉涓虹┖锛屼笖绂佺敤鐘舵�佷笉涓虹鐢ㄤ互鍙婂彧鍏ョ殑璐т綅锛屽鏋滄槸true锛屽垯琛ㄧず娴呰揣浣嶈浣跨敤鎴栬�呰绂佺敤鐨勬儏鍐�
+                    }
+            }
+            return false;
+        }
+
         /// <summary>
         /// 鍒ゆ柇涓嶅悓娣卞害鐨勫悓缁勮揣浣嶇姸鎬佹槸鍚︿负绌洪棽绌轰綅(娴嬭瘯鏋朵粨)
         /// </summary>
@@ -184,7 +205,7 @@
                         List<Dt_LocationInfo> littleDepth = locations.Where(x => x.Depth <= emptyLocation.Depth).ToList();
                         littleDepthFlag = littleDepth.FirstOrDefault(x => x.LocationStatus != LocationStatusEnum.Free.ObjToInt() && x.EnableStatus != EnableStatusEnum.OnlyIn.ObjToInt() && x.EnableStatus != EnableStatusEnum.Normal.ObjToInt()) == null; //鏌ヨ灏忎簬褰撳墠璐т綅娣卞害鐨勯泦鍚堥噷鏄惁鏈夌姸鎬佷笉涓虹┖锛屼笖绂佺敤鐘舵�佷笉涓虹鐢ㄤ互鍙婂彧鍏ョ殑璐т綅锛屽鏋滄槸true锛屽垯琛ㄧず娴呰揣浣嶈浣跨敤鎴栬�呰绂佺敤鐨勬儏鍐�
                     }
-                    
+
                     break;
             }
 

--
Gitblit v1.9.3