| Line 583... |
Line 583... |
| 583 |
pending_orders = PendingOrdersInventoryHistoryMap.get(inventory.getSellerSku()).getPendingOrders()+(inventory.getAvailableInventory() - PendingOrdersInventoryHistoryMap.get(inventory.getSellerSku()).getInventoryHistory() - created_orders);
|
583 |
pending_orders = PendingOrdersInventoryHistoryMap.get(inventory.getSellerSku()).getPendingOrders()+(inventory.getAvailableInventory() - PendingOrdersInventoryHistoryMap.get(inventory.getSellerSku()).getInventoryHistory() - created_orders);
|
| 584 |
itemIdpendingOrdersMap.put(sku, pending_orders);
|
584 |
itemIdpendingOrdersMap.put(sku, pending_orders);
|
| 585 |
PendingOrderInventoryHistory pendingOrderInventoryHistory = PendingOrdersInventoryHistoryMap.get(inventory.getSellerSku());
|
585 |
PendingOrderInventoryHistory pendingOrderInventoryHistory = PendingOrdersInventoryHistoryMap.get(inventory.getSellerSku());
|
| 586 |
pendingOrderInventoryHistory.setPendingOrders(pending_orders);
|
586 |
pendingOrderInventoryHistory.setPendingOrders(pending_orders);
|
| 587 |
PendingOrdersInventoryHistoryMap.put(inventory.getSellerSku(),pendingOrderInventoryHistory);
|
587 |
PendingOrdersInventoryHistoryMap.put(inventory.getSellerSku(),pendingOrderInventoryHistory);
|
| 588 |
|
588 |
|
| 589 |
}
|
589 |
}
|
| 590 |
List<SnapdealInventoryItem> snapdealInventoryItemList = new ArrayList<SnapdealInventoryItem>();
|
590 |
List<SnapdealInventoryItem> snapdealInventoryItemList = new ArrayList<SnapdealInventoryItem>();
|
| 591 |
SnapdealInventoryItem snapdealInventoryItem;
|
591 |
SnapdealInventoryItem snapdealInventoryItem;
|
| 592 |
for(Entry<String, PendingOrderInventoryHistory> pendingOrderInventoryHistory:PendingOrdersInventoryHistoryMap.entrySet()){
|
592 |
for(Entry<String, PendingOrderInventoryHistory> pendingOrderInventoryHistory:PendingOrdersInventoryHistoryMap.entrySet()){
|
| 593 |
snapdealInventoryItem = new SnapdealInventoryItem();
|
593 |
snapdealInventoryItem = new SnapdealInventoryItem();
|
| Line 670... |
Line 670... |
| 670 |
System.out.println("actual" + actualavailability + "\t2/3actual" + Math.round(actualavailability*2/3) + "\theld for source" + inventoryItem.getHeldForSource() + "\theldorders" + heldorders + "\tFinal Value is : " + (Math.round(actualavailability*2/3) + inventoryItem.getHeldForSource() - heldorders));
|
670 |
System.out.println("actual" + actualavailability + "\t2/3actual" + Math.round(actualavailability*2/3) + "\theld for source" + inventoryItem.getHeldForSource() + "\theldorders" + heldorders + "\tFinal Value is : " + (Math.round(actualavailability*2/3) + inventoryItem.getHeldForSource() - heldorders));
|
| 671 |
}
|
671 |
}
|
| 672 |
else{
|
672 |
else{
|
| 673 |
sent_inventory = 0;
|
673 |
sent_inventory = 0;
|
| 674 |
}
|
674 |
}
|
| 675 |
|
675 |
|
| 676 |
}
|
676 |
}
|
| 677 |
else{
|
677 |
else{
|
| 678 |
if((actualavailability + inventoryItem.getHeldForSource()) > defaultinventory){
|
678 |
if((actualavailability + inventoryItem.getHeldForSource()) > defaultinventory){
|
| 679 |
if((Math.round(actualavailability*2/3) + inventoryItem.getHeldForSource()) > heldorders){
|
679 |
if((Math.round(actualavailability*2/3) + inventoryItem.getHeldForSource()) > heldorders){
|
| 680 |
System.out.println("actual" + actualavailability + "\t2/3actual" + Math.round(actualavailability*2/3) + "\theld for source" + inventoryItem.getHeldForSource() + "\theldorders" + heldorders + "\tFinal Value is : " + (Math.round(actualavailability*2/3) + inventoryItem.getHeldForSource() - heldorders));
|
680 |
System.out.println("actual" + actualavailability + "\t2/3actual" + Math.round(actualavailability*2/3) + "\theld for source" + inventoryItem.getHeldForSource() + "\theldorders" + heldorders + "\tFinal Value is : " + (Math.round(actualavailability*2/3) + inventoryItem.getHeldForSource() - heldorders));
|
| Line 716... |
Line 716... |
| 716 |
}
|
716 |
}
|
| 717 |
else{
|
717 |
else{
|
| 718 |
continue;
|
718 |
continue;
|
| 719 |
}
|
719 |
}
|
| 720 |
}
|
720 |
}
|
| - |
|
721 |
java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy-MM-dd-HH:mm:ss");
|
| - |
|
722 |
String emailFromAddress = "build@shop2020.in";
|
| - |
|
723 |
String password = "cafe@nes";
|
| - |
|
724 |
GmailUtils mailer = new GmailUtils();
|
| - |
|
725 |
//String sendTo[] = new String[]{"vikram.raghav@shop2020.in","rajveer.singh@shop2020.in"};
|
| - |
|
726 |
//String sendTo[] = new String[]{"vikram.raghav@shop2020.in","kshitij.sood@shop2020.in"};
|
| - |
|
727 |
String sendTo[] = new String[]{ "sandeep.sachdeva@shop2020.in", "vikram.raghav@shop2020.in", "rajneesh.arora@shop2020.in",
|
| - |
|
728 |
"khushal.bhatia@shop2020.in","manoj.kumar@saholic.com","chaitnaya.vats@saholic.com",
|
| - |
|
729 |
"yukti.jain@shop2020.in","manisha.sharma@shop2020.in","chandan.kumar@shop2020.in","ankush.dhingra@shop2020.in","amar.kumar@shop2020.in"};
|
| 721 |
if(iterator > 1){
|
730 |
if(iterator > 1){
|
| 722 |
FileOutputStream fileOut = null;
|
731 |
FileOutputStream fileOut = null;
|
| 723 |
fis.close();
|
732 |
fis.close();
|
| 724 |
try {
|
733 |
try {
|
| 725 |
System.out.println("Before writing file ");
|
734 |
System.out.println("Before writing file ");
|
| Line 798... |
Line 807... |
| 798 |
transactionClient.updateSourceDetailTimestamp(7, lastSentInventoryTime);
|
807 |
transactionClient.updateSourceDetailTimestamp(7, lastSentInventoryTime);
|
| 799 |
} catch (Exception ex) {
|
808 |
} catch (Exception ex) {
|
| 800 |
ex.printStackTrace();
|
809 |
ex.printStackTrace();
|
| 801 |
}
|
810 |
}
|
| 802 |
}
|
811 |
}
|
| 803 |
java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy-MM-dd-HH:mm:ss");
|
- |
|
| 804 |
String emailFromAddress = "build@shop2020.in";
|
- |
|
| 805 |
String password = "cafe@nes";
|
- |
|
| 806 |
GmailUtils mailer = new GmailUtils();
|
- |
|
| 807 |
//String sendTo[] = new String[]{"vikram.raghav@shop2020.in","rajveer.singh@shop2020.in"};
|
- |
|
| 808 |
//String sendTo[] = new String[]{"vikram.raghav@shop2020.in","kshitij.sood@shop2020.in"};
|
- |
|
| 809 |
String sendTo[] = new String[]{ "sandeep.sachdeva@shop2020.in", "vikram.raghav@shop2020.in", "rajneesh.arora@shop2020.in",
|
- |
|
| 810 |
"khushal.bhatia@shop2020.in","manoj.kumar@saholic.com","chaitnaya.vats@saholic.com",
|
- |
|
| 811 |
"yukti.jain@shop2020.in","manisha.sharma@shop2020.in","chandan.kumar@shop2020.in","ankush.dhingra@shop2020.in","amar.kumar@shop2020.in"};
|
- |
|
| 812 |
String emailSubjectTxt = "Products back in stock on Snapdeal "+sdf.format(lastSentInventoryTime);
|
812 |
String emailSubjectTxt = "Products back in stock on Snapdeal "+sdf.format(lastSentInventoryTime);
|
| 813 |
String text = backInStockItems.toString();
|
813 |
String text = backInStockItems.toString();
|
| 814 |
if(text.length() > 0){
|
814 |
if(text.length() > 0){
|
| 815 |
try {
|
815 |
try {
|
| 816 |
mailer.sendSSLMessage(sendTo, emailSubjectTxt, text, emailFromAddress, password, new ArrayList<File>());
|
816 |
mailer.sendSSLMessage(sendTo, emailSubjectTxt, text, emailFromAddress, password, new ArrayList<File>());
|
| Line 825... |
Line 825... |
| 825 |
mailer.sendSSLMessage(sendTo, emailSubjectTxt, text, emailFromAddress, password, new ArrayList<File>());
|
825 |
mailer.sendSSLMessage(sendTo, emailSubjectTxt, text, emailFromAddress, password, new ArrayList<File>());
|
| 826 |
} catch (MessagingException e) {
|
826 |
} catch (MessagingException e) {
|
| 827 |
e.printStackTrace();
|
827 |
e.printStackTrace();
|
| 828 |
}
|
828 |
}
|
| 829 |
}
|
829 |
}
|
| 830 |
/* List<File> files = new ArrayList<File>();
|
830 |
/* List<File> files = new ArrayList<File>();
|
| 831 |
files.add(new File(SNAPDEAL_INVENTORY_SHEET));
|
831 |
files.add(new File(SNAPDEAL_INVENTORY_SHEET));
|
| 832 |
try {
|
832 |
try {
|
| 833 |
mailer.sendSSLMessage(sendTo,"Inventory File",feedresponse, emailFromAddress, password, files);
|
833 |
mailer.sendSSLMessage(sendTo,"Inventory File",feedresponse, emailFromAddress, password, files);
|
| 834 |
} catch (MessagingException e) {
|
834 |
} catch (MessagingException e) {
|
| 835 |
e.printStackTrace();
|
835 |
e.printStackTrace();
|
| 836 |
}
|
836 |
}
|
| - |
|
837 |
*/ }
|
| - |
|
838 |
else{
|
| - |
|
839 |
try {
|
| - |
|
840 |
mailer.sendSSLMessage(sendTo,"Snapdeal Inventory (No change to update)"+ sdf.format(System.currentTimeMillis()),"No change in Snapdea Inventory to be sent ", emailFromAddress, password, new ArrayList<File>());
|
| - |
|
841 |
} catch (MessagingException e) {
|
| - |
|
842 |
e.printStackTrace();
|
| 837 |
*/ }
|
843 |
}
|
| - |
|
844 |
}
|
| - |
|
845 |
|
| 838 |
|
846 |
|
| 839 |
|
847 |
|
| 840 |
}
|
848 |
}
|
| 841 |
|
849 |
|
| 842 |
}
|
850 |
}
|