|
|
|
@@ -0,0 +1,177 @@ |
|
|
|
class CropPlot { |
|
|
|
TbCropDTO tbCropDTO; |
|
|
|
List<Activities> activities; |
|
|
|
String sowingDate; |
|
|
|
int soakSeedsTime; |
|
|
|
int seedIncubationTime; |
|
|
|
int numberPlants; |
|
|
|
int numberCurrentPlants; |
|
|
|
String endOfFarmingDate; |
|
|
|
|
|
|
|
CropPlot( |
|
|
|
{this.tbCropDTO, |
|
|
|
this.activities, |
|
|
|
this.sowingDate, |
|
|
|
this.soakSeedsTime, |
|
|
|
this.seedIncubationTime, |
|
|
|
this.numberPlants, |
|
|
|
this.numberCurrentPlants, |
|
|
|
this.endOfFarmingDate}); |
|
|
|
|
|
|
|
CropPlot.fromJson(Map<String, dynamic> json) { |
|
|
|
tbCropDTO = json['tbCropDTO'] != null |
|
|
|
? new TbCropDTO.fromJson(json['tbCropDTO']) |
|
|
|
: null; |
|
|
|
if (json['activities'] != null) { |
|
|
|
activities = new List<Activities>(); |
|
|
|
json['activities'].forEach((v) { |
|
|
|
activities.add(new Activities.fromJson(v)); |
|
|
|
}); |
|
|
|
} |
|
|
|
sowingDate = json['sowingDate']; |
|
|
|
soakSeedsTime = json['soakSeedsTime']; |
|
|
|
seedIncubationTime = json['seedIncubationTime']; |
|
|
|
numberPlants = json['numberPlants']; |
|
|
|
numberCurrentPlants = json['numberCurrentPlants']; |
|
|
|
endOfFarmingDate = json['endOfFarmingDate']; |
|
|
|
} |
|
|
|
|
|
|
|
Map<String, dynamic> toJson() { |
|
|
|
final Map<String, dynamic> data = new Map<String, dynamic>(); |
|
|
|
if (this.tbCropDTO != null) { |
|
|
|
data['tbCropDTO'] = this.tbCropDTO.toJson(); |
|
|
|
} |
|
|
|
if (this.activities != null) { |
|
|
|
data['activities'] = this.activities.map((v) => v.toJson()).toList(); |
|
|
|
} |
|
|
|
data['sowingDate'] = this.sowingDate; |
|
|
|
data['soakSeedsTime'] = this.soakSeedsTime; |
|
|
|
data['seedIncubationTime'] = this.seedIncubationTime; |
|
|
|
data['numberPlants'] = this.numberPlants; |
|
|
|
data['numberCurrentPlants'] = this.numberCurrentPlants; |
|
|
|
data['endOfFarmingDate'] = this.endOfFarmingDate; |
|
|
|
return data; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
class TbCropDTO { |
|
|
|
int id; |
|
|
|
String qrCode; |
|
|
|
String code; |
|
|
|
num areaM2; |
|
|
|
int type; |
|
|
|
String startDate; |
|
|
|
String endDate; |
|
|
|
String status; |
|
|
|
String description; |
|
|
|
int ageDayStartAt; |
|
|
|
int tbSuppliesId; |
|
|
|
String suppliesName; |
|
|
|
int tbGuidelineId; |
|
|
|
int netHouseId; |
|
|
|
String netHouseName; |
|
|
|
int areaId; |
|
|
|
String area; |
|
|
|
|
|
|
|
TbCropDTO( |
|
|
|
{this.id, |
|
|
|
this.qrCode, |
|
|
|
this.code, |
|
|
|
this.areaM2, |
|
|
|
this.type, |
|
|
|
this.startDate, |
|
|
|
this.endDate, |
|
|
|
this.status, |
|
|
|
this.description, |
|
|
|
this.ageDayStartAt, |
|
|
|
this.tbSuppliesId, |
|
|
|
this.suppliesName, |
|
|
|
this.tbGuidelineId, |
|
|
|
this.netHouseId, |
|
|
|
this.netHouseName, |
|
|
|
this.areaId, |
|
|
|
this.area}); |
|
|
|
|
|
|
|
TbCropDTO.fromJson(Map<String, dynamic> json) { |
|
|
|
id = json['id']; |
|
|
|
qrCode = json['qrCode']; |
|
|
|
code = json['code']; |
|
|
|
areaM2 = json['areaM2']; |
|
|
|
type = json['type']; |
|
|
|
startDate = json['startDate']; |
|
|
|
endDate = json['endDate']; |
|
|
|
status = json['status']; |
|
|
|
description = json['description']; |
|
|
|
ageDayStartAt = json['ageDayStartAt']; |
|
|
|
tbSuppliesId = json['tbSuppliesId']; |
|
|
|
suppliesName = json['suppliesName']; |
|
|
|
tbGuidelineId = json['tbGuidelineId']; |
|
|
|
netHouseId = json['netHouseId']; |
|
|
|
netHouseName = json['netHouseName']; |
|
|
|
areaId = json['areaId']; |
|
|
|
area = json['area']; |
|
|
|
} |
|
|
|
|
|
|
|
Map<String, dynamic> toJson() { |
|
|
|
final Map<String, dynamic> data = new Map<String, dynamic>(); |
|
|
|
data['id'] = this.id; |
|
|
|
data['qrCode'] = this.qrCode; |
|
|
|
data['code'] = this.code; |
|
|
|
data['areaM2'] = this.areaM2; |
|
|
|
data['type'] = this.type; |
|
|
|
data['startDate'] = this.startDate; |
|
|
|
data['endDate'] = this.endDate; |
|
|
|
data['status'] = this.status; |
|
|
|
data['description'] = this.description; |
|
|
|
data['ageDayStartAt'] = this.ageDayStartAt; |
|
|
|
data['tbSuppliesId'] = this.tbSuppliesId; |
|
|
|
data['suppliesName'] = this.suppliesName; |
|
|
|
data['tbGuidelineId'] = this.tbGuidelineId; |
|
|
|
data['netHouseId'] = this.netHouseId; |
|
|
|
data['netHouseName'] = this.netHouseName; |
|
|
|
data['areaId'] = this.areaId; |
|
|
|
data['area'] = this.area; |
|
|
|
return data; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
class Activities { |
|
|
|
int id; |
|
|
|
int ageDay; |
|
|
|
int cropId; |
|
|
|
String executeDate; |
|
|
|
String description; |
|
|
|
int activityTypeId; |
|
|
|
String activityTypeName; |
|
|
|
|
|
|
|
Activities( |
|
|
|
{this.id, |
|
|
|
this.ageDay, |
|
|
|
this.cropId, |
|
|
|
this.executeDate, |
|
|
|
this.description, |
|
|
|
this.activityTypeId, |
|
|
|
this.activityTypeName}); |
|
|
|
|
|
|
|
Activities.fromJson(Map<String, dynamic> json) { |
|
|
|
id = json['id']; |
|
|
|
ageDay = json['ageDay']; |
|
|
|
cropId = json['cropId']; |
|
|
|
executeDate = json['executeDate']; |
|
|
|
description = json['description']; |
|
|
|
activityTypeId = json['activityTypeId']; |
|
|
|
activityTypeName = json['activityTypeName']; |
|
|
|
} |
|
|
|
|
|
|
|
Map<String, dynamic> toJson() { |
|
|
|
final Map<String, dynamic> data = new Map<String, dynamic>(); |
|
|
|
data['id'] = this.id; |
|
|
|
data['ageDay'] = this.ageDay; |
|
|
|
data['cropId'] = this.cropId; |
|
|
|
data['executeDate'] = this.executeDate; |
|
|
|
data['description'] = this.description; |
|
|
|
data['activityTypeId'] = this.activityTypeId; |
|
|
|
data['activityTypeName'] = this.activityTypeName; |
|
|
|
return data; |
|
|
|
} |
|
|
|
} |