From cabcb499a03de83b62eb8c01a734a1f4049f1dcf Mon Sep 17 00:00:00 2001
From: yuyou_x <2336760928@qq.com>
Date: 星期三, 13 三月 2024 11:49:30 +0800
Subject: [PATCH] Merge branch 'master' of https://gitee.com/liudongl/jc24-wms

---
 Wms/WMS.Entity/DataEntity/DataStockDetail.cs          |   14 +++++++
 Pda/View/AsnSetting/pingKuEnter.html                  |    2 
 Wms/Model/ModelDto/DataDto/StockDetailDto.cs          |   13 ++++++
 HTML/views/StatisticalReport/InventoryStatistics.html |    4 +
 Wms/Wms/Controllers/StatisticalController.cs          |    4 +-
 Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs               |   11 +++++
 Wms/WMS.IBLL/IDataServer/IStockServer.cs              |    2 
 Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs              |   20 +++++++++
 Wms/WMS.BLL/BllAsnServer/PalletBindServer.cs          |   23 ++++++++---
 Wms/WMS.BLL/DataServer/StockServer.cs                 |   14 ++++++-
 10 files changed, 93 insertions(+), 14 deletions(-)

diff --git a/HTML/views/StatisticalReport/InventoryStatistics.html b/HTML/views/StatisticalReport/InventoryStatistics.html
index d48b2e1..cee3e63 100644
--- a/HTML/views/StatisticalReport/InventoryStatistics.html
+++ b/HTML/views/StatisticalReport/InventoryStatistics.html
@@ -401,7 +401,7 @@
 						cols:colsJson
 					};
 
