| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- using ServiceCenter.WebApi;
- using WCS.WorkEngineering.WebApi.Models.AGV;
- using WCS.WorkEngineering.WebApi.Models.AGV.Request;
- using WCS.WorkEngineering.WebApi.Models.AGV.Response;
- using WCS.WorkEngineering.Worlds.Logs;
- namespace WCS.WorkEngineering.WebApi.Controllers
- {
- /// <summary>
- /// AGV接口
- /// </summary>
- public static class AgvApi
- {
- /// <summary>
- /// AGV地址
- /// </summary>
- public static string AgvUrl = null!;
- //public static GenAgvSchedulingTaskResponse GenAgvSchedulingTask()
- //{
- // var res = APICaller.CallApi2<ContinueTaskResponse>(AgvUrl + "/hikRpcService/continueTask", new ContinueTaskRequest
- // {
- // reqCode = Guid.NewGuid().ToString(),
- // taskCode = taskCode,
- // type = "00",
- // nextPositionCode = nextPositionCode
- // });
- // if (res.code != AgvContinueTaskResponseCode.Success)
- // {
- // throw new KnownException(res.message, LogLevelEnum.High);
- // }
- // return res;
- //}
- /// <summary>
- /// 继续执行任务
- /// </summary>
- /// <param name="taskCode">AGV任务号</param>
- /// <param name="nextPositionCode">下一个地址</param>
- /// <returns>接口返回结果</returns>
- /// <exception cref="KnownException"></exception>
- public static ContinueTaskResponse ContinueTask(string taskCode, string nextPositionCode)
- {
- var res = APICaller.CallApi2<ContinueTaskResponse>(AgvUrl + "/hikRpcService/continueTask", new ContinueTaskRequest
- {
- reqCode = Guid.NewGuid().ToString(),
- taskCode = taskCode,
- type = "00",
- nextPositionCode = nextPositionCode
- });
- if (res.code != AgvResponseCode.Success)
- {
- throw new KnownException(res.message, LogLevelEnum.High);
- }
- return res;
- }
- }
- }
|