| Line 12... |
Line 12... |
| 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
|
| 16 |
import math
|
16 |
import math
|
| - |
|
17 |
import sys
|
| 17 |
from shop2020.logistics.service.impl.DataService import ServiceableLocationDetails
|
18 |
from shop2020.logistics.service.impl.DataService import ServiceableLocationDetails
|
| 18 |
|
19 |
|
| 19 |
class LogisticsServiceHandler:
|
20 |
class LogisticsServiceHandler:
|
| 20 |
|
21 |
|
| 21 |
def __init__(self, dbname='logistics'):
|
22 |
def __init__(self, dbname='logistics'):
|
| Line 24... |
Line 25... |
| 24 |
config_client = ConfigClient()
|
25 |
config_client = ConfigClient()
|
| 25 |
self.cutoff_time = int(config_client.get_property('delivery_cutoff_time'))
|
26 |
self.cutoff_time = int(config_client.get_property('delivery_cutoff_time'))
|
| 26 |
self.stock_threshold = int(config_client.get_property('inventory_stock_threshold'))
|
27 |
self.stock_threshold = int(config_client.get_property('inventory_stock_threshold'))
|
| 27 |
self.time_to_producre = int(config_client.get_property('inventory_time_to_procure'))
|
28 |
self.time_to_producre = int(config_client.get_property('inventory_time_to_procure'))
|
| 28 |
self.default_pincode = int(config_client.get_property('default_pincode'))
|
29 |
self.default_pincode = int(config_client.get_property('default_pincode'))
|
| 29 |
except:
|
30 |
except Exception as ex:
|
| - |
|
31 |
print "[ERROR] Unexpected config error:", sys.exc_info()[0]
|
| 30 |
self.cutoff_time = 15
|
32 |
self.cutoff_time = 15
|
| 31 |
self.stock_threshold = 2
|
33 |
self.stock_threshold = 2
|
| 32 |
self.time_to_producre = 48
|
34 |
self.time_to_producre = 48
|
| 33 |
self.default_pincode = "110001"
|
35 |
self.default_pincode = "110001"
|
| 34 |
|
36 |
|