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.

98 lines
3.8 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 TP025CheckLifterItemReportDto : CommonMessage
  10. {
  11. /// <summary>
  12. /// 當下任務編號
  13. /// </summary>
  14. /// <remarks>A[YYYYMMDDHH][Sequnce * 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. [Required, JsonPropertyName("floor"), JsonPropertyOrder(103)]
  26. public int Floor { get; set; }
  27. /// <summary>
  28. /// 電梯內貨物狀態
  29. /// </summary>
  30. [Required, JsonPropertyName("lifter_item_status"), JsonPropertyOrder(104)]
  31. public LifterItemStatus LifterItemStatus { get; set; }
  32. /// <summary>
  33. /// 取得檢查電梯貨物回報
  34. /// </summary>
  35. /// <param name="transName">交易名稱</param>
  36. /// <param name="softwareID">軟體編號</param>
  37. /// <param name="currentTaskID">當下任務編號</param>
  38. /// <param name="stationID">站點編號</param>
  39. /// <param name="floor">所在樓層</param>
  40. /// <param name="lifterItemStatus">電梯內貨物狀態</param>
  41. /// <returns>檢查電梯貨物回報</returns>
  42. public static TP025CheckLifterItemReportDto Get(TransactionName transName, string softwareID,
  43. string currentTaskID, string stationID, int floor, LifterItemStatus lifterItemStatus)
  44. {
  45. return new TP025CheckLifterItemReportDto()
  46. {
  47. Timetick = DateTime.Now,
  48. TransactionName = transName.ToTransactionName(),
  49. SoftwareID = softwareID,
  50. CurrentTaskID = currentTaskID,
  51. StationID = stationID,
  52. Floor = floor,
  53. LifterItemStatus = lifterItemStatus
  54. };
  55. }
  56. }
  57. /// <summary>
  58. /// 檢查電梯貨物回應類別
  59. /// </summary>
  60. public class FP026CheckLifterItemAckDto : CommonMessage
  61. {
  62. /// <summary>
  63. /// 當下任務編號
  64. /// </summary>
  65. /// <remarks>A[YYYYMMDDHH][Sequnce * 5]/S[YYYYMMDDHH][Sequnce * 5]</remarks>
  66. [Required, StringLength(16), JsonPropertyName("current_task_id"), JsonPropertyOrder(101)]
  67. public string CurrentTaskID { get; set; }
  68. /// <summary>
  69. /// 站點編號
  70. /// </summary>
  71. [Required, StringLength(9), JsonPropertyName("station_id"), JsonPropertyOrder(102)]
  72. public string StationID { get; set; }
  73. /// <summary>
  74. /// 當前所在樓層
  75. /// </summary>
  76. [Required, JsonPropertyName("floor"), JsonPropertyOrder(103)]
  77. public int Floor { get; set; }
  78. /// <summary>
  79. /// 電梯貨物狀態
  80. /// </summary>
  81. /// <value>
  82. /// 0 = Have Item <br/>
  83. /// 1 = Haven't Item <br/>
  84. /// </value>
  85. [Required, JsonPropertyName("lifter_item_status"), JsonPropertyOrder(104)]
  86. public LifterItemStatus LiftItemStatus { get; set; }
  87. /// <summary>
  88. /// 回應代碼
  89. /// </summary>
  90. /// <value>
  91. /// 0 = OK <br/>
  92. /// 1 = NG <br/>
  93. /// </value>
  94. [Required, JsonPropertyName("reply_code"), JsonPropertyOrder(105)]
  95. public ReplyCode ReplyCode { get; set; }
  96. }
  97. }