集成,总结MES功能
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

474 lines
12 KiB

  1. using BPA.AGV;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. namespace BPA.MES.Base.Application.Services.AGVService.Dtos
  8. {
  9. public class Roller_JobRequest
  10. {
  11. public string Url { get; set; }
  12. [Required(ErrorMessage = "[{0}]不能为空")]
  13. [MaxLength(64, ErrorMessage = "[{0}]不能超过64字符")]
  14. public string AgvCode { get; set; }
  15. [Required(ErrorMessage = "[{0}]不能为空")]
  16. [MaxLength(64, ErrorMessage = "[{0}]不能超过64字符")]
  17. public string JobId { get; set; }
  18. [Required(ErrorMessage = "[{0}]不能为空")]
  19. [MaxLength(64, ErrorMessage = "[{0}]不能超过64字符")]
  20. public string MsgId { get; set; }
  21. public bool? Complete { get; set; }
  22. }
  23. public class AGVExecuteReplyRequest
  24. {
  25. public AgvHeader Header { get; set; }
  26. public AgvReplyBody Body { get; set; }
  27. }
  28. public class AgvReplyBody
  29. {
  30. public AGVExecuteReplyDto Event { get; set; }
  31. }
  32. public class AGVExecuteReplyMQTT: IMessage
  33. {
  34. public AGVExecuteReplyDto Event { get; set; }
  35. public int MessageId { get; set; }
  36. public Version MsgVersion { get; set; }
  37. }
  38. public class AGVLoadAndUnloadRequest
  39. {
  40. public AgvHeader Header { get; set; }
  41. public AGVLoadAndUnloadBody Body { get; set; }
  42. }
  43. public class AGVLoadAndUnloadBody
  44. {
  45. public AGVLoadAndUnloadDto Event { get; set; }
  46. }
  47. public class AGVLoadAndUnloadMQTT : IMessage
  48. {
  49. public AGVLoadAndUnloadDto Event { get; set; }
  50. public int MessageId { get; set; }
  51. public Version MsgVersion { get; set; }
  52. }
  53. public class AgvBody
  54. {
  55. public AgvHeader Header { get; set; }
  56. public AgvRetrun Body { get; set; }
  57. }
  58. public class AgvHeader
  59. {
  60. public string RequestId { get; set; }
  61. public string Timestamp { get; set; }
  62. public string Version { get; set; }
  63. }
  64. public class AgvRetrun
  65. {
  66. public string Code { get; set; }
  67. public bool Success { get; set; }
  68. public string Message { get; set; }
  69. public object? Data { get; set; }
  70. }
  71. /// <summary>
  72. /// 任务完成回报Dto
  73. /// </summary>
  74. public class AGVExecuteReplyDto
  75. {
  76. /// <summary>
  77. /// 上游系统任务号,全局唯一
  78. /// </summary>
  79. public string robotJobId { get; set; }
  80. /// <summary>
  81. /// 仓库编号
  82. /// </summary>
  83. public long warehouseId { get; set; }
  84. /// <summary>
  85. /// 任务快仓系统编号
  86. /// </summary>
  87. public string jobId { get; set; }
  88. /// <summary>
  89. /// 任务状态
  90. /// </summary>
  91. public string state { get; set; }
  92. /// <summary>
  93. /// 内部任务类型
  94. /// </summary>
  95. public string jobType { get; set; }
  96. /// <summary>
  97. /// 数据字段
  98. /// </summary>
  99. public PointToPoint jobData { get; set; }
  100. }
  101. /// <summary>
  102. /// 上下料交互请求DTO
  103. /// </summary>
  104. public class AGVLoadAndUnloadDto
  105. {
  106. /// <summary>
  107. /// AGV编号
  108. /// </summary>
  109. public string agvCode { get; set; }
  110. /// <summary>
  111. /// 容器编号,如果一次上/下多个容器,则多个容器用英文逗号分隔
  112. /// </summary>
  113. public string containerCode { get; set; }
  114. /// <summary>
  115. /// 上游设备ID
  116. /// </summary>
  117. public long equipmentId { get; set; }
  118. /// <summary>
  119. /// 上游设备ID,多个用英文逗号分隔
  120. /// </summary>
  121. public string equipmentIds { get; set; }
  122. /// <summary>
  123. /// 快仓任务编号
  124. /// </summary>
  125. public string jobId { get; set; }
  126. /// <summary>
  127. /// 消息ID
  128. /// </summary>
  129. public string msgId { get; set; }
  130. /// <summary>
  131. /// 交互阶段LOAD:上料阶段 UNLOAD:下料阶段
  132. /// </summary>
  133. public string command { get; set; }
  134. /// <summary>
  135. /// 上游任务号
  136. /// </summary>
  137. public string robotJobId { get; set; }
  138. }
  139. /// <summary>
  140. /// 货到货
  141. /// </summary>
  142. public class GoodsToGoods
  143. {
  144. /// <summary>
  145. /// AGV编号
  146. /// </summary>
  147. public string agvCode { get; set; }
  148. /// <summary>
  149. /// 容器编号
  150. /// </summary>
  151. public string containerCode { get; set; }
  152. /// <summary>
  153. /// 上料点位
  154. /// </summary>
  155. public string startPointCode { get; set; }
  156. /// <summary>
  157. /// 上料货位编号
  158. /// </summary>
  159. public string startSlotCode { get; set; }
  160. /// <summary>
  161. /// 下料点位
  162. /// </summary>
  163. public string targetPointCode { get; set; }
  164. /// <summary>
  165. /// 下料货位编号
  166. /// </summary>
  167. public string targetSlotCode { get; set; }
  168. /// <summary>
  169. /// 是否需要上料交互
  170. /// </summary>
  171. public bool loadInteractive { get; set; }
  172. }
  173. /// <summary>
  174. /// 点到点
  175. /// </summary>
  176. public class PointToPoint
  177. {
  178. /// <summary>
  179. /// AGV编号
  180. /// </summary>
  181. public string agvCode { get; set; }
  182. /// <summary>
  183. /// 容器编号
  184. /// </summary>
  185. public string containerCode { get; set; }
  186. /// <summary>
  187. /// 上料点位
  188. /// </summary>
  189. public string startPointCode { get; set; }
  190. /// <summary>
  191. /// 下料点位
  192. /// </summary>
  193. public string targetPointCode { get; set; }
  194. /// <summary>
  195. /// 是否需要上料交互
  196. /// </summary>
  197. public bool loadInteractive { get; set; }
  198. }
  199. public enum AGVState
  200. {
  201. //任务状态:
  202. //1)货架/货位/点到点货架搬运任务枚举:
  203. //LIFT_UP_DONE:顶升完成
  204. //MOVE_BEGIN:开始移动
  205. //PUT_DOWN_DONE:放下完成
  206. //DONE:任务完成
  207. //CANCEL:任务取消
  208. //ABNORMAL_CANCEL:任务异常取消
  209. //ABNORMAL_COMPLETED:任务异常完成
  210. //2)货位到货位/点到点辊筒料箱搬运任务枚举:
  211. //ROLLER_LOAD_DOING:正在上料
  212. //ROLLER_LOAD_FINISH:上料完成
  213. //ROLLER_UNLOAD_DOING:正在下料
  214. //DONE:下料完成
  215. //ABNORMAL_CANCEL:任务异常取消
  216. //ABNORMAL_COMPLETED:任务异常完成
  217. //3)AGV移动任务枚举:
  218. //DONE:任务完成
  219. //CANCEL:任务取消
  220. //ABNORMAL_CANCEL:任务异常取消
  221. //ABNORMAL_COMPLETED:任务异常完成
  222. //4) 纯料箱任务枚举:
  223. //MOVE_BEGIN:开始移动(仅单插臂或单夹报,2.8.1后)
  224. //ENTER_STATION:到站
  225. //DONE:任务完成
  226. //LOAD_COMPLETED:取料完成
  227. //UNLOAD_COMPLETED:放料完成
  228. //ABNORMAL_CANCEL:任务异常取消ABNORMAL_COMPLETED:任务异常完成
  229. //5) 小皮带任务枚举:
  230. //DONE:任务完成
  231. //6) QuickPick任务枚举:
  232. //ENTER_STATION:到站
  233. //DONE:任务完成
  234. //CANCEL:任务取消
  235. //LEAVE_STATION离站
  236. //ROLLBACK 回滚(有其他任务,当前任务可不执行)
  237. /// <summary>
  238. /// 顶升完成
  239. /// </summary>
  240. LIFT_UP_DONE = 1,
  241. /// <summary>
  242. /// 开始移动
  243. /// </summary>
  244. MOVE_BEGIN = 2,
  245. /// <summary>
  246. /// 放下完成
  247. /// </summary>
  248. PUT_DOWN_DONE = 3,
  249. /// <summary>
  250. /// 任务完成
  251. /// </summary>
  252. DONE = 4,
  253. /// <summary>
  254. /// 任务取消
  255. /// </summary>
  256. CANCEL = 5,
  257. /// <summary>
  258. /// 任务异常取消
  259. /// </summary>
  260. ABNORMAL_CANCEL = 6,
  261. /// <summary>
  262. /// 任务异常完成
  263. /// </summary>
  264. ABNORMAL_COMPLETED = 7
  265. }
  266. public enum jobType
  267. {
  268. /// <summary>
  269. /// 1) 辊筒货位到货位搬运
  270. /// </summary>
  271. SLOT_ROLLER_MOVE = 1,
  272. POINT_ROLLER_MOVE=2
  273. }
  274. public class KC_Response
  275. {
  276. public KC_Response()
  277. {
  278. Data = new();
  279. }
  280. /// <summary>
  281. /// 是否成功
  282. /// </summary>
  283. public bool Success { get; set; }
  284. /// <summary>
  285. /// 状态码
  286. /// </summary>
  287. public string Code { get; set; }
  288. /// <summary>
  289. /// 消息
  290. /// </summary>
  291. public string Message { get; set; }
  292. /// <summary>
  293. /// 返回数据数组
  294. /// </summary>
  295. public List<KC_Response_Data> Data { get; set; }
  296. }
  297. public class KC_Response_Data
  298. {
  299. /// <summary>
  300. /// 状态码
  301. /// </summary>
  302. public string Code { get; set; }
  303. /// <summary>
  304. /// 消息体
  305. /// </summary>
  306. public string Message { get; set; }
  307. /// <summary>
  308. /// 任务编号
  309. /// </summary>
  310. public string RobotJobId { get; set; }
  311. }
  312. /// <summary>
  313. /// AGV请求
  314. /// </summary>
  315. public class KC_ExecuteRequest
  316. {
  317. /// <summary>
  318. /// 快仓api地址
  319. /// </summary>
  320. public string Url { get; set; }
  321. /// <summary>
  322. /// 任务编码
  323. /// </summary>
  324. public string RobotJobId { get; set; }
  325. /// <summary>
  326. /// 仓库编码 默认值1
  327. /// </summary>
  328. public long WarehouseId { get; set; } = 1;
  329. public string RobotJobGroupId { get; set; }
  330. public int? Sequence { get; set; }
  331. public string RobotJobGroupNum { get; set; }
  332. /// <summary>
  333. /// 优先级 0-99 越高越先执行
  334. /// </summary>
  335. public int? JobPriority { get; set; }
  336. public int? JobPriorityType { get; set; }
  337. public string Deadline { get; set; }
  338. public string AgvType { get; set; }
  339. public string AgvEndPoint { get; set; }
  340. public bool NeedOperation { get; set; }
  341. public string AgvCode { get; set; }
  342. public int? TaskCountDown { get; set; } = 0;
  343. public string BusinessType { get; set; }
  344. [Required(ErrorMessage = "[{0}]不能为空")]
  345. [MaxLength(64, ErrorMessage = "[{0}]不能超过64字符")]
  346. //任务类型 用来滚筒点对点 POINT_ROLLER_MOVE n8H7jX
  347. public string JobType { get; set; } = "POINT_ROLLER_MOVE";
  348. [Required(ErrorMessage = "[{0}]不能为空")]
  349. public KC_JobDataRequest? JobData { get; set; }
  350. }
  351. /// <summary>
  352. /// 任务下发起止点信息
  353. /// </summary>
  354. public class KC_JobDataRequest
  355. {
  356. /// <summary>
  357. /// 用户自定义信息编号
  358. /// </summary>
  359. public string ContainerCode { get; set; }
  360. /// <summary>
  361. /// 起点点位
  362. /// </summary>
  363. [Required(ErrorMessage = "[{0}]不能为空")]
  364. [MaxLength(64, ErrorMessage = "[{0}]不能超过64字符")]
  365. public string StartPoint { get; set; }
  366. /// <summary>
  367. /// 终点点位
  368. /// </summary>
  369. [Required(ErrorMessage = "[{0}]不能为空")]
  370. [MaxLength(64, ErrorMessage = "[{0}]不能超过64字符")]
  371. public string EndPoint { get; set; }
  372. /// <summary>
  373. /// 上料方式 自动/人工
  374. /// </summary>
  375. public bool? AutoLoad { get; set; }
  376. /// <summary>
  377. /// 上料交互方式 //接口对接 false
  378. /// </summary>
  379. public bool? EnableIOLoad { get; set; } = false;
  380. /// <summary>
  381. /// 下料方式 true自动/false人工
  382. /// </summary>
  383. public bool? AutoUnload { get; set; }
  384. /// <summary>
  385. /// 接口对接 false
  386. /// </summary>
  387. public bool? EnableIOUnload { get; set; } = false;
  388. /// <summary>
  389. /// 起点设备ID
  390. /// </summary>
  391. public long LoadEquipmentId { get; set; }
  392. /// <summary>
  393. /// 目标设备ID
  394. /// </summary>
  395. public long UnloadEquipmentId { get; set; }
  396. public long LoadInteractive { get; set; }
  397. public long LoadHeight { get; set; }
  398. public long UnloadHeight { get; set; }
  399. }
  400. }