Commit 1a7b2329 张东亮

1

1 个父辈 959d8cdd
......@@ -13,7 +13,7 @@ namespace DeviceLibrary.AGVService.Controllers
/// 任务执行通知
/// </summary>
[RoutePrefix("nepconSmf/notification")]
public class taskNotificationController : ApiController
public class notificationController : ApiController
{
[HttpPost]
public RtnData taskStatus([FromBody] NotificationDto dto)
......
......@@ -8,7 +8,7 @@ namespace DeviceLibrary.AGVService.Schemas
{
public class RtnData
{
public int code { get; set; } = 0;
public int code { get; set; } = 200;
public object data { get; set; }
public string msg { get; set; } = "ok";
}
......
......@@ -87,7 +87,7 @@
</ItemGroup>
<ItemGroup>
<Compile Include="AGVService\Controllers\deviceOperateController.cs" />
<Compile Include="AGVService\Controllers\taskNotificationController.cs" />
<Compile Include="AGVService\Controllers\notificationController.cs" />
<Compile Include="AGVService\HttpService.cs" />
<Compile Include="AGVService\Schemas\DeviceCheckDto.cs" />
<Compile Include="AGVService\Schemas\NotificationDto.cs" />
......
......@@ -46,23 +46,10 @@ namespace DeviceLibrary
private void ServerConnectTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
if (Monitor.TryEnter(serverConnectTimer))
{
try
{
if (!server.StartsWith("http"))
return;
SendLineStatus();
}
catch (Exception ex)
{
LogUtil.error($"ServerConnectTimer_Elapsed:{ex}");
}
finally
{
Monitor.Exit(serverConnectTimer);
}
}
}
public void StartConnectServer()
{
......@@ -164,7 +151,8 @@ namespace DeviceLibrary
{
if (RobotManage.IsDebug)
return;
try
{
lock (serverclock)
{
bool printlog = false;
......@@ -188,6 +176,12 @@ namespace DeviceLibrary
}
}
}
catch (Exception ex)
{
LogUtil.error("SendLineStatus",ex);
}
}
public bool SendAgvLog(string msg)
{
lock (serverclock)
......@@ -198,7 +192,7 @@ namespace DeviceLibrary
{
new AgvLogInfo(msg)
};
LogUtil.info(JsonHelper.SerializeObject(operation));
//LogUtil.info(JsonHelper.SerializeObject(operation));
Operation resultOperation = HttpHelper.Post(GetPostApi(), operation, 5000);
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!