From 84b6d17e422e7fb52edfa51fdaf390dc1dd52ed7 Mon Sep 17 00:00:00 2001
From: Demo <Demo@DESKTOP-CPA90BF>
Date: 星期二, 20 二月 2024 16:38:38 +0800
Subject: [PATCH] Merge branch 'csc'

---
 Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs |   71 ++++++++++++++++++++++++++---------
 1 files changed, 53 insertions(+), 18 deletions(-)

diff --git a/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs b/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs
index 116e879..58006e1 100644
--- a/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs
+++ b/Wms/WMS.BLL/BllPdaServer/PdaAsnServer.cs
@@ -1281,6 +1281,30 @@
             }
         }
 
+        /// <summary>
+        /// 楠岃瘉鍌ㄤ綅鍦板潃(鍦扮爜)鏄惁鍙敤
+        /// </summary>
+        /// <param name="locatNo">鍌ㄤ綅缂栫爜</param>
+        /// <returns></returns>
+        public string CheckLocatNo(string locatNo) 
+        {
+            try
+            {
+                string strMsg = "";
+                var storageLocat = Db.Queryable<SysStorageLocat>().First(w => w.IsDel == "0" && w.LocatNo == locatNo && w.Status == "0" && w.WareHouseNo == "W02");
+                if (storageLocat == null)
+                {
+                    throw new Exception("-1:鍦扮爜(鍌ㄤ綅淇℃伅)涓嶅瓨鍦ㄦ垨闈炵┖闂茬姸鎬侊紝璇锋牳鏌�!");
+                }
+
+                return strMsg;
+            }
+            catch (Exception ex)
+            {
+                throw new Exception(ex.Message);
+            }
+        }
+
         //鏍规嵁绠辩爜鑾峰彇鐗╂枡銆佹壒娆°�佹暟閲忕瓑淇℃伅
         public PdaPalletNoCheckDto GetBoxInfoByBoxNo(string boxNo)
         {
@@ -1892,6 +1916,7 @@
                         throw new Exception("-1:褰撳墠鎵樼洏姝e湪鎵ц涓紝缁戝畾澶辫触锛岃鏍稿疄!");
                     }
                     bindId = bind.Id;
+                    bind.Qty += model.SkuQty;
                 }
 
                 #region 绠辩爜淇℃伅
@@ -1926,6 +1951,7 @@
 
                 // 鏇存敼绠辨敮鍏崇郴琛�
                 decimal factQty = 0.00m;//鎵樼洏鎬绘暟閲�
+                //鎴愬搧缁勬墭
                 if (model.SkuQty == 0)
                 {
                     var boxGroup = boxInfoList.GroupBy(m => m.BoxNo).ToList();
@@ -1985,7 +2011,7 @@
                 var sqlString = string.Empty;
                 if (factQty == 0)
                 {
-                    sqlString += $"update BllArrivalNoticeDetail set FactQty = FactQty + '{bind.Qty}' where id = '{model.AsnDetailId}';";
+                    sqlString += $"update BllArrivalNoticeDetail set FactQty = FactQty + '{model.SkuQty}' where id = '{model.AsnDetailId}';";
                 }
                 else
                 {
@@ -2084,22 +2110,6 @@
                 Db.BeginTran();//寮�鍚簨鍔�
                 if (iscount == 0)//姝e父鍏ュ簱
                 {
-                    #region 绠辩爜淇℃伅
-                    var boxInfoList = Db.Queryable<BllBoxInfo>().Where(w => w.IsDel == "0" && w.ASNNo == model.ASNNo).ToList();
-                    //楠岃瘉绠辩爜淇℃伅鏄惁瀛樺湪
-                    if (boxInfoList.Count <= 0)
-                    {
-                        throw new Exception("绠辩爜淇℃伅涓嶅瓨鍦紝璇锋牳鏌�!");
-                    }
-                    foreach (var item in boxInfoList)
-                    {
-                        item.Status = "2"; // 鏀瑰彉绠辨敮鍏崇郴琛ㄧ姸鎬侊細宸插叆搴�
-                        item.UpdateTime = serverTime;
-                        item.UpdateUser = model.CreateUser;
-                    }
-                    Db.Updateable(boxInfoList).ExecuteCommand();
-                    #endregion
-
                     #region 鍏ュ簱鎬诲崟淇℃伅
                     var notice = Db.Queryable<BllArrivalNotice>().First(a => a.IsDel == "0" && a.Status != "3" && a.ASNNo == model.ASNNo);
                     //楠岃瘉鍏ュ簱鍗曟�诲崟鏄惁鍏抽棴
@@ -2111,6 +2121,30 @@
                     if (notice.Status == "3")
                     {
                         throw new Exception("鍏ュ簱鍗曟�诲崟宸插叧闂紝璇锋牳鏌�!");
+                    }
+                    #endregion
+
+                    #region 绠辩爜淇℃伅
+                    var boxInfoList = Db.Queryable<BllBoxInfo>().Where(w => w.IsDel == "0" && w.ASNNo == model.ASNNo).ToList();
+                    // type 0:鎴愬搧鍏ュ簱 1:閲囪喘鍏ュ簱 2:涓棿鍝佸叆搴� 3:閫�璐у叆搴� 4:杞﹂棿浣欐枡閫�鍥炲叆搴� 5:鍏跺畠鍏ュ簱 6:浠e偍鍏ュ簱 7:瀵勫瓨鍏ュ簱
+                    if (notice.Type == "2" || notice.Type == "6" || notice.Type == "7")
+                    {
+                        // 涓嶈创鐮佺墿鏂� 鏃犻渶楠岃瘉绠辩爜淇℃伅
+                    }
+                    else 
+                    {
+                        //楠岃瘉绠辩爜淇℃伅鏄惁瀛樺湪
+                        if (boxInfoList.Count <= 0)
+                        {
+                            throw new Exception("绠辩爜淇℃伅涓嶅瓨鍦紝璇锋牳鏌�!");
+                        }
+                        foreach (var item in boxInfoList)
+                        {
+                            item.Status = "2"; // 鏀瑰彉绠辨敮鍏崇郴琛ㄧ姸鎬侊細宸插叆搴�
+                            item.UpdateTime = serverTime;
+                            item.UpdateUser = model.CreateUser;
+                        }
+                        Db.Updateable(boxInfoList).ExecuteCommand();
                     }
                     #endregion
 
@@ -2202,7 +2236,7 @@
                             ASNDetailNo = (int)bindInfo.ASNDetailNo,
                             WareHouseNo = "W02",
                             RoadwayNo = "",
-                            AreaNo = "",
+                            AreaNo = storageLocat.AreaNo,
                             LocatNo = model.LocatNo,
                             PalletNo = model.PalletNo,
                             PalletNo2 = bindInfo.PalletNo2,
@@ -2227,6 +2261,7 @@
                     {
                         stId = detailModel.Id;
                         detailModel.LocatNo = model.LocatNo;
+                        detailModel.AreaNo = storageLocat.AreaNo;
                         detailModel.UpdateTime = serverTime;
                         detailModel.UpdateUser = (int)model.CreateUser;
                         // 鍙樻洿鍌ㄤ綅鍦板潃

--
Gitblit v1.8.0