From 9937f480fd5e861255b0c51d10d7f1135d4c5db9 Mon Sep 17 00:00:00 2001 From: 南骏 池 <chiffly@163.com> Date: 星期五, 21 二月 2025 09:59:39 +0800 Subject: [PATCH] 1.委外补料优化调整 2.新增PDA日志通用方法 --- util/LogUtil.cs | 40 ++++++++++++++++++++++++++++++++++++++++ service/Wom/WwGdManager.cs | 15 ++++++++++----- 2 files changed, 50 insertions(+), 5 deletions(-) diff --git a/service/Wom/WwGdManager.cs b/service/Wom/WwGdManager.cs index 1552913..9aeb560 100644 --- a/service/Wom/WwGdManager.cs +++ b/service/Wom/WwGdManager.cs @@ -718,17 +718,17 @@ // 寮�鍚簨鍔″鐞� var success = UseTransaction(db => { - query.Type = "濮斿琛ユ枡"; + //query.Type = "濮斿琛ユ枡"; var outNoType = "WWBL(濮斿琛ユ枡)"; - if (query.Type == "鐢熶骇琛ユ枡") + if (query.Type == "濮斿琛ユ枡") { - outNoType = "SCBL(鐢熶骇琛ユ枡)"; + outNoType = "WWBL(濮斿琛ユ枡)"; } else { - outNoType = "SCCL(鐢熶骇瓒呴)"; + outNoType = "WWCL(濮斿瓒呴)"; } - outNoType = "WWBL(濮斿琛ユ枡)"; + //outNoType = "WWBL(濮斿琛ユ枡)"; // 鑾峰彇鎴栧垱寤哄嚭搴撳崟 var outId = Guid.NewGuid(); var outNo = BillNo.GetBillNo(outNoType); @@ -947,6 +947,11 @@ .Where(it => it.Id == mesItemBl.Id) .ExecuteCommand(); + // 鍒涘缓 鎻掑叆鏃ュ織 + var logService = new LogService(); + var LogMsg = query.Type + "銆傛潯鐮併��" +query.barcode+"銆� 琛ユ枡鍗曞彿銆�"+ outNo +"銆�"; + logService.CreateLog(db,query.userName,wwgd.Id.ToString(), "WW_GD", LogMsg,wwgd.Daa001); + return 1; }); diff --git a/util/LogUtil.cs b/util/LogUtil.cs new file mode 100644 index 0000000..5840796 --- /dev/null +++ b/util/LogUtil.cs @@ -0,0 +1,40 @@ +锘縩amespace NewPdaSqlServer.util +{ + using NewPdaSqlServer.entity; + using SqlSugar; + using System; + + public class LogService + { + /// <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(); + + detail = "[PDA]" + detail; + // 鎵ц瀛樺偍杩囩▼ + db.Ado.ExecuteCommand( + "exec prc_log_create @edtUserGuid, @abtGuid, @abtTable, @detail, @orderNo", + new + { + edtUserGuid, + abtGuid, + abtTable, + detail, + orderNo + } + ); + } + } +} \ No newline at end of file -- Gitblit v1.9.3