| Line 4... |
Line 4... |
| 4 |
@author: ashish
|
4 |
@author: ashish
|
| 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
|
9 |
get_shipment_info, initialize, get_logistics_estimation, get_provider
|
| 10 |
from shop2020.logistics.service.impl.Converters import to_t_awbupdate
|
10 |
from shop2020.logistics.service.impl.Converters import to_t_awbupdate,\
|
| - |
|
11 |
to_t_provider
|
| 11 |
from shop2020.clients.InventoryClient import InventoryClient
|
12 |
from shop2020.clients.InventoryClient import InventoryClient
|
| 12 |
from shop2020.config.client.ConfigClient import ConfigClient
|
13 |
from shop2020.config.client.ConfigClient import ConfigClient
|
| 13 |
import datetime
|
14 |
import datetime
|
| 14 |
import math
|
15 |
import math
|
| 15 |
|
16 |
|
| Line 20... |
Line 21... |
| 20 |
config_client = ConfigClient()
|
21 |
config_client = ConfigClient()
|
| 21 |
self.cutoff_time = int(config_client.get_property('delivery_cutoff_time'))
|
22 |
self.cutoff_time = int(config_client.get_property('delivery_cutoff_time'))
|
| 22 |
self.stock_threshold = int(config_client.get_property('inventory_stock_threshold'))
|
23 |
self.stock_threshold = int(config_client.get_property('inventory_stock_threshold'))
|
| 23 |
self.time_to_producre = int(config_client.get_property('inventory_time_to_procure'))
|
24 |
self.time_to_producre = int(config_client.get_property('inventory_time_to_procure'))
|
| 24 |
|
25 |
|
| - |
|
26 |
def getProvider(self, providerId):
|
| - |
|
27 |
"""
|
| - |
|
28 |
Returns a provider for a given provider ID. Throws an exception if none found.
|
| - |
|
29 |
|
| - |
|
30 |
Parameters:
|
| - |
|
31 |
- providerId
|
| - |
|
32 |
"""
|
| - |
|
33 |
return to_t_provider(get_provider(providerId))
|
| - |
|
34 |
|
| 25 |
def getLogisticsInfo(self, destination_pincode, itemId):
|
35 |
def getLogisticsInfo(self, destination_pincode, itemId):
|
| 26 |
"""
|
36 |
"""
|
| 27 |
Parameters:
|
37 |
Parameters:
|
| 28 |
- destination_pincode
|
38 |
- destination_pincode
|
| 29 |
- sku_id
|
39 |
- sku_id
|