From 90ba60a8243c0b8b54f8868cbc8809343704ff46 Mon Sep 17 00:00:00 2001
From: kyy <3283105747@qq.com>
Date: 星期一, 15 九月 2025 17:15:41 +0800
Subject: [PATCH] 1、送货单签收

---
 service/Warehouse/MesXkyShdManager.cs        |   50 +++++++++++++++++++++++++
 Controllers/Warehouse/MesXkyShdController.cs |   26 ++++++++++++
 2 files changed, 75 insertions(+), 1 deletions(-)

diff --git a/Controllers/Warehouse/MesXkyShdController.cs b/Controllers/Warehouse/MesXkyShdController.cs
index 8aad5e8..487a6e4 100644
--- a/Controllers/Warehouse/MesXkyShdController.cs
+++ b/Controllers/Warehouse/MesXkyShdController.cs
@@ -24,7 +24,7 @@
         {
             dynamic resultInfos = new ExpandoObject();
             resultInfos.tbBillList = m.GetShdhItems(unity);
-            resultInfos.tbMesItems = m.GetShdhBar(unity);
+            //resultInfos.tbMesItems = m.GetShdhBar(unity);
             return new ResponseResult
             {
                 status = 0,
@@ -95,4 +95,28 @@
             return ResponseResult.ResponseError(ex);
         }
     }
+
+    /// <summary>
+    ///     纭畾绛炬敹
+    /// </summary>
+    /// <returns></returns>
+    [HttpPost("OkBtn")]
+    public ResponseResult OkBtn(dynamic unity)
+    {
+        try
+        {
+            dynamic resultInfos = new ExpandoObject();
+            resultInfos.message = m.ConfirmSignReceipt(unity);
+            return new ResponseResult
+            {
+                status = 0,
+                message = resultInfos.message,
+                data = resultInfos
+            };
+        }
+        catch (Exception ex)
+        {
+            return ResponseResult.ResponseError(ex);
+        }
+    }
 }
\ No newline at end of file
diff --git a/service/Warehouse/MesXkyShdManager.cs b/service/Warehouse/MesXkyShdManager.cs
index cdb3113..dd9a9d2 100644
--- a/service/Warehouse/MesXkyShdManager.cs
+++ b/service/Warehouse/MesXkyShdManager.cs
@@ -159,6 +159,56 @@
             }
         }
     }
+
+    public string ConfirmSignReceipt(dynamic unity)
+    {
+        var _strMsg = "";
+        var _intSum = 0;
+        using (var conn = new SqlConnection(DbHelperSQL.strConn))
+        {
+            if (unity == null) throw new ArgumentNullException(nameof(unity), "鍙傛暟瀵硅薄涓嶈兘涓� null");
+            
+            if (string.IsNullOrEmpty(unity.userName?.ToString()))
+                throw new ArgumentException("鐢ㄦ埛璐︽埛涓嶅厑璁镐负绌�", nameof(unity.userName));
+            
+            if (string.IsNullOrEmpty(unity.shdh?.ToString()))
+                throw new ArgumentException("閫佽揣鍗曞彿涓嶅厑璁镐负绌�", nameof(unity.shdh));
+
+            using (var cmd = new SqlCommand("[prc_pda_inv_dhdsh_qs]", conn))
+            {
+                try
+                {
+                    conn.Open();
+                    cmd.CommandType = CommandType.StoredProcedure;
+                    SqlParameter[] parameters =
+                    {
+                        new("@po_outMsg", SqlDbType.NVarChar, 2000) { Direction = ParameterDirection.Output },
+                        new("@po_outSum", SqlDbType.Int) { Direction = ParameterDirection.Output },
+                        new("@pi_user", SqlDbType.NVarChar) { Value = unity.userName.ToString() },
+                        new("@pi_shdh", SqlDbType.NVarChar) { Value = unity.shdh.ToString() }
+                    };
+
+                    foreach (var parameter in parameters)
+                        cmd.Parameters.Add(parameter);
+                    cmd.ExecuteNonQuery();
+                    _strMsg = parameters[0].Value.ToString();
+                    _intSum = Convert.ToInt32(parameters[1].Value);
+
+                    if (_intSum <= 0) throw new Exception(_strMsg);
+
+                    return _strMsg;
+                }
+                catch (Exception ex)
+                {
+                    throw new Exception(ex.Message);
+                }
+                finally
+                {
+                    conn.Close();
+                }
+            }
+        }
+    }
 }
 
 

--
Gitblit v1.9.3