| Line 15... |
Line 15... |
| 15 |
import in.shop2020.content.ContentServiceException;
|
15 |
import in.shop2020.content.ContentServiceException;
|
| 16 |
import in.shop2020.model.v1.catalog.CatalogService.Client;
|
16 |
import in.shop2020.model.v1.catalog.CatalogService.Client;
|
| 17 |
import in.shop2020.model.v1.catalog.ItemType;
|
17 |
import in.shop2020.model.v1.catalog.ItemType;
|
| 18 |
import in.shop2020.model.v1.catalog.status;
|
18 |
import in.shop2020.model.v1.catalog.status;
|
| 19 |
import in.shop2020.model.v1.inventory.InventoryService;
|
19 |
import in.shop2020.model.v1.inventory.InventoryService;
|
| - |
|
20 |
import in.shop2020.model.v1.inventory.ItemStockPurchaseParams;
|
| 20 |
import in.shop2020.model.v1.user.VoucherType;
|
21 |
import in.shop2020.model.v1.user.VoucherType;
|
| 21 |
import in.shop2020.thrift.clients.CatalogClient;
|
22 |
import in.shop2020.thrift.clients.CatalogClient;
|
| 22 |
import in.shop2020.thrift.clients.ContentClient;
|
23 |
import in.shop2020.thrift.clients.ContentClient;
|
| 23 |
import in.shop2020.thrift.clients.InventoryClient;
|
24 |
import in.shop2020.thrift.clients.InventoryClient;
|
| 24 |
import in.shop2020.thrift.clients.config.ConfigClient;
|
25 |
import in.shop2020.thrift.clients.config.ConfigClient;
|
| Line 98... |
Line 99... |
| 98 |
Client catalogClient = catalogServiceClient.getClient();
|
99 |
Client catalogClient = catalogServiceClient.getClient();
|
| 99 |
|
100 |
|
| 100 |
List<in.shop2020.model.v1.catalog.Item> thriftItems = catalogClient.getAllIgnoredInventoryUpdateItemsList(offset, limit);
|
101 |
List<in.shop2020.model.v1.catalog.Item> thriftItems = catalogClient.getAllIgnoredInventoryUpdateItemsList(offset, limit);
|
| 101 |
|
102 |
|
| 102 |
for(in.shop2020.model.v1.catalog.Item thriftItem : thriftItems) {
|
103 |
for(in.shop2020.model.v1.catalog.Item thriftItem : thriftItems) {
|
| 103 |
itemList.add(getItemFromThriftItem(thriftItem, null, null, null, null, null, null));
|
104 |
itemList.add(getItemFromThriftItem(thriftItem, null, null, null, null, null, null, null));
|
| 104 |
}
|
105 |
}
|
| 105 |
} catch (Exception e) {
|
106 |
} catch (Exception e) {
|
| 106 |
logger.error("Error while getting all items from the catalog service", e);
|
107 |
logger.error("Error while getting all items from the catalog service", e);
|
| 107 |
}
|
108 |
}
|
| 108 |
return itemList;
|
109 |
return itemList;
|
| Line 132... |
Line 133... |
| 132 |
Client catalogClient = catalogServiceClient.getClient();
|
133 |
Client catalogClient = catalogServiceClient.getClient();
|
| 133 |
|
134 |
|
| 134 |
List<in.shop2020.model.v1.catalog.Item> thriftItems = catalogClient.getAllItemsInRange(start, limit);
|
135 |
List<in.shop2020.model.v1.catalog.Item> thriftItems = catalogClient.getAllItemsInRange(start, limit);
|
| 135 |
|
136 |
|
| 136 |
for(in.shop2020.model.v1.catalog.Item thriftItem : thriftItems) {
|
137 |
for(in.shop2020.model.v1.catalog.Item thriftItem : thriftItems) {
|
| 137 |
itemList.add(getItemFromThriftItem(thriftItem, null, null, null, null, null, null));
|
138 |
itemList.add(getItemFromThriftItem(thriftItem, null, null, null, null, null, null, null));
|
| 138 |
}
|
139 |
}
|
| 139 |
} catch (Exception e) {
|
140 |
} catch (Exception e) {
|
| 140 |
logger.error("Error while getting all items from the catalog service", e);
|
141 |
logger.error("Error while getting all items from the catalog service", e);
|
| 141 |
}
|
142 |
}
|
| 142 |
return itemList;
|
143 |
return itemList;
|
| Line 172... |
Line 173... |
| 172 |
CatalogClient catalogServiceClient = new CatalogClient();
|
173 |
CatalogClient catalogServiceClient = new CatalogClient();
|
| 173 |
Client catalogClient = catalogServiceClient.getClient();
|
174 |
Client catalogClient = catalogServiceClient.getClient();
|
| 174 |
|
175 |
|
| 175 |
List<in.shop2020.model.v1.catalog.Item> thriftItems = catalogClient.getBestDeals();
|
176 |
List<in.shop2020.model.v1.catalog.Item> thriftItems = catalogClient.getBestDeals();
|
| 176 |
for(in.shop2020.model.v1.catalog.Item thriftItem : thriftItems) {
|
177 |
for(in.shop2020.model.v1.catalog.Item thriftItem : thriftItems) {
|
| 177 |
itemList.add(getItemFromThriftItem(thriftItem, null, null, null, null, null, null));
|
178 |
itemList.add(getItemFromThriftItem(thriftItem, null, null, null, null, null, null, null));
|
| 178 |
}
|
179 |
}
|
| 179 |
} catch(Exception e){
|
180 |
} catch(Exception e){
|
| 180 |
logger.error("Error while getting the best deals from the catalog service", e);
|
181 |
logger.error("Error while getting the best deals from the catalog service", e);
|
| 181 |
}
|
182 |
}
|
| 182 |
//Collections.sort(itemList, new ItemsComparator());
|
183 |
//Collections.sort(itemList, new ItemsComparator());
|
| Line 190... |
Line 191... |
| 190 |
CatalogClient catalogServiceClient = new CatalogClient();
|
191 |
CatalogClient catalogServiceClient = new CatalogClient();
|
| 191 |
Client catalogClient = catalogServiceClient.getClient();
|
192 |
Client catalogClient = catalogServiceClient.getClient();
|
| 192 |
|
193 |
|
| 193 |
List<in.shop2020.model.v1.catalog.Item> thriftItems = catalogClient.getItemsByRiskyFlag();
|
194 |
List<in.shop2020.model.v1.catalog.Item> thriftItems = catalogClient.getItemsByRiskyFlag();
|
| 194 |
for(in.shop2020.model.v1.catalog.Item thriftItem : thriftItems) {
|
195 |
for(in.shop2020.model.v1.catalog.Item thriftItem : thriftItems) {
|
| 195 |
itemList.add(getItemFromThriftItem(thriftItem, null, null, null, null, null, null));
|
196 |
itemList.add(getItemFromThriftItem(thriftItem, null, null, null, null, null, null, null));
|
| 196 |
}
|
197 |
}
|
| 197 |
} catch(Exception e){
|
198 |
} catch(Exception e){
|
| 198 |
logger.error("Error while getting the risky items from the catalog service", e);
|
199 |
logger.error("Error while getting the risky items from the catalog service", e);
|
| 199 |
}
|
200 |
}
|
| 200 |
Collections.sort(itemList, new ItemsComparator());
|
201 |
Collections.sort(itemList, new ItemsComparator());
|
| Line 208... |
Line 209... |
| 208 |
CatalogClient catalogServiceClient = new CatalogClient();
|
209 |
CatalogClient catalogServiceClient = new CatalogClient();
|
| 209 |
Client catalogClient = catalogServiceClient.getClient();
|
210 |
Client catalogClient = catalogServiceClient.getClient();
|
| 210 |
|
211 |
|
| 211 |
List<in.shop2020.model.v1.catalog.Item> thriftItems = catalogClient.getBestSellers();
|
212 |
List<in.shop2020.model.v1.catalog.Item> thriftItems = catalogClient.getBestSellers();
|
| 212 |
for(in.shop2020.model.v1.catalog.Item thriftItem : thriftItems) {
|
213 |
for(in.shop2020.model.v1.catalog.Item thriftItem : thriftItems) {
|
| 213 |
itemList.add(getItemFromThriftItem(thriftItem, null, null, null, null, null, null));
|
214 |
itemList.add(getItemFromThriftItem(thriftItem, null, null, null, null, null, null, null));
|
| 214 |
}
|
215 |
}
|
| 215 |
} catch(Exception e){
|
216 |
} catch(Exception e){
|
| 216 |
logger.error("Error while getting the best sellers from the catalog service", e);
|
217 |
logger.error("Error while getting the best sellers from the catalog service", e);
|
| 217 |
}
|
218 |
}
|
| 218 |
return itemList;
|
219 |
return itemList;
|
| Line 254... |
Line 255... |
| 254 |
Client catalogClient = catalogServiceClient.getClient();
|
255 |
Client catalogClient = catalogServiceClient.getClient();
|
| 255 |
|
256 |
|
| 256 |
List<in.shop2020.model.v1.catalog.Item> thriftItems = catalogClient.getLatestArrivals();
|
257 |
List<in.shop2020.model.v1.catalog.Item> thriftItems = catalogClient.getLatestArrivals();
|
| 257 |
for(in.shop2020.model.v1.catalog.Item thriftItem : thriftItems) {
|
258 |
for(in.shop2020.model.v1.catalog.Item thriftItem : thriftItems) {
|
| 258 |
//List<in.shop2020.model.v1.inventory.VendorItemPricing> vip = catalogClient.getAllItemPricing(thriftItem.getId());
|
259 |
//List<in.shop2020.model.v1.inventory.VendorItemPricing> vip = catalogClient.getAllItemPricing(thriftItem.getId());
|
| 259 |
itemList.add(getItemFromThriftItem(thriftItem, null, null, null, null, null, null));
|
260 |
itemList.add(getItemFromThriftItem(thriftItem, null, null, null, null, null, null, null));
|
| 260 |
}
|
261 |
}
|
| 261 |
} catch(Exception e){
|
262 |
} catch(Exception e){
|
| 262 |
logger.error("Error while getting the latest arrivals from the catalog service", e);
|
263 |
logger.error("Error while getting the latest arrivals from the catalog service", e);
|
| 263 |
}
|
264 |
}
|
| 264 |
return itemList;
|
265 |
return itemList;
|
| Line 272... |
Line 273... |
| 272 |
CatalogClient catalogServiceClient = new CatalogClient();
|
273 |
CatalogClient catalogServiceClient = new CatalogClient();
|
| 273 |
Client catalogClient = catalogServiceClient.getClient();
|
274 |
Client catalogClient = catalogServiceClient.getClient();
|
| 274 |
|
275 |
|
| 275 |
List<in.shop2020.model.v1.catalog.Item> thriftItems = catalogClient.searchItemsInRange(searchTerms, start, limit);
|
276 |
List<in.shop2020.model.v1.catalog.Item> thriftItems = catalogClient.searchItemsInRange(searchTerms, start, limit);
|
| 276 |
for(in.shop2020.model.v1.catalog.Item thriftItem : thriftItems) {
|
277 |
for(in.shop2020.model.v1.catalog.Item thriftItem : thriftItems) {
|
| 277 |
itemList.add(getItemFromThriftItem(thriftItem, null, null, null, null, null, null));
|
278 |
itemList.add(getItemFromThriftItem(thriftItem, null, null, null, null, null, null, null));
|
| 278 |
}
|
279 |
}
|
| 279 |
} catch(Exception e){
|
280 |
} catch(Exception e){
|
| 280 |
logger.error("Error while getting the search results from the catalog service", e);
|
281 |
logger.error("Error while getting the search results from the catalog service", e);
|
| 281 |
}
|
282 |
}
|
| 282 |
return itemList;
|
283 |
return itemList;
|
| Line 318... |
Line 319... |
| 318 |
List<in.shop2020.model.v1.inventory.VendorItemPricing> vip = inventoryClient.getAllItemPricing(thriftItem.getId());
|
319 |
List<in.shop2020.model.v1.inventory.VendorItemPricing> vip = inventoryClient.getAllItemPricing(thriftItem.getId());
|
| 319 |
List<in.shop2020.model.v1.inventory.VendorItemMapping> vim = inventoryClient.getVendorItemMappings(thriftItem.getId());
|
320 |
List<in.shop2020.model.v1.inventory.VendorItemMapping> vim = inventoryClient.getVendorItemMappings(thriftItem.getId());
|
| 320 |
List<in.shop2020.model.v1.catalog.SourceItemPricing> sip = catalogClient.getAllSourcePricing(thriftItem.getId());
|
321 |
List<in.shop2020.model.v1.catalog.SourceItemPricing> sip = catalogClient.getAllSourcePricing(thriftItem.getId());
|
| 321 |
List<in.shop2020.model.v1.catalog.Item> sit = catalogClient.getAllSimilarItems(thriftItem.getId());
|
322 |
List<in.shop2020.model.v1.catalog.Item> sit = catalogClient.getAllSimilarItems(thriftItem.getId());
|
| 322 |
in.shop2020.model.v1.inventory.ItemInventory itemInventory = inventoryClient.getItemInventoryByItemId(thriftItem.getId());
|
323 |
in.shop2020.model.v1.inventory.ItemInventory itemInventory = inventoryClient.getItemInventoryByItemId(thriftItem.getId());
|
| - |
|
324 |
ItemStockPurchaseParams stockPurchaseParams = inventoryClient.getItemStockPurchaseParams(thriftItem.getId());
|
| 323 |
List<in.shop2020.model.v1.catalog.VoucherItemMapping> tvouchers = catalogClient.getAllItemVouchers(thriftItem.getId());
|
325 |
List<in.shop2020.model.v1.catalog.VoucherItemMapping> tvouchers = catalogClient.getAllItemVouchers(thriftItem.getId());
|
| 324 |
Item it = getItemFromThriftItem(thriftItem, vip, vim, sip, sit, itemInventory, tvouchers);
|
326 |
Item it = getItemFromThriftItem(thriftItem, vip, vim, sip, sit, itemInventory, tvouchers, stockPurchaseParams);
|
| 325 |
it.setSameItemsWithDifferentColors(sameItemsWithDifferentColors);
|
327 |
it.setSameItemsWithDifferentColors(sameItemsWithDifferentColors);
|
| 326 |
return it;
|
328 |
return it;
|
| 327 |
}catch(Exception e){
|
329 |
}catch(Exception e){
|
| 328 |
logger.error("Error while getting the item from the catalog service", e);
|
330 |
logger.error("Error while getting the item from the catalog service", e);
|
| 329 |
}
|
331 |
}
|
| Line 362... |
Line 364... |
| 362 |
inventoryClient.addVendorItemMapping(e.getKey().substring(e.getKey().indexOf(Item.KEY_SEPARATOR)+1), tVendorMapping);
|
364 |
inventoryClient.addVendorItemMapping(e.getKey().substring(e.getKey().indexOf(Item.KEY_SEPARATOR)+1), tVendorMapping);
|
| 363 |
logger.info("Updates VendorItemMapping: " + tVendorMapping.toString());
|
365 |
logger.info("Updates VendorItemMapping: " + tVendorMapping.toString());
|
| 364 |
}
|
366 |
}
|
| 365 |
}
|
367 |
}
|
| 366 |
|
368 |
|
| - |
|
369 |
if(item.getMinStockLevel()!=0 || item.getNumOfDaysStock()!=0) {
|
| - |
|
370 |
inventoryClient.updateItemStockPurchaseParams(item.getId(), item.getNumOfDaysStock(),
|
| - |
|
371 |
item.getMinStockLevel());
|
| - |
|
372 |
}
|
| - |
|
373 |
|
| 367 |
Map<Long, VendorPricings> vendorPricings = item.getVendorPricesMap();
|
374 |
Map<Long, VendorPricings> vendorPricings = item.getVendorPricesMap();
|
| 368 |
if(vendorPricings != null && !vendorPricings.isEmpty()) {
|
375 |
if(vendorPricings != null && !vendorPricings.isEmpty()) {
|
| 369 |
in.shop2020.model.v1.inventory.VendorItemPricing tVendorPricing;
|
376 |
in.shop2020.model.v1.inventory.VendorItemPricing tVendorPricing;
|
| 370 |
for(VendorPricings v : vendorPricings.values()) {
|
377 |
for(VendorPricings v : vendorPricings.values()) {
|
| 371 |
tVendorPricing = new in.shop2020.model.v1.inventory.VendorItemPricing();
|
378 |
tVendorPricing = new in.shop2020.model.v1.inventory.VendorItemPricing();
|
| Line 551... |
Line 558... |
| 551 |
tVendorMapping.setItemKey(v.getItemKey());
|
558 |
tVendorMapping.setItemKey(v.getItemKey());
|
| 552 |
tVendorMapping.setItemId(itemId);
|
559 |
tVendorMapping.setItemId(itemId);
|
| 553 |
inventoryClient.addVendorItemMapping(e.getKey().substring(e.getKey().indexOf(Item.KEY_SEPARATOR)+1), tVendorMapping);
|
560 |
inventoryClient.addVendorItemMapping(e.getKey().substring(e.getKey().indexOf(Item.KEY_SEPARATOR)+1), tVendorMapping);
|
| 554 |
}
|
561 |
}
|
| 555 |
}
|
562 |
}
|
| - |
|
563 |
|
| - |
|
564 |
inventoryClient.updateItemStockPurchaseParams(itemId, item.getNumOfDaysStock(),
|
| - |
|
565 |
item.getMinStockLevel());
|
| 556 |
} catch (Exception e) {
|
566 |
} catch (Exception e) {
|
| 557 |
logger.error("Error while adding an item: ", e);
|
567 |
logger.error("Error while adding an item: ", e);
|
| 558 |
}
|
568 |
}
|
| 559 |
return itemId;
|
569 |
return itemId;
|
| 560 |
}
|
570 |
}
|
| Line 758... |
Line 768... |
| 758 |
|
768 |
|
| 759 |
for(in.shop2020.model.v1.catalog.Item thriftItem : thriftItems) {
|
769 |
for(in.shop2020.model.v1.catalog.Item thriftItem : thriftItems) {
|
| 760 |
List<in.shop2020.model.v1.inventory.VendorItemPricing> vip = inventoryClient.getAllItemPricing(thriftItem.getId());
|
770 |
List<in.shop2020.model.v1.inventory.VendorItemPricing> vip = inventoryClient.getAllItemPricing(thriftItem.getId());
|
| 761 |
List<in.shop2020.model.v1.inventory.VendorItemMapping> vim = inventoryClient.getVendorItemMappings(thriftItem.getId());
|
771 |
List<in.shop2020.model.v1.inventory.VendorItemMapping> vim = inventoryClient.getVendorItemMappings(thriftItem.getId());
|
| 762 |
List<in.shop2020.model.v1.catalog.SourceItemPricing> sip = catalogClient.getAllSourcePricing(thriftItem.getId());
|
772 |
List<in.shop2020.model.v1.catalog.SourceItemPricing> sip = catalogClient.getAllSourcePricing(thriftItem.getId());
|
| 763 |
itemList.add(getItemFromThriftItem(thriftItem, vip, vim, sip, null, null, null));
|
773 |
itemList.add(getItemFromThriftItem(thriftItem, vip, vim, sip, null, null, null, null));
|
| 764 |
}
|
774 |
}
|
| 765 |
} catch (Exception e) {
|
775 |
} catch (Exception e) {
|
| 766 |
logger.error("Error while getting items by category: " + category, e);
|
776 |
logger.error("Error while getting items by category: " + category, e);
|
| 767 |
}
|
777 |
}
|
| 768 |
Collections.sort(itemList, new ItemsComparator());
|
778 |
Collections.sort(itemList, new ItemsComparator());
|
| Line 788... |
Line 798... |
| 788 |
|
798 |
|
| 789 |
in.shop2020.model.v1.catalog.Item thriftItem = catalogClient.getItem(itemId);
|
799 |
in.shop2020.model.v1.catalog.Item thriftItem = catalogClient.getItem(itemId);
|
| 790 |
List<in.shop2020.model.v1.inventory.VendorItemPricing> vip = inventoryClient.getAllItemPricing(thriftItem.getId());
|
800 |
List<in.shop2020.model.v1.inventory.VendorItemPricing> vip = inventoryClient.getAllItemPricing(thriftItem.getId());
|
| 791 |
List<in.shop2020.model.v1.inventory.VendorItemMapping> vim = inventoryClient.getVendorItemMappings(thriftItem.getId());
|
801 |
List<in.shop2020.model.v1.inventory.VendorItemMapping> vim = inventoryClient.getVendorItemMappings(thriftItem.getId());
|
| 792 |
List<in.shop2020.model.v1.catalog.SourceItemPricing> sip = catalogClient.getAllSourcePricing(thriftItem.getId());
|
802 |
List<in.shop2020.model.v1.catalog.SourceItemPricing> sip = catalogClient.getAllSourcePricing(thriftItem.getId());
|
| 793 |
items.add(getItemFromThriftItem(thriftItem, vip, vim, sip, null, null, null));
|
803 |
items.add(getItemFromThriftItem(thriftItem, vip, vim, sip, null, null, null, null));
|
| 794 |
} catch (Exception e) {
|
804 |
} catch (Exception e) {
|
| 795 |
logger.error("Could not fetch item for : " + itemId, e);
|
805 |
logger.error("Could not fetch item for : " + itemId, e);
|
| 796 |
return "Could not push to production. No item got pushed.";
|
806 |
return "Could not push to production. No item got pushed.";
|
| 797 |
}
|
807 |
}
|
| 798 |
}
|
808 |
}
|
| Line 912... |
Line 922... |
| 912 |
Client catalogClient = catalogServiceClient.getClient();
|
922 |
Client catalogClient = catalogServiceClient.getClient();
|
| 913 |
|
923 |
|
| 914 |
List<in.shop2020.model.v1.catalog.Item> thriftItems = catalogClient.getAllItemsByStatusInRange(st, start, limit);
|
924 |
List<in.shop2020.model.v1.catalog.Item> thriftItems = catalogClient.getAllItemsByStatusInRange(st, start, limit);
|
| 915 |
|
925 |
|
| 916 |
for(in.shop2020.model.v1.catalog.Item thriftItem : thriftItems) {
|
926 |
for(in.shop2020.model.v1.catalog.Item thriftItem : thriftItems) {
|
| 917 |
itemList.add(getItemFromThriftItem(thriftItem, null, null, null, null, null, null));
|
927 |
itemList.add(getItemFromThriftItem(thriftItem, null, null, null, null, null, null, null));
|
| 918 |
}
|
928 |
}
|
| 919 |
} catch (Exception e) {
|
929 |
} catch (Exception e) {
|
| 920 |
logger.error("Error while getting items by status: " + st, e);
|
930 |
logger.error("Error while getting items by status: " + st, e);
|
| 921 |
}
|
931 |
}
|
| 922 |
return itemList;
|
932 |
return itemList;
|
| Line 930... |
Line 940... |
| 930 |
* @param tVendorPricings
|
940 |
* @param tVendorPricings
|
| 931 |
* @param tVendorMappings
|
941 |
* @param tVendorMappings
|
| 932 |
* @param tSourceMappings
|
942 |
* @param tSourceMappings
|
| 933 |
* @param tSimilarItems
|
943 |
* @param tSimilarItems
|
| 934 |
* @param tVoucherMappings
|
944 |
* @param tVoucherMappings
|
| - |
|
945 |
* @param stockPurchaseParams
|
| 935 |
* @return item object with attributes copied from thrift item object.
|
946 |
* @return item object with attributes copied from thrift item object.
|
| 936 |
*/
|
947 |
*/
|
| 937 |
private Item getItemFromThriftItem(in.shop2020.model.v1.catalog.Item thriftItem,
|
948 |
private Item getItemFromThriftItem(in.shop2020.model.v1.catalog.Item thriftItem,
|
| 938 |
List<in.shop2020.model.v1.inventory.VendorItemPricing> tVendorPricings,
|
949 |
List<in.shop2020.model.v1.inventory.VendorItemPricing> tVendorPricings,
|
| 939 |
List<in.shop2020.model.v1.inventory.VendorItemMapping> tVendorMappings,
|
950 |
List<in.shop2020.model.v1.inventory.VendorItemMapping> tVendorMappings,
|
| 940 |
List<in.shop2020.model.v1.catalog.SourceItemPricing> tSourceMappings,
|
951 |
List<in.shop2020.model.v1.catalog.SourceItemPricing> tSourceMappings,
|
| - |
|
952 |
List<in.shop2020.model.v1.catalog.Item> tSimilarItems,
|
| - |
|
953 |
in.shop2020.model.v1.inventory.ItemInventory tItemInventory,
|
| 941 |
List<in.shop2020.model.v1.catalog.Item> tSimilarItems, in.shop2020.model.v1.inventory.ItemInventory tItemInventory, List<in.shop2020.model.v1.catalog.VoucherItemMapping> tVoucherMappings){
|
954 |
List<in.shop2020.model.v1.catalog.VoucherItemMapping> tVoucherMappings,
|
| - |
|
955 |
ItemStockPurchaseParams tStockPurchaseParams){
|
| 942 |
|
956 |
|
| 943 |
Map<String, VendorItemMapping> vItemMap = new HashMap<String, VendorItemMapping>();
|
957 |
Map<String, VendorItemMapping> vItemMap = new HashMap<String, VendorItemMapping>();
|
| 944 |
VendorItemMapping vItemMapping;
|
958 |
VendorItemMapping vItemMapping;
|
| 945 |
if(tVendorMappings != null) {
|
959 |
if(tVendorMappings != null) {
|
| 946 |
for(in.shop2020.model.v1.inventory.VendorItemMapping vim : tVendorMappings) {
|
960 |
for(in.shop2020.model.v1.inventory.VendorItemMapping vim : tVendorMappings) {
|
| Line 1015... |
Line 1029... |
| 1015 |
for(in.shop2020.model.v1.catalog.VoucherItemMapping tvoucher : tVoucherMappings) {
|
1029 |
for(in.shop2020.model.v1.catalog.VoucherItemMapping tvoucher : tVoucherMappings) {
|
| 1016 |
voucher = new VoucherItemMapping(tvoucher.getAmount(), VoucherType.findByValue((int) tvoucher.getVoucherType()).name());
|
1030 |
voucher = new VoucherItemMapping(tvoucher.getAmount(), VoucherType.findByValue((int) tvoucher.getVoucherType()).name());
|
| 1017 |
voucherMap.put(VoucherType.findByValue((int) tvoucher.getVoucherType()).name(), voucher);
|
1031 |
voucherMap.put(VoucherType.findByValue((int) tvoucher.getVoucherType()).name(), voucher);
|
| 1018 |
}
|
1032 |
}
|
| 1019 |
}
|
1033 |
}
|
| 1020 |
|
1034 |
|
| - |
|
1035 |
in.shop2020.catalog.dashboard.shared.ItemStockPurchaseParams stockPurchaseParams =
|
| - |
|
1036 |
new in.shop2020.catalog.dashboard.shared.ItemStockPurchaseParams();
|
| - |
|
1037 |
if(tStockPurchaseParams != null) {
|
| - |
|
1038 |
stockPurchaseParams.setItem_id(tStockPurchaseParams.getItem_id());
|
| - |
|
1039 |
stockPurchaseParams.setMinStockLevel(tStockPurchaseParams.getMinStockLevel());
|
| - |
|
1040 |
stockPurchaseParams.setNumOfDaysStock(tStockPurchaseParams.getNumOfDaysStock());
|
| - |
|
1041 |
}
|
| - |
|
1042 |
|
| 1021 |
Item item = new Item(thriftItem.getId(),
|
1043 |
Item item = new Item(thriftItem.getId(),
|
| 1022 |
thriftItem.getProductGroup(),
|
1044 |
thriftItem.getProductGroup(),
|
| 1023 |
thriftItem.getBrand(),
|
1045 |
thriftItem.getBrand(),
|
| 1024 |
thriftItem.getModelNumber(),
|
1046 |
thriftItem.getModelNumber(),
|
| 1025 |
thriftItem.getModelName(),
|
1047 |
thriftItem.getModelName(),
|
| Line 1059... |
Line 1081... |
| 1059 |
itemInventoryMap,
|
1081 |
itemInventoryMap,
|
| 1060 |
vendorPricingMap,
|
1082 |
vendorPricingMap,
|
| 1061 |
vItemMap,
|
1083 |
vItemMap,
|
| 1062 |
sourcePricingMap,
|
1084 |
sourcePricingMap,
|
| 1063 |
SimilarItemslist,
|
1085 |
SimilarItemslist,
|
| - |
|
1086 |
voucherMap, stockPurchaseParams.getNumOfDaysStock(),
|
| 1064 |
voucherMap);
|
1087 |
stockPurchaseParams.getMinStockLevel());
|
| 1065 |
return item;
|
1088 |
return item;
|
| 1066 |
}
|
1089 |
}
|
| 1067 |
|
1090 |
|
| 1068 |
/**
|
1091 |
/**
|
| 1069 |
*
|
1092 |
*
|
| Line 1119... |
Line 1142... |
| 1119 |
try{
|
1142 |
try{
|
| 1120 |
CatalogClient catalogServiceClient = new CatalogClient();
|
1143 |
CatalogClient catalogServiceClient = new CatalogClient();
|
| 1121 |
Client catalogClient = catalogServiceClient.getClient();
|
1144 |
Client catalogClient = catalogServiceClient.getClient();
|
| 1122 |
in.shop2020.model.v1.catalog.Item thriftItem = catalogClient.addSimilarItem(itemId, catalogItemId);;
|
1145 |
in.shop2020.model.v1.catalog.Item thriftItem = catalogClient.addSimilarItem(itemId, catalogItemId);;
|
| 1123 |
|
1146 |
|
| 1124 |
return getItemFromThriftItem(thriftItem, null, null, null, null, null, null);
|
1147 |
return getItemFromThriftItem(thriftItem, null, null, null, null, null, null, null);
|
| 1125 |
}catch(Exception e){
|
1148 |
}catch(Exception e){
|
| 1126 |
logger.error("Error while adding the SimilarItems for: " + itemId, e);
|
1149 |
logger.error("Error while adding the SimilarItems for: " + itemId, e);
|
| 1127 |
}
|
1150 |
}
|
| 1128 |
return null;
|
1151 |
return null;
|
| 1129 |
}
|
1152 |
}
|