From a667d4159bb3f1ba909b94d5b5dd7c6eb28e7197 Mon Sep 17 00:00:00 2001
From: yl <ykxkd@outlook.com>
Date: 星期五, 07 四月 2023 09:48:30 +0800
Subject: [PATCH] 1.添加质检方案基础资料 2.采购到货接口调整 3.入厂检验扫描标签添加标签判断 4.ERP订单下达生成工单接口修改 5.编码规则接口修改 6.采购退货查询采购订单接口开发、订单查找物料接口开发
---
VueWebApi/Tools/DapperHelper.cs | 39 ++++++++++++++++++++++++++++++++++++---
1 files changed, 36 insertions(+), 3 deletions(-)
diff --git a/VueWebApi/Tools/DapperHelper.cs b/VueWebApi/Tools/DapperHelper.cs
index 7439ad3..37af73e 100644
--- a/VueWebApi/Tools/DapperHelper.cs
+++ b/VueWebApi/Tools/DapperHelper.cs
@@ -512,15 +512,14 @@
}
}
-
/// <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 +547,39 @@
}
return result;
}
+
+
+ /// <summary>
+ /// Dapper 杩斿洖鑷涓婚敭褰撳墠鏁版嵁琛ㄦ渶澶d
+ /// </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