From 1a09e10891586f227bec656d92ad27382f0412a2 Mon Sep 17 00:00:00 2001 From: hao <1836460075@qq.com> Date: 星期一, 18 八月 2025 15:14:12 +0800 Subject: [PATCH] 直接调拨申请单 --- StandardInterface/MES.Service/service/WomcaaManager.cs | 48 ++++++++++++++++++++++++------------------------ 1 files changed, 24 insertions(+), 24 deletions(-) diff --git a/StandardInterface/MES.Service/service/WomcaaManager.cs b/StandardInterface/MES.Service/service/WomcaaManager.cs index 84b5753..37adb77 100644 --- a/StandardInterface/MES.Service/service/WomcaaManager.cs +++ b/StandardInterface/MES.Service/service/WomcaaManager.cs @@ -98,8 +98,30 @@ List<Womcab> mesWomcabs) { + //瀹氫箟杈撳叆鍙傛暟 + var inputParam1 = new SugarParameter("P_WORK_NO", mesWomcaa.Caa001); + // 瀹氫箟杈撳嚭鍙傛暟 + var outParam1 = new SugarParameter("c_Result", null, true); + var outParam2 = new SugarParameter("C_MSG", null, true); + // 浣跨敤 SqlSugar 鎵ц瀛樺偍杩囩▼ + Db.Ado.ExecuteCommand( + "BEGIN PRC_UPDATE_DAA2(:P_WORK_NO,:c_Result,:C_MSG); END;", + inputParam1, outParam1, outParam2); + // 鑾峰彇杈撳嚭鍙傛暟鐨勫�� + var result = int.Parse((string)outParam1.Value); + var message = outParam2.Value == DBNull.Value + ? string.Empty + : (string)outParam2.Value; + if (result == 1) + { + //瀛樺偍杩囩▼澶辫触鍒欎簨鍔¤繘琛屽洖婊� + db.Ado.RollbackTran(); + throw new Exception(message); + } - + // 鎻愪氦浜嬪姟 + db.Ado.CommitTran(); + var decimals = mesWomcabs.Select(s => s.Id).ToArray(); @@ -119,29 +141,7 @@ if (update && insertOrUpdate) { - //瀹氫箟杈撳叆鍙傛暟 - var inputParam1 = new SugarParameter("P_WORK_NO", mesWomcaa.Caa001); - // 瀹氫箟杈撳嚭鍙傛暟 - var outParam1 = new SugarParameter("c_Result", null, true); - var outParam2 = new SugarParameter("C_MSG", null, true); - // 浣跨敤 SqlSugar 鎵ц瀛樺偍杩囩▼ - Db.Ado.ExecuteCommand( - "BEGIN PRC_UPDATE_DAA2(:P_WORK_NO,:c_Result,:C_MSG); END;", - inputParam1, outParam1, outParam2); - // 鑾峰彇杈撳嚭鍙傛暟鐨勫�� - var result = int.Parse((string)outParam1.Value); - var message = outParam2.Value == DBNull.Value - ? string.Empty - : (string)outParam2.Value; - if (result == 1) - { - //瀛樺偍杩囩▼澶辫触鍒欎簨鍔¤繘琛屽洖婊� - db.Ado.RollbackTran(); - throw new Exception(message); - } - - // 鎻愪氦浜嬪姟 - db.Ado.CommitTran(); + return true; } throw new NotImplementedException("鏇存柊澶辫触"); -- Gitblit v1.9.3