| Line 10... |
Line 10... |
| 10 |
import java.util.GregorianCalendar;
|
10 |
import java.util.GregorianCalendar;
|
| 11 |
import java.util.HashMap;
|
11 |
import java.util.HashMap;
|
| 12 |
import java.util.LinkedHashMap;
|
12 |
import java.util.LinkedHashMap;
|
| 13 |
import java.util.List;
|
13 |
import java.util.List;
|
| 14 |
import java.util.Map;
|
14 |
import java.util.Map;
|
| 15 |
import java.util.Map.Entry;
|
- |
|
| 16 |
|
15 |
|
| 17 |
import in.shop2020.logistics.DeliveryType;
|
16 |
import in.shop2020.logistics.DeliveryType;
|
| 18 |
import in.shop2020.logistics.LogisticsService.Client;
|
17 |
import in.shop2020.logistics.LogisticsService.Client;
|
| 19 |
import in.shop2020.logistics.LogisticsServiceException;
|
18 |
import in.shop2020.logistics.LogisticsServiceException;
|
| 20 |
import in.shop2020.model.v1.catalog.InventoryServiceException;
|
19 |
import in.shop2020.model.v1.catalog.InventoryServiceException;
|
| Line 189... |
Line 188... |
| 189 |
|
188 |
|
| 190 |
deliveryDays = logisticsClient.getLogisticsEstimation(item.getId(), DEFAULT_PINCODE, DeliveryType.PREPAID).getDeliveryTime();
|
189 |
deliveryDays = logisticsClient.getLogisticsEstimation(item.getId(), DEFAULT_PINCODE, DeliveryType.PREPAID).getDeliveryTime();
|
| 191 |
}catch (LogisticsServiceException e) {
|
190 |
}catch (LogisticsServiceException e) {
|
| 192 |
logger.error("Error while getting estimate of the inventory for item " + item.getId(), e);
|
191 |
logger.error("Error while getting estimate of the inventory for item " + item.getId(), e);
|
| 193 |
}
|
192 |
}
|
| - |
|
193 |
ItemInventory inventory = client.getItemInventoryByItemId(item.getId());
|
| 194 |
RowItem rowItem = new RowItem(item, deliveryDays);
|
194 |
RowItem rowItem = new RowItem(item, deliveryDays, inventory);
|
| 195 |
if(state == status.ACTIVE){
|
195 |
if(state == status.ACTIVE){
|
| 196 |
if(deliveryDays == NEXT_DAY_DELAY)
|
196 |
if(deliveryDays == NEXT_DAY_DELAY)
|
| 197 |
sheetsMap.get(nextDay).add(rowItem);
|
197 |
sheetsMap.get(nextDay).add(rowItem);
|
| 198 |
else
|
198 |
else
|
| 199 |
sheetsMap.get(notNextDay).add(rowItem);
|
199 |
sheetsMap.get(notNextDay).add(rowItem);
|
| Line 366... |
Line 366... |
| 366 |
public long wh5Reserved = 0;
|
366 |
public long wh5Reserved = 0;
|
| 367 |
public long wh7Availability = 0;
|
367 |
public long wh7Availability = 0;
|
| 368 |
public long wh7Reserved = 0;
|
368 |
public long wh7Reserved = 0;
|
| 369 |
public String similarItems = "";
|
369 |
public String similarItems = "";
|
| 370 |
|
370 |
|
| 371 |
public RowItem(Item item, long estimate){
|
371 |
public RowItem(Item item, long estimate, ItemInventory itemInventory){
|
| 372 |
id = item.getId();
|
372 |
id = item.getId();
|
| 373 |
brand = item.getBrand();
|
373 |
brand = item.getBrand();
|
| 374 |
modelNumber = item.getModelNumber();
|
374 |
modelNumber = item.getModelNumber();
|
| 375 |
modelName = item.getModelName();
|
375 |
modelName = item.getModelName();
|
| 376 |
color = item.getColor();
|
376 |
color = item.getColor();
|
| 377 |
deliveryEstimate = estimate;
|
377 |
deliveryEstimate = estimate;
|
| 378 |
totalAvailability = 0;
|
378 |
totalAvailability = 0;
|
| 379 |
ItemInventory itemInventory = item.getItemInventory();
|
- |
|
| 380 |
for(Map.Entry<Long, Long> entry : itemInventory.getAvailability().entrySet()){
|
379 |
for(Map.Entry<Long, Long> entry : itemInventory.getAvailability().entrySet()){
|
| 381 |
long value = entry.getValue();
|
380 |
long value = entry.getValue();
|
| 382 |
switch (entry.getKey().intValue()) {
|
381 |
switch (entry.getKey().intValue()) {
|
| 383 |
case 1:
|
382 |
case 1:
|
| 384 |
wh1Availability = value;
|
383 |
wh1Availability = value;
|