| Line 61... |
Line 61... |
| 61 |
logger.info("Calling Thread to update price at snapdeal");
|
61 |
logger.info("Calling Thread to update price at snapdeal");
|
| 62 |
updatePriceOnSnapdeal.start();
|
62 |
updatePriceOnSnapdeal.start();
|
| 63 |
|
63 |
|
| 64 |
}
|
64 |
}
|
| 65 |
int updatePricing(Float price,String supc,Item item,Long timestamp) throws ClientProtocolException, IOException{
|
65 |
int updatePricing(Float price,String supc,Item item,Long timestamp) throws ClientProtocolException, IOException{
|
| 66 |
logger.info("Calling Update Snapdeal VOI Price Constructor --" + " Price :" +price + " Seller_Sku :"+supc +" Item ID:" +item.getId());
|
66 |
logger.info("Calling Update Snapdeal VOI Price Constructor --" + " Price :" +price + " supc :"+supc +" Item ID:" +item.getId());
|
| 67 |
long priceVal = (long)price.floatValue();
|
67 |
long priceVal = (long)price.floatValue();
|
| 68 |
HttpPost post = new HttpPost("http://seller.snapdeal.com/pricing/update");
|
68 |
HttpPost post = new HttpPost("http://seller.snapdeal.com/pricing/update");
|
| 69 |
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
|
69 |
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
|
| 70 |
nameValuePairs.add(new BasicNameValuePair("changedField",
|
70 |
nameValuePairs.add(new BasicNameValuePair("changedField",
|
| 71 |
"sellingPrice"));
|
71 |
"sellingPrice"));
|
| 72 |
nameValuePairs.add(new BasicNameValuePair("changedValue",
|
72 |
nameValuePairs.add(new BasicNameValuePair("changedValue",
|
| 73 |
priceVal+""));
|
73 |
priceVal+""));
|
| 74 |
nameValuePairs.add(new BasicNameValuePair("seller_sku",
|
74 |
nameValuePairs.add(new BasicNameValuePair("supc",
|
| 75 |
supc));
|
75 |
supc));
|
| 76 |
post.setEntity(new UrlEncodedFormEntity(nameValuePairs,"utf-8"));
|
76 |
post.setEntity(new UrlEncodedFormEntity(nameValuePairs,"utf-8"));
|
| 77 |
HttpResponse response = httpClient.execute(post);
|
77 |
HttpResponse response = httpClient.execute(post);
|
| 78 |
BufferedReader rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
|
78 |
BufferedReader rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
|
| 79 |
String line = "";
|
79 |
String line = "";
|