Enhancements

merge-requests/24/head
zaid_daoud 1 year ago
parent 8968f9ae2f
commit 048774bd8c

@ -1,4 +1,4 @@
class URLs{ class URLs {
URLs._(); URLs._();
static const host2 = "http://194.163.164.213/atoms/api"; static const host2 = "http://194.163.164.213/atoms/api";
static const host1 = "https://atomsuat.hmg.com"; // uat url static const host1 = "https://atomsuat.hmg.com"; // uat url
@ -11,8 +11,7 @@ class URLs{
set host(String value) => _host = value; set host(String value) => _host = value;
static String getFileUrl(String file) => file == null || file.isEmpty static String getFileUrl(String file) => file == null || file.isEmpty ? null : "$_host/attachment/$file";
? null : "$_host/attachment/$file";
// API Routes // API Routes
static get login => "$_baseUrl/MobileAuth/Login"; // post static get login => "$_baseUrl/MobileAuth/Login"; // post
@ -39,7 +38,7 @@ class URLs{
static get getRecentNotifications => "$_baseUrl/return/user/recent/notification"; // get static get getRecentNotifications => "$_baseUrl/return/user/recent/notification"; // get
static get createRequest => "$_baseUrl/CallRequest/AddCallRequest"; // get static get createRequest => "$_baseUrl/CallRequest/AddCallRequest"; // get
static get createReport => "$_baseUrl/handle/create/report/issue"; // get static get createReport => "$_baseUrl/handle/create/report/issue"; // get
static get updateRequestDate => "$_baseUrl/handle/update/request"; // get static get updateRequestDate => "$_baseUrl/CallRequest/UpdateCallRequest"; // get
// service report // service report
static get createServiceReport => "$_baseUrl/WorkOrder/AddWorkOrder"; // get static get createServiceReport => "$_baseUrl/WorkOrder/AddWorkOrder"; // get
@ -47,7 +46,7 @@ class URLs{
static get getServiceReport => "$_baseUrl/WorkOrder/GetWorkOrderById"; // get static get getServiceReport => "$_baseUrl/WorkOrder/GetWorkOrderById"; // get
static get createDuplicatedReport => "$_baseUrl/handle/duplicate/request"; // get static get createDuplicatedReport => "$_baseUrl/handle/duplicate/request"; // get
static get getServiceReportReasons => "$_baseUrl/Lookups/GetLookup?lookupEnum=522"; // get static get getServiceReportReasons => "$_baseUrl/Lookups/GetLookup?lookupEnum=522"; // get
static get getServiceReportTypes => "$_baseUrl/Lookups/GetLookup?lookupEnum=501"; // get static get getServiceReportTypes => "$_baseUrl/Lookups/GetLookup?lookupEnum=501"; // get
static get getServiceReportStatus => "$_baseUrl/Lookups/GetLookup?lookupEnum=521"; // get static get getServiceReportStatus => "$_baseUrl/Lookups/GetLookup?lookupEnum=521"; // get
static get getServiceReportLastCalls => "$_baseUrl/Lookups/GetLookup?lookupEnum=520"; // get static get getServiceReportLastCalls => "$_baseUrl/Lookups/GetLookup?lookupEnum=520"; // get
@ -83,5 +82,4 @@ class URLs{
static get getPentryStatus => "$_baseUrl/Lookups/GetLookup?lookupEnum=401"; // get static get getPentryStatus => "$_baseUrl/Lookups/GetLookup?lookupEnum=401"; // get
// contacts // contacts
static get getPentryContacts => "$_baseUrl/handle/return/all/contacts"; // get static get getPentryContacts => "$_baseUrl/handle/return/all/contacts"; // get
}
}

@ -193,17 +193,15 @@ class ServiceRequestsProvider extends ChangeNotifier {
@required ServiceRequest request, @required ServiceRequest request,
}) async { }) async {
Response response; Response response;
Map<String, String> body = {}; var body = {
body["uid"] = user.id; "callCreatedBy": {"id": user.id, "name": user.userName},
body["token"] = user.token; "assets": request.deviceId == null ? [] : [request.deviceId],
body["nid"] = request.id; "requestedDate": newDate,
if (newDate != null) body["date"] = newDate; "requestedTime": newDate,
if (employee != null) body["ass_emp"] = employee.id.toString(); };
try { try {
response = await post( response = await ApiManager.instance.put(
Uri.parse( URLs.updateRequestDate,
//host+
URLs.updateRequestDate),
body: body, body: body,
); );
stateCode = response.statusCode; stateCode = response.statusCode;

@ -3,7 +3,7 @@ import 'package:test_sa/models/lookup.dart';
import 'model.dart'; import 'model.dart';
class Device{ class Device {
int id; int id;
String serialNumber; String serialNumber;
String number; String number;
@ -12,7 +12,6 @@ class Device{
ModelDefinition modelDefinition; ModelDefinition modelDefinition;
Hospital hospital; Hospital hospital;
Device({ Device({
this.id, this.id,
this.serialNumber, this.serialNumber,
@ -21,20 +20,15 @@ class Device{
// this.brand, // this.brand,
// this.model, // this.model,
this.modelDefinition, this.modelDefinition,
}); });
factory Device.fromJson(Map<String, dynamic> parsedJson) {
factory Device.fromJson(Map<String,dynamic> parsedJson){
return Device( return Device(
id: parsedJson["id"], id: parsedJson["id"],
serialNumber: parsedJson["assetSerialNo"], serialNumber: parsedJson["assetSerialNo"],
number: parsedJson["assetNumber"], number: parsedJson["assetNumber"],
modelDefinition:ModelDefinition.fromJson(parsedJson["modelDefinition"]), modelDefinition: ModelDefinition.fromJson(parsedJson["modelDefinition"]),
hospital:Hospital.fromJson(parsedJson["site"]), hospital: Hospital.fromJson(parsedJson["site"]),
// parsedJson["modelDefinition"] == null ? "" : // parsedJson["modelDefinition"] == null ? "" :
// parsedJson["modelDefinition"]["manufacturerName"], // parsedJson["modelDefinition"]["manufacturerName"],
// model: parsedJson["modelDefinition"] == null ? "" : // model: parsedJson["modelDefinition"] == null ? "" :
@ -42,7 +36,7 @@ class Device{
); );
} }
factory Device.fromDevice(Device device){ factory Device.fromDevice(Device device) {
return Device( return Device(
id: device.id, id: device.id,
serialNumber: device.serialNumber, serialNumber: device.serialNumber,
@ -59,7 +53,8 @@ class Device{
'assetNumber': number, 'assetNumber': number,
'modelDefinition': modelDefinition.toJson(), 'modelDefinition': modelDefinition.toJson(),
'site': hospital.toMap(), 'site': hospital.toMap(),
'AssetType':assetType.toMap(), 'AssetType': assetType.toMap(),
"supplier": {"id": 0, "suppliername": "string"},
}; };
} }
} }

@ -113,41 +113,6 @@ class ServiceReport {
} }
_map["nurseSignature"] = signatureNurse; _map["nurseSignature"] = signatureNurse;
_map["engSignature"] = signatureEngineer; _map["engSignature"] = signatureEngineer;
// ///TODO : zaid
// _map["supplier"] = {
// "id": 0,
// "suppliername": "string",
// "name": "string",
// "website": "string",
// "email": "string",
// "code": "string",
// "suppNo": 0,
// "suppStatusId": 0,
// "cityId": 0,
// "person": "string",
// "comment": "string",
// "zipcode": 0,
// "contact": "string",
// "telephones": [
// {"id": 0, "supplierId": 0, "telephone": "string"}
// ],
// "faxes": [
// {"id": 0, "supplierId": 0, "fax": "string"}
// ],
// "addresses": [
// {"id": 0, "supplierId": 0, "address": "string"}
// ],
// "attachments": [
// {"id": 0, "supplierId": 0, "attachmentName": "string", "attachmentURL": "string"}
// ],
// "suppPersons": [
// {"id": 0, "supplierId": 0, "personName": "string", "personRoleId": 0, "contact": "string", "externalEngCode": "string", "email": "string"}
// ],
// "suppTCodes": [
// {"id": 0, "supplierId": 0, "codeTypeId": 0, "codeValue": "string"}
// ]
// };
return _map; return _map;
} }

Loading…
Cancel
Save