Commit e6b670ed 张东亮

入库验证请求重试次数改为5次且有提示消息时可进行重试

1 个父辈 ff4a2e32
......@@ -197,10 +197,9 @@ namespace OnlineStore.DeviceLibrary
LogUtil.info(Name + "执行TimerProcess 共处理了【" + span.TotalMilliseconds + "】毫秒");
}
}
public bool ReviceInStoreCMD(string posId, int plateH, int plateW, string message)
{
string logName = "入库库位验证【 " + message + "】【" + posId + "】:";
string logName = "入库库位验证【" + message + "】【" + posId + "】:";
try
{
......@@ -214,42 +213,42 @@ namespace OnlineStore.DeviceLibrary
operation.op = 1;
operation.data = new Dictionary<string, string>() { { "code", message }, { "boxId", this.DeviceID.ToString() } };
operation.data.Add("inPos", posId);
string server = ConfigAppSettings.GetValue(Setting_Init.http_server);
for (int i = 1; i <= 3; i++)
for (int i = 1; i <= 5; i++)
{
bool timeOut = false;
Operation resultOperation = HttpHelper.PostOperation(SServerManager.GetPostApi(server), operation);
if (timeOut)
{
LogUtil.info(logName + " 第" + i + "次发送超时 ");
LogUtil.error(logName + " 第" + i + "次发送超时 ");
continue;
}
if (resultOperation == null)
{
// CodeMsg = "二维码【" + message + "】没有收到服务器反馈";
LogUtil.info(logName + " 没有收到服务器反馈 ");
LogUtil.error(logName + " 没有收到服务器反馈 ");
}
else if (!string.IsNullOrEmpty(resultOperation.msg))
{
//如果有提示消息,直接显示提示
LogUtil.info(logName + "服务器反馈 :" + resultOperation.msg);
continue;
}
else if (resultOperation.op.Equals(1))
{
LogUtil.info(logName + " 成功");
LogUtil.info(logName + " 成功"+$"【{JsonHelper.SerializeObject(resultOperation)}】");
return true;
}
else
{
LogUtil.info(logName + "服务器反馈 :" + JsonHelper.SerializeObject(resultOperation));
continue;
}
break;
}
}
catch (Exception ex)
{
LogUtil.info(logName + " 出错:" + ex.ToString());
LogUtil.error(logName + " 出错:" + ex.ToString());
}
return false;
......
......@@ -77,6 +77,10 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error($" 入库验证失败:{param.PosInfo.ToStr()}");
return false;
}
else
{
ClearSpecifiedAlarm("入库验证失败");
}
}
return true;
}
......@@ -108,6 +112,10 @@ namespace OnlineStore.DeviceLibrary
SetWarnMsg($" 入库验证失败:{posinfo.ToStr()}");
return false;
}
else
{
ClearSpecifiedAlarm("入库验证失败");
}
}
return true;
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!