You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cloudsolutions-atoms/lib/models/service_request/search_work_order.dart

549 lines
18 KiB
Dart

import 'package:test_sa/models/lookup.dart';
class SearchWorkOrders {
int id;
String parentWOId;
String workOrderNo;
int workOrderYear;
int workOrderSequennce;
CallRequest callRequest;
String assetType;
AssignedEmployee assignedEmployee;
String visitDate;
List assistantEmployees;
String supplier;
String vendorTicketNumber;
List contactPersonWorkOrders;
Lookup calllastSituation;
Lookup currentSituation;
String repairLocation;
String reason;
String startofWorkTime;
String endofWorkTime;
double workingHours;
num travelingHours;
num travelingExpenses;
ModelDefRelatedDefects faultDescription;
List sparePartsWorkOrders;
String reviewComment;
String comment;
String attachmentsWorkOrder;
String equipmentStatus;
List suppEngineerWorkOrders;
String engSignature;
String nurseSignature;
String woParentDto;
SearchWorkOrders(
{this.id,
this.parentWOId,
this.workOrderNo,
this.workOrderYear,
this.workOrderSequennce,
this.callRequest,
this.assetType,
this.assignedEmployee,
this.visitDate,
this.assistantEmployees,
this.supplier,
this.vendorTicketNumber,
this.contactPersonWorkOrders,
this.calllastSituation,
this.currentSituation,
this.repairLocation,
this.reason,
this.startofWorkTime,
this.endofWorkTime,
this.workingHours,
this.travelingHours,
this.travelingExpenses,
this.faultDescription,
this.sparePartsWorkOrders,
this.reviewComment,
this.comment,
this.attachmentsWorkOrder,
this.equipmentStatus,
this.suppEngineerWorkOrders,
this.engSignature,
this.nurseSignature,
this.woParentDto});
SearchWorkOrders.fromJson(Map<String, dynamic> json) {
print(json['callRequest']);
id = json['id'];
parentWOId = json['parentWOId'];
workOrderNo = json['workOrderNo'];
workOrderYear = json['workOrderYear'];
workOrderSequennce = json['workOrderSequennce'];
callRequest = json['callRequest'] != null ? new CallRequest.fromJson(json['callRequest']) : CallRequest();
assetType = json['assetType'];
assignedEmployee = json['assignedEmployee'] != null ? new AssignedEmployee.fromJson(json['assignedEmployee']) : AssignedEmployee();
visitDate = json['visitDate'];
if (json['assistantEmployees'] != null) {
assistantEmployees = json['assistantEmployees'];
}
supplier = json['supplier'];
vendorTicketNumber = json['vendorTicketNumber'];
if (json['contactPersonWorkOrders'] != null) {
contactPersonWorkOrders = json['contactPersonWorkOrders'];
}
calllastSituation = json['calllastSituation'] != null ? new Lookup.fromJson(json['calllastSituation']) : Lookup();
currentSituation = json['currentSituation'] != null ? new Lookup.fromJson(json['currentSituation']) : Lookup();
repairLocation = json['repairLocation'];
reason = json['reason'];
startofWorkTime = json['startofWorkTime'];
endofWorkTime = json['endofWorkTime'];
workingHours = json['workingHours'];
travelingHours = json['travelingHours'];
travelingExpenses = json['travelingExpenses'];
faultDescription = json['faultDescription'] != null ? new ModelDefRelatedDefects.fromJson(json['faultDescription']) : ModelDefRelatedDefects();
if (json['sparePartsWorkOrders'] != null) {
sparePartsWorkOrders = json['sparePartsWorkOrders'];
}
reviewComment = json['reviewComment'];
comment = json['comment'];
attachmentsWorkOrder = json['attachmentsWorkOrder'];
equipmentStatus = json['equipmentStatus'];
if (json['suppEngineerWorkOrders'] != null) {
suppEngineerWorkOrders = json['suppEngineerWorkOrders'];
}
engSignature = json['engSignature'];
nurseSignature = json['nurseSignature'];
woParentDto = json['woParentDto'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['parentWOId'] = this.parentWOId;
data['workOrderNo'] = this.workOrderNo;
data['workOrderYear'] = this.workOrderYear;
data['workOrderSequennce'] = this.workOrderSequennce;
if (this.callRequest != null) {
data['callRequest'] = this.callRequest.toJson();
}
data['assetType'] = this.assetType;
if (this.assignedEmployee != null) {
data['assignedEmployee'] = this.assignedEmployee.toJson();
}
data['visitDate'] = this.visitDate;
if (this.assistantEmployees != null) {
data['assistantEmployees'] = this.assistantEmployees.map((v) => v.toJson()).toList();
}
data['supplier'] = this.supplier;
data['vendorTicketNumber'] = this.vendorTicketNumber;
if (this.contactPersonWorkOrders != null) {
data['contactPersonWorkOrders'] = this.contactPersonWorkOrders.map((v) => v.toJson()).toList();
}
if (this.calllastSituation != null) {
data['calllastSituation'] = this.calllastSituation.toMap();
}
if (this.currentSituation != null) {
data['currentSituation'] = this.currentSituation.toMap();
}
data['repairLocation'] = this.repairLocation;
data['reason'] = this.reason;
data['startofWorkTime'] = this.startofWorkTime;
data['endofWorkTime'] = this.endofWorkTime;
data['workingHours'] = this.workingHours;
data['travelingHours'] = this.travelingHours;
data['travelingExpenses'] = this.travelingExpenses;
if (this.faultDescription != null) {
data['faultDescription'] = this.faultDescription.toJson();
}
if (this.sparePartsWorkOrders != null) {
data['sparePartsWorkOrders'] = this.sparePartsWorkOrders.map((v) => v.toJson()).toList();
}
data['reviewComment'] = this.reviewComment;
data['comment'] = this.comment;
data['attachmentsWorkOrder'] = this.attachmentsWorkOrder;
data['equipmentStatus'] = this.equipmentStatus;
if (this.suppEngineerWorkOrders != null) {
data['suppEngineerWorkOrders'] = this.suppEngineerWorkOrders.map((v) => v.toJson()).toList();
}
data['engSignature'] = this.engSignature;
data['nurseSignature'] = this.nurseSignature;
data['woParentDto'] = this.woParentDto;
return data;
}
}
class CallRequest {
int id;
String callNo;
Asset asset;
AssignedEmployee assignedEmployee;
List callSiteContactPerson;
Lookup status;
Lookup callLastSituation;
String defectType;
String firstAction;
String assetType;
CallRequest({this.id, this.callNo, this.asset, this.assignedEmployee, this.callSiteContactPerson, this.status, this.callLastSituation, this.defectType, this.firstAction, this.assetType});
CallRequest.fromJson(Map<String, dynamic> json) {
id = json['id'];
callNo = json['callNo'];
asset = json['asset'] != null ? new Asset.fromJson(json['asset']) : Asset();
assignedEmployee = json['assignedEmployee'] != null ? new AssignedEmployee.fromJson(json['assignedEmployee']) : AssignedEmployee();
if (json['callSiteContactPerson'] != null) {
callSiteContactPerson = json['callSiteContactPerson'];
}
status = json['status'] != null ? new Lookup.fromJson(json['status']) : Lookup();
callLastSituation = json['callLastSituation'] != null ? new Lookup.fromJson(json['callLastSituation']) : Lookup();
defectType = json['defectType'];
firstAction = json['firstAction'];
assetType = json['assetType'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['callNo'] = this.callNo;
if (this.asset != null) {
data['asset'] = this.asset.toJson();
}
if (this.assignedEmployee != null) {
data['assignedEmployee'] = this.assignedEmployee.toJson();
}
if (this.callSiteContactPerson != null) {
data['callSiteContactPerson'] = this.callSiteContactPerson.map((v) => v.toJson()).toList();
}
if (this.status != null) {
data['status'] = this.status.toMap();
}
if (this.callLastSituation != null) {
data['callLastSituation'] = this.callLastSituation.toMap();
}
data['defectType'] = this.defectType;
data['firstAction'] = this.firstAction;
data['assetType'] = this.assetType;
return data;
}
}
class Asset {
int id;
String assetSerialNo;
String systemID;
String assetNumber;
ModelDefinition modelDefinition;
String supplier;
String ipAddress;
String macAddress;
String portNumber;
String assetReplace;
String oldAsset;
String isParent;
String parentAsset;
String assetType;
Site site;
String building;
String floor;
String department;
String room;
String testsDay;
String purchasingPrice;
String nbv;
String currency;
String poNo;
String invoiceNumber;
String invoiceDate;
String replacementDate;
String originDepartment;
Site originSite;
String budgetYear;
String lastPOPrice;
String commissioningStatus;
String productionDate;
String edd;
String technicalInspectionDate;
String deliveryInspectionDate;
String endUserAcceptanceDate;
String receivingCommittee;
String siteWarrantyMonths;
String extendedWarrantyMonths;
String remainderWarrantyMonths;
String eomWarrantyMonthsNo;
String warrantyValue;
String warrantyEndDate;
String warrantyContractConditions;
List technicalGuidanceBooks;
String comment;
String tagCode;
Asset(
{this.id,
this.assetSerialNo,
this.systemID,
this.assetNumber,
this.modelDefinition,
this.supplier,
this.ipAddress,
this.macAddress,
this.portNumber,
this.assetReplace,
this.oldAsset,
this.isParent,
this.parentAsset,
this.assetType,
this.site,
this.building,
this.floor,
this.department,
this.room,
this.testsDay,
this.purchasingPrice,
this.nbv,
this.currency,
this.poNo,
this.invoiceNumber,
this.invoiceDate,
this.replacementDate,
this.originDepartment,
this.originSite,
this.budgetYear,
this.lastPOPrice,
this.commissioningStatus,
this.productionDate,
this.edd,
this.technicalInspectionDate,
this.deliveryInspectionDate,
this.endUserAcceptanceDate,
this.receivingCommittee,
this.siteWarrantyMonths,
this.extendedWarrantyMonths,
this.remainderWarrantyMonths,
this.eomWarrantyMonthsNo,
this.warrantyValue,
this.warrantyEndDate,
this.warrantyContractConditions,
this.technicalGuidanceBooks,
this.comment,
this.tagCode});
Asset.fromJson(Map<String, dynamic> json) {
id = json['id'];
assetSerialNo = json['assetSerialNo'];
systemID = json['systemID'];
assetNumber = json['assetNumber'];
modelDefinition = json['modelDefinition'] != null ? new ModelDefinition.fromJson(json['modelDefinition']) : ModelDefinition();
supplier = json['supplier'];
ipAddress = json['ipAddress'];
macAddress = json['macAddress'];
portNumber = json['portNumber'];
assetReplace = json['assetReplace'];
oldAsset = json['oldAsset'];
isParent = json['isParent'];
parentAsset = json['parentAsset'];
assetType = json['assetType'];
site = json['site'] != null ? new Site.fromJson(json['site']) : Site();
building = json['building'];
floor = json['floor'];
department = json['department'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['assetSerialNo'] = this.assetSerialNo;
data['systemID'] = this.systemID;
data['assetNumber'] = this.assetNumber;
if (this.modelDefinition != null) {
data['modelDefinition'] = this.modelDefinition.toJson();
}
data['supplier'] = this.supplier;
data['ipAddress'] = this.ipAddress;
data['macAddress'] = this.macAddress;
data['portNumber'] = this.portNumber;
data['assetReplace'] = this.assetReplace;
data['oldAsset'] = this.oldAsset;
data['isParent'] = this.isParent;
data['parentAsset'] = this.parentAsset;
data['assetType'] = this.assetType;
if (this.site != null) {
data['site'] = this.site.toJson();
}
data['building'] = this.building;
data['floor'] = this.floor;
data['department'] = this.department;
data['room'] = this.room;
data['testsDay'] = this.testsDay;
data['purchasingPrice'] = this.purchasingPrice;
data['nbv'] = this.nbv;
data['currency'] = this.currency;
data['poNo'] = this.poNo;
data['invoiceNumber'] = this.invoiceNumber;
data['invoiceDate'] = this.invoiceDate;
data['replacementDate'] = this.replacementDate;
data['originDepartment'] = this.originDepartment;
if (this.originSite != null) {
data['originSite'] = this.originSite.toJson();
}
data['budgetYear'] = this.budgetYear;
data['lastPOPrice'] = this.lastPOPrice;
data['commissioningStatus'] = this.commissioningStatus;
data['productionDate'] = this.productionDate;
data['edd'] = this.edd;
data['technicalInspectionDate'] = this.technicalInspectionDate;
data['deliveryInspectionDate'] = this.deliveryInspectionDate;
data['endUserAcceptanceDate'] = this.endUserAcceptanceDate;
data['receivingCommittee'] = this.receivingCommittee;
data['siteWarrantyMonths'] = this.siteWarrantyMonths;
data['extendedWarrantyMonths'] = this.extendedWarrantyMonths;
data['remainderWarrantyMonths'] = this.remainderWarrantyMonths;
data['eomWarrantyMonthsNo'] = this.eomWarrantyMonthsNo;
data['warrantyValue'] = this.warrantyValue;
data['warrantyEndDate'] = this.warrantyEndDate;
data['warrantyContractConditions'] = this.warrantyContractConditions;
if (this.technicalGuidanceBooks != null) {
data['technicalGuidanceBooks'] = this.technicalGuidanceBooks.map((v) => v.toJson()).toList();
}
data['comment'] = this.comment;
data['tagCode'] = this.tagCode;
return data;
}
}
class ModelDefinition {
int id;
String assetName;
String modelDefCode;
String modelName;
int manufacturerId;
String manufacturerName;
String supplierName;
String replacementDate;
int lifeSpan;
List<ModelDefRelatedDefects> modelDefRelatedDefects;
List suppliers;
ModelDefinition(
{this.id,
this.assetName,
this.modelDefCode,
this.modelName,
this.manufacturerId,
this.manufacturerName,
this.supplierName,
this.replacementDate,
this.lifeSpan,
this.modelDefRelatedDefects,
this.suppliers});
ModelDefinition.fromJson(Map<String, dynamic> json) {
id = json['id'];
assetName = json['assetName'];
modelDefCode = json['modelDefCode'];
modelName = json['modelName'];
manufacturerId = json['manufacturerId'];
manufacturerName = json['manufacturerName'];
supplierName = json['supplierName'];
replacementDate = json['replacementDate'];
lifeSpan = json['lifeSpan'];
if (json['modelDefRelatedDefects'] != null) {
modelDefRelatedDefects = <ModelDefRelatedDefects>[];
json['modelDefRelatedDefects'].forEach((v) {
modelDefRelatedDefects.add(new ModelDefRelatedDefects.fromJson(v));
});
}
if (json['suppliers'] != null) {
suppliers = json['suppliers'];
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['assetName'] = this.assetName;
data['modelDefCode'] = this.modelDefCode;
data['modelName'] = this.modelName;
data['manufacturerId'] = this.manufacturerId;
data['manufacturerName'] = this.manufacturerName;
data['supplierName'] = this.supplierName;
data['replacementDate'] = this.replacementDate;
data['lifeSpan'] = this.lifeSpan;
if (this.modelDefRelatedDefects != null) {
data['modelDefRelatedDefects'] = this.modelDefRelatedDefects.map((v) => v.toJson()).toList();
}
if (this.suppliers != null) {
data['suppliers'] = this.suppliers.map((v) => v.toJson()).toList();
}
return data;
}
}
class ModelDefRelatedDefects {
int id;
String defectName;
String workPerformed;
String estimatedTime;
ModelDefRelatedDefects({this.id, this.defectName, this.workPerformed, this.estimatedTime});
ModelDefRelatedDefects.fromJson(Map<String, dynamic> json) {
id = json['id'];
defectName = json['defectName'];
workPerformed = json['workPerformed'];
estimatedTime = json['estimatedTime'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['defectName'] = this.defectName;
data['workPerformed'] = this.workPerformed;
data['estimatedTime'] = this.estimatedTime;
return data;
}
}
class Site {
int id;
int customerCode;
String custName;
List buildings;
Site({this.id, this.customerCode, this.custName, this.buildings});
Site.fromJson(Map<String, dynamic> json) {
id = json['id'];
customerCode = json['customerCode'];
custName = json['custName'];
if (json['buildings'] != null) {
buildings = json['buildings'];
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['customerCode'] = this.customerCode;
data['custName'] = this.custName;
if (this.buildings != null) {
data['buildings'] = this.buildings.map((v) => v.toJson()).toList();
}
return data;
}
}
class AssignedEmployee {
String id;
String name;
AssignedEmployee({this.id, this.name});
AssignedEmployee.fromJson(Map<String, dynamic> json) {
id = json['id'];
name = json['name'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['name'] = this.name;
return data;
}
}