From fd9ce381b904a22593de2ab242fb8f65cee45efa Mon Sep 17 00:00:00 2001
From: chengsc <11752@DESKTOP-DS49RCP>
Date: 星期四, 22 五月 2025 15:27:48 +0800
Subject: [PATCH] 修改问题

---
 Wms/WMS.BLL/Logic/AllotLocation.cs |   26 +++++++++++++++++---------
 1 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/Wms/WMS.BLL/Logic/AllotLocation.cs b/Wms/WMS.BLL/Logic/AllotLocation.cs
index 8817d57..2a5c1f1 100644
--- a/Wms/WMS.BLL/Logic/AllotLocation.cs
+++ b/Wms/WMS.BLL/Logic/AllotLocation.cs
@@ -292,10 +292,14 @@
         /// <param name="areaList">鍖哄煙闆嗗悎</param>
         /// <param name="roadwayNo">宸烽亾鍙�(鍙┖)</param>
         /// <returns></returns>
-        public SysStorageLocat GetSuiTableLocate(string houseNo, List<string> areaList,string roadwayNo = "")
+        public SysStorageLocat GetSuiTableLocate(string houseNo, List<string> areaList,string roadwayNo = "",string ceng = "")
         {
             try
             {
+                if (string.IsNullOrWhiteSpace(ceng))
+                {
+                    throw new Exception($"鐢宠璐ф灦搴撲綅灞傛暟涓嶈兘涓虹┖");
+                }
                 var db = DataContext.Db;
                 /* 1.鍏堝垽鏂粨搴擄紙绔嬪簱鎴栬�呭钩搴擄級
                  * 2.濡傛灉鏄珛搴� 鍐嶅垽鏂槸鍚︽寚瀹氬贩閬撳彿
@@ -334,7 +338,7 @@
 
                             //鏌ヨ璇ュ贩閬撳苟涓旀爣蹇椾负姝e父鐨勭殑鍌ㄤ綅
                             roadwayList.Add(roadway);
-                            var locate = GetLocateByRoadways(roadwayList,areaList,true,houseNo);
+                            var locate = GetLocateByRoadways(roadwayList,areaList,true,houseNo, ceng);
                             if (locate == null)
                             {
                                 throw new Exception($"{roadwayNo}宸烽亾娌℃湁鍚堥�傜殑绌哄偍浣�");
@@ -346,7 +350,7 @@
                         {
                             var roadwayList = db.Queryable<SysStorageRoadway>().Where(m => m.WareHouseNo == houseNo && m.Status == "0" && roadList.Contains(m.RoadwayNo)).OrderBy(m => new { m.Priority, m.RoadwayNo }).ToList();
 
-                            var locate = GetLocateByRoadways(roadwayList,areaList,false, houseNo);
+                            var locate = GetLocateByRoadways(roadwayList,areaList,false, houseNo,ceng);
                             if (locate == null)
                             {
                                 throw new Exception($"{houseNo}浠撳簱宸插惎鐢ㄧ殑宸烽亾涓病鏈夊悎閫傜殑绌哄偍浣�");
@@ -380,7 +384,7 @@
         /// <param name="areaList">鍖哄煙闆嗗悎</param>
         /// <param name="isRoadway">鏄惁鎸囧畾宸烽亾</param>
         /// <returns></returns>
-        private SysStorageLocat GetLocateByRoadways(List<SysStorageRoadway> roadways,List<string> areaList,bool isRoadway = false ,string houseNo = "W02")
+        private SysStorageLocat GetLocateByRoadways(List<SysStorageRoadway> roadways,List<string> areaList,bool isRoadway = false ,string houseNo = "W02",string ceng = "")
         {
             try
             {
@@ -469,7 +473,7 @@
                         var count = 0;
                         do
                         {
-                            locate = GetLocateByRoadway(l.RoadwayNo, topOrBom, leftOrRight, areaList, list, ref count);
+                            locate = GetLocateByRoadway(l.RoadwayNo, topOrBom, leftOrRight, areaList, list, ref count, ceng);
                             if (locate != null)
                             {
                                 break;
@@ -503,7 +507,7 @@
                                 var count = 0;
                                 do
                                 {
-                                    locate = GetLocateByRoadway(log.RoadwayNo, topOrBom, leftOrRight, areaList, list, ref count);
+                                    locate = GetLocateByRoadway(log.RoadwayNo, topOrBom, leftOrRight, areaList, list, ref count,ceng);
                                     if (locate != null)
                                     {
                                         break;
@@ -531,7 +535,7 @@
                         var count = 0;
                         do
                         {
-                            locate = GetLocateByRoadway(item.RoadwayNo, topOrBom, leftOrRight, areaList, list, ref count);
+                            locate = GetLocateByRoadway(item.RoadwayNo, topOrBom, leftOrRight, areaList, list, ref count,ceng);
                             if (locate != null)
                             {
                                 break;
@@ -575,7 +579,7 @@
         /// <param name="areaList">鍖哄煙闆嗗悎</param>
         /// <param name="locateNoStr">鎺掗櫎鐨勫偍浣嶉泦鍚�</param>
         /// <returns></returns>
-        private SysStorageLocat GetLocateByRoadway(string roadwayNo, int topOrBom, int leftOrRight,List<string> areaList,List<string> locateNoStr,ref int count)
+        private SysStorageLocat GetLocateByRoadway(string roadwayNo, int topOrBom, int leftOrRight,List<string> areaList,List<string> locateNoStr,ref int count,string ceng = "")
         {
             var db = DataContext.Db;
             var str = "";
@@ -596,7 +600,11 @@
             
             foreach (var area in areaList)
             {
-                var sql = $@"select * from SysStorageLocat where IsDel = 0 and Flag = 0 and [Status] = 0 and RoadwayNo = '{roadwayNo}' and AreaNo = '{area}' and LocatNo not in({str}) ";
+                var sql = $@"select * from SysStorageLocat where IsDel = 0 and Layer!= '3' and Flag = 0 and [Status] = 0 and RoadwayNo = '{roadwayNo}' and AreaNo = '{area}' and LocatNo not in({str}) ";
+                if (!string.IsNullOrWhiteSpace(ceng))
+                {
+                    sql += $"and Layer = '{ceng}' ";
+                }
                 sql += "order by ";
                 sql += topOrBom == 0 ? "Layer desc, " : "Layer, ";
                 sql += leftOrRight == 0 ? "[Column], " : "[Column] desc, ";

--
Gitblit v1.8.0