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 { /// /// AGV接口 /// public static class AgvApi { /// /// AGV地址 /// public static string AgvUrl = null!; //public static GenAgvSchedulingTaskResponse GenAgvSchedulingTask() //{ // var res = APICaller.CallApi2(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; //} /// /// 继续执行任务 /// /// AGV任务号 /// 下一个地址 /// 接口返回结果 /// public static ContinueTaskResponse ContinueTask(string taskCode, string nextPositionCode) { var res = APICaller.CallApi2(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; } } }