Subversion Repositories SmartDukaan

Rev

Rev 477 | Rev 494 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 477 Rev 483
Line 1... Line 1...
1
'''
1
'''
2
Created on 05-Aug-2010
2
Created on 05-Aug-2010
3
 
3
 
4
@author: ashish
4
@author: ashish
5
'''
5
'''
6
from shop2020.thriftpy.logistics.ttypes import Shipment
6
from shop2020.thriftpy.logistics.ttypes import Shipment, LogisticsInfo
7
from shop2020.logistics.service.impl.DataAccessor import add_empty_AWBs, get_empty_AWB,\
7
from shop2020.logistics.service.impl.DataAccessor import add_empty_AWBs, get_empty_AWB,\
8
    get_provider, get_shipment_info, get_shipments, get_todays_shipments, initialize,\
8
    get_provider, get_shipment_info, get_shipments, get_todays_shipments, initialize,\
9
    get_providers, create_shipment, update_shipment_status, get_logistics_estimation, add_delivery_estimate,\
9
    get_providers, create_shipment, update_shipment_status, get_logistics_estimation, add_delivery_estimate,\
10
    add_pincode_warehouse_mapping
10
    add_pincode_warehouse_mapping, get_logistics_info
11
from shop2020.logistics.service.impl.Converters import to_t_provider,\
11
from shop2020.logistics.service.impl.Converters import to_t_provider,\
12
    to_t_shipment, to_t_shipmentstatusinfo, to_t_shipmentupdate, to_t_itemLogistics
12
    to_t_shipment, to_t_shipmentstatusinfo, to_t_shipmentupdate, to_t_itemLogistics
13
 
13
 
14
from shop2020.utils.Utils import log_entry, to_py_date
14
from shop2020.utils.Utils import log_entry, to_py_date
15
 
15
 
16
class LogisticsServiceHandler:
16
class LogisticsServiceHandler:
17
    
17
    
18
    def __init__(self):
18
    def __init__(self):
19
        initialize()
19
        initialize()
-
 
20
 
-
 
21
    def getLogisticsInfo(self, destination_pincode, sku_id):
20
        
22
        """
-
 
23
        Parameters:
-
 
24
         - destination_pincode
-
 
25
         - sku_id
-
 
26
        """
-
 
27
        warehouse_id, provider_id, airway_billno, delivery_time = get_logistics_info(destination_pincode, sku_id)
-
 
28
        logistics_info = LogisticsInfo()
-
 
29
        logistics_info.airway_billno = airway_billno
-
 
30
        logistics_info.warehouse_id = warehouse_id
-
 
31
        logistics_info.delivery_estimate = delivery_time
-
 
32
        logistics_info.provider_id = provider_id
-
 
33
        return logistics_info
-
 
34
    
21
    def addEmptyAWBs(self, numbers, provider_id):
35
    def addEmptyAWBs(self, numbers, provider_id):
22
        """
36
        """
23
        Parameters:
37
        Parameters:
24
         - numbers
38
         - numbers
25
         - provider_id
39
         - provider_id