From 4eb3fe2b28f1ae4c4623ae5f7d7750bd265b5fc5 Mon Sep 17 00:00:00 2001
From: admin <qiutairan163@163.com>
Date: 星期三, 17 十二月 2025 15:36:22 +0800
Subject: [PATCH] 增加区域类型字段

---
 Wms/WMS.BLL/BllPdaServer/PdaSoServer.cs |   73 +++++++++++++++++++++---------------
 1 files changed, 42 insertions(+), 31 deletions(-)

diff --git a/Wms/WMS.BLL/BllPdaServer/PdaSoServer.cs b/Wms/WMS.BLL/BllPdaServer/PdaSoServer.cs
index 861dd0c..351a2c9 100644
--- a/Wms/WMS.BLL/BllPdaServer/PdaSoServer.cs
+++ b/Wms/WMS.BLL/BllPdaServer/PdaSoServer.cs
@@ -1,29 +1,30 @@
-锘縰sing System;
-using System.Collections.Generic;
-using SqlSugar;
-using System.Linq;
-using System.Linq.Expressions;
-using Model.InterFaceModel;
+锘縰sing Model.InterFaceModel;
 using Model.ModelDto;
-using SqlSugar.Extensions;
-using WMS.Entity.BllSoEntity;
-using WMS.Entity.Context;
-using WMS.Entity.DataEntity;
-using WMS.Entity.SysEntity;
-using WMS.IBLL.IPdaServer;
 using Model.ModelVm;
 using Model.ModelVm.PdaVm;
 using Newtonsoft.Json;
+using SqlSugar;
+using SqlSugar.Extensions;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Linq;
+using System.Linq.Expressions;
+using System.Threading.Tasks;
+using System.Web;
+using Utility;
 using Utility.Tools;
+using WMS.BLL.Logic;
 using WMS.BLL.LogServer;
 using WMS.DAL;
-using WMS.Entity.LogEntity;
-using WMS.Entity.BllQualityEntity;
 using WMS.Entity.BllAsnEntity;
-using System.Threading.Tasks;
-using Utility;
-using WMS.BLL.Logic;
-using System.Web;
+using WMS.Entity.BllQualityEntity;
+using WMS.Entity.BllSoEntity;
+using WMS.Entity.Context;
+using WMS.Entity.DataEntity;
+using WMS.Entity.LogEntity;
+using WMS.Entity.SysEntity;
+using WMS.IBLL.IPdaServer;
 
 namespace WMS.BLL.BllPdaServer
 {
@@ -86,7 +87,7 @@
                 //}
                 //2025骞�12鏈�05鏃ョ敳鏂硅姹傝秴鎹★紝鍑哄簱鍗曡皟鏁翠负鎵ц瀹屾瘯涔熷彲浠ヨ秴鎹�
                 List<string> statusList = new List<string>() { "3", "4" };
-                if (statusList.Contains(notice.Status))
+                if (!statusList.Contains(notice.Status))
                 {
                     throw Oops.Bah("鍑哄簱鍗曠殑鐘舵�侀潪姝e湪鎵ц锛屼笉鑳芥嫞璐�");
                 }
@@ -1567,9 +1568,12 @@
                 string skuNo = boxInfos.First().SkuNo;
                 string skuName = boxInfos.First().SkuName;
 
-                // 楠岃瘉鏄惁杞﹂棿绾胯竟浠撳簱
-                var areaList = new List<string>() { "B06", "B07", "B09", "B24" };
-                if (!areaList.Contains(stockDetail.AreaNo))
+                //楠岃瘉鏄惁杞﹂棿绾胯竟浠撳簱
+                string areaNoSql = $@"select AreaNo from SysStorageArea where IsDel='0' and AreaType='1'";
+                DataTable areaNoDt = Db.Ado.GetDataTable(areaNoSql);
+                List<string> areaNoList = areaNoDt.Rows.Cast<DataRow>().Select(e => e["AreaNo"] + "").ToList();
+
+                if (!areaNoList.Contains(stockDetail.AreaNo))
                 {
                     throw Oops.Bah("鎵樼洏涓嶆槸杞﹂棿鎵樼洏锛�");
                 }
@@ -1725,9 +1729,12 @@
                     throw Oops.Bah("鏈煡璇㈠埌璇ユ墭鐩樹笂璐х墿鐨勫簱瀛樻槑缁嗕俊鎭紒");
                 }
 
