diff --git a/SlnMesnac.Business/base/BaseStateRefreshBusiness.cs b/SlnMesnac.Business/base/BaseStateRefreshBusiness.cs index 6977a54..721e974 100644 --- a/SlnMesnac.Business/base/BaseStateRefreshBusiness.cs +++ b/SlnMesnac.Business/base/BaseStateRefreshBusiness.cs @@ -31,7 +31,7 @@ namespace SlnMesnac.Business.@base { try { - var response = AirPorthttpClient.AGVStateRequest(); + var response = AirPorthttpClient.AGVAllStateRequest(); _AGVStateService.UpdateOrAddByResponse(response); } catch (Exception e) diff --git a/SlnMesnac.TouchSocket/AirPorthttpClient.cs b/SlnMesnac.TouchSocket/AirPorthttpClient.cs index eb2b10d..28177a6 100644 --- a/SlnMesnac.TouchSocket/AirPorthttpClient.cs +++ b/SlnMesnac.TouchSocket/AirPorthttpClient.cs @@ -31,7 +31,6 @@ namespace SlnMesnac.TouchSocket } public static WebApiClient AirportAGVClient; - public static WebApiClient AirportManipulatorClient; private WebApiClient CreateWebApiClient(string IpHost) { @@ -63,25 +62,14 @@ namespace SlnMesnac.TouchSocket return Task.CompletedTask; } - /// - /// - /// - /// - public static string AGVCallRequest() - { - JToken responseValue = AirportAGVClient.InvokeT("POST:", null, new AGVSingalEntity()); - - return responseValue.ToString(); - } - /// /// AGV下发任务请求 /// /// /// - public static AGVResponseEntity AGVAddTaskRequest(AGVRequestAddTaskEntity addTaskEntity) + public static AGVResponseEntity AGVAddTaskRequest(AGVRequestAddTaskEntity requestValue) { - JToken responseValue = AirportAGVClient.InvokeT("POST:/api/task/addTask", null, addTaskEntity); + JToken responseValue = AirportAGVClient.InvokeT("POST:/api/task/addTask", null, requestValue); if (responseValue == null) { return new AGVResponseEntity(); @@ -96,15 +84,57 @@ namespace SlnMesnac.TouchSocket return responseEntity; } + /// + /// 取消/终止任务请求 + /// + /// + public static AGVResponseEntity AGVOperationalTaskRequest(AGVRequestOperationalTaskEntity requestValue) + { + JToken responseValue = AirportAGVClient.InvokeT("POST:/api/task/operationalTask", null, requestValue); + if (responseValue == null) + { + return new AGVResponseEntity(); + } + string json = responseValue.ToString(); + if (string.IsNullOrEmpty(json)) + { + return new AGVResponseEntity(); + } + AGVResponseEntity responseEntity; + responseEntity = JsonSerializer.Deserialize>(json); + return responseEntity; + } /// - /// 获取AGV所有信息 + /// 查询任务状态请求 /// /// /// - public static AGVResponseEntity> AGVStateRequest() + public static AGVResponseEntity AGVGetTaskStateDetailRequest(AGVRequestTaskStateDetailEntity requestValue) { - JToken responseValue = AirportAGVClient.InvokeT("GET:http://192.168.40.81:5102/api/task/robot/getRobot", null); + JToken responseValue = AirportAGVClient.InvokeT("PUT:/api/task/getTaskStateDetail", null, requestValue); + if (responseValue == null) + { + return new AGVResponseEntity(); + } + string json = responseValue.ToString(); + if (string.IsNullOrEmpty(json)) + { + return new AGVResponseEntity(); + } + AGVResponseEntity ResponseEntity; + ResponseEntity = JsonSerializer.Deserialize>(json); + return ResponseEntity; + } + + /// + /// 获取所有AGV信息请求 + /// + /// + /// + public static AGVResponseEntity> AGVAllStateRequest() + { + JToken responseValue = AirportAGVClient.InvokeT("GET:/api/task/robot/getRobot", null); if (responseValue == null) { return new AGVResponseEntity>(); @@ -118,6 +148,52 @@ namespace SlnMesnac.TouchSocket ResponseEntity = JsonSerializer.Deserialize>>(json); return ResponseEntity; } + + /// + /// 获取当前激活地图信息请求 + /// + /// + /// + public static AGVResponseEntity AGVMapActiveRequest() + { + JToken responseValue = AirportAGVClient.InvokeT("GET:/api/v1.0.0/Maps/mapActive", null); + if (responseValue == null) + { + return new AGVResponseEntity(); + } + string json = responseValue.ToString(); + if (string.IsNullOrEmpty(json)) + { + return new AGVResponseEntity(); + } + AGVResponseEntity ResponseEntity; + ResponseEntity = JsonSerializer.Deserialize>(json); + return ResponseEntity; + } + + /// + /// 获取当前地图所有位置点请求 + /// + /// + /// + public static AGVResponseEntity> AGVMapPositionRequest(string requestValue) + { + JToken responseValue = AirportAGVClient.InvokeT("GET:/api/v1.0.0/Positions?mapId={0}", null, requestValue); + if (responseValue == null) + { + return new AGVResponseEntity>(); + } + string json = responseValue.ToString(); + if (string.IsNullOrEmpty(json)) + { + return new AGVResponseEntity>(); + } + AGVResponseEntity> ResponseEntity; + ResponseEntity = JsonSerializer.Deserialize>>(json); + return ResponseEntity; + } + + } }