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.

66 lines
2.3 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 FP017PalletSupplyStatusReportDto : CommonMessage
  10. {
  11. /// <summary>
  12. /// 站點編號
  13. /// </summary>
  14. [Required, StringLength(9), JsonPropertyName("station_id"), JsonPropertyOrder(101)]
  15. public string StationID { get; set; }
  16. /// <summary>
  17. /// 棧板狀態
  18. /// </summary>
  19. /// <value>
  20. /// 0 = Full <br/>
  21. /// 1 = Empty <br/>
  22. /// </value>
  23. [Required, JsonPropertyName("pallet_status"), JsonPropertyOrder(102)]
  24. public PalletSupplyStatus PalletStatus { get; set; }
  25. }
  26. /// <summary>
  27. /// 棧板供應狀態回應類別
  28. /// </summary>
  29. public class TP018PalletSupplyStatusAckDto : CommonMessage
  30. {
  31. /// <summary>
  32. /// 站點編號
  33. /// </summary>
  34. [Required, StringLength(9), JsonPropertyName("station_id"), JsonPropertyOrder(101)]
  35. public string StationID { get; set; }
  36. /// <summary>
  37. /// 回應代碼
  38. /// </summary>
  39. /// <value>
  40. /// 0 = OK <br/>
  41. /// 1 = NG <br/>
  42. /// </value>
  43. [Required, JsonPropertyName("reply_code"), JsonPropertyOrder(102)]
  44. public ReplyCode ReplyCode { get; set; }
  45. /// <summary>
  46. /// 取得棧板供應狀態回應
  47. /// </summary>
  48. /// <param name="transName">交易名稱</param>
  49. /// <param name="softwareID">軟體編號</param>
  50. /// <param name="stationID">站點編號</param>
  51. /// <param name="replyCode">回應代碼</param>
  52. /// <returns>棧板供應狀態回應</returns>
  53. public static TP018PalletSupplyStatusAckDto Get(TransactionName transName, string softwareID, string stationID, ReplyCode replyCode)
  54. {
  55. return new TP018PalletSupplyStatusAckDto()
  56. {
  57. Timetick = DateTime.Now,
  58. TransactionName = transName.ToTransactionName(),
  59. SoftwareID = softwareID,
  60. StationID = stationID,
  61. ReplyCode = replyCode
  62. };
  63. }
  64. }
  65. }