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.

145 lines
4.4KB

  1. class RequestActivity {
  2. int tbActivityTypeId;
  3. int tbCropId;
  4. int totalCost;
  5. String executeDate;
  6. String externalTable;
  7. String description;
  8. List<TbObjectUpdateDTO> tbObjectUpdateDTOList;
  9. List<TbSuppliesUsingDetailsDTOs> tbSuppliesUsingDetailsDTOs;
  10. List<TbNurseryDetailsDTO> tbNurseryDetailsDTOList;
  11. RequestActivity(
  12. {this.tbActivityTypeId,
  13. this.tbCropId,
  14. this.totalCost,
  15. this.executeDate,
  16. this.externalTable,
  17. this.description,
  18. this.tbObjectUpdateDTOList,
  19. this.tbSuppliesUsingDetailsDTOs,
  20. this.tbNurseryDetailsDTOList});
  21. RequestActivity.fromJson(Map<String, dynamic> json) {
  22. tbActivityTypeId = json['tbActivityTypeId'];
  23. tbCropId = json['tbCropId'];
  24. totalCost = json['totalCost'];
  25. executeDate = json['executeDate'];
  26. externalTable = json['externalTable'];
  27. description = json['description'];
  28. if (json['tbObjectUpdateDTOList'] != null) {
  29. tbObjectUpdateDTOList = new List<TbObjectUpdateDTO>();
  30. json['tbObjectUpdateDTOList'].forEach((v) {
  31. tbObjectUpdateDTOList.add(new TbObjectUpdateDTO.fromJson(v));
  32. });
  33. }
  34. if (json['tbSuppliesUsingDetailsDTOs'] != null) {
  35. tbSuppliesUsingDetailsDTOs = new List<TbSuppliesUsingDetailsDTOs>();
  36. json['tbSuppliesUsingDetailsDTOs'].forEach((v) {
  37. tbSuppliesUsingDetailsDTOs
  38. .add(new TbSuppliesUsingDetailsDTOs.fromJson(v));
  39. });
  40. }
  41. if (json['tbNurseryDetailsDTOList'] != null) {
  42. tbNurseryDetailsDTOList = new List<TbNurseryDetailsDTO>();
  43. json['tbNurseryDetailsDTOList'].forEach((v) {
  44. tbNurseryDetailsDTOList.add(new TbNurseryDetailsDTO.fromJson(v));
  45. });
  46. }
  47. }
  48. Map<String, dynamic> toJson() {
  49. final Map<String, dynamic> data = new Map<String, dynamic>();
  50. data['tbActivityTypeId'] = this.tbActivityTypeId;
  51. data['tbCropId'] = this.tbCropId;
  52. data['totalCost'] = this.totalCost;
  53. data['executeDate'] = this.executeDate;
  54. data['externalTable'] = this.externalTable;
  55. data['description'] = this.description;
  56. if (this.tbObjectUpdateDTOList != null) {
  57. data['tbObjectUpdateDTOList'] =
  58. this.tbObjectUpdateDTOList.map((v) => v.toJson()).toList();
  59. }
  60. if (this.tbSuppliesUsingDetailsDTOs != null) {
  61. data['tbSuppliesUsingDetailsDTOs'] =
  62. this.tbSuppliesUsingDetailsDTOs.map((v) => v.toJson()).toList();
  63. }
  64. if (this.tbNurseryDetailsDTOList != null) {
  65. data['tbNurseryDetailsDTOList'] =
  66. this.tbNurseryDetailsDTOList.map((v) => v.toJson()).toList();
  67. }
  68. return data;
  69. }
  70. }
  71. class TbObjectUpdateDTO {
  72. int tbObjectParameterId;
  73. String index;
  74. TbObjectUpdateDTO({this.tbObjectParameterId, this.index});
  75. TbObjectUpdateDTO.fromJson(Map<String, dynamic> json) {
  76. tbObjectParameterId = json['tbObjectParameterId'];
  77. index = json['index'];
  78. }
  79. Map<String, dynamic> toJson() {
  80. final Map<String, dynamic> data = new Map<String, dynamic>();
  81. data['tbObjectParameterId'] = this.tbObjectParameterId;
  82. data['index'] = this.index;
  83. return data;
  84. }
  85. }
  86. class TbSuppliesUsingDetailsDTOs {
  87. int tbSuppliesInWarehouseId;
  88. String dosage;
  89. int quantity;
  90. int tbEquipmentOfCustomerId;
  91. String howToUse;
  92. TbSuppliesUsingDetailsDTOs(
  93. {this.tbSuppliesInWarehouseId,
  94. this.dosage,
  95. this.quantity,
  96. this.tbEquipmentOfCustomerId,
  97. this.howToUse});
  98. TbSuppliesUsingDetailsDTOs.fromJson(Map<String, dynamic> json) {
  99. tbSuppliesInWarehouseId = json['tbSuppliesInWarehouseId'];
  100. dosage = json['dosage'];
  101. quantity = json['quantity'];
  102. tbEquipmentOfCustomerId = json['tbEquipmentOfCustomerId'];
  103. howToUse = json['howToUse'];
  104. }
  105. Map<String, dynamic> toJson() {
  106. final Map<String, dynamic> data = new Map<String, dynamic>();
  107. data['tbSuppliesInWarehouseId'] = this.tbSuppliesInWarehouseId;
  108. data['dosage'] = this.dosage;
  109. data['quantity'] = this.quantity;
  110. data['tbEquipmentOfCustomerId'] = this.tbEquipmentOfCustomerId;
  111. data['howToUse'] = this.howToUse;
  112. return data;
  113. }
  114. }
  115. class TbNurseryDetailsDTO {
  116. String workerName;
  117. String trayNumber;
  118. TbNurseryDetailsDTO({this.workerName, this.trayNumber});
  119. TbNurseryDetailsDTO.fromJson(Map<String, dynamic> json) {
  120. workerName = json['workerName'];
  121. trayNumber = json['trayNumber'];
  122. }
  123. Map<String, dynamic> toJson() {
  124. final Map<String, dynamic> data = new Map<String, dynamic>();
  125. data['workerName'] = this.workerName;
  126. data['trayNumber'] = this.trayNumber;
  127. return data;
  128. }
  129. }