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.

72 lines
2.6 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 FW007CancelCommandRequestDto : CommonMessage
  10. {
  11. /// <summary>
  12. /// 搬運命令序號
  13. /// </summary>
  14. /// <remarks>W[YYYYMMDDHH][Sequence * 5]</remarks>
  15. [Required, StringLength(16), JsonPropertyName("cmd_sno"), JsonPropertyOrder(101)]
  16. public string CommandSequnceNumber { get; set; }
  17. /// <summary>
  18. /// 取消模式
  19. /// </summary>
  20. /// <value>
  21. /// 0 = Cancel <br/>
  22. /// 1 = Force Cancel <br/>
  23. /// 2 = Force Complete <br/>
  24. /// </value>
  25. [Required, JsonPropertyName("cancel_mode"), JsonPropertyOrder(102)]
  26. public CancelMode CancelMode { get; set; }
  27. }
  28. /// <summary>
  29. /// 取消命令回應類別
  30. /// </summary>
  31. public class TW008CancelCommandResponseDto : CommonMessage
  32. {
  33. /// <summary>
  34. /// 搬運命令序號
  35. /// </summary>
  36. /// <remarks>W[YYYYMMDDHH][Sequence * 5]</remarks>
  37. [Required, StringLength(16), JsonPropertyName("cmd_sno"), JsonPropertyOrder(101)]
  38. public string CommandSequnceNumber { get; set; }
  39. /// <summary>
  40. /// 結果代碼
  41. /// </summary>
  42. /// <value>
  43. /// 0 = Success <br/>
  44. /// 1 = Already Execute <br/>
  45. /// 2 = Cancel Command Error <br/>
  46. /// 3 = PLCC Unable Cancel <br/>
  47. /// 4 = AGVC Unable Cancel <br/>
  48. /// 5 = SHTC Unable Cancel <br/>
  49. /// 6 = Command SequenceNumber Is Not Exist <br/>
  50. /// </value>
  51. [Required, JsonPropertyName("result_code"), JsonPropertyOrder(102)]
  52. public CancelCommandResultCode ResultCode { get; set; }
  53. /// <summary>
  54. /// 取得取消命令回應
  55. /// </summary>
  56. /// <param name="transName">交易名稱</param>
  57. /// <param name="commandSequnceNumber">搬運命令序號</param>
  58. /// <param name="resultCode">取消命令結果代碼</param>
  59. /// <returns>取消命令回應</returns>
  60. public static TW008CancelCommandResponseDto Get(TransactionName transName, string commandSequnceNumber, CancelCommandResultCode resultCode)
  61. {
  62. return new TW008CancelCommandResponseDto()
  63. {
  64. Timetick = DateTime.Now,
  65. TransactionName = transName.ToTransactionName(),
  66. CommandSequnceNumber = commandSequnceNumber,
  67. ResultCode = resultCode
  68. };
  69. }
  70. }
  71. }