2024-11-15 11:37:55 +08:00
|
|
|
|
using WcsMain.ApiClient.AGV.Dto;
|
2024-11-14 12:06:40 +08:00
|
|
|
|
using WcsMain.Common;
|
|
|
|
|
|
using WcsMain.Constant;
|
|
|
|
|
|
using WcsMain.DataBase.TableEntity;
|
|
|
|
|
|
using WcsMain.ExtendMethod;
|
2024-11-15 11:37:55 +08:00
|
|
|
|
using WcsMain.Constant.WcsAttribute.AutoFacAttribute;
|
2024-11-14 12:06:40 +08:00
|
|
|
|
|
2024-11-15 11:37:55 +08:00
|
|
|
|
namespace WcsMain.ApiClient.AGV;
|
2024-11-14 12:06:40 +08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// AGV 动作
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[Component]
|
2024-11-15 11:37:55 +08:00
|
|
|
|
public class AGVWebApiAction(AGVBaseWebApi webApiPost)
|
2024-11-14 12:06:40 +08:00
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 发送点对点搬运的任务
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="wmsTask"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public string Send_NO_VERIFY_BUCKET_MOVE(AppWmsTask wmsTask)
|
|
|
|
|
|
{
|
|
|
|
|
|
AGVRequestLayout<AGVTaskRequest<AGVBucketMove>> request = new()
|
|
|
|
|
|
{
|
|
|
|
|
|
Header = new()
|
|
|
|
|
|
{
|
|
|
|
|
|
AppKey = ApplicationBaseConfig.APP_KEY,
|
|
|
|
|
|
AppSecret = ApplicationBaseConfig.APP_SECRET,
|
|
|
|
|
|
RequestId = wmsTask.TaskId,
|
|
|
|
|
|
TimeStamp = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
|
|
|
|
|
|
version = "2.9"
|
|
|
|
|
|
},
|
|
|
|
|
|
Body = new()
|
|
|
|
|
|
{
|
|
|
|
|
|
RobotJobId = wmsTask.TaskId,
|
|
|
|
|
|
WareHouseId = 100,
|
|
|
|
|
|
RobotJobGroupId = wmsTask.TaskId,
|
|
|
|
|
|
Sequence = 1,
|
|
|
|
|
|
RobotJobGroupNum = 1,
|
|
|
|
|
|
JobPriority = 1,
|
|
|
|
|
|
JobProorytyType = 0,
|
|
|
|
|
|
JobType = "NO_VERIFY_BUCKET_MOVE",
|
|
|
|
|
|
JobData = new()
|
|
|
|
|
|
{
|
|
|
|
|
|
StartPoint = wmsTask.Origin,
|
|
|
|
|
|
StartPointName = null,
|
|
|
|
|
|
WorkFaces = "0",
|
|
|
|
|
|
EndArea = wmsTask.Destination,
|
|
|
|
|
|
EndPoint = wmsTask.Destination,
|
|
|
|
|
|
EndPointName = null,
|
|
|
|
|
|
BucketTypeCode = "00",
|
|
|
|
|
|
LetDownFlag = 2,
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
var response = webApiPost.HttpPost<AGVRequestLayout<AGVTaskRequest<AGVBucketMove>>, AGVResponseLayout<AGVTaskResponse>>(request, CommonData.AppApiBaseInfos.GetAddress("AGV_NO_VERIFY_BUCKET_MOVE") ?? "");
|
|
|
|
|
|
var responseData = response.ResponseEntity;
|
|
|
|
|
|
if (!response.IsSend || responseData == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
return "请求失败,网络故障";
|
|
|
|
|
|
}
|
2024-11-15 11:37:55 +08:00
|
|
|
|
|
2024-11-14 12:06:40 +08:00
|
|
|
|
if (responseData.Body!.Success == true && responseData.Body!.Code?.ToLower() == "success")
|
|
|
|
|
|
{
|
|
|
|
|
|
// 发送成功
|
|
|
|
|
|
return string.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
return responseData.Body.Message ?? "请求失败,未知原因";
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 发送AGV任务
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="taskId"></param>
|
|
|
|
|
|
/// <param name="origin"></param>
|
|
|
|
|
|
/// <param name="destination"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public string Send_AGV_TASK(string? taskId, string? origin, string? destination)
|
|
|
|
|
|
{
|
|
|
|
|
|
AGVRequestLayout<AGVTaskRequest<AGVBucketMove>> request = new()
|
|
|
|
|
|
{
|
|
|
|
|
|
Header = new()
|
|
|
|
|
|
{
|
|
|
|
|
|
AppKey = ApplicationBaseConfig.APP_KEY,
|
|
|
|
|
|
AppSecret = ApplicationBaseConfig.APP_SECRET,
|
|
|
|
|
|
RequestId = taskId,
|
|
|
|
|
|
TimeStamp = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
|
|
|
|
|
|
version = "2.9"
|
|
|
|
|
|
},
|
|
|
|
|
|
Body = new()
|
|
|
|
|
|
{
|
|
|
|
|
|
RobotJobId = taskId,
|
|
|
|
|
|
WareHouseId = 100,
|
|
|
|
|
|
RobotJobGroupId = taskId,
|
|
|
|
|
|
Sequence = 1,
|
|
|
|
|
|
RobotJobGroupNum = 1,
|
|
|
|
|
|
JobPriority = 1,
|
|
|
|
|
|
JobProorytyType = 0,
|
|
|
|
|
|
JobType = "NO_VERIFY_BUCKET_MOVE",
|
|
|
|
|
|
JobData = new()
|
|
|
|
|
|
{
|
|
|
|
|
|
StartPoint = origin,
|
|
|
|
|
|
StartPointName = null,
|
|
|
|
|
|
WorkFaces = "0",
|
|
|
|
|
|
EndArea = destination,
|
|
|
|
|
|
EndPoint = destination,
|
|
|
|
|
|
EndPointName = null,
|
|
|
|
|
|
BucketTypeCode = "00",
|
|
|
|
|
|
LetDownFlag = 2,
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
var response = webApiPost.HttpPost<AGVRequestLayout<AGVTaskRequest<AGVBucketMove>>, AGVResponseLayout<AGVTaskResponse>>(request, CommonData.AppApiBaseInfos.GetAddress("AGV_NO_VERIFY_BUCKET_MOVE") ?? "");
|
|
|
|
|
|
var responseData = response.ResponseEntity;
|
|
|
|
|
|
if (!response.IsSend || responseData == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
return "请求失败,网络故障";
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (responseData.Body!.Success == true && responseData.Body!.Code?.ToLower() == "success")
|
|
|
|
|
|
{
|
|
|
|
|
|
// 发送成功
|
|
|
|
|
|
return string.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
return responseData.Body.Message ?? "请求失败,未知原因";
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|