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.

178 lines
4.7KB

  1. class CropPlot {
  2. TbCropDTO tbCropDTO;
  3. List<Activities> activities;
  4. String sowingDate;
  5. int soakSeedsTime;
  6. int seedIncubationTime;
  7. int numberPlants;
  8. int numberCurrentPlants;
  9. String endOfFarmingDate;
  10. CropPlot(
  11. {this.tbCropDTO,
  12. this.activities,
  13. this.sowingDate,
  14. this.soakSeedsTime,
  15. this.seedIncubationTime,
  16. this.numberPlants,
  17. this.numberCurrentPlants,
  18. this.endOfFarmingDate});
  19. CropPlot.fromJson(Map<String, dynamic> json) {
  20. tbCropDTO = json['tbCropDTO'] != null
  21. ? new TbCropDTO.fromJson(json['tbCropDTO'])
  22. : null;
  23. if (json['activities'] != null) {
  24. activities = new List<Activities>();
  25. json['activities'].forEach((v) {
  26. activities.add(new Activities.fromJson(v));
  27. });
  28. }
  29. sowingDate = json['sowingDate'];
  30. soakSeedsTime = json['soakSeedsTime'];
  31. seedIncubationTime = json['seedIncubationTime'];
  32. numberPlants = json['numberPlants'];
  33. numberCurrentPlants = json['numberCurrentPlants'];
  34. endOfFarmingDate = json['endOfFarmingDate'];
  35. }
  36. Map<String, dynamic> toJson() {
  37. final Map<String, dynamic> data = new Map<String, dynamic>();
  38. if (this.tbCropDTO != null) {
  39. data['tbCropDTO'] = this.tbCropDTO.toJson();
  40. }
  41. if (this.activities != null) {
  42. data['activities'] = this.activities.map((v) => v.toJson()).toList();
  43. }
  44. data['sowingDate'] = this.sowingDate;
  45. data['soakSeedsTime'] = this.soakSeedsTime;
  46. data['seedIncubationTime'] = this.seedIncubationTime;
  47. data['numberPlants'] = this.numberPlants;
  48. data['numberCurrentPlants'] = this.numberCurrentPlants;
  49. data['endOfFarmingDate'] = this.endOfFarmingDate;
  50. return data;
  51. }
  52. }
  53. class TbCropDTO {
  54. int id;
  55. String qrCode;
  56. String code;
  57. num areaM2;
  58. int type;
  59. String startDate;
  60. String endDate;
  61. String status;
  62. String description;
  63. int ageDayStartAt;
  64. int tbSuppliesId;
  65. String suppliesName;
  66. int tbGuidelineId;
  67. int netHouseId;
  68. String netHouseName;
  69. int areaId;
  70. String area;
  71. TbCropDTO(
  72. {this.id,
  73. this.qrCode,
  74. this.code,
  75. this.areaM2,
  76. this.type,
  77. this.startDate,
  78. this.endDate,
  79. this.status,
  80. this.description,
  81. this.ageDayStartAt,
  82. this.tbSuppliesId,
  83. this.suppliesName,
  84. this.tbGuidelineId,
  85. this.netHouseId,
  86. this.netHouseName,
  87. this.areaId,
  88. this.area});
  89. TbCropDTO.fromJson(Map<String, dynamic> json) {
  90. id = json['id'];
  91. qrCode = json['qrCode'];
  92. code = json['code'];
  93. areaM2 = json['areaM2'];
  94. type = json['type'];
  95. startDate = json['startDate'];
  96. endDate = json['endDate'];
  97. status = json['status'];
  98. description = json['description'];
  99. ageDayStartAt = json['ageDayStartAt'];
  100. tbSuppliesId = json['tbSuppliesId'];
  101. suppliesName = json['suppliesName'];
  102. tbGuidelineId = json['tbGuidelineId'];
  103. netHouseId = json['netHouseId'];
  104. netHouseName = json['netHouseName'];
  105. areaId = json['areaId'];
  106. area = json['area'];
  107. }
  108. Map<String, dynamic> toJson() {
  109. final Map<String, dynamic> data = new Map<String, dynamic>();
  110. data['id'] = this.id;
  111. data['qrCode'] = this.qrCode;
  112. data['code'] = this.code;
  113. data['areaM2'] = this.areaM2;
  114. data['type'] = this.type;
  115. data['startDate'] = this.startDate;
  116. data['endDate'] = this.endDate;
  117. data['status'] = this.status;
  118. data['description'] = this.description;
  119. data['ageDayStartAt'] = this.ageDayStartAt;
  120. data['tbSuppliesId'] = this.tbSuppliesId;
  121. data['suppliesName'] = this.suppliesName;
  122. data['tbGuidelineId'] = this.tbGuidelineId;
  123. data['netHouseId'] = this.netHouseId;
  124. data['netHouseName'] = this.netHouseName;
  125. data['areaId'] = this.areaId;
  126. data['area'] = this.area;
  127. return data;
  128. }
  129. }
  130. class Activities {
  131. int id;
  132. int ageDay;
  133. int cropId;
  134. String executeDate;
  135. String description;
  136. int activityTypeId;
  137. String activityTypeName;
  138. Activities(
  139. {this.id,
  140. this.ageDay,
  141. this.cropId,
  142. this.executeDate,
  143. this.description,
  144. this.activityTypeId,
  145. this.activityTypeName});
  146. Activities.fromJson(Map<String, dynamic> json) {
  147. id = json['id'];
  148. ageDay = json['ageDay'];
  149. cropId = json['cropId'];
  150. executeDate = json['executeDate'];
  151. description = json['description'];
  152. activityTypeId = json['activityTypeId'];
  153. activityTypeName = json['activityTypeName'];
  154. }
  155. Map<String, dynamic> toJson() {
  156. final Map<String, dynamic> data = new Map<String, dynamic>();
  157. data['id'] = this.id;
  158. data['ageDay'] = this.ageDay;
  159. data['cropId'] = this.cropId;
  160. data['executeDate'] = this.executeDate;
  161. data['description'] = this.description;
  162. data['activityTypeId'] = this.activityTypeId;
  163. data['activityTypeName'] = this.activityTypeName;
  164. return data;
  165. }
  166. }