Subversion Repositories SmartDukaan

Rev

Rev 7190 | Rev 9788 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7190 Rev 8183
Line 23... Line 23...
23
 
23
 
24
public class OosStatusMarker {
24
public class OosStatusMarker {
25
	private static final Integer OOS_STATUS_CUTOFF_HOUR = 23;
25
	private static final Integer OOS_STATUS_CUTOFF_HOUR = 23;
26
	private static final Integer OOS_STATUS_CUTOFF_MINUTE = 59;
26
	private static final Integer OOS_STATUS_CUTOFF_MINUTE = 59;
27
	
27
	
-
 
28
	private static final String[] tomail = {"amar.kumar@shop2020.in", "sandeep.sachdeva@shop2020.in", "khushal.bhatia@shop2020.in", "rajveer.singh@shop2020.in"};
-
 
29
	//private static final String[] tomail = {"amar.kumar@shop2020.in"};
-
 
30
	
28
	public static void main(String[] args) throws TTransportException {
31
	public static void main(String[] args) throws TTransportException {
29
		Calendar oosEvaluationDate = Calendar.getInstance();
32
		Calendar oosEvaluationDate = Calendar.getInstance();
30
		Calendar cartAdditionStartDate = Calendar.getInstance();
33
		Calendar cartAdditionStartDate = Calendar.getInstance();
31
		oosEvaluationDate.add(Calendar.DATE, -1);
34
		oosEvaluationDate.add(Calendar.DATE, -1);
32
		oosEvaluationDate.set(oosEvaluationDate.get(Calendar.YEAR), 
35
		oosEvaluationDate.set(oosEvaluationDate.get(Calendar.YEAR), 
Line 80... Line 83...
80
 
83
 
81
	private static void sendMailForError(String errorMessage) {
84
	private static void sendMailForError(String errorMessage) {
82
		
85
		
83
        GmailUtils g = new GmailUtils();
86
        GmailUtils g = new GmailUtils();
84
        try {
87
        try {
85
	        g.sendSSLMessage(new String[]{ "amar.kumar@shop2020.in", "sandeep.sachdeva@shop2020.in", "khushal.bhatia@shop2020.in", "rajveer.singh@shop2020.in"},
-
 
86
	        		"Error while Marking OutOfStock Statuses for Items", errorMessage, "cnc.center@shop2020.in", "5h0p2o2o", new ArrayList<File>());
88
	        g.sendSSLMessage(tomail, "Error while Marking OutOfStock Statuses for Items", errorMessage, "cnc.center@shop2020.in", "5h0p2o2o", new ArrayList<File>());
87
        } catch(MessagingException mex) {
89
        } catch(MessagingException mex) {
88
        	try {
90
        	try {
89
        		g.sendSSLMessage(new String[]{ "amar.kumar@shop2020.in", "sandeep.sachdeva@shop2020.in", "khushal.bhatia@shop2020.in", "rajveer.singh@shop2020.in"},
-
 
90
    	        		"Error while Marking OutOfStock Statuses for Items", errorMessage, "cnc.center@shop2020.in", "5h0p2o2o", new ArrayList<File>());
91
        		g.sendSSLMessage(tomail, "Error while Marking OutOfStock Statuses for Items", errorMessage, "cnc.center@shop2020.in", "5h0p2o2o", new ArrayList<File>());
91
        	} catch (Exception e) {
92
        	} catch (Exception e) {
92
        		//TODO Logging
93
        		//TODO Logging
93
        	}
94
        	}
94
        }
95
        }
95
	}
96
	}
96
	
97
	
97
	private static void sendMailForSuccess(String message) {
98
	private static void sendMailForSuccess(String message) {
98
		
99
		
99
        GmailUtils g = new GmailUtils();
100
        GmailUtils g = new GmailUtils();
100
        try {
101
        try {
101
	        g.sendSSLMessage(new String[]{ "amar.kumar@shop2020.in", "sandeep.sachdeva@shop2020.in", "khushal.bhatia@shop2020.in", "rajveer.singh@shop2020.in"},
-
 
102
	        		"Marked OutOfStock Statuses ", message, "cnc.center@shop2020.in", "5h0p2o2o", new ArrayList<File>());
102
	        g.sendSSLMessage(tomail, "Marked OutOfStock Statuses ", message, "cnc.center@shop2020.in", "5h0p2o2o", new ArrayList<File>());
103
        } catch(MessagingException mex) {
103
        } catch(MessagingException mex) {
104
        		//TODO Logging
104
        		//TODO Logging
105
        }
105
        }
106
	}
106
	}
107
}
107
}