From 983cb777c4bfea428b9802b21b2eb9787f988946 Mon Sep 17 00:00:00 2001
From: chengsc <11752@DESKTOP-DS49RCP>
Date: 星期三, 05 三月 2025 10:05:54 +0800
Subject: [PATCH] 修改入库流程

---
 Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs |  117 ++++++++++++++++++++++++++++------------------------------
 1 files changed, 57 insertions(+), 60 deletions(-)

diff --git a/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs b/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs
index 5270e8a..9de08a8 100644
--- a/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs
+++ b/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs
@@ -1187,10 +1187,10 @@
                 {
                     throw new Exception("璇ユ墭鐩樺凡鏈夊偍浣嶄俊鎭紝璇锋牳瀹烇紒");
                 }
-                if (stockDetail != null && (stockDetail.SkuNo != detail.SkuNo || stockDetail.LotNo != model.LotNo))
-                {
-                    throw new Exception("璇ユ墭鐩樺湪搴撳瓨宸叉湁鍏跺畠鐗╂枡鎵规淇℃伅锛岃鏍稿疄锛�");
-                }
+                //if (stockDetail != null && (stockDetail.SkuNo != detail.SkuNo || stockDetail.LotNo != model.LotNo))
+                //{
+                //    throw new Exception("璇ユ墭鐩樺湪搴撳瓨宸叉湁鍏跺畠鐗╂枡鎵规淇℃伅锛岃鏍稿疄锛�");
+                //}
 
                 #endregion
 
