diff --git a/SlnMesnac.Business/base/BaseTaskInfoBusiness.cs b/SlnMesnac.Business/base/BaseTaskInfoBusiness.cs
index 83bb45a..c434925 100644
--- a/SlnMesnac.Business/base/BaseTaskInfoBusiness.cs
+++ b/SlnMesnac.Business/base/BaseTaskInfoBusiness.cs
@@ -158,7 +158,7 @@ namespace SlnMesnac.Business.@base
}
///
- /// Timer刷新任务状态, 有新任务初次下发AGV,Timer执行
+ /// Timer刷新任务状态, 有新任务初次下发AGV, Timer执行
///
public void RefreshTaskState()
{
diff --git a/SlnMesnac.Repository/service/Impl/AGVStateServiceImpl.cs b/SlnMesnac.Repository/service/Impl/AGVStateServiceImpl.cs
index 7a5b55e..a86250b 100644
--- a/SlnMesnac.Repository/service/Impl/AGVStateServiceImpl.cs
+++ b/SlnMesnac.Repository/service/Impl/AGVStateServiceImpl.cs
@@ -66,8 +66,16 @@ namespace SlnMesnac.Repository.service.Impl
///
public async Task UpdateAsync(AGVState record)
{
- bool result = await _rep.UpdateAsync(record);
- return result;
+ try
+ {
+ bool result = await _rep.UpdateAsync(record);
+ return result;
+ }
+ catch (Exception ex)
+ {
+ _logger.LogError($"更新设备状态信息出现错误:{ex.Message}");
+ return false;
+ }
}
///
@@ -116,7 +124,7 @@ namespace SlnMesnac.Repository.service.Impl
{
return _rep.DeleteById(id);
}
- catch(Exception ex)
+ catch (Exception ex)
{
_logger.LogError("AGV状态删除错误:" + ex.Message);
return false;
diff --git a/SlnMesnac.TouchSocket/AirPorthttpClient.cs b/SlnMesnac.TouchSocket/AirPorthttpClient.cs
index 022c396..8f3d53b 100644
--- a/SlnMesnac.TouchSocket/AirPorthttpClient.cs
+++ b/SlnMesnac.TouchSocket/AirPorthttpClient.cs
@@ -127,18 +127,26 @@ namespace SlnMesnac.TouchSocket
///
public AGVResponseEntity AGVAddTaskRequest(AGVRequestAddTaskEntity requestValue)
{
- if (_httpClient == null)
+ try
{
- _logger.LogError("http服务为空");
+ if (_httpClient == null)
+ {
+ _logger.LogError("http服务为空");
+ return null;
+ }
+ //序列化输入数据
+ string json = Newtonsoft.Json.JsonConvert.SerializeObject(requestValue);
+ var context = new StringContent(json, Encoding.UTF8, "application/json");
+ var httpContent = _httpClient.PostAsync($"{Url}/api/task/addTask", context).ConfigureAwait(false).GetAwaiter().GetResult().Content;
+ string result = httpContent.ReadAsStringAsync().ConfigureAwait(false).GetAwaiter().GetResult();
+ //JToken responseValue = AirportAGVClient.InvokeT("POST:/api/task/addTask", null, requestValue);
+ return JsonStringToEntity(result);
+ }
+ catch (Exception ex)
+ {
+ _logger.LogError($"AGV下发任务请求接口异常 {ex.Message}");
return null;
}
- //序列化输入数据
- string json = Newtonsoft.Json.JsonConvert.SerializeObject(requestValue);
- var context = new StringContent(json, Encoding.UTF8, "application/json");
- var httpContent = _httpClient.PostAsync($"{Url}/api/task/addTask", context).ConfigureAwait(false).GetAwaiter().GetResult().Content;
- string result = httpContent.ReadAsStringAsync().ConfigureAwait(false).GetAwaiter().GetResult();
- //JToken responseValue = AirportAGVClient.InvokeT("POST:/api/task/addTask", null, requestValue);
- return JsonStringToEntity(result);
}
///
@@ -148,18 +156,27 @@ namespace SlnMesnac.TouchSocket
///
public AGVResponseEntity