| Line 541... |
Line 541... |
| 541 |
in.shop2020.model.v1.catalog.CatalogService.Client catalogServiceClient = null;
|
541 |
in.shop2020.model.v1.catalog.CatalogService.Client catalogServiceClient = null;
|
| 542 |
SnapdealItemDetails snapdealitem = null;
|
542 |
SnapdealItemDetails snapdealitem = null;
|
| 543 |
long sku = 0;
|
543 |
long sku = 0;
|
| 544 |
long created_orders;
|
544 |
long created_orders;
|
| 545 |
long pending_orders;
|
545 |
long pending_orders;
|
| - |
|
546 |
Map<Long, Long> itemIdCreatedOrdersMap = null;
|
| 546 |
try {
|
547 |
try {
|
| 547 |
transactionClient = new TransactionClient("support_transaction_service_server_host","transaction_service_server_port").getClient();
|
548 |
transactionClient = new TransactionClient("support_transaction_service_server_host","transaction_service_server_port").getClient();
|
| - |
|
549 |
System.out.println("Last Updated on Time is " + lastUpdatedInventoryTime);
|
| - |
|
550 |
if(lastUpdatedInventoryTime > 0){
|
| - |
|
551 |
itemIdCreatedOrdersMap = transactionClient.getOrdersCreatedAfterTimestampForSource(lastUpdatedInventoryTime, 7);
|
| - |
|
552 |
}
|
| 548 |
} catch (TTransportException e1) {
|
553 |
} catch (TTransportException e1) {
|
| 549 |
// TODO Auto-generated catch block
|
554 |
// TODO Auto-generated catch block
|
| 550 |
e1.printStackTrace();
|
555 |
e1.printStackTrace();
|
| 551 |
}
|
556 |
}
|
| 552 |
try {
|
557 |
try {
|
| Line 554... |
Line 559... |
| 554 |
} catch (TTransportException e1) {
|
559 |
} catch (TTransportException e1) {
|
| 555 |
// TODO Auto-generated catch block
|
560 |
// TODO Auto-generated catch block
|
| 556 |
e1.printStackTrace();
|
561 |
e1.printStackTrace();
|
| 557 |
}
|
562 |
}
|
| 558 |
List<String> notMappedItems = new ArrayList<String>();
|
563 |
List<String> notMappedItems = new ArrayList<String>();
|
| 559 |
System.out.println("Last Updated on Time is " + lastUpdatedInventoryTime);
|
- |
|
| - |
|
564 |
|
| 560 |
for(Inventory inventory:currentInventoryItemList){
|
565 |
for(Inventory inventory:currentInventoryItemList){
|
| 561 |
created_orders = 0;
|
566 |
created_orders = 0;
|
| 562 |
pending_orders = 0;
|
567 |
pending_orders = 0;
|
| 563 |
try {
|
- |
|
| 564 |
snapdealitem = snapdealItemMap.get(inventory.getSellerSku());
|
568 |
snapdealitem = snapdealItemMap.get(inventory.getSellerSku());
|
| 565 |
if(snapdealitem==null){
|
569 |
if(snapdealitem==null){
|
| 566 |
notMappedItems.add(inventory.getSellerSku()+" "+inventory.getProductName());
|
570 |
notMappedItems.add(inventory.getSellerSku()+" "+inventory.getProductName());
|
| 567 |
System.out.println("Not Mapped " + inventory.getSellerSku());
|
571 |
System.out.println("Not Mapped " + inventory.getSellerSku());
|
| 568 |
continue;
|
572 |
continue;
|
| 569 |
}
|
573 |
}
|
| 570 |
sku = snapdealitem.getItem_id();
|
574 |
sku = snapdealitem.getItem_id();
|
| 571 |
if(sku!=0){
|
575 |
if(sku!=0){
|
| 572 |
try{
|
- |
|
| 573 |
if(lastUpdatedInventoryTime > 0){
|
- |
|
| 574 |
created_orders = transactionClient.getOrdersCreatedAfterTimestampForSource(lastUpdatedInventoryTime, 7, sku);
|
576 |
created_orders = itemIdCreatedOrdersMap.get(sku);
|
| 575 |
System.out.println("Fetching created orders for " + sku +" " + created_orders);
|
577 |
System.out.println("Created orders for " + sku +" " + created_orders);
|
| 576 |
}
|
- |
|
| 577 |
}
|
- |
|
| 578 |
catch(TTransportException e){
|
- |
|
| 579 |
if(lastUpdatedInventoryTime > 0){
|
- |
|
| 580 |
transactionClient = new TransactionClient("support_transaction_service_server_host","transaction_service_server_port").getClient();
|
- |
|
| 581 |
created_orders = transactionClient.getOrdersCreatedAfterTimestampForSource(lastUpdatedInventoryTime, 7, sku);
|
- |
|
| 582 |
}
|
- |
|
| 583 |
}
|
- |
|
| 584 |
}
|
578 |
}
|
| 585 |
else{
|
579 |
else{
|
| 586 |
continue;
|
580 |
continue;
|
| 587 |
}
|
- |
|
| 588 |
} catch (TException e) {
|
- |
|
| 589 |
// TODO Auto-generated catch block
|
- |
|
| 590 |
e.printStackTrace();
|
- |
|
| 591 |
}
|
581 |
}
|
| 592 |
if(PendingOrdersInventoryHistoryMap.containsKey(inventory.getSellerSku())){
|
582 |
if(PendingOrdersInventoryHistoryMap.containsKey(inventory.getSellerSku())){
|
| 593 |
System.out.println("Calculating Pending Orders for " + inventory.getSellerSku());
|
583 |
System.out.println("Calculating Pending Orders for " + inventory.getSellerSku());
|
| 594 |
System.out.println("Current Inventory "+inventory.getAvailableInventory());
|
584 |
System.out.println("Current Inventory "+inventory.getAvailableInventory());
|
| 595 |
System.out.println("History Inventory "+PendingOrdersInventoryHistoryMap.get(inventory.getSellerSku()).getInventoryHistory());
|
585 |
System.out.println("History Inventory "+PendingOrdersInventoryHistoryMap.get(inventory.getSellerSku()).getInventoryHistory());
|