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.

63 lines
1.7KB

  1. import 'SuppliesUsing.dart';
  2. class HarvestProcess {
  3. int id;
  4. int activityId;
  5. int harvestId;
  6. String executeDate;
  7. String description;
  8. int quantityLv1;
  9. int quantityLv2;
  10. int quantityLv3;
  11. int removedQuantity;
  12. List<SuppliesUsing> suppliesUsing;
  13. HarvestProcess(
  14. {this.id,
  15. this.activityId,
  16. this.harvestId,
  17. this.executeDate,
  18. this.description,
  19. this.quantityLv1,
  20. this.quantityLv2,
  21. this.quantityLv3,
  22. this.removedQuantity,
  23. this.suppliesUsing});
  24. HarvestProcess.fromJson(Map<String, dynamic> json) {
  25. id = json['id'];
  26. activityId = json['activityId'];
  27. harvestId = json['harvestId'];
  28. executeDate = json['executeDate'];
  29. description = json['description'];
  30. quantityLv1 = json['quantityLv1'];
  31. quantityLv2 = json['quantityLv2'];
  32. quantityLv3 = json['quantityLv3'];
  33. removedQuantity = json['removedQuantity'];
  34. if (json['suppliesUsing'] != null) {
  35. suppliesUsing = new List<SuppliesUsing>();
  36. json['suppliesUsing'].forEach((v) {
  37. suppliesUsing.add(new SuppliesUsing.fromJson(v));
  38. });
  39. }
  40. }
  41. Map<String, dynamic> toJson() {
  42. final Map<String, dynamic> data = new Map<String, dynamic>();
  43. data['id'] = this.id;
  44. data['activityId'] = this.activityId;
  45. data['harvestId'] = this.harvestId;
  46. data['executeDate'] = this.executeDate;
  47. data['description'] = this.description;
  48. data['quantityLv1'] = this.quantityLv1;
  49. data['quantityLv2'] = this.quantityLv2;
  50. data['quantityLv3'] = this.quantityLv3;
  51. data['removedQuantity'] = this.removedQuantity;
  52. if (this.suppliesUsing != null) {
  53. data['suppliesUsing'] =
  54. this.suppliesUsing.map((v) => v.toJson()).toList();
  55. }
  56. return data;
  57. }
  58. }