Subversion Repositories SmartDukaan

Rev

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

Rev 6537 Rev 6643
Line 12... Line 12...
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, update_pincode, \
16
    get_pickup_store_by_hotspot_id, get_destination_code, update_pincode, \
17
    add_pincode
17
    add_pincode, store_shipment_info
18
from shop2020.thriftpy.logistics.ttypes import LogisticsInfo, \
18
from shop2020.thriftpy.logistics.ttypes import LogisticsInfo, \
19
    LogisticsServiceException, DeliveryType, PickUpType
19
    LogisticsServiceException, DeliveryType, PickUpType
20
from shop2020.thriftpy.model.v1.catalog.ttypes import status
20
from shop2020.thriftpy.model.v1.catalog.ttypes import status
21
import datetime
21
import datetime
22
import math
22
import math
Line 91... Line 91...
91
        try:
91
        try:
92
            return get_empty_AWB(providerId, type)
92
            return get_empty_AWB(providerId, type)
93
        finally:
93
        finally:
94
            close_session()
94
            close_session()
95
            
95
            
96
    def getShipmentInfo(self, awb, providerId):
96
    def getShipmentInfo(self, awbNumber, providerId):
97
        """
97
        """
98
        Parameters:
98
        Parameters:
99
         - awb
99
         - awbNumber
100
         - providerId
100
         - providerId
101
        """
101
        """
102
        try:
102
        try:
103
            awb_updates = get_shipment_info(awb, providerId)
103
            awb_updates = get_shipment_info(awbNumber, providerId)
104
            t_updates = []
104
            t_updates = []
105
            for update in awb_updates:
105
            for update in awb_updates:
106
                t_updates.append(to_t_awbupdate(update))
106
                t_updates.append(to_t_awbupdate(update))
107
            return t_updates
107
            return t_updates
108
        finally:
108
        finally:
109
            close_session()
109
            close_session()
110
    
110
    
-
 
111
    def storeShipmentInfo(self, update):
-
 
112
        """
-
 
113
        Parameters:
-
 
114
         - update
-
 
115
        """
-
 
116
        try:
-
 
117
            store_shipment_info(update)
-
 
118
        finally:
-
 
119
            close_session()
-
 
120
 
-
 
121
    
111
    def getLogisticsEstimation(self, itemId, destination_pin, type):
122
    def getLogisticsEstimation(self, itemId, destination_pin, type):
112
        """
123
        """
113
        Parameters:
124
        Parameters:
114
         - itemId
125
         - itemId
115
         - destination_pin
126
         - destination_pin