-					sendData(IP + "/Statistical/GetInventoryList?SkuNo=" + $("#SkuNo").val() + "&&SkuName=" + $("#SkuName").val() + "&&OwnerNo=" + $("#OwnerNo").val()+ "&&OwnerName=" + $("#OwnerName").val(), {}, 'get', function (res) {
+					sendData(IP + "/Statistical/GetInventoryList?SkuNo=" + $("#SkuNo").val() + "&&SkuName=" + $("#SkuName").val() + "&&OwnerNo=" + $("#OwnerNo").val()+ "&&OwnerName=" + $("#OwnerName").val()+"&&LotNo=" + $("#LotNo").val(), {}, 'get', function (res) {
 						console.log(res)
 						if (res.code == 0) { //鎴愬姛
 							var list = res.data;
@@ -527,6 +527,8 @@
 						{field: 'LotNo',title: '鎵规鍙�',align: 'center'}, 
 						{field: 'OwnerNo',title: '璐т富缂栫爜',align: 'center'},
 						{field: 'OwnerName',title: '璐т富鍚嶇О',align: 'center'}, 
+						{field: 'SupplierNo',title: '渚涘簲鍟嗙紪鐮�',align: 'center'},
+						{field: 'SupplierName',title: '渚涘簲鍟嗗悕绉�',align: 'center'}, 
 						{field: 'Qty',title: '搴撳瓨鏁伴噺',width: 110,align: 'center'}, 
 						{field: 'LockQty',title: '閿佸畾鏁伴噺',width: 110,align: 'center'},
 						{field: 'Status',templet: '#buttonTpl',title: '搴撳瓨鐘舵��',width: 90,align: 'center'}, 
diff --git a/Pda/View/AsnSetting/pingKuEnter.html b/Pda/View/AsnSetting/pingKuEnter.html
index 9f3ec0a..a483601 100644
--- a/Pda/View/AsnSetting/pingKuEnter.html
+++ b/Pda/View/AsnSetting/pingKuEnter.html
@@ -236,7 +236,7 @@
 				form.render('select');
 
 				var param = {
-					Type: '0,1,2,3',
+					Type: '0,1,2,3,4,5,6,7',
 				};
 				sendData(IP + "/PdaAsn/GetArrivalNotices", param, 'post', function (res) {
 					if (res.code == 0) { //鎴愬姛
diff --git a/Wms/Model/ModelDto/DataDto/StockDetailDto.cs b/Wms/Model/ModelDto/DataDto/StockDetailDto.cs
index 3c1efd9..e2b0d12 100644
--- a/Wms/Model/ModelDto/DataDto/StockDetailDto.cs
+++ b/Wms/Model/ModelDto/DataDto/StockDetailDto.cs
@@ -179,6 +179,19 @@
         /// </summary>           
         public string OwnerName { get; set; }
 
+        /// <summary>
+        /// Desc:渚涘簲鍟嗙紪鍙�
+        /// Default:
+        /// Nullable:True
+        /// </summary>           
+        public string SupplierNo { get; set; }
+
+        /// <summary>
+        /// Desc:渚涘簲鍟嗗悕绉�
+        /// Default:
+        /// Nullable:True
+        /// </summary>           
+        public string SupplierName { get; set; }
 
         /// <summary>
         /// Desc:澶囨敞
diff --git a/Wms/WMS.BLL/BllAsnServer/PalletBindServer.cs b/Wms/WMS.BLL/BllAsnServer/PalletBindServer.cs
index c1debd7..4e5e8b7 100644
--- a/Wms/WMS.BLL/BllAsnServer/PalletBindServer.cs
+++ b/Wms/WMS.BLL/BllAsnServer/PalletBindServer.cs
@@ -1639,13 +1639,21 @@
                                 IsBelt = item.IsBelt,
                                 Demo = item.Demo,
 
-                                OwnerNo = ownerNo,
-                                OwnerName = ownerName,
-
                                 IsDel = "0",
                                 CreateUser = 0,
                                 CreateTime = comTime
                             };
+                            //缁存姢搴撳瓨鏄庣粏璐т富/渚涘簲鍟嗕俊鎭�
+                            if (notice.Type == "0" || notice.Type == "2" || notice.Type == "4" || notice.Type == "6" || notice.Type == "7")//0:鎴愬搧鍏ュ簱锛�2:涓棿鍝佸叆搴�,4:杞﹂棿浣欐枡鍏ュ簱,6:浠e偍鍏ュ簱,7:瀵勫瓨鍏ュ簱
+                            {
+                                sd.OwnerNo = notice.CustomerNo;//璐т富缂栫爜
+                                sd.OwnerName = notice.CustomerName;//璐т富鍚嶇О
+                            }
+                            else if (notice.Type == "1" || notice.Type == "5")//1:閲囪喘鍏ュ簱,2:鍏跺畠鍏ュ簱
+                            { 
+                                sd.SupplierNo= notice.CustomerNo;//渚涘簲鍟嗙紪鐮�
+                                sd.SupplierName = notice.CustomerName;//渚涘簲鍟嗗悕绉�
+                            }
 
                             //if (quality.Count() > 0)
                             //{
@@ -1730,13 +1738,16 @@
                                     LockQty = 0,
                                     FrozenQty = 0,
 
-                                    OwnerNo = ownerNo,
-                                    OwnerName = ownerName,
-
                                     IsDel = "0",
                                     CreateUser = userId,
                                     CreateTime = comTime
                                 };
+                                //缁存姢搴撳瓨璐т富淇℃伅
+                                if (notice.Type == "0" || notice.Type == "2" || notice.Type == "4" || notice.Type == "6" || notice.Type == "7")//0:鎴愬搧鍏ュ簱锛�2:涓棿鍝佸叆搴�,4:杞﹂棿浣欐枡鍏ュ簱,6:浠e偍鍏ュ簱,7:瀵勫瓨鍏ュ簱
+                                {
+                                    stock.OwnerNo = notice.CustomerNo;//璐т富缂栫爜
+                                    stock.OwnerName = notice.CustomerName;//璐т富鍚嶇О
+                                }
                                 Db.Insertable(stock).ExecuteCommand();
                             }
                             #endregion
diff --git a/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs b/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs
index 1d8d751..8d0d9c4 100644
--- a/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs
+++ b/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs
@@ -2224,7 +2224,7 @@
                     #endregion
 
                     #region 绠辩爜淇℃伅
-                    var boxInfoList = Db.Queryable<BllBoxInfo>().Where(w => w.IsDel == "0" && w.ASNNo == model.ASNNo).ToList();
+                    var boxInfoList = Db.Queryable<BllBoxInfo>().Where(w => w.IsDel == "0" && w.ASNNo == model.ASNNo && w.PalletNo == model.PalletNo).ToList();
                     // type 0:鎴愬搧鍏ュ簱 1:閲囪喘鍏ュ簱 2:涓棿鍝佸叆搴� 3:閫�璐у叆搴� 4:杞﹂棿浣欐枡閫�鍥炲叆搴� 5:鍏跺畠鍏ュ簱 6:浠e偍鍏ュ簱 7:瀵勫瓨鍏ュ簱
                     if (notice.Type == "2" || notice.Type == "6" || notice.Type == "7")
                     {
@@ -2298,6 +2298,12 @@
                             CreateUser = (int)model.CreateUser,
                             CreateTime = serverTime
                         };
+                        //缁存姢搴撳瓨璐т富淇℃伅
+                        if (notice.Type == "0" || notice.Type == "2" || notice.Type == "4" || notice.Type == "6" || notice.Type == "7")//0:鎴愬搧鍏ュ簱锛�2:涓棿鍝佸叆搴�,4:杞﹂棿浣欐枡鍏ュ簱,6:浠e偍鍏ュ簱,7:瀵勫瓨鍏ュ簱
+                        {
+                            stockModel.OwnerNo = notice.CustomerNo;//璐т富缂栫爜
+                            stockModel.OwnerName = notice.CustomerName;//璐т富鍚嶇О
+                        }
                         //鏂板搴撳瓨鎬讳俊鎭�
                         Db.Insertable<DataStock>(stockModel).ExecuteCommand();
                     }
@@ -2350,9 +2356,21 @@
                             PackagNo = sku.PackagNo,
                             IsBale = bindInfo.IsBale,
                             IsBelt = bindInfo.IsBelt,
+
                             CreateUser = (int)model.CreateUser,
                             CreateTime = serverTime
                         };
+                        //缁存姢搴撳瓨鏄庣粏璐т富/渚涘簲鍟嗕俊鎭�
+                        if (notice.Type == "0" || notice.Type == "2" || notice.Type == "4" || notice.Type == "6" || notice.Type == "7")//0:鎴愬搧鍏ュ簱锛�2:涓棿鍝佸叆搴�,4:杞﹂棿浣欐枡鍏ュ簱,6:浠e偍鍏ュ簱,7:瀵勫瓨鍏ュ簱
+                        {
+                            detailModel.OwnerNo = notice.CustomerNo;//璐т富缂栫爜
+                            detailModel.OwnerName = notice.CustomerName;//璐т富鍚嶇О
+                        }
+                        else if (notice.Type == "1" || notice.Type == "5")//1:閲囪喘鍏ュ簱,2:鍏跺畠鍏ュ簱
+                        {
+                            detailModel.SupplierNo = notice.CustomerNo;//渚涘簲鍟嗙紪鐮�
+                            detailModel.SupplierName = notice.CustomerName;//渚涘簲鍟嗗悕绉�
+                        }
                         stId = Db.Insertable<DataStockDetail>(detailModel).ExecuteReturnIdentity();
 
                     }
diff --git a/Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs b/Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs
index 0afc859..13d05b0 100644
--- a/Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs
+++ b/Wms/WMS.BLL/BllPdaServer/PdaCrServer.cs
@@ -890,6 +890,11 @@
             {
                 string EndLocat = string.Empty;//鐩爣浣嶇疆                
 
+                var log = Db.Queryable<LogTask>().First(w => w.IsDel == "0" && w.PalletNo == palletNo && (w.Status == "0" || w.Status == "1"));
+                if (log != null)
+                {
+                    throw new Exception("璇ユ墭鐩樺凡鏈夊皬杞︾瓑寰呮墽琛屾垨姝e湪鎵ц鐨勪换鍔�!");
+                }                
                 var stockDetail = Db.Queryable<DataStockDetail>().First(w => w.IsDel == "0" && w.PalletNo == palletNo);
                 if (stockDetail == null)
                 {
@@ -1002,6 +1007,12 @@
             }
             try
             {
+                var log = Db.Queryable<LogTask>().First(w => w.IsDel == "0" && w.PalletNo == palletNo && (w.Status == "0" || w.Status == "1"));
+                if (log != null)
+                {
+                    throw new Exception("璇ユ墭鐩樺凡鏈夊皬杞︾瓑寰呮墽琛屾垨姝e湪鎵ц鐨勪换鍔�!");
+                }
+
                 var notice = Db.Queryable<BllExportNotice>().First(w => w.IsDel == "0" && w.SONo == soNo);
                 if (notice == null)
                 {
diff --git a/Wms/WMS.BLL/DataServer/StockServer.cs b/Wms/WMS.BLL/DataServer/StockServer.cs
index 22bc852..99a4ebd 100644
--- a/Wms/WMS.BLL/DataServer/StockServer.cs
+++ b/Wms/WMS.BLL/DataServer/StockServer.cs
@@ -32,7 +32,7 @@
         /// <param name="skuNo">鐗╂枡缂栫爜</param>
         /// <param name="skuName">鐗╂枡鍚嶇О</param>
         /// <returns></returns>
-        public List<MateDataStockDto> GetDataStockList(string skuNo, string skuName, string ownerNo, string ownerName)
+        public List<MateDataStockDto> GetDataStockList(string skuNo, string skuName, string ownerNo, string ownerName, string lotNo)
         {
             string str = "select stock.SkuNo,stock.SkuName,stock.LotNo,stock.LotText,stock.Standard,stock.Qty," +
                 "stock.LockQty,stock.FrozenQty,stock.OwnerNo,stock.OwnerName,(mate.Weight * stock.Qty) WeightSum " +
@@ -59,6 +59,11 @@
             {
                 str += " and stock.OwnerName like @ownerName";
             }
+            //鍒ゆ柇璐т富鍚嶇О鏄惁涓虹┖
+            if (!string.IsNullOrEmpty(lotNo))
+            {
+                str += " and stock.LotNo like @lotNo";
+            }
             //鎺掑簭
             str += " order by stock.SkuNo";
             List<MateDataStockDto> StockList = Db.Ado.SqlQuery<MateDataStockDto>(str, new
@@ -67,7 +72,8 @@
                 skuno = "%" + skuNo + "%", //鐗╂枡缂栫爜
                 skuname = "%" + skuName + "%", //鐗╂枡鍚嶇О
                 ownerNo= "%" + ownerNo + "%", //璐т富缂栫爜
-                ownerName= "%" + ownerName + "%" //璐т富鍚嶇О
+                ownerName= "%" + ownerName + "%", //璐т富鍚嶇О
+                lotNo= "%" + lotNo + "%", //鎵规鍙�
             });
 
             //搴撳瓨鎬婚噺
@@ -146,6 +152,10 @@
             {
                 str += " and detail.LotNo like @lotno";
             }
+            if (!string.IsNullOrEmpty(skuNo) && string.IsNullOrEmpty(lotNo))
+            {
+                str += " and detail.LotNo = ''";
+            }
             //鍒ゆ柇鍌ㄤ綅鍦板潃鏄惁涓虹┖
             if (!string.IsNullOrEmpty(locatNo))
             {
diff --git a/Wms/WMS.Entity/DataEntity/DataStockDetail.cs b/Wms/WMS.Entity/DataEntity/DataStockDetail.cs
index ccd3218..e839ce4 100644
--- a/Wms/WMS.Entity/DataEntity/DataStockDetail.cs
+++ b/Wms/WMS.Entity/DataEntity/DataStockDetail.cs
@@ -47,6 +47,20 @@
         public string OwnerName { get; set; }
 
         /// <summary>
+        /// Desc:渚涘簲鍟嗙紪鍙�
+        /// Default:
+        /// Nullable:True
+        /// </summary>           
+        public string SupplierNo { get; set; }
+
+        /// <summary>
+        /// Desc:渚涘簲鍟嗗悕绉�
+        /// Default:
+        /// Nullable:True
+        /// </summary>           
+        public string SupplierName { get; set; }
+
+        /// <summary>
         /// Desc:鐗╂枡缂栫爜
         /// Default:
         /// Nullable:True
diff --git a/Wms/WMS.IBLL/IDataServer/IStockServer.cs b/Wms/WMS.IBLL/IDataServer/IStockServer.cs
index 8f05642..3580bb1 100644
--- a/Wms/WMS.IBLL/IDataServer/IStockServer.cs
+++ b/Wms/WMS.IBLL/IDataServer/IStockServer.cs
@@ -16,7 +16,7 @@
         /// <param name="skuNo">鐗╂枡缂栫爜</param>
         /// <param name="skuName">鐗╂枡鍚嶇О</param>
         /// <returns></returns>
-        List<MateDataStockDto> GetDataStockList(string skuNo, string skuName, string ownerNo, string ownerName);
+        List<MateDataStockDto> GetDataStockList(string skuNo, string skuName, string ownerNo, string ownerName, string lotNo);
 
         /// <summary>
         /// 鑾峰彇搴撳瓨鏄庣粏
diff --git a/Wms/Wms/Controllers/StatisticalController.cs b/Wms/Wms/Controllers/StatisticalController.cs
index 5364465..c6e3391 100644
--- a/Wms/Wms/Controllers/StatisticalController.cs
+++ b/Wms/Wms/Controllers/StatisticalController.cs
@@ -40,9 +40,9 @@
         /// <param name="skuName"></param>
         /// <returns></returns>
         [HttpGet]
-        public IActionResult GetInventoryList(string skuNo, string skuName,string ownerNo,string ownerName)
+        public IActionResult GetInventoryList(string skuNo, string skuName,string ownerNo,string ownerName,string lotNo)
         {
-            List<MateDataStockDto> StockList = _stock.GetDataStockList(skuNo, skuName,ownerNo,ownerName);
+            List<MateDataStockDto> StockList = _stock.GetDataStockList(skuNo, skuName,ownerNo,ownerName,lotNo);
             return Ok(new
             {
                 data = StockList,

--
Gitblit v1.8.0