From 0aa54059b26e6641196e9953490dd18616e916e3 Mon Sep 17 00:00:00 2001 From: 啊鑫 <t2856754968@163.com> Date: 星期三, 10 九月 2025 17:26:47 +0800 Subject: [PATCH] 精简修正代码 --- util/LogUtil.cs | 86 +++++++++++++++++++++--------------------- 1 files changed, 43 insertions(+), 43 deletions(-) diff --git a/util/LogUtil.cs b/util/LogUtil.cs index 8c88150..aeecbfe 100644 --- a/util/LogUtil.cs +++ b/util/LogUtil.cs @@ -1,45 +1,45 @@ -锘縩amespace NewPdaSqlServer.util +锘縰sing NewPdaSqlServer.DB; +using NewPdaSqlServer.entity; +using SqlSugar; + +namespace NewPdaSqlServer.util; + +public class LogService : RepositoryNoEntity { - using NewPdaSqlServer.DB; - using NewPdaSqlServer.entity; - using SqlSugar; - using System; - - public class LogService : RepositoryNoEntity + /// <summary> + /// 鍒涘缓鏃ュ織璁板綍 + /// </summary> + /// <param name="db">SqlSugar 鏁版嵁搴撲笂涓嬫枃</param> + /// <param name="edtUserNo">鐢ㄦ埛缂栧彿</param> + /// <param name="abtGuid">鍏宠仈鍗曟嵁id</param> + /// <param name="abtTable">琛ㄥ悕绉�</param> + /// <param name="detail">鏃ュ織鍐呭</param> + /// <param name="orderNo">鍗曟嵁鍙�</param> + public void CreateLog(SqlSugarScope db, string edtUserNo, string abtGuid, + string abtTable, string detail, string orderNo) { - /// <summary> - /// 鍒涘缓鏃ュ織璁板綍 - /// </summary> - /// <param name="db">SqlSugar 鏁版嵁搴撲笂涓嬫枃</param> - /// <param name="edtUserNo">鐢ㄦ埛缂栧彿</param> - /// <param name="abtGuid">鍏宠仈鍗曟嵁id</param> - /// <param name="abtTable">琛ㄥ悕绉�</param> - /// <param name="detail">鏃ュ織鍐呭</param> - /// <param name="orderNo">鍗曟嵁鍙�</param> - public void CreateLog(SqlSugarScope db, string edtUserNo, string abtGuid, string abtTable, string detail, string orderNo) - { - var edtUserGuid = db.Queryable<SysUser>() - .Where(it => it.Account == edtUserNo) - .Select(it => it.Guid) // - .First(); + var edtUserGuid = db.Queryable<SysUser>() + .Where(it => it.Account == edtUserNo) + .Select(it => it.Guid) // + .First(); - //detail = "[PDA]" + detail; - // 鎵ц瀛樺偍杩囩▼ - db.Ado.ExecuteCommand( - "exec prc_log_create @edtUserGuid, @abtGuid, @abtTable, @detail, @orderNo", - new - { - edtUserGuid, - abtGuid, - abtTable, - detail, - orderNo - } - ); - } + //detail = "[PDA]" + detail; + // 鎵ц瀛樺偍杩囩▼ + db.Ado.ExecuteCommand( + "exec prc_log_create @edtUserGuid, @abtGuid, @abtTable, @detail, @orderNo", + new + { + edtUserGuid, + abtGuid, + abtTable, + detail, + orderNo + } + ); + } - public void CreateLogI( + public void CreateLogI( SqlSugarScope db, Guid edtUserGuid, string abtGuid, @@ -53,11 +53,14 @@ int sendStatus, string executeTime) { - Db.Ado.ExecuteCommand( + Db.Ado.ExecuteCommand( "exec prc_log_create @edtUserGuid, @abtGuid, @abtTable, @detail, @hNo,@RtnLogGuid, @SendJson, @RtnJson, @xkyBeginTime, @xkyEndTime, @sendStatus, @executeTime", - new { + new + { edtUserGuid, - abtGuid = string.IsNullOrEmpty(abtGuid) ? DBNull.Value : (object)abtGuid, + abtGuid = string.IsNullOrEmpty(abtGuid) + ? DBNull.Value + : (object)abtGuid, abtTable = (object)abtTable ?? DBNull.Value, detail, hNo = orderNo, @@ -70,7 +73,4 @@ executeTime = (object)executeTime ?? DBNull.Value }); } - } - - } \ No newline at end of file -- Gitblit v1.9.3