Subversion Repositories SmartDukaan

Rev

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

Rev 12596 Rev 12605
Line 32... Line 32...
32
import org.json.JSONObject;
32
import org.json.JSONObject;
33
 
33
 
34
import com.google.gson.Gson;
34
import com.google.gson.Gson;
35
 
35
 
36
public class FlipkartHoldOrdersReconciliation{
36
public class FlipkartHoldOrdersReconciliation{
37
	private static String sendTo[] = new String[]{ "sandeep.sachdeva@shop2020.in", "vikram.raghav@shop2020.in", "rajneesh.arora@shop2020.in",
37
	private static String sendTo[] = new String[]{ "sandeep.sachdeva@shop2020.in", "eng@shop2020.in" ,
38
			"khushal.bhatia@shop2020.in","manoj.kumar@saholic.com","chaitnaya.vats@saholic.com",
38
			"khushal.bhatia@shop2020.in","manoj.kumar@saholic.com","chaitnaya.vats@saholic.com",
39
			"yukti.jain@shop2020.in","manish.sharma@shop2020.in","chandan.kumar@shop2020.in","ankush.dhingra@shop2020.in","anikendra.das@shop2020.in"};
39
			"yukti.jain@shop2020.in","chandan.kumar@shop2020.in","ankush.dhingra@shop2020.in"};
40
	private static java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy-MM-dd-HH:mm:ss");
40
	private static java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy-MM-dd-HH:mm:ss");
41
	private static Calendar cal=GregorianCalendar.getInstance();
41
	private static Calendar cal=GregorianCalendar.getInstance();
42
	private static String emailFromAddress = "build@shop2020.in";
42
	private static String emailFromAddress = "build-staging@shop2020.in";
43
	private static String password = "cafe@nes";
43
	private static String password = "shop2020";
44
	private static GmailUtils mailer = new GmailUtils();
44
	private static GmailUtils mailer = new GmailUtils();
45
	
45
	
46
	public static void main(String[] args) throws TException, TransactionServiceException, JSONException {
46
	public static void main(String[] args) throws TException, TransactionServiceException, JSONException {
47
		HttpClient client = new DefaultHttpClient();
47
		HttpClient client = new DefaultHttpClient();
48
		HttpPost post = new HttpPost("https://seller.flipkart.com/login");
48
		HttpPost post = new HttpPost("https://seller.flipkart.com/login");
Line 132... Line 132...
132
					}
132
					}
133
				}
133
				}
134
			}
134
			}
135
			
135
			
136
			resB.append("Still Pending Orders:-\n");
136
			resB.append("Still Pending Orders:-\n");
-
 
137
			System.out.println("Still Pending Orders:-");
137
			for(FlipkartOrder order: pendingOrderList){
138
			for(FlipkartOrder order: pendingOrderList){
138
				resB.append(order.getOrderId()+" "+ order.getFlipkartOrderId()+"\n");
139
				resB.append(order.getOrderId()+" "+ order.getFlipkartOrderId()+"\n");
-
 
140
				System.out.println(order.getOrderId()+" "+ order.getFlipkartOrderId());
139
			}
141
			}
140
			resB.append("Accepeted Orders:-\n");
142
			resB.append("Accepeted Orders:-\n");
-
 
143
			System.out.println("Accepeted Orders:-");
141
			for(FlipkartOrder order: acceptedOrderList){
144
			for(FlipkartOrder order: acceptedOrderList){
142
				resB.append(order.getOrderId()+" "+ order.getFlipkartOrderId()+"\n");
145
				resB.append(order.getOrderId()+" "+ order.getFlipkartOrderId()+"\n");
-
 
146
				System.out.println(order.getOrderId()+" "+ order.getFlipkartOrderId());
143
			}
147
			}
144
			resB.append("Cancelled Orders:-\n");
148
			resB.append("Cancelled Orders:-\n");
-
 
149
			System.out.println("Cancelled Orders:-");
145
			for(FlipkartOrder order: cancelledOrderList){
150
			for(FlipkartOrder order: cancelledOrderList){
146
				resB.append(order.getOrderId()+" "+ order.getFlipkartOrderId()+"\n");
151
				resB.append(order.getOrderId()+" "+ order.getFlipkartOrderId()+"\n");
-
 
152
				System.out.println(order.getOrderId()+" "+ order.getFlipkartOrderId());
147
			}
153
			}
148
			resB.append("Response not found Orders:-\n");
154
			resB.append("Response not found Orders:-\n");
-
 
155
			System.out.println("Response not found Orders:-");
149
			for(FlipkartOrder order: errorOrderList){
156
			for(FlipkartOrder order: errorOrderList){
150
				resB.append(order.getOrderId()+" "+ order.getFlipkartOrderId()+"\n");
157
				resB.append(order.getOrderId()+" "+ order.getFlipkartOrderId()+"\n");
-
 
158
				System.out.println(order.getOrderId()+" "+ order.getFlipkartOrderId());
151
			}
159
			}
152
			String emailSubjectTxt = " Flipkart Hold Order Reconcilaition Process "+sdf.format(cal.getTime());
160
			String emailSubjectTxt = " Flipkart Hold Order Reconcilaition Process "+sdf.format(cal.getTime());
153
			mailer.sendSSLMessage(sendTo, emailSubjectTxt, resB.toString(), emailFromAddress, password, new ArrayList<File>());
161
			mailer.sendSSLMessage(sendTo, emailSubjectTxt, resB.toString(), emailFromAddress, password, new ArrayList<File>());
154
			System.out.println(sb.toString());
162
			System.out.println(sb.toString());
155
		} catch (Exception e) {
163
		} catch (Exception e) {