| Line 269... |
Line 269... |
| 269 |
tVendorMapping = new in.shop2020.model.v1.catalog.VendorItemMapping();
|
269 |
tVendorMapping = new in.shop2020.model.v1.catalog.VendorItemMapping();
|
| 270 |
VendorItemMapping v = e.getValue();
|
270 |
VendorItemMapping v = e.getValue();
|
| 271 |
tVendorMapping.setVendorId(v.getVendorId());
|
271 |
tVendorMapping.setVendorId(v.getVendorId());
|
| 272 |
tVendorMapping.setItemKey(v.getItemKey());
|
272 |
tVendorMapping.setItemKey(v.getItemKey());
|
| 273 |
tVendorMapping.setItemId(item.getId());
|
273 |
tVendorMapping.setItemId(item.getId());
|
| 274 |
tVendorMapping.setVendorCategory(item.getVendorCategory());
|
- |
|
| 275 |
catalogClient.addVendorItemMapping(e.getKey().substring(e.getKey().indexOf(Item.KEY_SEPARATOR)+1), tVendorMapping);
|
274 |
catalogClient.addVendorItemMapping(e.getKey().substring(e.getKey().indexOf(Item.KEY_SEPARATOR)+1), tVendorMapping);
|
| 276 |
logger.info("Updates VendorItemMapping: " + tVendorMapping.toString());
|
275 |
logger.info("Updates VendorItemMapping: " + tVendorMapping.toString());
|
| 277 |
}
|
276 |
}
|
| 278 |
}
|
277 |
}
|
| 279 |
|
278 |
|
| Line 401... |
Line 400... |
| 401 |
tVendorMapping = new in.shop2020.model.v1.catalog.VendorItemMapping();
|
400 |
tVendorMapping = new in.shop2020.model.v1.catalog.VendorItemMapping();
|
| 402 |
VendorItemMapping v = e.getValue();
|
401 |
VendorItemMapping v = e.getValue();
|
| 403 |
tVendorMapping.setVendorId(v.getVendorId());
|
402 |
tVendorMapping.setVendorId(v.getVendorId());
|
| 404 |
tVendorMapping.setItemKey(v.getItemKey());
|
403 |
tVendorMapping.setItemKey(v.getItemKey());
|
| 405 |
tVendorMapping.setItemId(itemId);
|
404 |
tVendorMapping.setItemId(itemId);
|
| 406 |
tVendorMapping.setVendorCategory(item.getVendorCategory());
|
- |
|
| 407 |
catalogClient.addVendorItemMapping(e.getKey().substring(e.getKey().indexOf(Item.KEY_SEPARATOR)+1), tVendorMapping);
|
405 |
catalogClient.addVendorItemMapping(e.getKey().substring(e.getKey().indexOf(Item.KEY_SEPARATOR)+1), tVendorMapping);
|
| 408 |
}
|
406 |
}
|
| 409 |
}
|
407 |
}
|
| 410 |
} catch (Exception e) {
|
408 |
} catch (Exception e) {
|
| 411 |
logger.error("Error while adding an item: ", e);
|
409 |
logger.error("Error while adding an item: ", e);
|
| Line 486... |
Line 484... |
| 486 |
if(item.getRetireDate() != null) {
|
484 |
if(item.getRetireDate() != null) {
|
| 487 |
tItem.setRetireDate(item.getRetireDate());
|
485 |
tItem.setRetireDate(item.getRetireDate());
|
| 488 |
}
|
486 |
}
|
| 489 |
|
487 |
|
| 490 |
tItem.setUpdatedOn(Calendar.getInstance().getTimeInMillis());
|
488 |
tItem.setUpdatedOn(Calendar.getInstance().getTimeInMillis());
|
| 491 |
|
- |
|
| 492 |
tItem.setHotspotCategory(item.getVendorCategory());
|
- |
|
| 493 |
}
|
489 |
}
|
| 494 |
|
490 |
|
| 495 |
@Override
|
491 |
@Override
|
| 496 |
public void pauseItem(long itemId) {
|
492 |
public void pauseItem(long itemId) {
|
| 497 |
try {
|
493 |
try {
|
| Line 570... |
Line 566... |
| 570 |
return true;
|
566 |
return true;
|
| 571 |
}
|
567 |
}
|
| 572 |
|
568 |
|
| 573 |
|
569 |
|
| 574 |
/**
|
570 |
/**
|
| 575 |
* Retuns list of Items filtered by Vendor category (column is hotspotCategory in catalog.item table)
|
571 |
* Retuns list of Items filtered by category (column is product_group in catalog.item table)
|
| 576 |
* This list is used to generate master sheet (excel sheet)
|
572 |
* This list is used to generate master sheet (excel sheet)
|
| 577 |
* @param category
|
573 |
* @param category
|
| 578 |
* @return
|
574 |
* @return
|
| 579 |
*/
|
575 |
*/
|
| 580 |
public List<Item> getItemsByVendorCategory(String category) {
|
576 |
public List<Item> getItemsByCategory(String category) {
|
| 581 |
List<Item> itemList = new ArrayList<Item>();
|
577 |
List<Item> itemList = new ArrayList<Item>();
|
| 582 |
try {
|
578 |
try {
|
| 583 |
CatalogClient catalogServiceClient = new CatalogClient();
|
579 |
CatalogClient catalogServiceClient = new CatalogClient();
|
| 584 |
InventoryService.Client catalogClient = catalogServiceClient.getClient();
|
580 |
InventoryService.Client catalogClient = catalogServiceClient.getClient();
|
| 585 |
|
581 |
|
| 586 |
List<in.shop2020.model.v1.catalog.Item> thriftItems = catalogClient.getItemsByVendorCategory(category);
|
582 |
List<in.shop2020.model.v1.catalog.Item> thriftItems = catalogClient.getItemsByCategory(category);
|
| 587 |
|
583 |
|
| 588 |
for(in.shop2020.model.v1.catalog.Item thriftItem : thriftItems) {
|
584 |
for(in.shop2020.model.v1.catalog.Item thriftItem : thriftItems) {
|
| 589 |
List<in.shop2020.model.v1.catalog.VendorItemPricing> vip = catalogClient.getAllItemPricing(thriftItem.getId());
|
585 |
List<in.shop2020.model.v1.catalog.VendorItemPricing> vip = catalogClient.getAllItemPricing(thriftItem.getId());
|
| 590 |
List<in.shop2020.model.v1.catalog.VendorItemMapping> vim = catalogClient.getVendorItemMappings(thriftItem.getId());
|
586 |
List<in.shop2020.model.v1.catalog.VendorItemMapping> vim = catalogClient.getVendorItemMappings(thriftItem.getId());
|
| 591 |
List<in.shop2020.model.v1.catalog.SourceItemPricing> sip = catalogClient.getAllSourcePricing(thriftItem.getId());
|
587 |
List<in.shop2020.model.v1.catalog.SourceItemPricing> sip = catalogClient.getAllSourcePricing(thriftItem.getId());
|
| 592 |
itemList.add(getItemFromThriftItem(thriftItem, vip, vim, sip, null));
|
588 |
itemList.add(getItemFromThriftItem(thriftItem, vip, vim, sip, null));
|
| 593 |
}
|
589 |
}
|
| 594 |
} catch (Exception e) {
|
590 |
} catch (Exception e) {
|
| 595 |
logger.error("Error while getting items by vendor category: " + category, e);
|
591 |
logger.error("Error while getting items by category: " + category, e);
|
| 596 |
}
|
592 |
}
|
| 597 |
Collections.sort(itemList, new ItemsComparator());
|
593 |
Collections.sort(itemList, new ItemsComparator());
|
| 598 |
return itemList;
|
594 |
return itemList;
|
| 599 |
}
|
595 |
}
|
| 600 |
|
596 |
|
| Line 795... |
Line 791... |
| 795 |
else {
|
791 |
else {
|
| 796 |
itemInventoryMap = null;
|
792 |
itemInventoryMap = null;
|
| 797 |
}
|
793 |
}
|
| 798 |
|
794 |
|
| 799 |
Item item = new Item(thriftItem.getId(),
|
795 |
Item item = new Item(thriftItem.getId(),
|
| 800 |
thriftItem.getHotspotCategory(),
|
- |
|
| 801 |
thriftItem.getProductGroup(),
|
796 |
thriftItem.getProductGroup(),
|
| 802 |
thriftItem.getBrand(),
|
797 |
thriftItem.getBrand(),
|
| 803 |
thriftItem.getModelNumber(),
|
798 |
thriftItem.getModelNumber(),
|
| 804 |
thriftItem.getModelName(),
|
799 |
thriftItem.getModelName(),
|
| 805 |
thriftItem.getColor(),
|
800 |
thriftItem.getColor(),
|