| Line 446... |
Line 446... |
| 446 |
}
|
446 |
}
|
| 447 |
}
|
447 |
}
|
| 448 |
else{
|
448 |
else{
|
| 449 |
exitfetchinghistory = false;
|
449 |
exitfetchinghistory = false;
|
| 450 |
}
|
450 |
}
|
| 451 |
EntityUtils.consume(response.getEntity());
|
451 |
response.getEntity().consumeContent();
|
| 452 |
i++;
|
452 |
i++;
|
| 453 |
}
|
453 |
}
|
| 454 |
InventoryClient inventoryServiceClient = new InventoryClient("inventory_service_server_host","inventory_service_server_port");
|
454 |
InventoryClient inventoryServiceClient = new InventoryClient("inventory_service_server_host","inventory_service_server_port");
|
| 455 |
in.shop2020.model.v1.inventory.InventoryService.Client inventoryClient = inventoryServiceClient.getClient();
|
455 |
in.shop2020.model.v1.inventory.InventoryService.Client inventoryClient = inventoryServiceClient.getClient();
|
| 456 |
List<SnapdealInventoryItem> snapdealInventoryItemHistoryList = inventoryClient.getSnapdealInventorySnapshot();
|
456 |
List<SnapdealInventoryItem> snapdealInventoryItemHistoryList = inventoryClient.getSnapdealInventorySnapshot();
|
| Line 542... |
Line 542... |
| 542 |
}
|
542 |
}
|
| 543 |
else{
|
543 |
else{
|
| 544 |
System.out.println("Fetched " + items);
|
544 |
System.out.println("Fetched " + items);
|
| 545 |
break;
|
545 |
break;
|
| 546 |
}
|
546 |
}
|
| 547 |
EntityUtils.consume(response.getEntity());
|
547 |
response.getEntity().consumeContent();
|
| 548 |
i++;
|
548 |
i++;
|
| 549 |
}
|
549 |
}
|
| 550 |
if(currentInventoryItemList.size()==0){
|
550 |
if(currentInventoryItemList.size()==0){
|
| 551 |
try {
|
551 |
try {
|
| 552 |
mailer.sendSSLMessage(sendTo,"Snapdeal : Unable to fetch current inventory "+ sdf.format(System.currentTimeMillis()),"Error : Unable to fetch current inventory ", emailFromAddress, password, new ArrayList<File>());
|
552 |
mailer.sendSSLMessage(sendTo,"Snapdeal : Unable to fetch current inventory "+ sdf.format(System.currentTimeMillis()),"Error : Unable to fetch current inventory ", emailFromAddress, password, new ArrayList<File>());
|
| Line 620... |
Line 620... |
| 620 |
pendingOrderInventoryHistory.setInventoryHistory(inventory.getAvailableInventory());
|
620 |
pendingOrderInventoryHistory.setInventoryHistory(inventory.getAvailableInventory());
|
| 621 |
pendingOrderInventoryHistory.setLastUpdatedTimestamp(System.currentTimeMillis());
|
621 |
pendingOrderInventoryHistory.setLastUpdatedTimestamp(System.currentTimeMillis());
|
| 622 |
PendingOrdersInventoryHistoryMap.put(inventory.getSellerSku(),pendingOrderInventoryHistory);
|
622 |
PendingOrdersInventoryHistoryMap.put(inventory.getSellerSku(),pendingOrderInventoryHistory);
|
| 623 |
}
|
623 |
}
|
| 624 |
itemIdpendingOrdersMap.put(sku, pending_orders);
|
624 |
itemIdpendingOrdersMap.put(sku, pending_orders);
|
| 625 |
|
- |
|
| 626 |
}
|
625 |
}
|
| 627 |
}
|
626 |
}
|
| 628 |
|
627 |
|
| 629 |
@SuppressWarnings("deprecation")
|
628 |
@SuppressWarnings("deprecation")
|
| 630 |
public static void sendsnapdealinventory (){
|
629 |
public static void sendsnapdealinventory (){
|
| Line 836... |
Line 835... |
| 836 |
BufferedReader rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
|
835 |
BufferedReader rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
|
| 837 |
String line = "";
|
836 |
String line = "";
|
| 838 |
while ((line = rd.readLine()) != null) {
|
837 |
while ((line = rd.readLine()) != null) {
|
| 839 |
System.out.println("Response of Inventory Update: "+line);
|
838 |
System.out.println("Response of Inventory Update: "+line);
|
| 840 |
}
|
839 |
}
|
| 841 |
EntityUtils.consume(response.getEntity());
|
840 |
response.getEntity().consumeContent();
|
| 842 |
Thread.sleep(2000);
|
841 |
Thread.sleep(2000);
|
| 843 |
} catch (ClientProtocolException e) {
|
842 |
} catch (ClientProtocolException e) {
|
| 844 |
System.out.println("Could not login and update inventory");
|
843 |
System.out.println("Could not login and update inventory");
|
| 845 |
e.printStackTrace();
|
844 |
e.printStackTrace();
|
| 846 |
continue;
|
845 |
continue;
|
| Line 939... |
Line 938... |
| 939 |
try {
|
938 |
try {
|
| 940 |
while ((line = rd.readLine()) != null) {
|
939 |
while ((line = rd.readLine()) != null) {
|
| 941 |
System.out.println(line);
|
940 |
System.out.println(line);
|
| 942 |
feedresponse = line;
|
941 |
feedresponse = line;
|
| 943 |
}
|
942 |
}
|
| 944 |
EntityUtils.consume(response.getEntity());
|
943 |
response.getEntity().consumeContent();
|
| 945 |
} catch (IOException e) {
|
944 |
} catch (IOException e) {
|
| 946 |
|
945 |
|
| 947 |
e.printStackTrace();
|
946 |
e.printStackTrace();
|
| 948 |
}
|
947 |
}
|
| 949 |
System.out.println("posting response" + feedresponse);
|
948 |
System.out.println("posting response" + feedresponse);
|