|
|
|
@ -2,6 +2,7 @@ import 'package:test_sa/models/lookup.dart';
|
|
|
|
|
import 'package:test_sa/models/service_request/sub_work_order_details.dart';
|
|
|
|
|
import 'package:test_sa/models/timer_model.dart';
|
|
|
|
|
|
|
|
|
|
import '../device/asset.dart';
|
|
|
|
|
import '../fault_description.dart';
|
|
|
|
|
|
|
|
|
|
class SearchWorkOrder {
|
|
|
|
@ -1563,354 +1564,6 @@ class CallSiteContactPerson {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class Asset {
|
|
|
|
|
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(dynamic json) {
|
|
|
|
|
id = json['id'];
|
|
|
|
|
assetSerialNo = json['assetSerialNo'];
|
|
|
|
|
systemID = json['systemID'];
|
|
|
|
|
assetNumber = json['assetNumber'];
|
|
|
|
|
modelDefinition = json['modelDefinition'] != null ? ModelDefinition.fromJson(json['modelDefinition']) : null;
|
|
|
|
|
supplier = json['supplier'] != null ? Supplier.fromJson(json['supplier']) : null;
|
|
|
|
|
ipAddress = json['ipAddress'];
|
|
|
|
|
macAddress = json['macAddress'];
|
|
|
|
|
portNumber = json['portNumber'];
|
|
|
|
|
assetReplace = json['assetReplace'] != null ? AssetReplace.fromJson(json['assetReplace']) : null;
|
|
|
|
|
oldAsset = json['oldAsset'] != null ? OldAsset.fromJson(json['oldAsset']) : null;
|
|
|
|
|
isParent = json['isParent'] != null ? IsParent.fromJson(json['isParent']) : null;
|
|
|
|
|
parentAsset = json['parentAsset'] != null ? ParentAsset.fromJson(json['parentAsset']) : null;
|
|
|
|
|
assetType = json['assetType'] != null ? Lookup.fromJson(json['assetType']) : null;
|
|
|
|
|
site = json['site'] != null ? Site.fromJson(json['site']) : null;
|
|
|
|
|
building = json['building'] != null ? Building.fromJson(json['building']) : null;
|
|
|
|
|
floor = json['floor'] != null ? Floor.fromJson(json['floor']) : null;
|
|
|
|
|
department = json['department'] != null ? Department.fromJson(json['department']) : null;
|
|
|
|
|
room = json['room'];
|
|
|
|
|
testsDay = json['testsDay'];
|
|
|
|
|
purchasingPrice = json['purchasingPrice'];
|
|
|
|
|
nbv = json['nbv'];
|
|
|
|
|
currency = json['currency'] != null ? Currency.fromJson(json['currency']) : null;
|
|
|
|
|
poNo = json['poNo'];
|
|
|
|
|
invoiceNumber = json['invoiceNumber'];
|
|
|
|
|
invoiceDate = json['invoiceDate'];
|
|
|
|
|
replacementDate = json['replacementDate'];
|
|
|
|
|
originDepartment = json['originDepartment'] != null ? OriginDepartment.fromJson(json['originDepartment']) : null;
|
|
|
|
|
originSite = json['originSite'] != null ? OriginSite.fromJson(json['originSite']) : null;
|
|
|
|
|
budgetYear = json['budgetYear'];
|
|
|
|
|
lastPOPrice = json['lastPOPrice'];
|
|
|
|
|
commissioningStatus = json['commissioningStatus'] != null ? CommissioningStatus.fromJson(json['commissioningStatus']) : null;
|
|
|
|
|
productionDate = json['productionDate'];
|
|
|
|
|
edd = json['edd'];
|
|
|
|
|
technicalInspectionDate = json['technicalInspectionDate'];
|
|
|
|
|
deliveryInspectionDate = json['deliveryInspectionDate'];
|
|
|
|
|
endUserAcceptanceDate = json['endUserAcceptanceDate'];
|
|
|
|
|
receivingCommittee = json['receivingCommittee'];
|
|
|
|
|
siteWarrantyMonths = json['siteWarrantyMonths'] != null ? SiteWarrantyMonths.fromJson(json['siteWarrantyMonths']) : null;
|
|
|
|
|
extendedWarrantyMonths = json['extendedWarrantyMonths'] != null ? ExtendedWarrantyMonths.fromJson(json['extendedWarrantyMonths']) : null;
|
|
|
|
|
remainderWarrantyMonths = json['remainderWarrantyMonths'] != null ? RemainderWarrantyMonths.fromJson(json['remainderWarrantyMonths']) : null;
|
|
|
|
|
eomWarrantyMonthsNo = json['eomWarrantyMonthsNo'];
|
|
|
|
|
warrantyValue = json['warrantyValue'];
|
|
|
|
|
warrantyEndDate = json['warrantyEndDate'];
|
|
|
|
|
warrantyContractConditions = json['warrantyContractConditions'];
|
|
|
|
|
if (json['technicalGuidanceBooks'] != null) {
|
|
|
|
|
technicalGuidanceBooks = [];
|
|
|
|
|
json['technicalGuidanceBooks'].forEach((v) {
|
|
|
|
|
technicalGuidanceBooks.add(TechnicalGuidanceBooks.fromJson(v));
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
comment = json['comment'];
|
|
|
|
|
tagCode = json['tagCode'];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
num id;
|
|
|
|
|
String assetSerialNo;
|
|
|
|
|
String systemID;
|
|
|
|
|
String assetNumber;
|
|
|
|
|
ModelDefinition modelDefinition;
|
|
|
|
|
Supplier supplier;
|
|
|
|
|
String ipAddress;
|
|
|
|
|
String macAddress;
|
|
|
|
|
String portNumber;
|
|
|
|
|
AssetReplace assetReplace;
|
|
|
|
|
OldAsset oldAsset;
|
|
|
|
|
IsParent isParent;
|
|
|
|
|
ParentAsset parentAsset;
|
|
|
|
|
Lookup assetType;
|
|
|
|
|
Site site;
|
|
|
|
|
Building building;
|
|
|
|
|
Floor floor;
|
|
|
|
|
Department department;
|
|
|
|
|
String room;
|
|
|
|
|
num testsDay;
|
|
|
|
|
num purchasingPrice;
|
|
|
|
|
String nbv;
|
|
|
|
|
Currency currency;
|
|
|
|
|
String poNo;
|
|
|
|
|
String invoiceNumber;
|
|
|
|
|
String invoiceDate;
|
|
|
|
|
String replacementDate;
|
|
|
|
|
OriginDepartment originDepartment;
|
|
|
|
|
OriginSite originSite;
|
|
|
|
|
num budgetYear;
|
|
|
|
|
num lastPOPrice;
|
|
|
|
|
CommissioningStatus commissioningStatus;
|
|
|
|
|
String productionDate;
|
|
|
|
|
String edd;
|
|
|
|
|
String technicalInspectionDate;
|
|
|
|
|
String deliveryInspectionDate;
|
|
|
|
|
String endUserAcceptanceDate;
|
|
|
|
|
String receivingCommittee;
|
|
|
|
|
SiteWarrantyMonths siteWarrantyMonths;
|
|
|
|
|
ExtendedWarrantyMonths extendedWarrantyMonths;
|
|
|
|
|
RemainderWarrantyMonths remainderWarrantyMonths;
|
|
|
|
|
num eomWarrantyMonthsNo;
|
|
|
|
|
num warrantyValue;
|
|
|
|
|
String warrantyEndDate;
|
|
|
|
|
String warrantyContractConditions;
|
|
|
|
|
List<TechnicalGuidanceBooks> technicalGuidanceBooks;
|
|
|
|
|
String comment;
|
|
|
|
|
String tagCode;
|
|
|
|
|
|
|
|
|
|
Asset copyWith({
|
|
|
|
|
num id,
|
|
|
|
|
String assetSerialNo,
|
|
|
|
|
String systemID,
|
|
|
|
|
String assetNumber,
|
|
|
|
|
ModelDefinition modelDefinition,
|
|
|
|
|
SupplierModel supplier,
|
|
|
|
|
String ipAddress,
|
|
|
|
|
String macAddress,
|
|
|
|
|
String portNumber,
|
|
|
|
|
AssetReplace assetReplace,
|
|
|
|
|
OldAsset oldAsset,
|
|
|
|
|
IsParent isParent,
|
|
|
|
|
ParentAsset parentAsset,
|
|
|
|
|
Lookup assetType,
|
|
|
|
|
Site site,
|
|
|
|
|
Building building,
|
|
|
|
|
Floor floor,
|
|
|
|
|
Department department,
|
|
|
|
|
String room,
|
|
|
|
|
num testsDay,
|
|
|
|
|
num purchasingPrice,
|
|
|
|
|
String nbv,
|
|
|
|
|
Currency currency,
|
|
|
|
|
String poNo,
|
|
|
|
|
String invoiceNumber,
|
|
|
|
|
String invoiceDate,
|
|
|
|
|
String replacementDate,
|
|
|
|
|
OriginDepartment originDepartment,
|
|
|
|
|
OriginSite originSite,
|
|
|
|
|
num budgetYear,
|
|
|
|
|
num lastPOPrice,
|
|
|
|
|
CommissioningStatus commissioningStatus,
|
|
|
|
|
String productionDate,
|
|
|
|
|
String edd,
|
|
|
|
|
String technicalInspectionDate,
|
|
|
|
|
String deliveryInspectionDate,
|
|
|
|
|
String endUserAcceptanceDate,
|
|
|
|
|
String receivingCommittee,
|
|
|
|
|
SiteWarrantyMonths siteWarrantyMonths,
|
|
|
|
|
ExtendedWarrantyMonths extendedWarrantyMonths,
|
|
|
|
|
RemainderWarrantyMonths remainderWarrantyMonths,
|
|
|
|
|
num eomWarrantyMonthsNo,
|
|
|
|
|
num warrantyValue,
|
|
|
|
|
String warrantyEndDate,
|
|
|
|
|
String warrantyContractConditions,
|
|
|
|
|
List<TechnicalGuidanceBooks> technicalGuidanceBooks,
|
|
|
|
|
String comment,
|
|
|
|
|
String tagCode,
|
|
|
|
|
}) =>
|
|
|
|
|
Asset(
|
|
|
|
|
id: id ?? this.id,
|
|
|
|
|
assetSerialNo: assetSerialNo ?? this.assetSerialNo,
|
|
|
|
|
systemID: systemID ?? this.systemID,
|
|
|
|
|
assetNumber: assetNumber ?? this.assetNumber,
|
|
|
|
|
modelDefinition: modelDefinition ?? this.modelDefinition,
|
|
|
|
|
supplier: supplier ?? this.supplier,
|
|
|
|
|
ipAddress: ipAddress ?? this.ipAddress,
|
|
|
|
|
macAddress: macAddress ?? this.macAddress,
|
|
|
|
|
portNumber: portNumber ?? this.portNumber,
|
|
|
|
|
assetReplace: assetReplace ?? this.assetReplace,
|
|
|
|
|
oldAsset: oldAsset ?? this.oldAsset,
|
|
|
|
|
isParent: isParent ?? this.isParent,
|
|
|
|
|
parentAsset: parentAsset ?? this.parentAsset,
|
|
|
|
|
assetType: assetType ?? this.assetType,
|
|
|
|
|
site: site ?? this.site,
|
|
|
|
|
building: building ?? this.building,
|
|
|
|
|
floor: floor ?? this.floor,
|
|
|
|
|
department: department ?? this.department,
|
|
|
|
|
room: room ?? this.room,
|
|
|
|
|
testsDay: testsDay ?? this.testsDay,
|
|
|
|
|
purchasingPrice: purchasingPrice ?? this.purchasingPrice,
|
|
|
|
|
nbv: nbv ?? this.nbv,
|
|
|
|
|
currency: currency ?? this.currency,
|
|
|
|
|
poNo: poNo ?? this.poNo,
|
|
|
|
|
invoiceNumber: invoiceNumber ?? this.invoiceNumber,
|
|
|
|
|
invoiceDate: invoiceDate ?? this.invoiceDate,
|
|
|
|
|
replacementDate: replacementDate ?? this.replacementDate,
|
|
|
|
|
originDepartment: originDepartment ?? this.originDepartment,
|
|
|
|
|
originSite: originSite ?? this.originSite,
|
|
|
|
|
budgetYear: budgetYear ?? this.budgetYear,
|
|
|
|
|
lastPOPrice: lastPOPrice ?? this.lastPOPrice,
|
|
|
|
|
commissioningStatus: commissioningStatus ?? this.commissioningStatus,
|
|
|
|
|
productionDate: productionDate ?? this.productionDate,
|
|
|
|
|
edd: edd ?? this.edd,
|
|
|
|
|
technicalInspectionDate: technicalInspectionDate ?? this.technicalInspectionDate,
|
|
|
|
|
deliveryInspectionDate: deliveryInspectionDate ?? this.deliveryInspectionDate,
|
|
|
|
|
endUserAcceptanceDate: endUserAcceptanceDate ?? this.endUserAcceptanceDate,
|
|
|
|
|
receivingCommittee: receivingCommittee ?? this.receivingCommittee,
|
|
|
|
|
siteWarrantyMonths: siteWarrantyMonths ?? this.siteWarrantyMonths,
|
|
|
|
|
extendedWarrantyMonths: extendedWarrantyMonths ?? this.extendedWarrantyMonths,
|
|
|
|
|
remainderWarrantyMonths: remainderWarrantyMonths ?? this.remainderWarrantyMonths,
|
|
|
|
|
eomWarrantyMonthsNo: eomWarrantyMonthsNo ?? this.eomWarrantyMonthsNo,
|
|
|
|
|
warrantyValue: warrantyValue ?? this.warrantyValue,
|
|
|
|
|
warrantyEndDate: warrantyEndDate ?? this.warrantyEndDate,
|
|
|
|
|
warrantyContractConditions: warrantyContractConditions ?? this.warrantyContractConditions,
|
|
|
|
|
technicalGuidanceBooks: technicalGuidanceBooks ?? this.technicalGuidanceBooks,
|
|
|
|
|
comment: comment ?? this.comment,
|
|
|
|
|
tagCode: tagCode ?? this.tagCode,
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
Map<String, dynamic> toJson() {
|
|
|
|
|
final map = <String, dynamic>{};
|
|
|
|
|
map['id'] = id ?? 0;
|
|
|
|
|
map['assetSerialNo'] = assetSerialNo;
|
|
|
|
|
map['systemID'] = systemID;
|
|
|
|
|
map['assetNumber'] = assetNumber;
|
|
|
|
|
if (modelDefinition != null) {
|
|
|
|
|
map['modelDefinition'] = modelDefinition.toJson();
|
|
|
|
|
}
|
|
|
|
|
map['supplier'] = supplier?.toJson();
|
|
|
|
|
|
|
|
|
|
map['ipAddress'] = ipAddress;
|
|
|
|
|
map['macAddress'] = macAddress;
|
|
|
|
|
map['portNumber'] = portNumber;
|
|
|
|
|
if (assetReplace != null) {
|
|
|
|
|
map['assetReplace'] = assetReplace.toJson();
|
|
|
|
|
}
|
|
|
|
|
if (oldAsset != null) {
|
|
|
|
|
map['oldAsset'] = oldAsset.toJson();
|
|
|
|
|
}
|
|
|
|
|
if (isParent != null) {
|
|
|
|
|
map['isParent'] = isParent.toJson();
|
|
|
|
|
}
|
|
|
|
|
if (parentAsset != null) {
|
|
|
|
|
map['parentAsset'] = parentAsset.toJson();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
map['assetType'] = assetType?.toJson();
|
|
|
|
|
if (site != null) {
|
|
|
|
|
map['site'] = site.toJson();
|
|
|
|
|
}
|
|
|
|
|
if (building != null) {
|
|
|
|
|
map['building'] = building.toJson();
|
|
|
|
|
}
|
|
|
|
|
if (floor != null) {
|
|
|
|
|
map['floor'] = floor.toJson();
|
|
|
|
|
}
|
|
|
|
|
if (department != null) {
|
|
|
|
|
map['department'] = department.toJson();
|
|
|
|
|
}
|
|
|
|
|
map['room'] = room;
|
|
|
|
|
map['testsDay'] = testsDay;
|
|
|
|
|
map['purchasingPrice'] = purchasingPrice;
|
|
|
|
|
map['nbv'] = nbv;
|
|
|
|
|
if (currency != null) {
|
|
|
|
|
map['currency'] = currency.toJson();
|
|
|
|
|
}
|
|
|
|
|
map['poNo'] = poNo;
|
|
|
|
|
map['invoiceNumber'] = invoiceNumber;
|
|
|
|
|
map['invoiceDate'] = invoiceDate;
|
|
|
|
|
map['replacementDate'] = replacementDate;
|
|
|
|
|
if (originDepartment != null) {
|
|
|
|
|
map['originDepartment'] = originDepartment.toJson();
|
|
|
|
|
}
|
|
|
|
|
if (originSite != null) {
|
|
|
|
|
map['originSite'] = originSite.toJson();
|
|
|
|
|
}
|
|
|
|
|
map['budgetYear'] = budgetYear;
|
|
|
|
|
map['lastPOPrice'] = lastPOPrice;
|
|
|
|
|
if (commissioningStatus != null) {
|
|
|
|
|
map['commissioningStatus'] = commissioningStatus.toJson();
|
|
|
|
|
}
|
|
|
|
|
map['productionDate'] = productionDate;
|
|
|
|
|
map['edd'] = edd;
|
|
|
|
|
map['technicalInspectionDate'] = technicalInspectionDate;
|
|
|
|
|
map['deliveryInspectionDate'] = deliveryInspectionDate;
|
|
|
|
|
map['endUserAcceptanceDate'] = endUserAcceptanceDate;
|
|
|
|
|
map['receivingCommittee'] = receivingCommittee;
|
|
|
|
|
if (siteWarrantyMonths != null) {
|
|
|
|
|
map['siteWarrantyMonths'] = siteWarrantyMonths.toJson();
|
|
|
|
|
}
|
|
|
|
|
if (extendedWarrantyMonths != null) {
|
|
|
|
|
map['extendedWarrantyMonths'] = extendedWarrantyMonths.toJson();
|
|
|
|
|
}
|
|
|
|
|
if (remainderWarrantyMonths != null) {
|
|
|
|
|
map['remainderWarrantyMonths'] = remainderWarrantyMonths.toJson();
|
|
|
|
|
}
|
|
|
|
|
map['eomWarrantyMonthsNo'] = eomWarrantyMonthsNo;
|
|
|
|
|
map['warrantyValue'] = warrantyValue;
|
|
|
|
|
map['warrantyEndDate'] = warrantyEndDate;
|
|
|
|
|
map['warrantyContractConditions'] = warrantyContractConditions;
|
|
|
|
|
if (technicalGuidanceBooks != null) {
|
|
|
|
|
map['technicalGuidanceBooks'] = technicalGuidanceBooks.map((v) => v.toJson()).toList();
|
|
|
|
|
}
|
|
|
|
|
map['comment'] = comment;
|
|
|
|
|
map['tagCode'] = tagCode;
|
|
|
|
|
return map;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class TechnicalGuidanceBooks {
|
|
|
|
|
TechnicalGuidanceBooks({
|
|
|
|
|
this.id,
|
|
|
|
|