Fix asset destination issue

main_design2.0
zaid_daoud 2 years ago
parent f1bb4117e2
commit fe1885b367

@ -202,8 +202,11 @@ class DeviceTransferProvider extends ChangeNotifier {
"senderEndDate": newModel.timer?.endAt?.toIso8601String(),
"senderTravelingHours": newModel.travelingHours,
"senderAttachmentName": newModel?.signature ?? "",
"destSiteId": oldModel.receiver.client.id,
"destDepartmentId": oldModel.receiver.department.id,
"destSiteId": oldModel.receiver.client?.id,
"destDepartmentId": oldModel.receiver.department?.id,
"destBuildingId": oldModel.receiver.building?.id,
"destFloorId": oldModel.receiver.floor?.id,
"destRoom": oldModel.receiver?.room,
"receiverAssignedEmployeeId": oldModel.receiver.userId,
"receiverMachineStatusId": oldModel.receiver.status.id ?? "",
"receiverComment": oldModel.receiver.comment,
@ -225,8 +228,11 @@ class DeviceTransferProvider extends ChangeNotifier {
"senderEndDate": oldModel.sender.timer?.endAt?.toIso8601String(),
"senderTravelingHours": oldModel.sender.travelingHours,
"senderAttachmentName": oldModel.sender?.signature ?? "",
"destSiteId": newModel.client.id,
"destDepartmentId": newModel.department.id,
"destSiteId": newModel.client?.id,
"destDepartmentId": newModel.department?.id,
"destBuildingId": newModel.building?.id,
"destFloorId": newModel.floor?.id,
"destRoom": newModel.room,
"receiverAssignedEmployeeId": newModel.userId,
"receiverMachineStatusId": newModel.status?.id ?? "",
"receiverComment": newModel.comment,
@ -237,7 +243,7 @@ class DeviceTransferProvider extends ChangeNotifier {
"receiverAttachmentName": newModel?.signature ?? "",
});
}
if (true) {}
//body.addAll(newModel.toJson(isSender));
print(body);
Response response;

@ -9,6 +9,9 @@ class DeviceTransferInfo {
String comment;
Hospital client;
Department department;
Buildings building;
Floors floor;
String room;
String workingHours;
// DateTime startDate;
@ -34,6 +37,9 @@ class DeviceTransferInfo {
this.status,
this.assignedEmployeeName,
this.timer,
this.building,
this.room,
this.floor,
});
Map<String, String> toJson(bool isSender) {
@ -63,6 +69,19 @@ class DeviceTransferInfo {
userName = old.userName;
client = Hospital.fromHospital(old.client);
department = Department.fromDepartment(old.department);
building = Buildings(
id: old.building?.id,
name: old.building?.name,
value: old.building?.value,
floors: old.building?.floors,
);
floor = Floors(
id: old.floor?.id,
name: old.floor?.name,
value: old.floor?.value,
departments: old.floor?.departments,
);
room = old.room;
workingHours = old.workingHours;
// startDate = old.startDate;
// endDate = old.endDate;
@ -94,6 +113,15 @@ class DeviceTransferInfo {
id: parsedJson["${key}DepartmentId"],
name: parsedJson["${key}DepartmentName"],
),
building: Buildings(
id: parsedJson["${key}BuildingId"],
name: parsedJson["${key}BuildingName"],
),
floor: Floors(
id: parsedJson["${key}FloorId"],
name: parsedJson["${key}FloorName"],
),
room: parsedJson["${key}Room"],
status: Lookup(
id: parsedJson["${key}status"],
name: parsedJson["${key}status"],

Loading…
Cancel
Save