From da6350d73fdd6b168756a2986b1e5cb0a2da00ed Mon Sep 17 00:00:00 2001
From: yl <ykxkd@outlook.com>
Date: 星期三, 29 三月 2023 10:59:13 +0800
Subject: [PATCH] 订单下达生成工单语句修改、手工创建生产工单生成单据号接口

---
 VueWebApi/Tools/DapperHelper.cs |   37 +++++++++++++++++++++++++++++++++++--
 1 files changed, 35 insertions(+), 2 deletions(-)

diff --git a/VueWebApi/Tools/DapperHelper.cs b/VueWebApi/Tools/DapperHelper.cs
index 7439ad3..a0762d0 100644
--- a/VueWebApi/Tools/DapperHelper.cs
+++ b/VueWebApi/Tools/DapperHelper.cs
@@ -514,13 +514,13 @@
 
 
         /// <summary>
-        /// Dapper鎻掑叆 杩斿洖鑷涓婚敭Id
+        /// Dapper鎻掑叆 杩斿洖鑷涓婚敭Id锛堝浠斤級
         /// </summary>
         /// <param name="sql"></param>
         /// <param name="parameter"></param>
         /// <param name="tableName">寰呮彃鍏ユ暟鎹殑琛ㄥ悕</param>
         /// <returns></returns>
-        public static int insertReturnId(string sql, Object parameter, String tableName)
+        public static int insertReturnId0(string sql, Object parameter, String tableName)
         {
 
             int result = 0;
@@ -548,5 +548,38 @@
             }
             return result;
         }
+
+        /// <summary>
+        /// Dapper鎻掑叆 杩斿洖鑷涓婚敭Id
+        /// </summary>
+        /// <param name="tableName">寰呮彃鍏ユ暟鎹殑琛ㄥ悕</param>
+        /// <returns></returns>
+        public static int insertReturnId(String tableName)
+        {
+
+            int result = 0;
+            using (IDbConnection conn = sqlConnection())
+            {
+                try
+                {
+                    if (result == 0)
+                    {
+                        result = conn.Query<int>("select ident_current(@table)", new { table = tableName }).Single<int>();
+                    }
+                }
+                catch (Exception ex)
+                {
+                    //鍒涘缓鏃ュ織璁板綍缁勪欢瀹炰緥
+                    LogHelper.WriteLog(ex);
+                    throw ex;
+                }
+                finally
+                {
+                    conn.Dispose();
+                    conn.Close();
+                }
+            }
+            return result;
+        }
     }
 }
\ No newline at end of file

--
Gitblit v1.9.3