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.

94 lines
3.6 KiB

8 months ago
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel.DataAnnotations;
  4. using System.Text.Json.Serialization;
  5. namespace Mirle.Component.API.ProgrammableLogicController.Models
  6. {
  7. /// <summary>
  8. /// 確認載具編號及物料編號請求類別
  9. /// </summary>
  10. public class FP015CheckCarrierIDRequest : CommonMessage
  11. {
  12. /// <summary>
  13. /// 站點編號
  14. /// </summary>
  15. [Required, StringLength(9), JsonPropertyName("station_id"), JsonPropertyOrder(101)]
  16. public string StationID { get; set; }
  17. /// <summary>
  18. /// 載具編號
  19. /// </summary>
  20. /// <remarks>棧板編號/物流箱號</remarks>
  21. [JsonPropertyName("carrier_id"), JsonPropertyOrder(102)]
  22. public string CarrierID { get; set; }
  23. /// <summary>
  24. /// 物料編號清單
  25. /// </summary>
  26. [JsonPropertyName("material_id"), JsonPropertyOrder(103)]
  27. public List<string> MaterialID { get; set; }
  28. /// <summary>
  29. /// 物料重量
  30. /// </summary>
  31. /// <remarks>單位: kgs</remarks>
  32. [JsonPropertyName("material_weigth"), JsonPropertyOrder(104)]
  33. public int MaterialWeight { get; set; }
  34. }
  35. /// <summary>
  36. /// 檢查載具編號及物料編號回應類別
  37. /// </summary>
  38. public class TP016CheckCarrierIDResponseDto : CommonMessage
  39. {
  40. /// <summary>
  41. /// 站點編號
  42. /// </summary>
  43. [Required, StringLength(9), JsonPropertyName("station_id"), JsonPropertyOrder(101)]
  44. public string StationID { get; set; }
  45. /// <summary>
  46. /// 載具編號
  47. /// </summary>
  48. /// <remarks>棧板編號/物流箱編號</remarks>
  49. [JsonPropertyName("carrier_id"), JsonPropertyOrder(102)]
  50. public string CarrierID { get; set; }
  51. /// <summary>
  52. /// 物料編號
  53. /// </summary>
  54. [JsonPropertyName("material_id"), JsonPropertyOrder(103)]
  55. public List<string> MaterialID { get; set; }
  56. /// <summary>
  57. /// 結果代碼
  58. /// </summary>
  59. /// <value>
  60. /// 0 = Success <br/>
  61. /// 1 = CarrierID Error <br/>
  62. /// 2 = MaterialID Error <br/>
  63. /// </value>
  64. [Required, JsonPropertyName("result_code"), JsonPropertyOrder(104)]
  65. public CarrierIDInsepectResultCode ResultCode { get; set; }
  66. /// <summary>
  67. /// 取得檢查載具編號及物料編號回應
  68. /// </summary>
  69. /// <param name="transName">交易名稱</param>
  70. /// <param name="softwareID">軟體編號</param>
  71. /// <param name="TaskID">任務編號</param>
  72. /// <param name="stationID">站點編號</param>
  73. /// <param name="carrierID">載具編號</param>
  74. /// <param name="resultcode">檢查結果代碼</param>
  75. /// <param name="materialID">物料編號清單</param>
  76. /// <returns>檢查載具編號及物料編號回應</returns>
  77. public static TP016CheckCarrierIDResponseDto Get(TransactionName transName, string softwareID, string TaskID,
  78. string stationID, string carrierID, CarrierIDInsepectResultCode resultcode, List<string> materialID = null)
  79. {
  80. return new TP016CheckCarrierIDResponseDto()
  81. {
  82. Timetick = DateTime.Now,
  83. TransactionName = transName.ToTransactionName(),
  84. SoftwareID = softwareID,
  85. TaskID = TaskID,
  86. StationID = stationID,
  87. CarrierID = carrierID,
  88. MaterialID = materialID,
  89. ResultCode = resultcode
  90. };
  91. }
  92. }
  93. }