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.

112 lines
4.1 KiB

8 months ago
  1. using System;
  2. using System.ComponentModel.DataAnnotations;
  3. using System.Text.Json.Serialization;
  4. namespace Mirle.Component.API.ProgrammableLogicController.Models
  5. {
  6. /// <summary>
  7. /// 完成取放貨回報類別
  8. /// </summary>
  9. public class TP011FinishLoadUnloadReportDto : CommonMessage
  10. {
  11. /// <summary>
  12. /// 當下任務編號
  13. /// </summary>
  14. /// <remarks>A[YYYYMMDDHH][Sequence * 5]/S[YYYYMMDDHH][Sequnce * 5]</remarks>
  15. [Required, StringLength(16), JsonPropertyName("current_task_id"), JsonPropertyOrder(101)]
  16. public string CurrentTaskID { get; set; }
  17. /// <summary>
  18. /// 站點名稱
  19. /// </summary>
  20. [Required, StringLength(9), JsonPropertyName("station_id"), JsonPropertyOrder(102)]
  21. public string StationID { get; set; }
  22. /// <summary>
  23. /// 任務模式
  24. /// </summary>
  25. /// <value>
  26. /// 0 = Store In
  27. /// 1 = Store Out
  28. /// </value>
  29. [Required, JsonPropertyName("task_mode"), JsonPropertyOrder(103)]
  30. public TaskActionMode TaskMode { get; set; }
  31. /// <summary>
  32. /// 事件類別
  33. /// </summary>
  34. /// <value>
  35. /// 0 = Load <br/>
  36. /// 1 = Unload <br/>
  37. /// </value>
  38. [Required, JsonPropertyName("event_type"), JsonPropertyOrder(104)]
  39. public LoadUnloadEvent EventType { get; set; }
  40. /// <summary>
  41. /// 取得完成取放貨回報
  42. /// </summary>
  43. /// <param name="transName">交易名稱</param>
  44. /// <param name="softwareID">軟體編號</param>
  45. /// <param name="taskId">任務編號</param>
  46. /// <param name="currentTaskID">當前任務編號</param>
  47. /// <param name="stationID">站點編號</param>
  48. /// <param name="taskMod">任務模式</param>
  49. /// <param name="eventType">事件類別</param>
  50. /// <returns>完成取放貨回報</returns>
  51. public static TP011FinishLoadUnloadReportDto Get(TransactionName transName, string softwareID, string taskId,
  52. string currentTaskID, string stationID, TaskActionMode taskMod, LoadUnloadEvent eventType)
  53. {
  54. return new TP011FinishLoadUnloadReportDto()
  55. {
  56. Timetick = DateTime.Now,
  57. TransactionName = transName.ToTransactionName(),
  58. SoftwareID = softwareID,
  59. TaskID = taskId,
  60. CurrentTaskID = currentTaskID,
  61. StationID = stationID,
  62. TaskMode = taskMod,
  63. EventType = eventType
  64. };
  65. }
  66. }
  67. /// <summary>
  68. /// 完成取放貨回應類別
  69. /// </summary>
  70. public class FP012FinishLoadUnloadAckDto : CommonMessage
  71. {
  72. /// <summary>
  73. /// 當下任務編號
  74. /// </summary>
  75. /// <remarks>A[YYYYMMDDHH][Sequence * 5]/S[YYYYMMDDHH][Sequnce * 5]</remarks>
  76. [Required, StringLength(16), JsonPropertyName("current_task_id"), JsonPropertyOrder(101)]
  77. public string CurrentTaskID { get; set; }
  78. /// <summary>
  79. /// 站點編號
  80. /// </summary>
  81. [Required, StringLength(9), JsonPropertyName("station_id"), JsonPropertyOrder(102)]
  82. public string StationID { get; set; }
  83. /// <summary>
  84. /// 任務模式
  85. /// </summary>
  86. /// <value>
  87. /// 0 = Store In <br/>
  88. /// 1 = Store Out <br/>
  89. /// </value>
  90. [Required, JsonPropertyName("task_mode"), JsonPropertyOrder(103)]
  91. public TaskActionMode TaskMode { get; set; }
  92. /// <summary>
  93. /// 事件類別
  94. /// </summary>
  95. /// <value>
  96. /// 0 = Load <br/>
  97. /// 1 = Unload <br/>
  98. /// </value>
  99. [Required, JsonPropertyName("event_type"), JsonPropertyOrder(104)]
  100. public LoadUnloadEvent EventType { get; set; }
  101. /// <summary>
  102. /// 回應代碼
  103. /// </summary>
  104. /// <value>
  105. /// 0 = OK <br/>
  106. /// 1 = NG <br/>
  107. /// </value>
  108. [Required, JsonPropertyName("reply_code"), JsonPropertyOrder(105)]
  109. public ReplyCode ReplyCode { get; set; }
  110. }
  111. }