|
|
@@ -0,0 +1,59 @@ |
|
|
|
using BPA.AGV; |
|
|
|
using System; |
|
|
|
using System.Collections.Generic; |
|
|
|
using System.Linq; |
|
|
|
using System.Text; |
|
|
|
using System.Threading.Tasks; |
|
|
|
|
|
|
|
namespace BPA.MES.Base.Application.Services.AGVService.Services |
|
|
|
{ |
|
|
|
|
|
|
|
[ApiDescriptionSettings("AGV管理", Name = "AgvThirdParty", Tag = "AGV第三方api", KeepName = true, SplitCamelCase = true, KeepVerb = true)] |
|
|
|
public class AGVThirdPartyService:IAGVThirdPartyService, ITransient, IDynamicApiController |
|
|
|
{ |
|
|
|
private readonly AGVHandler _aGVHandler; |
|
|
|
public AGVThirdPartyService(AGVHandler aGVHandler) |
|
|
|
{ |
|
|
|
_aGVHandler = aGVHandler; |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// 下发任务 |
|
|
|
/// </summary> |
|
|
|
/// <param name="cExecuteRequest"></param> |
|
|
|
/// <returns></returns> |
|
|
|
[HttpPost] |
|
|
|
public async Task<KCResponse> ExecuteAsync(KCExecuteRequest cExecuteRequest) |
|
|
|
{ |
|
|
|
if (cExecuteRequest.JobData != null) |
|
|
|
cExecuteRequest = new KCExecuteRequest |
|
|
|
{ |
|
|
|
Url = cExecuteRequest.Url, |
|
|
|
RobotJobId = Guid.NewGuid().ToString(), |
|
|
|
WarehouseId = cExecuteRequest.WarehouseId, |
|
|
|
JobPriority = cExecuteRequest.JobPriority, |
|
|
|
JobPriorityType = cExecuteRequest.JobPriorityType, |
|
|
|
JobData = new KCJobDataRequest |
|
|
|
{ |
|
|
|
StartPoint = cExecuteRequest.JobData.StartPoint, |
|
|
|
|
|
|
|
EndPoint = cExecuteRequest.JobData.EndPoint, |
|
|
|
} |
|
|
|
}; |
|
|
|
return await _aGVHandler.ExecuteAsync(cExecuteRequest); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// 取消任务 |
|
|
|
/// </summary> |
|
|
|
/// <param name="kCCancelRequest"></param> |
|
|
|
/// <returns></returns> |
|
|
|
[HttpPost] |
|
|
|
public async Task<KCResponse> CancelAsync(KCCancelRequest kCCancelRequest) |
|
|
|
{ |
|
|
|
return await _aGVHandler.CancelAsync(kCCancelRequest); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |