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.

224 lines
6.1KB

  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. List<TbDetailUsers> tbDetailUsers;
  72. TbCropDTO(
  73. {this.id,
  74. this.qrCode,
  75. this.code,
  76. this.areaM2,
  77. this.type,
  78. this.startDate,
  79. this.endDate,
  80. this.status,
  81. this.description,
  82. this.ageDayStartAt,
  83. this.tbSuppliesId,
  84. this.suppliesName,
  85. this.tbGuidelineId,
  86. this.netHouseId,
  87. this.netHouseName,
  88. this.areaId,
  89. this.area,
  90. this.tbDetailUsers});
  91. TbCropDTO.fromJson(Map<String, dynamic> json) {
  92. id = json['id'];
  93. qrCode = json['qrCode'];
  94. code = json['code'];
  95. areaM2 = json['areaM2'];
  96. type = json['type'];
  97. startDate = json['startDate'];
  98. endDate = json['endDate'];
  99. status = json['status'];
  100. description = json['description'];
  101. ageDayStartAt = json['ageDayStartAt'];
  102. tbSuppliesId = json['tbSuppliesId'];
  103. suppliesName = json['suppliesName'];
  104. tbGuidelineId = json['tbGuidelineId'];
  105. netHouseId = json['netHouseId'];
  106. netHouseName = json['netHouseName'];
  107. areaId = json['areaId'];
  108. area = json['area'];
  109. if (json['tbDetailUsers'] != null) {
  110. tbDetailUsers = new List<TbDetailUsers>();
  111. json['tbDetailUsers'].forEach((v) {
  112. tbDetailUsers.add(new TbDetailUsers.fromJson(v));
  113. });
  114. }
  115. }
  116. Map<String, dynamic> toJson() {
  117. final Map<String, dynamic> data = new Map<String, dynamic>();
  118. data['id'] = this.id;
  119. data['qrCode'] = this.qrCode;
  120. data['code'] = this.code;
  121. data['areaM2'] = this.areaM2;
  122. data['type'] = this.type;
  123. data['startDate'] = this.startDate;
  124. data['endDate'] = this.endDate;
  125. data['status'] = this.status;
  126. data['description'] = this.description;
  127. data['ageDayStartAt'] = this.ageDayStartAt;
  128. data['tbSuppliesId'] = this.tbSuppliesId;
  129. data['suppliesName'] = this.suppliesName;
  130. data['tbGuidelineId'] = this.tbGuidelineId;
  131. data['netHouseId'] = this.netHouseId;
  132. data['netHouseName'] = this.netHouseName;
  133. data['areaId'] = this.areaId;
  134. data['area'] = this.area;
  135. if (this.tbDetailUsers != null) {
  136. data['tbDetailUsers'] =
  137. this.tbDetailUsers.map((v) => v.toJson()).toList();
  138. }
  139. return data;
  140. }
  141. }
  142. class TbDetailUsers {
  143. int id;
  144. String fullName;
  145. String phone;
  146. TbDetailUsers({this.id, this.fullName, this.phone});
  147. TbDetailUsers.fromJson(Map<String, dynamic> json) {
  148. id = json['id'];
  149. fullName = json['fullName'];
  150. phone = json['phone'];
  151. }
  152. Map<String, dynamic> toJson() {
  153. final Map<String, dynamic> data = new Map<String, dynamic>();
  154. data['id'] = this.id;
  155. data['fullName'] = this.fullName;
  156. data['phone'] = this.phone;
  157. return data;
  158. }
  159. }
  160. class Activities {
  161. int id;
  162. int ageDay;
  163. int cropId;
  164. String executeDate;
  165. String description;
  166. int activityTypeId;
  167. String activityTypeName;
  168. String activityTypeDescription;
  169. Activities(
  170. {this.id,
  171. this.ageDay,
  172. this.cropId,
  173. this.executeDate,
  174. this.description,
  175. this.activityTypeId,
  176. this.activityTypeName,
  177. this.activityTypeDescription});
  178. Activities.clone(Activities activities) {
  179. this.id = activities.id;
  180. this.cropId = activities.cropId;
  181. this.activityTypeName = activities.activityTypeName;
  182. this.activityTypeDescription = activities.activityTypeDescription;
  183. this.executeDate = activities.executeDate;
  184. }
  185. Activities.fromJson(Map<String, dynamic> json) {
  186. id = json['id'];
  187. ageDay = json['ageDay'];
  188. cropId = json['cropId'];
  189. executeDate = json['executeDate'];
  190. description = json['description'];
  191. activityTypeId = json['activityTypeId'];
  192. activityTypeName = json['activityTypeName'];
  193. activityTypeDescription = json['activityTypeDescription'];
  194. }
  195. Map<String, dynamic> toJson() {
  196. final Map<String, dynamic> data = new Map<String, dynamic>();
  197. data['id'] = this.id;
  198. data['ageDay'] = this.ageDay;
  199. data['cropId'] = this.cropId;
  200. data['executeDate'] = this.executeDate;
  201. data['description'] = this.description;
  202. data['activityTypeId'] = this.activityTypeId;
  203. data['activityTypeName'] = this.activityTypeName;
  204. data['activityTypeDescription'] = this.activityTypeDescription;
  205. return data;
  206. }
  207. }