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.

106 lines
4.0 KiB

8 months ago
  1. using System;
  2. using System.ComponentModel.DataAnnotations;
  3. using System.Text.Json.Serialization;
  4. namespace Mirle.Component.API.WarehouseExecutionSystem.Models
  5. {
  6. /// <summary>
  7. /// 棧板供收狀態回報類別
  8. /// </summary>
  9. public class TW011PalletSupplyStatusReportDto : CommonMessage
  10. {
  11. /// <summary>
  12. /// 軟體編號
  13. /// </summary>
  14. [Required, StringLength(7), JsonPropertyName("software_id"), JsonPropertyOrder(101)]
  15. public string SoftwareID { get; set; }
  16. /// <summary>
  17. /// 站點編號
  18. /// </summary>
  19. [Required, StringLength(16), JsonPropertyName("station_id"), JsonPropertyOrder(102)]
  20. public string StationID { get; set; }
  21. /// <summary>
  22. /// 棧板供應狀態
  23. /// </summary>
  24. /// <value>
  25. /// 0 = Full <br/>
  26. /// 1 = Empty <br/>
  27. /// </value>
  28. [Required, JsonPropertyName("pallet_status"), JsonPropertyOrder(103)]
  29. public PalletSupplyStatus PalletStatus { get; set; }
  30. /// <summary>
  31. /// 取得棧板供收狀態回報
  32. /// </summary>
  33. /// <param name="transName">交易名稱</param>
  34. /// <param name="softwareID">軟體編號</param>
  35. /// <param name="stationID">站點編號</param>
  36. /// <param name="palletStatus">棧板供收狀態</param>
  37. /// <returns>棧板供收狀態回報</returns>
  38. public static TW011PalletSupplyStatusReportDto Get(TransactionName transName, string softwareID, string stationID, PalletSupplyStatus palletStatus)
  39. {
  40. return new TW011PalletSupplyStatusReportDto()
  41. {
  42. Timetick = DateTime.Now,
  43. TransactionName = transName.ToTransactionName(),
  44. SoftwareID = softwareID,
  45. StationID = stationID,
  46. PalletStatus = palletStatus
  47. };
  48. }
  49. }
  50. /// <summary>
  51. /// 棧板供收狀態回應類別
  52. /// </summary>
  53. public class FW012PalletSupplyStatusAckDto : CommonMessage
  54. {
  55. /// <summary>
  56. /// 軟體編號
  57. /// </summary>
  58. [Required, StringLength(7), JsonPropertyName("software_id"), JsonPropertyOrder(101)]
  59. public string SoftwareID { get; set; }
  60. /// <summary>
  61. /// 站點編號
  62. /// </summary>
  63. [Required, StringLength(16), JsonPropertyName("station_id"), JsonPropertyOrder(102)]
  64. public string StationID { get; set; }
  65. /// <summary>
  66. /// 棧板供應狀態
  67. /// </summary>
  68. /// <value>
  69. /// 0 = Full <br/>
  70. /// 1 = Empty <br/>
  71. /// </value>
  72. [Required, JsonPropertyName("pallet_status"), JsonPropertyOrder(103)]
  73. public PalletSupplyStatus PalletStatus { get; set; }
  74. /// <summary>
  75. /// 回應代碼
  76. /// </summary>
  77. /// <value>
  78. /// 0 = OK <br/>
  79. /// 1 = NG <br/>
  80. /// </value>
  81. [Required, JsonPropertyName("reply_code"), JsonPropertyOrder(104)]
  82. public ReplyCode ReplyCode { get; set; }
  83. /// <summary>
  84. /// 取得棧板供收狀態回應
  85. /// </summary>
  86. /// <param name="transName">交易名稱</param>
  87. /// <param name="softwareID">軟體編號</param>
  88. /// <param name="stationID">站點編號</param>
  89. /// <param name="palletStatus">棧板供收狀態</param>
  90. /// <param name="replyCode">回應代碼</param>
  91. /// <returns>棧板供收狀態回應</returns>
  92. public static FW012PalletSupplyStatusAckDto Get(TransactionName transName, string softwareID, string stationID, PalletSupplyStatus palletStatus, bool replyCode)
  93. {
  94. return new FW012PalletSupplyStatusAckDto()
  95. {
  96. Timetick = DateTime.Now,
  97. TransactionName = transName.ToTransactionName(),
  98. SoftwareID = softwareID,
  99. StationID = stationID,
  100. PalletStatus = palletStatus,
  101. ReplyCode = replyCode ? ReplyCode.OK : ReplyCode.NG
  102. };
  103. }
  104. }
  105. }