@@ -1589,13 +1589,11 @@
         {
             try
             {
-                var item = Expressionable.Create<BllArrivalNoticeDetail>() 
-                .AndIF(true, it => it.IsDel == "0")
-                .ToExpression();//娉ㄦ剰 杩欎竴鍙� 涓嶈兘灏�
-
-                var modelList = Db.Queryable<BllArrivalNoticeDetail>().Where(item)
-                    .LeftJoin<BllArrivalNotice>((tb1, tb2) => tb1.ASNNo == tb2.ASNNo && tb2.IsDel == "0" && (tb1.Status == "0" || tb1.Status == "1"))
-                    .LeftJoin<SysMaterials>((tb1, tb2, tb3) => tb1.SkuNo == tb3.SkuNo && tb3.IsDel == "0" && tb3.IsPasteCode == "1")
+               
+                var modelList = Db.Queryable<BllArrivalNoticeDetail>()
+                    .LeftJoin<BllArrivalNotice>((tb1, tb2) => tb1.ASNNo == tb2.ASNNo )
+                    .LeftJoin<SysMaterials>((tb1, tb2, tb3) => tb1.SkuNo == tb3.SkuNo )
+                    .Where((tb1, tb2, tb3) => tb1.IsDel == "0" && tb2.IsDel == "0" && (tb2.Status == "0" || tb2.Status == "1") && tb3.IsDel == "0" && tb3.IsPasteCode == "1")
                     .Select((tb1, tb2, tb3) => tb1.ASNNo).Distinct().ToList();
 
                 return modelList;
@@ -1613,13 +1611,11 @@
         {
             try
             {
-                var item = Expressionable.Create<BllArrivalNoticeDetail>()
-                .AndIF(true, it => it.IsDel == "0")
-                .ToExpression();//娉ㄦ剰 杩欎竴鍙� 涓嶈兘灏�
 
-                var modelList = Db.Queryable<BllArrivalNoticeDetail>().Where(item)
-                     .LeftJoin<BllArrivalNotice>((tb1, tb2) => tb1.ASNNo == tb2.ASNNo && tb2.IsDel == "0" && (tb2.Status == "0" || tb2.Status == "1"))
-                     .LeftJoin<SysMaterials>((tb1, tb2, tb3) => tb1.SkuNo == tb3.SkuNo && tb3.IsDel == "0" && tb3.IsPasteCode == "0")
+                var modelList = Db.Queryable<BllArrivalNoticeDetail>()
+                     .LeftJoin<BllArrivalNotice>((tb1, tb2) => tb1.ASNNo == tb2.ASNNo )
+                     .LeftJoin<SysMaterials>((tb1, tb2, tb3) => tb1.SkuNo == tb3.SkuNo )
+                     .Where((tb1, tb2, tb3) => tb1.IsDel == "0" && tb2.IsDel == "0" && (tb2.Status == "0" || tb2.Status == "1") && tb3.IsDel == "0" && tb3.IsPasteCode == "0")
                      .Select((tb1, tb2, tb3) => tb1.ASNNo).Distinct().ToList();
 
                 return modelList;
@@ -1859,6 +1855,49 @@
             }
         }
 
+        /// <summary>
+        /// 楠岃瘉鎵樼洏鏄惁瀛樺湪
+        /// </summary>
+        /// <param name="palletNo">鎵樼洏鍙�</param>
+        /// <returns>"":鍙娇鐢� -1:涓嶅彲浣跨敤锛堝師鍥�)</returns>
+        public string IsEnablePalletNo(string palletNo)
+        {
+            string sqlMsg = "";
+            string sqlString = string.Empty;
+            try
+            {
+                sqlString = $"select * from SysPallets where PalletNo = '{palletNo}' and isdel = '0';";
+                var models = Db.Ado.SqlQuery<PalletBindVm>(sqlString);
+
+                if (models.Count > 1)
+                {
+                    sqlMsg = "-1:瀛樺湪閲嶅鎵樼洏鍙�,璇锋鏌�!";
+                    return sqlMsg;
+                }
+                if (models.Count > 0)
+                {
+                    if (models[0].Status == "1")
+                    {
+                        sqlString = $"select count(id) from DataStockDetail where PalletNo = '{palletNo}' and isnull(LocatNo,'') != '' and isdel = '0';";
+                        int rowNum = Db.Ado.GetInt(sqlString);
+                        if (rowNum > 0)
+                        {
+                            sqlMsg = "-1:鎵樼洏浣跨敤涓紝姝ゆ墭鐩樺簲鍦ㄥ簱鍐呰鏍稿疄!";
+                        }
+                    }
+                }
+                else
+                {
+                    sqlMsg = "-1:鎵樼洏鍙蜂笉瀛樺湪!";
+                }
+
+                return sqlMsg;
+            }
+            catch (Exception ex)
+            {
+                throw ex;
+            }
+        }
 
         #endregion
 
@@ -1906,49 +1945,7 @@
        
 
 
-        /// <summary>
-        /// 楠岃瘉鎵樼洏鏄惁瀛樺湪
-        /// </summary>
-        /// <param name="palletNo">鎵樼洏鍙�</param>
-        /// <returns>"":鍙娇鐢� -1:涓嶅彲浣跨敤锛堝師鍥�)</returns>
-        public string IsEnablePalletNo(string palletNo)
-        {
-            string sqlMsg = "";
-            string sqlString = string.Empty;
-            try
-            {
-                sqlString = $"select * from SysPallets where PalletNo = '{palletNo}' and isdel = '0';";
-                var models = Db.Ado.SqlQuery<PalletBindVm>(sqlString);
-
-                if (models.Count > 1)
-                {
-                    sqlMsg = "-1:瀛樺湪閲嶅鎵樼洏鍙�,璇锋鏌�!";
-                    return sqlMsg;
-                }
-                if (models.Count > 0)
-                {
-                    if (models[0].Status == "1")
-                    {
-                        sqlString = $"select count(id) from DataStockDetail where PalletNo = '{palletNo}' and isnull(LocatNo,'') != '' and isdel = '0';";
-                        int rowNum = Db.Ado.GetInt(sqlString);
-                        if (rowNum > 0)
-                        {
-                            sqlMsg = "-1:鎵樼洏浣跨敤涓紝姝ゆ墭鐩樺簲鍦ㄥ簱鍐呰鏍稿疄!";
-                        }
-                    }
-                }
-                else
-                {
-                    sqlMsg = "-1:鎵樼洏鍙蜂笉瀛樺湪!";
-                }
-
-                return sqlMsg;
-            }
-            catch (Exception ex)
-            {
-                throw ex;
-            }
-        }
+        
 
         // 鏍规嵁绠辩爜鎴栨墭鐩樺彿鑾峰彇绠辨敮淇℃伅   liudl 
         public List<BoxInfoDto> GetBoxInfos(BoxInfoVm model)

--
Gitblit v1.8.0