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
3.9 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.WarehouseExecutionSystem.Models
  6. {
  7. /// <summary>
  8. /// 建立命令請求類別
  9. /// </summary>
  10. public class FW001CreateCommandRequestDto : CommonMessage
  11. {
  12. /// <summary>
  13. /// 搬運命令序號
  14. /// </summary>
  15. /// <remarks>W[YYYYMMDDHH][Sequnece * 5]</remarks>
  16. [Required, StringLength(16), JsonPropertyName("cmd_sno"), JsonPropertyOrder(101)]
  17. public string CommandSequnceNumber { get; set; }
  18. /// <summary>
  19. /// 命令類別
  20. /// </summary>
  21. /// <value>
  22. /// 0 = Store In <br/>
  23. /// 1 = Store Out <br/>
  24. /// 2 = Task Inventory <br/>
  25. /// 3 = Station To Staion <br/>
  26. /// 4 = Storage To Storage <br/>
  27. /// 5 = Take Inventory Operation <br/>
  28. /// 6 = Task Inventory Adjust <br/>
  29. /// 7 = Maintenance Loc <br/>
  30. /// </value>
  31. [Required, JsonPropertyName("cmd_mode"), JsonPropertyOrder(102)]
  32. public CommandMode CommandMode { get; set; }
  33. /// <summary>
  34. /// 搬運命令優先權重
  35. /// </summary>
  36. /// <value>0 - 9</value>
  37. /// <remarks>0 最優先</remarks>
  38. [Required, JsonPropertyName("cmd_priority"), JsonPropertyOrder(103)]
  39. public int CommandPriority { get; set; }
  40. /// <summary>
  41. /// 起始位置
  42. /// </summary>
  43. [Required, StringLength(9), JsonPropertyName("from"), JsonPropertyOrder(104)]
  44. public string From { get; set; }
  45. /// <summary>
  46. /// 目的位置
  47. /// </summary>
  48. [Required, StringLength(9), JsonPropertyName("to"), JsonPropertyOrder(105)]
  49. public string To { get; set; }
  50. /// <summary>
  51. /// 路線清單
  52. /// </summary>
  53. [Required, JsonPropertyName("route"), JsonPropertyOrder(106)]
  54. public List<string> Route { get; set; }
  55. /// <summary>
  56. /// 設備路線清單
  57. /// </summary>
  58. [Required, JsonPropertyName("eqpt_route"), JsonPropertyOrder(107)]
  59. public List<string> EquipmemntRoute { get; set; }
  60. /// <summary>
  61. /// 載具編號
  62. /// </summary>
  63. [JsonPropertyName("carrier_id"), JsonPropertyOrder(108)]
  64. public string CarrierID { get; set; }
  65. }
  66. /// <summary>
  67. /// 建立命令回應類別
  68. /// </summary>
  69. public class TW002CreateCommandResponseDto : CommonMessage
  70. {
  71. /// <summary>
  72. /// 搬運命令序號
  73. /// </summary>
  74. /// <remarks>W[YYYYMMDDHH][Sequence * 5]</remarks>
  75. [Required, StringLength(16), JsonPropertyName("cmd_sno"), JsonPropertyOrder(3)]
  76. public string CommandSequnceNumber { get; set; }
  77. /// <summary>
  78. /// 結果代碼
  79. /// </summary>
  80. /// <value>
  81. /// 0 = Success <br/>
  82. /// 1 = Reject <br/>
  83. /// 2 = Dismantel Command Error <br/>
  84. /// </value>
  85. [Required, JsonPropertyName("result_code"), JsonPropertyOrder(102)]
  86. public CreateCommandResultCode ResultCode { get; set; }
  87. /// <summary>
  88. /// 取得建立命令回應
  89. /// </summary>
  90. /// <param name="transName">交易名稱</param>
  91. /// <param name="commandSequenceNumber">搬運命令序號</param>
  92. /// <param name="resultCode">建立命令結果代碼</param>
  93. /// <returns>建立命令回應</returns>
  94. public static TW002CreateCommandResponseDto Get(TransactionName transName, string commandSequenceNumber, CreateCommandResultCode resultCode)
  95. {
  96. return new TW002CreateCommandResponseDto()
  97. {
  98. Timetick = DateTime.Now,
  99. TransactionName = transName.ToTransactionName(),
  100. CommandSequnceNumber = commandSequenceNumber,
  101. ResultCode = resultCode
  102. };
  103. }
  104. }
  105. }