From b2be3b6939b4382f9165c78857a072f1aa7b01d0 Mon Sep 17 00:00:00 2001 From: zyf <1071160500@qq.com> Date: 星期六, 12 四月 2025 12:34:02 +0800 Subject: [PATCH] 更新平板功能,首检页面生成巡检单 --- MES.Service/service/QC/SJService.cs | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 48 insertions(+), 0 deletions(-) diff --git a/MES.Service/service/QC/SJService.cs b/MES.Service/service/QC/SJService.cs index 0dd735c..268d7ae 100644 --- a/MES.Service/service/QC/SJService.cs +++ b/MES.Service/service/QC/SJService.cs @@ -3,6 +3,8 @@ using MES.Service.Modes; using MES.Service.util; using SqlSugar; +using System.Data; +using DbType = System.Data.DbType; namespace MES.Service.service.QC; @@ -468,4 +470,50 @@ return withOracle; } + + public bool QaSubmit(LLJDto dto) + { + + try + { + // 瀹氫箟杈撳嚭鍙傛暟 + var outputResult = new SugarParameter("C_RES", null, + DbType.Int32, ParameterDirection.Output, + 4000); + + var outputMessage = new SugarParameter("C_MSG", null,DbType.String, + ParameterDirection.Output, 4000); + + // 瀹氫箟杈撳叆鍙傛暟 + var parameters = new List<SugarParameter> + { + + new("P_ID", dto.id, DbType.String, + ParameterDirection.Input), + new("P_USER", dto.userNo, DbType.String, + ParameterDirection.Input), + outputResult, + outputMessage + }; + + var db = SqlSugarHelper.GetInstance(); + + // 浣跨敤 SqlSugar 鎵ц瀛樺偍杩囩▼ + db.Ado.ExecuteCommand( + "BEGIN PRC_FPI_OK_GEN_IPI(:P_ID, :P_USER, :C_RES, :C_MSG); END;", + parameters.ToArray()); + + // 鑾峰彇杈撳嚭鍙傛暟鐨勫�� + var resultValue = outputResult.Value?.ToString(); + var messageValue = outputMessage.Value?.ToString(); + + if ("1".Equals(resultValue)) throw new Exception(messageValue); + + return true; + } + catch (Exception ex) + { + throw new Exception(ex.Message); + } + } } \ No newline at end of file -- Gitblit v1.9.3