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.5 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 FW015MaterialWeightRequestDto : 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(9), JsonPropertyName("station_id"), JsonPropertyOrder(102)]
  20. public string StationID { get; set; }
  21. /// <summary>
  22. /// 取得量測物料重量請求
  23. /// </summary>
  24. /// <param name="transName">交易名稱</param>
  25. /// <param name="softwareID">軟體編號</param>
  26. /// <param name="stationID">站點編號</param>
  27. /// <returns>量測物料重量請求</returns>
  28. public static FW015MaterialWeightRequestDto Get(TransactionName transName, string softwareID, string stationID)
  29. {
  30. return new FW015MaterialWeightRequestDto()
  31. {
  32. Timetick = DateTime.Now,
  33. TransactionName = transName.ToTransactionName(),
  34. SoftwareID = softwareID,
  35. StationID = stationID
  36. };
  37. }
  38. }
  39. /// <summary>
  40. /// 量測物料重量回應類別
  41. /// </summary>
  42. public class TW016MaterialWeightResponseDto : CommonMessage
  43. {
  44. /// <summary>
  45. /// 軟體編號
  46. /// </summary>
  47. [Required, StringLength(7), JsonPropertyName("software_id"), JsonPropertyOrder(101)]
  48. public string SoftwareID { get; set; }
  49. /// <summary>
  50. /// 站點編號
  51. /// </summary>
  52. [Required, StringLength(9), JsonPropertyName("station_id"), JsonPropertyOrder(102)]
  53. public string StationID { get; set; }
  54. /// <summary>
  55. /// 物料重量
  56. /// </summary>
  57. [Required, JsonPropertyName("material_weight"), JsonPropertyOrder(103)]
  58. public int MaterialWeight { get; set; }
  59. /// <summary>
  60. /// 結果代碼
  61. /// </summary>
  62. /// <value>
  63. /// 0 = Success <br/>
  64. /// 1 = Too Light <br/>
  65. /// 2 = Too Heavy <br/>
  66. /// 3 = No Weight <br/>
  67. /// </value>
  68. [Required, JsonPropertyName("result_code"), JsonPropertyOrder(104)]
  69. public MaterialInspectResultCode ResultCode { get; set; }
  70. /// <summary>
  71. /// 取得量測物料重量回報
  72. /// </summary>
  73. /// <param name="transName">交易名稱</param>
  74. /// <param name="softwareID">軟體編號</param>
  75. /// <param name="stationID">站點編號</param>
  76. /// <param name="materialWeight">物料重量</param>
  77. /// <param name="resultCode">物料重量檢測結果代碼</param>
  78. /// <returns>量測物料重量回報</returns>
  79. public static TW016MaterialWeightResponseDto Get(TransactionName transName, string softwareID,
  80. string stationID, int materialWeight, MaterialInspectResultCode resultCode)
  81. {
  82. return new TW016MaterialWeightResponseDto()
  83. {
  84. Timetick = DateTime.Now,
  85. TransactionName = transName.ToTransactionName(),
  86. SoftwareID = softwareID,
  87. StationID = stationID,
  88. MaterialWeight = materialWeight,
  89. ResultCode = resultCode
  90. };
  91. }
  92. }
  93. }