From 74d068d0bf8a55fd8c910b46de8d3e0c0fc2ecf7 Mon Sep 17 00:00:00 2001
From: sjz <1240968267@qq.com>
Date: 星期一, 21 四月 2025 12:13:43 +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