Commit 809db973 张东亮

1

1 个父辈 c3d83b63
......@@ -142,7 +142,7 @@ namespace Common
}
catch (Exception e)
{
LogUtil.error($"POST ERROR:【{url}】【{paramData}】",e);
LogUtil.error($"POST ERROR:【{url}】【{paramData}】", e);
}
if (!result.Contains("null") && result.Length != 0)
{
......@@ -193,19 +193,18 @@ namespace Common
{
try
{
LogUtil.debug("HTTP GET FROM: " + url);
var wc = new WebClient { Encoding = encoding};
var wc = new WebClient { Encoding = encoding };
var readStream = wc.OpenRead(url);
using (var sr = new StreamReader(readStream, encoding))
{
var result = sr.ReadToEnd();
LogUtil.debug("receive << " + result);
LogUtil.debug($"HTTP GET:【{url}】【{result}】");
return result;
}
}
catch (Exception e)
{
LogUtil.error("HTTP GET ERROR:[" +url+ "]",e);
LogUtil.error("HTTP GET ERROR:[" + url + "]", e);
}
return "";
}
......
......@@ -482,8 +482,6 @@ namespace DeviceLibrary
{
try
{
//string resultStr = HttpHelper.Post(agvreporttask, txt);
Task.Factory.StartNew(() =>
{
Dictionary<string, string> param = new Dictionary<string, string>();
......@@ -494,9 +492,13 @@ namespace DeviceLibrary
string resultStr = HttpHelper.Get(addr);
itsData data = JsonHelper.DeserializeJsonToObject<itsData>(resultStr);
//fbackkinfo":"no agvinfo","fbacktime":"20215306105317"}
if (data != null)
if (data == null)
{
log.Error($"上报任务执行信息失败:[{txt}][{resultStr}]");
}
else
{
log.Info($"AGV反馈任务执行信息 info:[{txt}][{resultStr}]");
log.Info($"上报任务执行信息成功:[{txt}][{resultStr}]");
break;
}
Thread.Sleep(1000);
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!