| Line 62... |
Line 62... |
| 62 |
Client logisticsClient = logisticsServiceClient.getClient();
|
62 |
Client logisticsClient = logisticsServiceClient.getClient();
|
| 63 |
LogisticsInfo logistincInfo = logisticsClient.getLogisticsEstimationForStore(itemId, pin, DeliveryType.COD);
|
63 |
LogisticsInfo logistincInfo = logisticsClient.getLogisticsEstimationForStore(itemId, pin, DeliveryType.COD);
|
| 64 |
date = logistincInfo.getDeliveryTime();
|
64 |
date = logistincInfo.getDeliveryTime();
|
| 65 |
isCODAvailable = logistincInfo.isCodAllowed();
|
65 |
isCODAvailable = logistincInfo.isCodAllowed();
|
| 66 |
isOTGAvailable = logistincInfo.isOtgAvailable();
|
66 |
isOTGAvailable = logistincInfo.isOtgAvailable();
|
| - |
|
67 |
//We are using providerId field of logistics info to get minAdvance
|
| - |
|
68 |
minAdvanceAmount = logistincInfo.getProviderId();
|
| - |
|
69 |
} catch (Exception e) {
|
| - |
|
70 |
date = -1;
|
| - |
|
71 |
isCODAvailable = false;
|
| - |
|
72 |
log.error("Unable to get estimate/COD availability for " + itemId, e);
|
| - |
|
73 |
}
|
| - |
|
74 |
|
| - |
|
75 |
try {
|
| 67 |
catalogServiceClient = new CatalogClient();
|
76 |
catalogServiceClient = new CatalogClient();
|
| 68 |
ItemShippingInfo info = catalogServiceClient.getClient().isActive(itemId);
|
77 |
ItemShippingInfo info = catalogServiceClient.getClient().isActive(itemId);
|
| 69 |
isActive = info.isIsActive();
|
78 |
isActive = info.isIsActive();
|
| 70 |
activeOnStore = catalogServiceClient.getClient().getItem(itemId).isActiveOnStore();
|
79 |
activeOnStore = catalogServiceClient.getClient().getItem(itemId).isActiveOnStore();
|
| 71 |
sp = catalogServiceClient.getClient().getStorePricing(itemId);
|
80 |
sp = catalogServiceClient.getClient().getStorePricing(itemId);
|
| 72 |
sellingPrice = sp.getRecommendedPrice();
|
81 |
sellingPrice = sp.getRecommendedPrice();
|
| 73 |
minAdvanceAmount = logistincInfo.getProviderId();
|
- |
|
| 74 |
maxSellingPrice = sp.getMaxPrice();
|
82 |
maxSellingPrice = sp.getMaxPrice();
|
| 75 |
minSellingPrice = sp.getMinPrice();
|
83 |
minSellingPrice = sp.getMinPrice();
|
| 76 |
|
- |
|
| 77 |
} catch (Exception e) {
|
84 |
} catch (Exception e) {
|
| 78 |
date = -1;
|
- |
|
| 79 |
isCODAvailable = false;
|
- |
|
| 80 |
log.error("Unable to get estimate/COD availability for " + itemId, e);
|
85 |
log.error("Unable to get store pricing for " + itemId, e);
|
| 81 |
}
|
86 |
}
|
| - |
|
87 |
|
| 82 |
SimpleDateFormat dateformat = new SimpleDateFormat("dd MMMM yyyy");
|
88 |
SimpleDateFormat dateformat = new SimpleDateFormat("dd MMMM yyyy");
|
| 83 |
|
89 |
|
| 84 |
response.put("delivery_estimate", dateformat.format(new Date(date)));
|
90 |
response.put("delivery_estimate", dateformat.format(new Date(date)));
|
| 85 |
response.put("is_cod_available_for_location", Boolean.toString(isCODAvailable));
|
91 |
response.put("is_cod_available_for_location", Boolean.toString(isCODAvailable));
|
| 86 |
response.put("on_time_guarantee", Boolean.toString(isOTGAvailable));
|
92 |
response.put("on_time_guarantee", Boolean.toString(isOTGAvailable));
|