Subversion Repositories SmartDukaan

Rev

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

Rev 746 Rev 766
Line 5... Line 5...
5
'''
5
'''
6
from shop2020.thriftpy.logistics.ttypes import LogisticsInfo,\
6
from shop2020.thriftpy.logistics.ttypes import LogisticsInfo,\
7
    LogisticsServiceException
7
    LogisticsServiceException
8
from shop2020.logistics.service.impl.DataAccessor import get_empty_AWB,\
8
from shop2020.logistics.service.impl.DataAccessor import get_empty_AWB,\
9
    get_shipment_info, initialize, get_logistics_estimation, get_provider,\
9
    get_shipment_info, initialize, get_logistics_estimation, get_provider,\
10
    get_providers
10
    get_providers, close_session
11
from shop2020.logistics.service.impl.Converters import to_t_awbupdate,\
11
from shop2020.logistics.service.impl.Converters import to_t_awbupdate,\
12
    to_t_provider
12
    to_t_provider
13
from shop2020.clients.InventoryClient import InventoryClient
13
from shop2020.clients.InventoryClient import InventoryClient
14
from shop2020.config.client.ConfigClient import ConfigClient
14
from shop2020.config.client.ConfigClient import ConfigClient
15
import datetime
15
import datetime
Line 64... Line 64...
64
 
64
 
65
    def getShipmentInfo(self, awb, providerId):
65
    def getShipmentInfo(self, awb, providerId):
66
        """
66
        """
67
        Parameters:
67
        Parameters:
68
         - awb
68
         - awb
-
 
69
         - providerId
69
        """
70
        """
70
        awb_updates = get_shipment_info(awb, providerId)
71
        awb_updates = get_shipment_info(awb, providerId)
71
        t_updates = []
72
        t_updates = []
72
        for update in awb_updates:
73
        for update in awb_updates:
73
            t_updates.append(to_t_awbupdate(update))
74
            t_updates.append(to_t_awbupdate(update))
Line 111... Line 112...
111
        """
112
        """
112
        sld = ServiceableLocationDetails.get_by(provider_id = providerId, dest_pincode = pinCode)
113
        sld = ServiceableLocationDetails.get_by(provider_id = providerId, dest_pincode = pinCode)
113
        if sld != None:
114
        if sld != None:
114
            return sld.dest_code
115
            return sld.dest_code
115
        else:
116
        else:
116
            raise LogisticsServiceException(101, "The pincode " + pinCode + " is not serviced by this provider: " + str(providerId))
-
 
117
117
            raise LogisticsServiceException(101, "The pincode " + pinCode + " is not serviced by this provider: " + str(providerId))
-
 
118
     
-
 
119
    def closeSession(self, ):
-
 
120
        close_session()
-
 
121