| Line 56... |
Line 56... |
| 56 |
UPDATE_PRICE_ON_FK = ConfigClient.getClient().get("sync_price_on_marketplace");
|
56 |
UPDATE_PRICE_ON_FK = ConfigClient.getClient().get("sync_price_on_marketplace");
|
| 57 |
} catch (ConfigException e) {
|
57 |
} catch (ConfigException e) {
|
| 58 |
logger.error("Unable to get sync prices on marketplace", e);
|
58 |
logger.error("Unable to get sync prices on marketplace", e);
|
| 59 |
UPDATE_PRICE_ON_FK = "false";
|
59 |
UPDATE_PRICE_ON_FK = "false";
|
| 60 |
}
|
60 |
}
|
| 61 |
System.out.println(UPDATE_PRICE_ON_FK);
|
61 |
logger.info(UPDATE_PRICE_ON_FK);
|
| 62 |
}
|
62 |
}
|
| 63 |
|
63 |
|
| 64 |
|
64 |
|
| 65 |
public boolean updatePrice(String skuAtFlipkart, String sellingPrice) throws ClientProtocolException, IOException, JSONException{
|
65 |
public boolean updatePrice(String skuAtFlipkart, String sellingPrice) throws ClientProtocolException, IOException, JSONException{
|
| 66 |
|
66 |
|
| Line 87... |
Line 87... |
| 87 |
while ((line = rd.readLine()) != null) {
|
87 |
while ((line = rd.readLine()) != null) {
|
| 88 |
System.out.println(line);
|
88 |
System.out.println(line);
|
| 89 |
}
|
89 |
}
|
| 90 |
String data = "{\"refiners\":{\"sku_id\":[\""+skuAtFlipkart+"\"]},\"verticalGroup\":{},\"sellerId\":\""+SELLER_ID+"\",\"pageSize\":10,\"pageNumber\":1,\"state\":\"LIVE\"}";
|
90 |
String data = "{\"refiners\":{\"sku_id\":[\""+skuAtFlipkart+"\"]},\"verticalGroup\":{},\"sellerId\":\""+SELLER_ID+"\",\"pageSize\":10,\"pageNumber\":1,\"state\":\"LIVE\"}";
|
| 91 |
//String data = "{\"refiners\":{\"sku_id\":[\"12442\"]},\"verticalGroup\":{},\"sellerId\":\"m2z93iskuj81qiid\",\"pageSize\":10,\"pageNumb
|
91 |
//String data = "{\"refiners\":{\"sku_id\":[\"12442\"]},\"verticalGroup\":{},\"sellerId\":\"m2z93iskuj81qiid\",\"pageSize\":10,\"pageNumb
|
| 92 |
System.out.println(data);
|
92 |
logger.info(data);
|
| 93 |
//HttpGet get_new = new HttpGet("https://seller.flipkart.com/dashboard/som/new_order_items?status=on_hold%2Capproved.payment_approved&sort=confirm_by_date&page="+i+"&page_size=100&_="+time);
|
93 |
//HttpGet get_new = new HttpGet("https://seller.flipkart.com/dashboard/som/new_order_items?status=on_hold%2Capproved.payment_approved&sort=confirm_by_date&page="+i+"&page_size=100&_="+time);
|
| 94 |
HttpPost httppost = new HttpPost("https://seller.flipkart.com/sellerListing/listing/listingsForContext?sellerId=m2z93iskuj81qiid");
|
94 |
HttpPost httppost = new HttpPost("https://seller.flipkart.com/sellerListing/listing/listingsForContext?sellerId=m2z93iskuj81qiid");
|
| 95 |
httppost.addHeader("Cookie",COOKIE);
|
95 |
httppost.addHeader("Cookie",COOKIE);
|
| 96 |
httppost.addHeader("User-agent", USER_AGENT);
|
96 |
httppost.addHeader("User-agent", USER_AGENT);
|
| 97 |
httppost.addHeader("Referer", "https://seller.flipkart.com/appV2");
|
97 |
httppost.addHeader("Referer", "https://seller.flipkart.com/appV2");
|
| Line 116... |
Line 116... |
| 116 |
JSONObject x = jsonArray.getJSONObject(i);
|
116 |
JSONObject x = jsonArray.getJSONObject(i);
|
| 117 |
listingId = x.get("listing").toString();
|
117 |
listingId = x.get("listing").toString();
|
| 118 |
}
|
118 |
}
|
| 119 |
|
119 |
|
| 120 |
data = getPostForSku(skuAtFlipkart, sellingPrice, listingId);
|
120 |
data = getPostForSku(skuAtFlipkart, sellingPrice, listingId);
|
| 121 |
System.out.println(listingId);
|
121 |
logger.info(listingId);
|
| 122 |
httppost = new HttpPost("https://seller.flipkart.com/sellerListing/listing/updateListings?sellerId=m2z93iskuj81qiid");
|
122 |
httppost = new HttpPost("https://seller.flipkart.com/sellerListing/listing/updateListings?sellerId=m2z93iskuj81qiid");
|
| 123 |
httppost.addHeader("Cookie",COOKIE);
|
123 |
httppost.addHeader("Cookie",COOKIE);
|
| 124 |
httppost.addHeader("User-agent", USER_AGENT);
|
124 |
httppost.addHeader("User-agent", USER_AGENT);
|
| 125 |
httppost.addHeader("Referer", "https://seller.flipkart.com/appV2");
|
125 |
httppost.addHeader("Referer", "https://seller.flipkart.com/appV2");
|
| 126 |
|
126 |
|
| Line 143... |
Line 143... |
| 143 |
String listingPrice = "";
|
143 |
String listingPrice = "";
|
| 144 |
for (int i = 0, size = jsonArray.length(); i < size; i++){
|
144 |
for (int i = 0, size = jsonArray.length(); i < size; i++){
|
| 145 |
JSONObject x = jsonArray.getJSONObject(i);
|
145 |
JSONObject x = jsonArray.getJSONObject(i);
|
| 146 |
listingPrice = x.get("listingPrice").toString();
|
146 |
listingPrice = x.get("listingPrice").toString();
|
| 147 |
}
|
147 |
}
|
| 148 |
System.out.println(listingPrice);
|
148 |
logger.info("New listing price "+listingPrice);
|
| 149 |
if (listingPrice.equalsIgnoreCase(sellingPrice)){
|
149 |
if (listingPrice.equalsIgnoreCase(sellingPrice)){
|
| 150 |
return true;
|
150 |
return true;
|
| 151 |
}
|
151 |
}
|
| 152 |
return false;
|
152 |
return false;
|
| 153 |
}
|
153 |
}
|