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 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 50 insertions(+), 0 deletions(-)

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