Subversion Repositories SmartDukaan

Rev

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

Rev 14638 Rev 14639
Line 24... Line 24...
24
import org.apache.http.client.ClientProtocolException;
24
import org.apache.http.client.ClientProtocolException;
25
import org.apache.http.client.HttpClient;
25
import org.apache.http.client.HttpClient;
26
import org.apache.http.client.entity.UrlEncodedFormEntity;
26
import org.apache.http.client.entity.UrlEncodedFormEntity;
27
import org.apache.http.client.methods.HttpGet;
27
import org.apache.http.client.methods.HttpGet;
28
import org.apache.http.client.methods.HttpPost;
28
import org.apache.http.client.methods.HttpPost;
-
 
29
import org.apache.http.entity.StringEntity;
29
import org.apache.http.impl.client.DefaultHttpClient;
30
import org.apache.http.impl.client.DefaultHttpClient;
30
import org.apache.http.message.BasicNameValuePair;
31
import org.apache.http.message.BasicNameValuePair;
31
import org.json.JSONArray;
32
import org.json.JSONArray;
32
import org.json.JSONObject;
33
import org.json.JSONObject;
33
import org.slf4j.LoggerFactory;
34
import org.slf4j.LoggerFactory;
Line 275... Line 276...
275
					}
276
					}
276
				}*/
277
				}*/
277
 
278
 
278
				logger.info("Getting Delivery Information for OneShip Snapdeal Orders");
279
				logger.info("Getting Delivery Information for OneShip Snapdeal Orders");
279
				//statusCode=CLD&dispatchCategoryId=0&startDate=2013%2F11%2F01&endDate=2013%2F11%2F07&statusColumn=cancelledOn
280
				//statusCode=CLD&dispatchCategoryId=0&startDate=2013%2F11%2F01&endDate=2013%2F11%2F07&statusColumn=cancelledOn
280
				String oneShipUrl = "http://shipping.snapdeal.com/vendor/ONESHIP/product-shipment/shippedData/fetch/?startDate="+startDate+"&endDate="+endDate+"&statusCode=COURIER_DELIVERED&statusColumn=deliveredOn&dispatchCategoryId=0";
-
 
281
				logger.info("One Ship Url "+oneShipUrl);
-
 
282
				
281
				
283
				post = new HttpPost("http://shipping.snapdeal.com/vendor/ONESHIP/product-shipment/shippedData/fetch");
282
				post = new HttpPost("http://shipping.snapdeal.com/vendor/ONESHIP/product-shipment/shippedData/fetch");
284
				nameValuePairs = new ArrayList<NameValuePair>();
283
				/*nameValuePairs = new ArrayList<NameValuePair>();
285
				nameValuePairs.add(new BasicNameValuePair("startDate",startDate));
284
				nameValuePairs.add(new BasicNameValuePair("startDate",startDate));
286
				nameValuePairs.add(new BasicNameValuePair("endDate",endDate));
285
				nameValuePairs.add(new BasicNameValuePair("endDate",endDate));
287
				nameValuePairs.add(new BasicNameValuePair("statusColumn","deliveredOn"));
286
				nameValuePairs.add(new BasicNameValuePair("statusColumn","deliveredOn"));
288
				nameValuePairs.add(new BasicNameValuePair("queryType","CREATED"));
287
				nameValuePairs.add(new BasicNameValuePair("queryType","CREATED"));*/
-
 
288
				String paramVal = "startDate="+startDate+"&endDate="+endDate+"&statusColumn=deliveredOn&queryType=CREATED";
-
 
289
				System.out.println(paramVal);
289
				post.setEntity(new UrlEncodedFormEntity(nameValuePairs,"utf-8"));
290
				StringEntity entity = new StringEntity(paramVal, "utf-8");
-
 
291
 
-
 
292
				post.setEntity(entity);
290
 
293
 
291
				try {
294
				try {
292
					response = client.execute(post);
295
					response = client.execute(post);
293
				} catch (Exception e) {
296
				} catch (Exception e) {
294
					logger.error("Unable to get Http Response for snapdeal oneship delivered orders", e);
297
					logger.error("Unable to get Http Response for snapdeal oneship delivered orders", e);