From eec91a7c880119540cd0578d64d1e14092ee6bd3 Mon Sep 17 00:00:00 2001
From: yangpeixing <yangpeixing@hnkhzn.com>
Date: 星期一, 02 三月 2026 14:55:42 +0800
Subject: [PATCH] 1

---
 WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_BC.cs |   39 ++++++++++++++++++++++++---------------
 1 files changed, 24 insertions(+), 15 deletions(-)

diff --git a/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_BC.cs b/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_BC.cs
index b88363c..b025ed5 100644
--- a/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_BC.cs
+++ b/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_BC.cs
@@ -67,21 +67,30 @@
 
                 List<Dt_LocationInfo> definedTypeEmptyLocations = locationInfos.Where(x => (x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() || x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt()) && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.LocationType == palletType.ObjToInt() && !lockLocationCodes.Contains(x.LocationCode)).OrderByDescending(x => x.Depth).ThenBy(x => x.Layer).ThenBy(x => x.Column).ThenBy(x => x.Row).ToList();
 
-                //if (heightType == 1)
-                //{
-                //    undefinedTypeEmptyLocations = undefinedTypeEmptyLocations.Where(x => x.Layer <= 3).ToList();
-                //    definedTypeEmptyLocations = definedTypeEmptyLocations.Where(x => x.Layer <= 3).ToList();
-                //}
-                //else if (heightType == 2)
-                //{
-                //    undefinedTypeEmptyLocations = undefinedTypeEmptyLocations.Where(x => x.Layer == 4).ToList();
-                //    definedTypeEmptyLocations = definedTypeEmptyLocations.Where(x => x.Layer == 4).ToList();
-                //}
-                //else if (heightType == 3)
-                //{
-                //    undefinedTypeEmptyLocations = undefinedTypeEmptyLocations.Where(x => x.Layer == 5).ToList();
-                //    definedTypeEmptyLocations = definedTypeEmptyLocations.Where(x => x.Layer == 5).ToList();
-                //}
+                if (heightType == 1)
+                {
+                    undefinedTypeEmptyLocations = undefinedTypeEmptyLocations.Where(x => x.Layer >= 14).ToList();
+                    definedTypeEmptyLocations = definedTypeEmptyLocations.Where(x => x.Layer >= 14).ToList();
+                }
+                if (heightType == 1 && undefinedTypeEmptyLocations.Count == 0)
+                {
+                    List<Dt_LocationInfo> undefinedTypeEmptyLocation = locationInfos.Where(x => (x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() || x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt()) && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.LocationType == LocationTypeEnum.Undefined.ObjToInt() && !lockLocationCodes.Contains(x.LocationCode)).OrderByDescending(x => x.Depth).ThenBy(x => x.Layer).ThenBy(x => x.Column).ThenBy(x => x.Row).ToList();
+
+                    List<Dt_LocationInfo> definedTypeEmptyLocation = locationInfos.Where(x => (x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() || x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt()) && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.LocationType == palletType.ObjToInt() && !lockLocationCodes.Contains(x.LocationCode)).OrderByDescending(x => x.Depth).ThenBy(x => x.Layer).ThenBy(x => x.Column).ThenBy(x => x.Row).ToList();
+
+                    undefinedTypeEmptyLocations = undefinedTypeEmptyLocation.Where(x => x.Layer >= 3).ToList();
+                    definedTypeEmptyLocations = definedTypeEmptyLocation.Where(x => x.Layer >= 3).ToList();
+                }
+                else if (heightType == 2)
+                {
+                    undefinedTypeEmptyLocations = undefinedTypeEmptyLocations.Where(x => x.Layer <= 13).ToList();
+                    definedTypeEmptyLocations = definedTypeEmptyLocations.Where(x => x.Layer <= 13).ToList();
+                }
+                else if (heightType == 3)
+                {
+                    undefinedTypeEmptyLocations = undefinedTypeEmptyLocations.Where(x => x.Layer <= 4).ToList();
+                    definedTypeEmptyLocations = definedTypeEmptyLocations.Where(x => x.Layer <= 4).ToList();
+                }
                 //else
                 //{
                 //    undefinedTypeEmptyLocations = undefinedTypeEmptyLocations.Where(x => false).ToList();

--
Gitblit v1.9.3