|
@@ -59,7 +59,6 @@ https://wiki.sharix-app.org/doku.php/open/tech/dev/sharix_open_-_primery_json
|
|
"attempts": null
|
|
"attempts": null
|
|
}
|
|
}
|
|
'''
|
|
'''
|
|
-
|
|
|
|
#надо адаптировать класс к новому формату JSON
|
|
#надо адаптировать класс к новому формату JSON
|
|
class Order(object):
|
|
class Order(object):
|
|
def __init__(self, order_synced, ticket, status, title, note, due_date, id_metaservice, is_global, is_visible, service, service_type, status_changed_date, time_placed, time_start=None, time_start_predicted=None, time_finish_predicted=None, time_start_real=None, time_finish_real=None, order_place_type=None, order_place_start=None, order_place_start_gps=None, order_place_start_real=None, order_place_start_real_gps=None, order_place_finish_predicted=None, order_place_finish_predicted_gps=None, order_place_finish_real=None, order_place_finish_real_gps=None, predicted_price=None, real_price=None, payment_transaction_id=None, rating_id=None, provider=None, provider_screen_name=None, receiver=None, receiver_screen_name=None, client_id=None, resource_id=None, attempts=None, asap=None):
|
|
def __init__(self, order_synced, ticket, status, title, note, due_date, id_metaservice, is_global, is_visible, service, service_type, status_changed_date, time_placed, time_start=None, time_start_predicted=None, time_finish_predicted=None, time_start_real=None, time_finish_real=None, order_place_type=None, order_place_start=None, order_place_start_gps=None, order_place_start_real=None, order_place_start_real_gps=None, order_place_finish_predicted=None, order_place_finish_predicted_gps=None, order_place_finish_real=None, order_place_finish_real_gps=None, predicted_price=None, real_price=None, payment_transaction_id=None, rating_id=None, provider=None, provider_screen_name=None, receiver=None, receiver_screen_name=None, client_id=None, resource_id=None, attempts=None, asap=None):
|
|
@@ -151,25 +150,57 @@ class Order(object):
|
|
"type": 1,
|
|
"type": 1,
|
|
"assigned_to": null
|
|
"assigned_to": null
|
|
}
|
|
}
|
|
-'''
|
|
|
|
|
|
+{
|
|
|
|
+ "serviceType": 2,
|
|
|
|
+ "driverSearchEngine": 0,
|
|
|
|
+ "comment": "Yyyy",
|
|
|
|
+ "arrivalTime": "2023-12-07T14:39:54Z",
|
|
|
|
+ "additionalServices": [],
|
|
|
|
+ "tasks": [
|
|
|
|
+ {
|
|
|
|
+ "text": "Eeee",
|
|
|
|
+ "address": "Jjjj"
|
|
|
|
+ }
|
|
|
|
+ ],
|
|
|
|
+ "spendingLimit": 6668,
|
|
|
|
+ "isWithPaymentDocument": true,
|
|
|
|
+ "id": 294830,
|
|
|
|
+ "isProceedBeforeArrival": true
|
|
|
|
+}
|
|
|
|
|
|
|
|
+'''
|
|
class OrderTicket(object):
|
|
class OrderTicket(object):
|
|
- def __init__(self, id, status, created_date, status_changed_date, priority, title=None, note=None, due_date=None, task_list=None, created_by=None, type=None, assigned_to=None):
|
|
|
|
|
|
+ def __init__(self, serviceType, driverSearchEngine, comment, arrivalTime, additionalServices, tasks, spendingLimit, isWithPaymentDocument, id, isProceedBeforeArrival):
|
|
|
|
+ self.serviceType = serviceType
|
|
|
|
+ self.driverSearchEngine = driverSearchEngine
|
|
|
|
+ self.comment = comment
|
|
|
|
+ self.arrivalTime = arrivalTime
|
|
|
|
+ self.additionalServices = additionalServices
|
|
|
|
+ self.tasks = tasks
|
|
|
|
+ self.spendingLimit = spendingLimit
|
|
|
|
+ self.isWithPaymentDocument = isWithPaymentDocument
|
|
self.id = id
|
|
self.id = id
|
|
- self.status = status
|
|
|
|
- self.created_date = created_date
|
|
|
|
- self.status_changed_date = status_changed_date
|
|
|
|
- self.priority = priority
|
|
|
|
- self.title = title
|
|
|
|
- self.note = note
|
|
|
|
- self.due_date = due_date
|
|
|
|
- self.task_list = task_list
|
|
|
|
- self.created_by = created_by
|
|
|
|
- self.type = type
|
|
|
|
- self.assigned_to = assigned_to
|
|
|
|
-
|
|
|
|
- def __str__(self):
|
|
|
|
- return "{0}, {1}, {2}, {3}, {4}, {5}, {6},\n{7}, {8}, {9}, {10}, {11}\n".format(self.id, self.status, self.created_date, self.status_changed_date, self.priority, self.title, self.note, self.due_date, self.task_list, self.created_by, self.type, self.assigned_to)
|
|
|
|
|
|
+ self.isProceedBeforeArrival = isProceedBeforeArrival
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+# class OrderTicketOLD(object):
|
|
|
|
+# def __init__(self, id, status, created_date, status_changed_date, priority, title=None, note=None, due_date=None, task_list=None, created_by=None, type=None, assigned_to=None):
|
|
|
|
+# self.id = id
|
|
|
|
+# self.status = status
|
|
|
|
+# self.created_date = created_date
|
|
|
|
+# self.status_changed_date = status_changed_date
|
|
|
|
+# self.priority = priority
|
|
|
|
+# self.title = title
|
|
|
|
+# self.note = note
|
|
|
|
+# self.due_date = due_date
|
|
|
|
+# self.task_list = task_list
|
|
|
|
+# self.created_by = created_by
|
|
|
|
+# self.type = type
|
|
|
|
+# self.assigned_to = assigned_to
|
|
|
|
+
|
|
|
|
+# def __str__(self):
|
|
|
|
+# return "{0}, {1}, {2}, {3}, {4}, {5}, {6},\n{7}, {8}, {9}, {10}, {11}\n".format(self.id, self.status, self.created_date, self.status_changed_date, self.priority, self.title, self.note, self.due_date, self.task_list, self.created_by, self.type, self.assigned_to)
|
|
|
|
|
|
#Функция преобразования json в объект класса Order
|
|
#Функция преобразования json в объект класса Order
|
|
def jsonToOrder(jsonstring) -> Order:
|
|
def jsonToOrder(jsonstring) -> Order:
|