From 54c9cb77e93d08bc330b9a421e6232b7f7bba57a Mon Sep 17 00:00:00 2001
From: wxw <Administrator@DESKTOP-5BIMHQ3>
Date: 星期五, 19 九月 2025 17:30:36 +0800
Subject: [PATCH] 修改问题

---
 Wms/WMS.BLL/HttpServer.cs |   58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 58 insertions(+), 0 deletions(-)

diff --git a/Wms/WMS.BLL/HttpServer.cs b/Wms/WMS.BLL/HttpServer.cs
index ba26307..7ca3643 100644
--- a/Wms/WMS.BLL/HttpServer.cs
+++ b/Wms/WMS.BLL/HttpServer.cs
@@ -6,6 +6,7 @@
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
+using System.Threading.Tasks;
 using Utility.Tools;
 using WMS.BLL.Logic;
 using WMS.BLL.LogServer;
@@ -1992,7 +1993,64 @@
                 throw new Exception(e.Message);
             }
         }
+        /// <summary>
+        /// PDA骞冲簱涓嬪彂鍑哄簱
+        /// </summary>
+        /// <param name="soNo"></param>
+        /// <param name="detailId"></param>
+        /// <param name="palletNo"></param>
+        /// <param name="userId"></param>
+        /// <exception cref="Exception"></exception>
+        public void IssueOutHousePk(string soNo, string detailId, string palletNo, int userId)
+        {
+            try
+            {
+                var notice = Db.Queryable<BllExportNotice>().First(m => m.SONo == soNo && m.IsDel == "0");
+                if (notice == null)
+                {
+                    throw new Exception($"鏈壘鍒皗soNo}鍑哄簱鍗曚俊鎭�");
+                }
+                var detail=Db.Queryable<DataStockDetail>().First(m => m.PalletNo == palletNo && m.IsDel == "0");
+                if (detail.WareHouseNo != "W04")
+                {
+                    throw new Exception("浠撳簱鍙烽敊璇�");
+                }
+                var intDetailId = int.Parse(detailId);
+                if (intDetailId <= 0)
+                {
+                    throw new Exception("閫夋嫨鐨勫嚭搴撳崟鏄庣粏鍙傛暟閿欒");
+                }
+                //寮�鍚簨鍔�
+                Db.BeginTran();
 
+                notice.Status = "3";//姝e湪杩涜
+                Db.Updateable(notice).ExecuteCommand();
+
+                //鎵�鏈夎鍑哄簱鐨勫嚭搴撳垎閰嶄俊鎭�(鏈笅鍙戠殑淇℃伅鍜屽緟鎷h揣鐨勪俊鎭�)
+                var allot = Db.Queryable<BllExportAllot>().Where(a => a.IsDel == "0" && a.PalletNo == palletNo && a.Status == "0").ToList();
+                if (allot == null || allot.Count <= 0) //鍒ゆ柇鏄惁鏈夐渶瑕佷笅鍙戠殑鍑哄簱娴佹按
+                {
+                    throw new Exception("褰撳墠鍑哄簱鍗曟嵁鏃犻渶瑕佷笅鍙戠殑鎵樼洏");
+                }
+                //鍑哄簱娴佹按锛堟洿鏀圭姸鎬侊級
+                foreach (var item in allot)
+                {
+                    item.Status = "2";
+                    Db.Updateable(item).ExecuteCommand();
+                }
+
+                //娣诲姞鎿嶄綔鏃ュ織璁板綍
+                var k = new OperationSOServer().AddLogOperationSo("PDA妯″潡", "涓嬪彂鍑哄簱", soNo, "鍑哄簱", $"鐐瑰嚮鍑哄簱鎸夐挳鍑哄簱鍗曞彿涓猴細{soNo}鐨勫嚭搴撳崟", userId);
+                //鎻愪氦浜嬪姟
+                Db.CommitTran();
+            }
+            catch (Exception e)
+            {
+                //鍥炴粴浜嬪姟
+                Db.RollbackTran();
+                throw new Exception(e.Message);
+            }
+        }
 
         #region MyRegion
 

--
Gitblit v1.8.0