-                // 楠岃瘉鏄惁杞﹂棿绾胯竟浠撳簱
-                var areaList = new List<string>() { "B06", "B07", "B09", "B24" };
-                if (!areaList.Contains(stockDetail.AreaNo))
+                //楠岃瘉鏄惁杞﹂棿绾胯竟浠撳簱
+                string areaNoSql = $@"select AreaNo from SysStorageArea where IsDel='0' and AreaType='1'";
+                DataTable areaNoDt = Db.Ado.GetDataTable(areaNoSql);
+                List<string> areaNoList = areaNoDt.Rows.Cast<DataRow>().Select(e => e["AreaNo"] + "").ToList();
+
+                if (!areaNoList.Contains(stockDetail.AreaNo))
                 {
                     throw Oops.Bah("鎵樼洏涓嶆槸杞﹂棿鎵樼洏锛�");
                 }
@@ -1924,10 +1931,12 @@
                 throw Oops.Bah("鍑哄簱鏄庣粏涓虹┖锛岃閫夋嫨鐗╂枡-鎵规");
             }
 
-            var allotList = await Db.Queryable<BllExportAllot>().Where(m => m.IsDel == "0" && m.Status == "0" && m.SONo == soNo && m.SODetailNo == int.Parse(soDetailId)).Select(m => m.PalletNo).Distinct().Where(m => !string.IsNullOrWhiteSpace(m)).ToListAsync();
+            //var allotList = await Db.Queryable<BllExportAllot>().Where(m => m.IsDel == "0" && m.Status == "0" && m.SONo == soNo && m.SODetailNo == int.Parse(soDetailId)).Select(m => m.PalletNo).Distinct().Where(m => !string.IsNullOrWhiteSpace(m)).ToListAsync();
+            //鑾峰彇鐘舵�佷负0寰呬笅鍙戙��1浠诲姟涓嬪彂銆�2寰呮嫞璐с��3閮ㄥ垎鎷h揣鐨勫嚭搴撳崟
+            List<string> statusList = new List<string>() { "0", "1", "2", "3" };
+            var allotList = await Db.Queryable<BllExportAllot>().Where(m => m.IsDel == "0" && statusList.Contains(m.Status) && m.SONo == soNo && m.SODetailNo == int.Parse(soDetailId)).Select(m => m.PalletNo).Distinct().Where(m => !string.IsNullOrWhiteSpace(m)).ToListAsync();
+
             return allotList;
-
-
         }
 
 
@@ -1937,7 +1946,8 @@
         {
             if (type == "1")//骞冲簱鍑哄簱鑾峰彇鍗曟嵁
             {
-                var allotList = await Db.Queryable<BllExportAllot>().Where(m => m.IsDel == "0" && (m.Status == "1" || m.Status == "0")).Select(m => m.SONo).Distinct().Where(m => !string.IsNullOrWhiteSpace(m)).ToListAsync();
+                List<string> statusList = new List<string>() { "0", "1", "2", "3" };
+                var allotList = await Db.Queryable<BllExportAllot>().Where(m => m.IsDel == "0" && statusList.Contains(m.Status)).Select(m => m.SONo).Distinct().Where(m => !string.IsNullOrWhiteSpace(m)).ToListAsync();
                 return allotList;
             }
             //鑾峰彇鐘舵�佷负寰呮嫞璐ф垨鑰呴儴鍒嗘嫞璐х殑鍑哄簱鍗�
@@ -1957,8 +1967,9 @@
             {
                 throw Oops.Bah("鍗曟嵁涓虹┖锛岃閫夋嫨鍗曟嵁");
             }
-            //鑾峰彇鐘舵�佷负寰呮嫞璐ф垨鑰呴儴鍒嗘嫞璐х殑鍑哄簱鍗�
-            var allotList = Db.Queryable<BllExportAllot>().Where(m => m.IsDel == "0" && m.SONo == soNo && (m.Status == "0" || m.Status == "1"));
+            //鑾峰彇鐘舵�佷负0寰呬笅鍙戙��1浠诲姟涓嬪彂銆�2寰呮嫞璐с��3閮ㄥ垎鎷h揣鐨勫嚭搴撳崟
+            List<string> statusList = new List<string>() { "0", "1", "2", "3" };
+            var allotList = Db.Queryable<BllExportAllot>().Where(m => m.IsDel == "0" && m.SONo == soNo && (statusList.Contains(m.Status)));
 
             var list = await allotList.GroupBy(m => new { m.SODetailNo, m.SkuNo, m.SkuName, m.LotNo }).Select(m => new DetailIdSkuLotNo()
             {

--
Gitblit v1.8.0