| Line 11... |
Line 11... |
| 11 |
to_t_provider, to_t_pickup_store
|
11 |
to_t_provider, to_t_pickup_store
|
| 12 |
from shop2020.logistics.service.impl.DataAccessor import get_empty_AWB, \
|
12 |
from shop2020.logistics.service.impl.DataAccessor import get_empty_AWB, \
|
| 13 |
get_shipment_info, initialize, get_logistics_estimation, get_provider, \
|
13 |
get_shipment_info, initialize, get_logistics_estimation, get_provider, \
|
| 14 |
get_providers, close_session, get_free_awb_count, get_holidays, is_alive, \
|
14 |
get_providers, close_session, get_free_awb_count, get_holidays, is_alive, \
|
| 15 |
get_provider_for_pickup_type, get_pickup_store, get_all_pickup_stores, \
|
15 |
get_provider_for_pickup_type, get_pickup_store, get_all_pickup_stores, \
|
| 16 |
get_pickup_store_by_hotspot_id, get_destination_code
|
16 |
get_pickup_store_by_hotspot_id, get_destination_code, update_pincode, \
|
| - |
|
17 |
add_pincode
|
| 17 |
from shop2020.thriftpy.logistics.ttypes import LogisticsInfo, \
|
18 |
from shop2020.thriftpy.logistics.ttypes import LogisticsInfo, \
|
| 18 |
LogisticsServiceException, DeliveryType, PickUpType
|
19 |
LogisticsServiceException, DeliveryType, PickUpType
|
| 19 |
from shop2020.thriftpy.model.v1.catalog.ttypes import status
|
20 |
from shop2020.thriftpy.model.v1.catalog.ttypes import status
|
| 20 |
import datetime
|
21 |
import datetime
|
| 21 |
import math
|
22 |
import math
|
| 22 |
import sys
|
23 |
import sys
|
| - |
|
24 |
from shop2020.logistics.service.impl.DataService import ServiceableLocationDetails
|
| 23 |
|
25 |
|
| 24 |
class LogisticsServiceHandler:
|
26 |
class LogisticsServiceHandler:
|
| 25 |
|
27 |
|
| 26 |
def __init__(self, dbname='logistics', db_hostname='localhost'):
|
28 |
def __init__(self, dbname='logistics', db_hostname='localhost'):
|
| 27 |
initialize(dbname, db_hostname)
|
29 |
initialize(dbname, db_hostname)
|
| Line 314... |
Line 316... |
| 314 |
"""
|
316 |
"""
|
| 315 |
try:
|
317 |
try:
|
| 316 |
storeToReturn = to_t_pickup_store(get_pickup_store_by_hotspot_id(hotspotId))
|
318 |
storeToReturn = to_t_pickup_store(get_pickup_store_by_hotspot_id(hotspotId))
|
| 317 |
return storeToReturn
|
319 |
return storeToReturn
|
| 318 |
finally:
|
320 |
finally:
|
| - |
|
321 |
close_session()
|
| - |
|
322 |
def addPincode(self, providerId, pincode, destCode, exp, cod, stationType):
|
| - |
|
323 |
try:
|
| - |
|
324 |
add_pincode(providerId, pincode, destCode, exp, cod, stationType)
|
| - |
|
325 |
finally:
|
| - |
|
326 |
close_session()
|
| - |
|
327 |
def updatePincode(self, providerId, pincode, exp, cod):
|
| - |
|
328 |
try:
|
| - |
|
329 |
update_pincode(providerId, pincode, exp, cod)
|
| - |
|
330 |
finally:
|
| 319 |
close_session()
|
331 |
close_session()
|
| 320 |
|
332 |
|