using Autofac.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_DTO.Agv;
using WIDESEAWCS_Common.APIEnum;
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.Helper;
namespace WIDESEAWCS_TaskInfoService
{
public partial class TaskService
{
///
/// 发送AGV任务
///
///
///
public WebResponseContent AgvSendTask(AgvTaskDTO taskModel)
{
WebResponseContent content = new WebResponseContent();
try
{
string apiAddress = AppSettings.Get(APIEnum.AgvSendTask.ToString());
string response = HttpHelper.Post(apiAddress, taskModel.Serialize());
AgvResponseContent agvContent = response.DeserializeObject();
if (agvContent.Code == "200")
{
content.OK(agvContent.Message);
}
else
{
content.Error(agvContent.Message);
}
}
catch (Exception ex)
{
content.Error(ex.Message);
}
return content;
}
///
/// 安全信号申请 AGV-WCS
///
public AgvResponseContent AgvSecureApply(AgvSecureApplyDTO secureApplyModel)
{
return new AgvResponseContent();
}
///
/// 安全信号回复 WCS-AGV
///
///
///
public WebResponseContent AgvSecureReply(AgvSecureReplyDTO secureReplyModel)
{
WebResponseContent content = new WebResponseContent();
try
{
string apiAddress = AppSettings.Get(APIEnum.AgvSecureReply.ToString());
string response = HttpHelper.Post(apiAddress, secureReplyModel.Serialize());
AgvResponseContent agvContent = response.DeserializeObject();
if (agvContent.Code == "200")
{
content.OK(agvContent.Message);
}
else
{
content.Error(agvContent.Message);
}
}
catch (Exception ex)
{
content.Error(ex.Message);
}
return content;
}
///
/// AGV任务状态刷新/AGV任务完成
///
///
///
public AgvResponseContent AgvUpdateTask(AgvUpdateDTO agvUpdateModel)
{
return new AgvResponseContent();
}
}
}