Enhancements

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

@ -1,4 +1,4 @@
class URLs{
class URLs {
URLs._();
static const host2 = "http://194.163.164.213/atoms/api";
static const host1 = "https://atomsuat.hmg.com"; // uat url
@ -11,8 +11,7 @@ class URLs{
set host(String value) => _host = value;
static String getFileUrl(String file) => file == null || file.isEmpty
? null : "$_host/attachment/$file";
static String getFileUrl(String file) => file == null || file.isEmpty ? null : "$_host/attachment/$file";
// API Routes
static get login => "$_baseUrl/MobileAuth/Login"; // post
@ -39,7 +38,7 @@ class URLs{
static get getRecentNotifications => "$_baseUrl/return/user/recent/notification"; // get
static get createRequest => "$_baseUrl/CallRequest/AddCallRequest"; // 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
static get createServiceReport => "$_baseUrl/WorkOrder/AddWorkOrder"; // get
@ -47,7 +46,7 @@ class URLs{
static get getServiceReport => "$_baseUrl/WorkOrder/GetWorkOrderById"; // 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 getServiceReportStatus => "$_baseUrl/Lookups/GetLookup?lookupEnum=521"; // 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
// contacts
static get getPentryContacts => "$_baseUrl/handle/return/all/contacts"; // get
}
}

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

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

@ -113,41 +113,6 @@ class ServiceReport {
}
_map["nurseSignature"] = signatureNurse;
_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;
}

Loading…
Cancel
Save