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.Dtos
{
public class Roller_JobRequest
{
public string Url { get; set; }
[Required(ErrorMessage = "[{0}]不能为空")]
[MaxLength(64, ErrorMessage = "[{0}]不能超过64字符")]
public string AgvCode { get; set; }
[Required(ErrorMessage = "[{0}]不能为空")]
[MaxLength(64, ErrorMessage = "[{0}]不能超过64字符")]
public string JobId { get; set; }
[Required(ErrorMessage = "[{0}]不能为空")]
[MaxLength(64, ErrorMessage = "[{0}]不能超过64字符")]
public string MsgId { get; set; }
public bool? Complete { get; set; }
}
public class AGVExecuteReplyRequest
{
public AgvHeader Header { get; set; }
public AgvReplyBody Body { get; set; }
}
public class AgvReplyBody
{
public AGVExecuteReplyDto Event { get; set; }
}
public class AGVExecuteReplyMQTT: IMessage
{
public AGVExecuteReplyDto Event { get; set; }
public int MessageId { get; set; }
public Version MsgVersion { get; set; }
}
public class AGVLoadAndUnloadRequest
{
public AgvHeader Header { get; set; }
public AGVLoadAndUnloadBody Body { get; set; }
}
public class AGVLoadAndUnloadBody
{
public AGVLoadAndUnloadDto Event { get; set; }
}
public class AGVLoadAndUnloadMQTT : IMessage
{
public AGVLoadAndUnloadDto Event { get; set; }
public int MessageId { get; set; }
public Version MsgVersion { get; set; }
}
public class AgvBody
{
public AgvHeader Header { get; set; }
public AgvRetrun Body { get; set; }
}
public class AgvHeader
{
public string RequestId { get; set; }
public string Timestamp { get; set; }
public string Version { get; set; }
}
public class AgvRetrun
{
public string Code { get; set; }
public bool Success { get; set; }
public string Message { get; set; }
public object? Data { get; set; }
}
///
/// 任务完成回报Dto
///
public class AGVExecuteReplyDto
{
///
/// 上游系统任务号,全局唯一
///
public string robotJobId { get; set; }
///
/// 仓库编号
///
public long warehouseId { get; set; }
///
/// 任务快仓系统编号
///
public string jobId { get; set; }
///
/// 任务状态
///
public string state { get; set; }
///
/// 内部任务类型
///
public string jobType { get; set; }
///
/// 数据字段
///
public PointToPoint jobData { get; set; }
}
///
/// 上下料交互请求DTO
///
public class AGVLoadAndUnloadDto
{
///
/// AGV编号
///
public string agvCode { get; set; }
///
/// 容器编号,如果一次上/下多个容器,则多个容器用英文逗号分隔
///
public string containerCode { get; set; }
///
/// 上游设备ID
///
public long equipmentId { get; set; }
///
/// 上游设备ID,多个用英文逗号分隔
///
public string equipmentIds { get; set; }
///
/// 快仓任务编号
///
public string jobId { get; set; }
///
/// 消息ID
///
public string msgId { get; set; }
///
/// 交互阶段LOAD:上料阶段 UNLOAD:下料阶段
///
public string command { get; set; }
///
/// 上游任务号
///
public string robotJobId { get; set; }
}
///
/// 货到货
///
public class GoodsToGoods
{
///
/// AGV编号
///
public string agvCode { get; set; }
///
/// 容器编号
///
public string containerCode { get; set; }
///
/// 上料点位
///
public string startPointCode { get; set; }
///
/// 上料货位编号
///
public string startSlotCode { get; set; }
///
/// 下料点位
///
public string targetPointCode { get; set; }
///
/// 下料货位编号
///
public string targetSlotCode { get; set; }
///
/// 是否需要上料交互
///
public bool loadInteractive { get; set; }
}
///
/// 点到点
///
public class PointToPoint
{
///
/// AGV编号
///
public string agvCode { get; set; }
///
/// 容器编号
///
public string containerCode { get; set; }
///
/// 上料点位
///
public string startPointCode { get; set; }
///
/// 下料点位
///
public string targetPointCode { get; set; }
///
/// 是否需要上料交互
///
public bool loadInteractive { get; set; }
}
public enum AGVState
{
//任务状态:
//1)货架/货位/点到点货架搬运任务枚举:
//LIFT_UP_DONE:顶升完成
//MOVE_BEGIN:开始移动
//PUT_DOWN_DONE:放下完成
//DONE:任务完成
//CANCEL:任务取消
//ABNORMAL_CANCEL:任务异常取消
//ABNORMAL_COMPLETED:任务异常完成
//2)货位到货位/点到点辊筒料箱搬运任务枚举:
//ROLLER_LOAD_DOING:正在上料
//ROLLER_LOAD_FINISH:上料完成
//ROLLER_UNLOAD_DOING:正在下料
//DONE:下料完成
//ABNORMAL_CANCEL:任务异常取消
//ABNORMAL_COMPLETED:任务异常完成
//3)AGV移动任务枚举:
//DONE:任务完成
//CANCEL:任务取消
//ABNORMAL_CANCEL:任务异常取消
//ABNORMAL_COMPLETED:任务异常完成
//4) 纯料箱任务枚举:
//MOVE_BEGIN:开始移动(仅单插臂或单夹报,2.8.1后)
//ENTER_STATION:到站
//DONE:任务完成
//LOAD_COMPLETED:取料完成
//UNLOAD_COMPLETED:放料完成
//ABNORMAL_CANCEL:任务异常取消ABNORMAL_COMPLETED:任务异常完成
//5) 小皮带任务枚举:
//DONE:任务完成
//6) QuickPick任务枚举:
//ENTER_STATION:到站
//DONE:任务完成
//CANCEL:任务取消
//LEAVE_STATION离站
//ROLLBACK 回滚(有其他任务,当前任务可不执行)
///
/// 顶升完成
///
LIFT_UP_DONE = 1,
///
/// 开始移动
///
MOVE_BEGIN = 2,
///
/// 放下完成
///
PUT_DOWN_DONE = 3,
///
/// 任务完成
///
DONE = 4,
///
/// 任务取消
///
CANCEL = 5,
///
/// 任务异常取消
///
ABNORMAL_CANCEL = 6,
///
/// 任务异常完成
///
ABNORMAL_COMPLETED = 7
}
public enum jobType
{
///
/// 1) 辊筒货位到货位搬运
///
SLOT_ROLLER_MOVE = 1,
POINT_ROLLER_MOVE=2
}
public class KC_Response
{
public KC_Response()
{
Data = new();
}
///
/// 是否成功
///
public bool Success { get; set; }
///
/// 状态码
///
public string Code { get; set; }
///
/// 消息
///
public string Message { get; set; }
///
/// 返回数据数组
///
public List Data { get; set; }
}
public class KC_Response_Data
{
///
/// 状态码
///
public string Code { get; set; }
///
/// 消息体
///
public string Message { get; set; }
///
/// 任务编号
///
public string RobotJobId { get; set; }
}
///
/// AGV请求
///
public class KC_ExecuteRequest
{
///
/// 快仓api地址
///
public string Url { get; set; }
///
/// 任务编码
///
public string RobotJobId { get; set; }
///
/// 仓库编码 默认值1
///
public long WarehouseId { get; set; } = 1;
public string RobotJobGroupId { get; set; }
public int? Sequence { get; set; }
public string RobotJobGroupNum { get; set; }
///
/// 优先级 0-99 越高越先执行
///
public int? JobPriority { get; set; }
public int? JobPriorityType { get; set; }
public string Deadline { get; set; }
public string AgvType { get; set; }
public string AgvEndPoint { get; set; }
public bool NeedOperation { get; set; }
public string AgvCode { get; set; }
public int? TaskCountDown { get; set; } = 0;
public string BusinessType { get; set; }
[Required(ErrorMessage = "[{0}]不能为空")]
[MaxLength(64, ErrorMessage = "[{0}]不能超过64字符")]
//任务类型 用来滚筒点对点 POINT_ROLLER_MOVE n8H7jX
public string JobType { get; set; } = "POINT_ROLLER_MOVE";
[Required(ErrorMessage = "[{0}]不能为空")]
public KC_JobDataRequest? JobData { get; set; }
}
///
/// 任务下发起止点信息
///
public class KC_JobDataRequest
{
///
/// 用户自定义信息编号
///
public string ContainerCode { get; set; }
///
/// 起点点位
///
[Required(ErrorMessage = "[{0}]不能为空")]
[MaxLength(64, ErrorMessage = "[{0}]不能超过64字符")]
public string StartPoint { get; set; }
///
/// 终点点位
///
[Required(ErrorMessage = "[{0}]不能为空")]
[MaxLength(64, ErrorMessage = "[{0}]不能超过64字符")]
public string EndPoint { get; set; }
///
/// 上料方式 自动/人工
///
public bool? AutoLoad { get; set; }
///
/// 上料交互方式 //接口对接 false
///
public bool? EnableIOLoad { get; set; } = false;
///
/// 下料方式 true自动/false人工
///
public bool? AutoUnload { get; set; }
///
/// 接口对接 false
///
public bool? EnableIOUnload { get; set; } = false;
///
/// 起点设备ID
///
public long LoadEquipmentId { get; set; }
///
/// 目标设备ID
///
public long UnloadEquipmentId { get; set; }
public long LoadInteractive { get; set; }
public long LoadHeight { get; set; }
public long UnloadHeight { get; set; }
}
}