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.

71 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.ProgrammableLogicController.Models
  5. {
  6. /// <summary>
  7. /// 允許取放貨回報類別
  8. /// </summary>
  9. public class FP013PermitLoadUnloadReportDto : CommonMessage
  10. {
  11. /// <summary>
  12. /// 當下任務編號
  13. /// </summary>
  14. /// <remarks>A[YYYYMMDDHH][Sequnce * 5]/S[YYYYMMSSHH][Sequnce * 5]</remarks>
  15. [Required, StringLength(16), JsonPropertyName("current_task_id"), JsonPropertyOrder(101)]
  16. public string CurrentTaskID { get; set; }
  17. /// <summary>
  18. /// 結果代碼
  19. /// </summary>
  20. /// <value>
  21. /// 0 = Permit <br/>
  22. /// 1 = Not Permit <br/>
  23. /// </value>
  24. [Required, JsonPropertyName("result_code"), JsonPropertyOrder(102)]
  25. public PermitLoadUnloadResultCode ResultCode { get; set; }
  26. }
  27. /// <summary>
  28. /// 允許取放貨回應類別
  29. /// </summary>
  30. public class TP014PermitLoadUnloadAckDto : CommonMessage
  31. {
  32. /// <summary>
  33. /// 當下任務編號
  34. /// </summary>
  35. /// <remarks>A[YYYYMMDDHH][Sequnce * 5]/S[YYYYMMSSHH][Sequnce * 5]</remarks>
  36. [Required, StringLength(16), JsonPropertyName("current_task_id"), JsonPropertyOrder(101)]
  37. public string CurrentTaskID { get; set; }
  38. /// <summary>
  39. /// 回應代碼
  40. /// </summary>
  41. /// <value>
  42. /// 0 = OK <br/>
  43. /// 1 = NG <br/>
  44. /// </value>
  45. [Required, JsonPropertyName("reply_code"), JsonPropertyOrder(102)]
  46. public ReplyCode ReplyCode { get; set; }
  47. /// <summary>
  48. /// 取得允許取放貨回應
  49. /// </summary>
  50. /// <param name="transName">交易名稱</param>
  51. /// <param name="softwareID">軟體編號</param>
  52. /// <param name="taskID">任務編號</param>
  53. /// <param name="currentTaskID">當下任務編號</param>
  54. /// <param name="replyCode">回應代碼</param>
  55. /// <returns>允許取放貨回應</returns>
  56. public static TP014PermitLoadUnloadAckDto Get(TransactionName transName, string softwareID, string taskID,
  57. string currentTaskID, ReplyCode replyCode)
  58. {
  59. return new TP014PermitLoadUnloadAckDto()
  60. {
  61. Timetick = DateTime.Now,
  62. TransactionName = transName.ToTransactionName(),
  63. SoftwareID = softwareID,
  64. TaskID = taskID,
  65. CurrentTaskID = currentTaskID,
  66. ReplyCode = replyCode
  67. };
  68. }
  69. }
  70. }