|
|
|
@ -195,7 +195,6 @@ class TaskData {
|
|
|
|
reasonOfFSCA = json['reasonOfFSCA'];
|
|
|
|
reasonOfFSCA = json['reasonOfFSCA'];
|
|
|
|
correctiveActionDescription = json['correctiveActionDescription'];
|
|
|
|
correctiveActionDescription = json['correctiveActionDescription'];
|
|
|
|
evaluatorUser = json['evaluatorUser'] != null ? TaskContactUser.fromJson(json['evaluatorUser']) : null;
|
|
|
|
evaluatorUser = json['evaluatorUser'] != null ? TaskContactUser.fromJson(json['evaluatorUser']) : null;
|
|
|
|
|
|
|
|
|
|
|
|
site = json["site"] == null ? null : Site.fromJson(json["site"]);
|
|
|
|
site = json["site"] == null ? null : Site.fromJson(json["site"]);
|
|
|
|
building = json["building"] == null ? null : Building.fromJson(json["building"]);
|
|
|
|
building = json["building"] == null ? null : Building.fromJson(json["building"]);
|
|
|
|
floor = json["floor"] == null ? null : Floor.fromJson(json["floor"]);
|
|
|
|
floor = json["floor"] == null ? null : Floor.fromJson(json["floor"]);
|
|
|
|
@ -227,13 +226,17 @@ class TaskData {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
data['asset'] = asset?.toJson();
|
|
|
|
data['asset'] = asset?.toJson();
|
|
|
|
data['site'] = site;
|
|
|
|
data['site'] = site?.toJson();
|
|
|
|
data['building'] = building;
|
|
|
|
data['building'] = building?.toJson();
|
|
|
|
data['floor'] = floor;
|
|
|
|
data['floor'] = floor?.toJson();
|
|
|
|
data['department'] = department;
|
|
|
|
data['department'] = department?.toJson();
|
|
|
|
data['room'] = room;
|
|
|
|
data['room'] = room?.toJson();
|
|
|
|
data['callComment'] = callComment;
|
|
|
|
data['callComment'] = callComment;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (taskJobAttachments != null) {
|
|
|
|
|
|
|
|
data['taskJobAttachments'] = taskJobAttachments!.map((e) => e.toJson()).toList();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (assignedEngineer != null) {
|
|
|
|
if (assignedEngineer != null) {
|
|
|
|
data['assignedEngineer'] = assignedEngineer!.toJson();
|
|
|
|
data['assignedEngineer'] = assignedEngineer!.toJson();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -241,40 +244,52 @@ class TaskData {
|
|
|
|
if (taskJobAssistantEmployees != null) {
|
|
|
|
if (taskJobAssistantEmployees != null) {
|
|
|
|
data['taskJobAssistantEmployees'] = taskJobAssistantEmployees!.map((v) => v.toJson()).toList();
|
|
|
|
data['taskJobAssistantEmployees'] = taskJobAssistantEmployees!.map((v) => v.toJson()).toList();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (taskJobHistories != null) {
|
|
|
|
if (taskJobHistories != null) {
|
|
|
|
data['taskJobHistories'] = taskJobHistories!.map((e) => e.toJson()).toList();
|
|
|
|
data['taskJobHistories'] = taskJobHistories!.map((e) => e.toJson()).toList();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (installationBuilding != null) {
|
|
|
|
if (installationBuilding != null) {
|
|
|
|
data['installationBuilding'] = installationBuilding!.toJson();
|
|
|
|
data['installationBuilding'] = installationBuilding!.toJson();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (installationFloor != null) {
|
|
|
|
if (installationFloor != null) {
|
|
|
|
data['installationFloor'] = installationFloor!.toJson();
|
|
|
|
data['installationFloor'] = installationFloor!.toJson();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (installationDepartment != null) {
|
|
|
|
if (installationDepartment != null) {
|
|
|
|
data['installationDepartment'] = installationDepartment!.toJson();
|
|
|
|
data['installationDepartment'] = installationDepartment!.toJson();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data['serialNo'] = serialNo;
|
|
|
|
|
|
|
|
data['installationDate'] = installationDate;
|
|
|
|
|
|
|
|
|
|
|
|
if (completedAction != null) {
|
|
|
|
if (completedAction != null) {
|
|
|
|
data['completedAction'] = completedAction!.toJson();
|
|
|
|
data['completedAction'] = completedAction!.toJson();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (impactStatus != null) {
|
|
|
|
if (impactStatus != null) {
|
|
|
|
data['impactStatus'] = impactStatus!.toJson();
|
|
|
|
data['impactStatus'] = impactStatus!.toJson();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data['isUserAcknowledge'] = isUserAcknowledge;
|
|
|
|
|
|
|
|
|
|
|
|
if (typeOfAlert != null) {
|
|
|
|
if (typeOfAlert != null) {
|
|
|
|
data['typeOfAlert'] = typeOfAlert!.toJson();
|
|
|
|
data['typeOfAlert'] = typeOfAlert!.toJson();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (riskLevel != null) {
|
|
|
|
if (riskLevel != null) {
|
|
|
|
data['riskLevel'] = riskLevel!.toJson();
|
|
|
|
data['riskLevel'] = riskLevel!.toJson();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (resource != null) {
|
|
|
|
if (resource != null) {
|
|
|
|
data['resource'] = resource!.toJson();
|
|
|
|
data['resource'] = resource!.toJson();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (actionNeeded != null) {
|
|
|
|
if (actionNeeded != null) {
|
|
|
|
data['actionNeeded'] = actionNeeded!.toJson();
|
|
|
|
data['actionNeeded'] = actionNeeded!.toJson();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
data['serialNo'] = serialNo;
|
|
|
|
|
|
|
|
data['installationDate'] = installationDate;
|
|
|
|
|
|
|
|
data['isUserAcknowledge'] = isUserAcknowledge;
|
|
|
|
|
|
|
|
data['alertNo'] = alertNo;
|
|
|
|
data['alertNo'] = alertNo;
|
|
|
|
data['estimationDeliveryDate'] = estimationDeliveryDate;
|
|
|
|
data['estimationDeliveryDate'] = estimationDeliveryDate;
|
|
|
|
data['reasonOfFSCA'] = reasonOfFSCA;
|
|
|
|
data['reasonOfFSCA'] = reasonOfFSCA;
|
|
|
|
@ -283,17 +298,14 @@ class TaskData {
|
|
|
|
if (evaluatorUser != null) {
|
|
|
|
if (evaluatorUser != null) {
|
|
|
|
data['evaluatorUser'] = evaluatorUser!.toJson();
|
|
|
|
data['evaluatorUser'] = evaluatorUser!.toJson();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (taskJobActivityEngineerTimers != null) {
|
|
|
|
if (taskJobActivityEngineerTimers != null) {
|
|
|
|
data['taskJobActivityEngineerTimers'] = taskJobActivityEngineerTimers!.map((e) => e.toJson()).toList();
|
|
|
|
data['taskJobActivityEngineerTimers'] = taskJobActivityEngineerTimers!.map((e) => e.toJson()).toList();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (taskJobAttachments != null) {
|
|
|
|
|
|
|
|
data['taskJobAttachments'] = taskJobAttachments?.map((e) => e.toJson()).toList();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return data;
|
|
|
|
return data;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Map<String, dynamic> toJson() {
|
|
|
|
// Map<String, dynamic> toJson() {
|
|
|
|
// final Map<String, dynamic> data = <String, dynamic>{};
|
|
|
|
// final Map<String, dynamic> data = <String, dynamic>{};
|
|
|
|
//
|
|
|
|
//
|
|
|
|
@ -376,7 +388,6 @@ class TaskData {
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
data['taskJobAssistantEmployees'] = [];
|
|
|
|
data['taskJobAssistantEmployees'] = [];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (taskJobActivityEngineerTimers != null) {
|
|
|
|
if (taskJobActivityEngineerTimers != null) {
|
|
|
|
data['taskJobActivityEngineerTimers'] = taskJobActivityEngineerTimers!.map((v) => v.toJson()).toList();
|
|
|
|
data['taskJobActivityEngineerTimers'] = taskJobActivityEngineerTimers!.map((v) => v.toJson()).toList();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -388,7 +399,10 @@ class TaskData {
|
|
|
|
data['installationDepartmentId'] = department?.id;
|
|
|
|
data['installationDepartmentId'] = department?.id;
|
|
|
|
data['serialNo'] = serialNo;
|
|
|
|
data['serialNo'] = serialNo;
|
|
|
|
data['installationDate'] = installationDate;
|
|
|
|
data['installationDate'] = installationDate;
|
|
|
|
data['completedActionId'] = actionNeeded?.id;
|
|
|
|
//this is not for recall and alert type..
|
|
|
|
|
|
|
|
if(taskType?.id!=7){
|
|
|
|
|
|
|
|
data['completedActionId'] = actionNeeded?.id;
|
|
|
|
|
|
|
|
}
|
|
|
|
data['impactStatusId'] = impactStatus?.id;
|
|
|
|
data['impactStatusId'] = impactStatus?.id;
|
|
|
|
data['isUserAcknowledge'] = isUserAcknowledge;
|
|
|
|
data['isUserAcknowledge'] = isUserAcknowledge;
|
|
|
|
return data;
|
|
|
|
return data;
|
|
|
|
|