From 5ea48455463691678b806badbee198699a878b5a Mon Sep 17 00:00:00 2001
From: HuBingJie <3146306518@qq.com>
Date: 星期四, 25 十二月 2025 18:38:58 +0800
Subject: [PATCH] 1

---
 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_BasicService/LocationInfoService.cs |   23 +++++++++++++++++++++--
 1 files changed, 21 insertions(+), 2 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_BasicService/LocationInfoService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_BasicService/LocationInfoService.cs"
index 6009ca3..e01e57f 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_BasicService/LocationInfoService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/WIDESEA_BasicService/LocationInfoService.cs"
@@ -455,8 +455,27 @@
 
         public Dt_LocationInfo? GetLocationInfoSC(string v)
         {
-            Dt_LocationInfo dt_Location = BaseDal.QueryFirst(x=>x.LocationStatus == (int)LocationStatusEnum.Free&& x.RoadwayNo == v&&x.EnableStatus == (int)EnableStatusEnum.Normal);
-            return dt_Location;
+            //Dt_LocationInfo dt_Location = BaseDal.QueryFirst(x => x.LocationStatus == (int)LocationStatusEnum.Free&& x.RoadwayNo == v &&x.EnableStatus == (int)EnableStatusEnum.Normal);
+            Dt_LocationInfo dt_LocationInfo = BaseDal.Db.Queryable<Dt_LocationInfo>()
+                .Where(x => x.LocationStatus == (int)LocationStatusEnum.Free
+                    && x.RoadwayNo == v
+                    && x.EnableStatus == (int)EnableStatusEnum.Normal)
+                .OrderBy("Layer DESC, CASE WHEN Row = 1 THEN 1 WHEN Row = 4 THEN 2 WHEN Row = 2 THEN 3 ELSE 4 END ASC")
+                .First();
+
+            return dt_LocationInfo;
+        }
+
+        public Dt_LocationInfo? GetLocationInfoSC2(string v)
+        {
+            Dt_LocationInfo dt_LocationInfo = Db.Queryable<Dt_LocationInfo>()
+                 .Where(x => x.LocationStatus == (int)LocationStatusEnum.Free
+                     && x.RoadwayNo == v
+                     && x.EnableStatus == (int)EnableStatusEnum.Normal)
+                 .OrderBy("Layer DESC")
+                 .First();// Layer浠庡ぇ鍒板皬鎺掑簭
+
+            return dt_LocationInfo;
         }
 
         public class LocationCache

--
Gitblit v1.9.3