From 96a77e69b0577c50adfaacd5fd8b89009242d3bd Mon Sep 17 00:00:00 2001
From: Admin <Admin@ADMIN>
Date: 星期日, 07 十二月 2025 18:25:00 +0800
Subject: [PATCH] 更新

---
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Base/LocationInfoService.cs |   61 ++++++++++++++++++++++++++++++
 1 files changed, 60 insertions(+), 1 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Base/LocationInfoService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Base/LocationInfoService.cs"
index 936f130..275ecf1 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Base/LocationInfoService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Base/LocationInfoService.cs"
@@ -139,7 +139,7 @@
         {
             lock (_locker)
             {
-                List<LocationCache> removeItems = locationCaches.Where(x => (DateTime.Now - x.DateTime).TotalMinutes > 20).ToList();//鏌ヨ娣诲姞闈欐�佸彉閲忚秴杩�5鍒嗛挓鐨勮揣浣�
+                List<LocationCache> removeItems = locationCaches.Where(x => (DateTime.Now - x.DateTime).TotalMinutes > 3).ToList();//鏌ヨ娣诲姞闈欐�佸彉閲忚秴杩�5鍒嗛挓鐨勮揣浣�
                 int count = removeItems.Count;
                 for (int i = 0; i < count; i++)
                 {
@@ -370,5 +370,64 @@
 
             public DateTime DateTime { get; set; }
         }
+
+        /*public WebResponseContent RetrieveStorageLocationInformation()
+        {
+            List<Dt_LocationInfo> dt_Locations = BaseDal.QueryData();
+
+            //鑾峰彇鎴愬搧搴撲綅鏁伴噺(娣�)
+            List<Dt_LocationInfo> Shallowlocation = dt_Locations.Where(x => x.RoadwayNo == "1" && x.LocationStatus == LocationStatusEnum.Free.ObjToInt()&& x.EnableStatus == (int)EnableStatusEnum.Normal && x.Layer <= 9 && x.Depth==1).ToList();
+            List<Dt_LocationInfo> Finishedlocation = dt_Locations.Where(x => x.RoadwayNo == "1" && x.LocationStatus == LocationStatusEnum.Free.ObjToInt()&& x.EnableStatus == (int)EnableStatusEnum.Normal && x.Layer <= 9 && x.Depth == 2).ToList();
+
+            //鑾峰彇14-37鍒楀簱浣嶆暟閲�
+
+            //鑾峰彇绌烘墭搴撲綅鏁伴噺
+
+            //鑾峰彇鍘熸潗鏂欏簱浣嶆暟閲�
+            //鑾峰彇绌烘墭鏁伴噺
+        }*/
+
+        public WebResponseContent RetrieveStorageLocationInformation()
+        {
+            // 1. 鏌ユ壘娣卞簱浣�
+            List<Dt_LocationInfo> dt_Locations = BaseDal.QueryData(
+                x => x.RoadwayNo == "1"
+                    && x.EnableStatus == 0
+                    && x.LocationStatus == 0
+                    && x.Depth == 2
+                    && x.Layer <= 9
+            );
+
+            if (dt_Locations == null || !dt_Locations.Any())
+            {
+                return WebResponseContent.Instance.OK(new List<string>().ToJson());
+            }
+
+            // 2. 鏌ヨ鎵�鏈夋祬搴撲綅
+            var allShallow = BaseDal.QueryData(
+                x => x.RoadwayNo == "1" && x.Depth == 1
+            );
+
+            List<string> locationCodes = new List<string>();
+
+            if (allShallow != null)
+            {
+                // 鍦ㄥ唴瀛樹腑杩囨护骞舵彁鍙朙ocationCode
+                locationCodes = allShallow
+                    .Where(x =>
+                        dt_Locations.Any(deep =>
+                            deep.Layer == x.Layer
+                            && deep.RoadwayNo == x.RoadwayNo
+                            && deep.Column == x.Column
+                            && ((deep.Row == 1 && x.Row == 2) || (deep.Row != 1 && x.Row == 3))
+                        )
+                        && x.LocationStatus != 0
+                    )
+                    .Select(x => x.LocationCode)  // 鍙�夋嫨LocationCode瀛楁
+                    .ToList();
+            }
+
+            return WebResponseContent.Instance.OK(locationCodes.ToJson());
+        }
     }
 }

--
Gitblit v1.9.3