集成mes接口,请求-响应-错误处理
This commit is contained in:
@@ -2445,7 +2445,8 @@ namespace JY.Inspection
|
||||
}
|
||||
else
|
||||
{
|
||||
LogManagerControl.AddLog("结果数据上传MES失败NG" + resMes.OriResponse.Message, LogAddtype.local, Logtype.Error);
|
||||
string errMsg = resMes.OriResponse == null ? resMes.ErrorMessage : resMes.OriResponse.ToString();
|
||||
LogManagerControl.AddLog("结果数据上传MES失败NG," + errMsg, LogAddtype.local, Logtype.Error);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
Generated
-1
@@ -2194,7 +2194,6 @@ namespace JY.Inspection
|
||||
this.button1.TabIndex = 51;
|
||||
this.button1.Text = "MEStest";
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
this.button1.Visible = false;
|
||||
this.button1.Click += new System.EventHandler(this.button1_Click);
|
||||
//
|
||||
// contextMenuStrip1
|
||||
|
||||
@@ -331,7 +331,7 @@
|
||||
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
|
||||
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
|
||||
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAAE
|
||||
CgAAAk1TRnQBSQFMAgEBAwEAAZABCAGQAQgBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
|
||||
CgAAAk1TRnQBSQFMAgEBAwEAAZgBCAGYAQgBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
|
||||
AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
|
||||
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
|
||||
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA
|
||||
|
||||
@@ -214,17 +214,17 @@ namespace JY.Inspection.Mes
|
||||
|
||||
var sw = new Stopwatch();
|
||||
sw.Start();
|
||||
var mesCallResult = MESApiHelper.HttpPostJsonAPI<RespProductResult>(Global.systemConfig.ResultProcessMesUrl, p, Global.systemConfig.MesRequestTime);
|
||||
resp = MESApiHelper.HttpPostJsonAPI<RespProductResult>(Global.systemConfig.ResultProcessMesUrl, p, Global.systemConfig.MesRequestTime);
|
||||
sw.Stop();
|
||||
|
||||
if (mesCallResult?.OriResponse?.Success != true)
|
||||
if (resp?.OriResponse != null && resp?.OriResponse.Success != true)
|
||||
{
|
||||
resp.IsSuccess = false;
|
||||
resp.ErrorType = MesErrorType.BusinessError;
|
||||
resp.ErrorMessage = mesCallResult?.OriResponse.Message ?? "MES业务处理失败";
|
||||
resp.ErrorMessage = resp?.OriResponse?.Message ?? "MES业务处理失败, 错误消息为空";
|
||||
}
|
||||
|
||||
new MesLog().LogProductResult(nowTime, p, mesCallResult.OriRespJsonStr, sw.ElapsedMilliseconds);
|
||||
new MesLog().LogProductResult(nowTime, p, resp.OriRespJsonStr, sw.ElapsedMilliseconds);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user