| Line 592... |
Line 592... |
| 592 |
java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy-MM-dd-HH:mm:ss");
|
592 |
java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy-MM-dd-HH:mm:ss");
|
| 593 |
Calendar cal=GregorianCalendar.getInstance();
|
593 |
Calendar cal=GregorianCalendar.getInstance();
|
| 594 |
String emailFromAddress = "build@shop2020.in";
|
594 |
String emailFromAddress = "build@shop2020.in";
|
| 595 |
String password = "cafe@nes";
|
595 |
String password = "cafe@nes";
|
| 596 |
GmailUtils mailer = new GmailUtils();
|
596 |
GmailUtils mailer = new GmailUtils();
|
| 597 |
String sendTo[] = new String[]{"vikram.raghav@shop2020.in"};
|
597 |
//String sendTo[] = new String[]{"vikram.raghav@shop2020.in"};
|
| 598 |
/*String sendTo[] = new String[]{ "sandeep.sachdeva@shop2020.in", "vikram.raghav@shop2020.in", "rajneesh.arora@shop2020.in",
|
598 |
String sendTo[] = new String[]{ "sandeep.sachdeva@shop2020.in", "vikram.raghav@shop2020.in", "rajneesh.arora@shop2020.in",
|
| 599 |
"khushal.bhatia@shop2020.in","manoj.kumar@saholic.com","chaitnaya.vats@saholic.com",
|
599 |
"khushal.bhatia@shop2020.in","manoj.kumar@saholic.com","chaitnaya.vats@saholic.com",
|
| 600 |
"yukti.jain@shop2020.in","manisha.sharma@shop2020.in","chandan.kumar@shop2020.in","ankush.dhingra@shop2020.in","amar.kumar@shop2020.in"};
|
600 |
"yukti.jain@shop2020.in","manisha.sharma@shop2020.in","chandan.kumar@shop2020.in","ankush.dhingra@shop2020.in","amar.kumar@shop2020.in"};
|
| 601 |
*/try {
|
601 |
try {
|
| 602 |
logger.info("Before Sending Emails");
|
602 |
logger.info("Before Sending Emails");
|
| 603 |
|
603 |
|
| 604 |
if(sb.toString().equalsIgnoreCase("")){
|
604 |
if(sb.toString().equalsIgnoreCase("")){
|
| 605 |
if(orders_processed!=0){
|
605 |
if(orders_processed!=0){
|
| 606 |
String emailSubjectTxt = orders_processed + " Flipkart " + order_string + " Created "+sdf.format(cal.getTime());
|
606 |
String emailSubjectTxt = orders_processed + " Flipkart " + order_string + " Created "+sdf.format(cal.getTime());
|
| 607 |
mailer.sendSSLMessage(sendTo, emailSubjectTxt,"Orders Created Successfully (No Alerts)", emailFromAddress, password, new ArrayList<File>());
|
607 |
mailer.sendSSLMessage(sendTo, emailSubjectTxt,"Orders Created Successfully (No Alerts)", emailFromAddress, password, new ArrayList<File>());
|
| 608 |
logger.info("Sending Email Flipkart Orders Created Successfully (No Alerts)");
|
608 |
logger.info("Sending Email Flipkart Orders Created Successfully (No Alerts)");
|
| 609 |
}
|
609 |
}
|
| 610 |
else{
|
610 |
else{
|
| 611 |
String emailSubjectTxt = "No new orders created "+sdf.format(cal.getTime());
|
611 |
String emailSubjectTxt = "No new orders created "+sdf.format(cal.getTime());
|
| 612 |
mailer.sendSSLMessage(sendTo, emailSubjectTxt,"No new orders created", emailFromAddress, password, new ArrayList<File>());
|
612 |
mailer.sendSSLMessage(sendTo, emailSubjectTxt,"No new orders created", emailFromAddress, password, new ArrayList<File>());
|
| 613 |
logger.info("Sending Email Flipkart Orders Created Successfully (No Alerts)");
|
613 |
logger.info("Sending Email Flipkart Orders Created Successfully (No Alerts)");
|
| 614 |
}
|
614 |
}
|
| 615 |
}
|
615 |
}
|
| 616 |
else{
|
616 |
else{
|
| 617 |
if(orders_processed!=0){
|
617 |
if(orders_processed!=0){
|
| 618 |
String emailSubjectTxt = orders_processed + " Flipkart " + order_string + " Created (Check Alerts) "+sdf.format(cal.getTime());
|
618 |
String emailSubjectTxt = orders_processed + " Flipkart " + order_string + " Created (Check Alerts) "+sdf.format(cal.getTime());
|
| 619 |
mailer.sendSSLMessage(sendTo, emailSubjectTxt,sb.toString(), emailFromAddress, password, new ArrayList<File>());
|
619 |
mailer.sendSSLMessage(sendTo, emailSubjectTxt,sb.toString(), emailFromAddress, password, new ArrayList<File>());
|
| 620 |
logger.info("Sending Email Flipkart Orders Created Successfully (Check Alerts)");
|
620 |
logger.info("Sending Email Flipkart Orders Created Successfully (Check Alerts)");
|
| 621 |
}
|
621 |
}
|
| 622 |
else{
|
622 |
else{
|
| 623 |
String emailSubjectTxt = "No new Flipkart orders created "+sdf.format(cal.getTime());
|
623 |
String emailSubjectTxt = "No new Flipkart orders created "+sdf.format(cal.getTime());
|
| 624 |
mailer.sendSSLMessage(sendTo, emailSubjectTxt,sb.toString(), emailFromAddress, password, new ArrayList<File>());
|
624 |
mailer.sendSSLMessage(sendTo, emailSubjectTxt,sb.toString(), emailFromAddress, password, new ArrayList<File>());
|
| 625 |
logger.info("Sending Email Flipkart Orders Created Successfully (Check Alerts)");
|
625 |
logger.info("Sending Email Flipkart Orders Created Successfully (Check Alerts)");
|
| 626 |
}
|
626 |
}
|
| 627 |
}
|
627 |
}
|
| 628 |
}
|
628 |
}
|
| 629 |
catch (Exception e) {
|
629 |
catch (Exception e) {
|
| 630 |
e.printStackTrace();
|
630 |
e.printStackTrace();
|
| 631 |
logger.error("Exception ",e);
|
631 |
logger.error("Exception ",e);
|
| 632 |
}
|
632 |
}
|
| 633 |
|
633 |
|
| 634 |
}
|
634 |
}
|
| 635 |
|
635 |
|
| 636 |
public static LineItem createLineItem(long itemId, double amount) throws CatalogServiceException, TException {
|
636 |
public static LineItem createLineItem(long itemId, double amount) throws CatalogServiceException, TException {
|
| 637 |
LineItem lineItem = new LineItem();
|
637 |
LineItem lineItem = new LineItem();
|