using Newtonsoft.Json;
|
using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
using WIDESEA_Comm.AGVTask;
|
using WIDESEA_Core;
|
using WIDESEA_Model.Models;
|
using WIDESEA_StorageTaskRepository;
|
|
namespace WIDESEA_StoragIntegrationServices
|
{
|
public partial class ToAGVService
|
{
|
/// <summary>
|
/// AGV回调接口
|
/// </summary>
|
/// <param name="taskRespon"></param>
|
/// <returns></returns>
|
public WebResponseContent agvCallback(object taskRespon)
|
{
|
WebResponseContent content = new WebResponseContent();
|
agvTask task = new agvTask();
|
try
|
{
|
task = JsonConvert.DeserializeObject<agvTask>(taskRespon.ToString());
|
if (task == null)
|
{
|
throw new Exception("AGV调用接口失败:无请求参数");
|
}
|
|
|
if (task.method.ToLower() == "apply") //AGV放料申请
|
{
|
//todo
|
}
|
|
if (task.method.ToLower() == "end") //AGV任务结束
|
{
|
|
//todo
|
//_taskRepository.QueryFirst(x=>x.SourceAddress == task.)
|
}
|
|
|
return content.OK();
|
}
|
catch (Exception ex)
|
{
|
return content.Error($"AGV回调异常:{ex.Message}");
|
}
|
}
|
}
|
}
|