| Line 1... |
Line 1... |
| 1 |
package in.shop2020.support.utils;
|
1 |
package in.shop2020.support.utils;
|
| 2 |
|
2 |
|
| 3 |
import in.shop2020.model.v1.catalog.CatalogService.Client;
|
3 |
import in.shop2020.model.v1.catalog.CatalogService.Client;
|
| 4 |
import in.shop2020.model.v1.catalog.CatalogServiceException;
|
4 |
import in.shop2020.model.v1.catalog.CatalogServiceException;
|
| 5 |
import in.shop2020.model.v1.catalog.Item;
|
5 |
import in.shop2020.model.v1.catalog.Item;
|
| - |
|
6 |
import in.shop2020.model.v1.order.OrderSource;
|
| 6 |
import in.shop2020.support.controllers.SnapdealListController;
|
7 |
import in.shop2020.support.controllers.SnapdealListController;
|
| 7 |
import in.shop2020.thrift.clients.CatalogClient;
|
8 |
import in.shop2020.thrift.clients.CatalogClient;
|
| 8 |
import in.shop2020.utils.GmailUtils;
|
9 |
import in.shop2020.utils.GmailUtils;
|
| 9 |
|
10 |
|
| 10 |
import java.io.BufferedReader;
|
11 |
import java.io.BufferedReader;
|
| Line 54... |
Line 55... |
| 54 |
this.timestamp = timestamp;
|
55 |
this.timestamp = timestamp;
|
| 55 |
}
|
56 |
}
|
| 56 |
public UpdateSDPricingUsingPanel() {
|
57 |
public UpdateSDPricingUsingPanel() {
|
| 57 |
}
|
58 |
}
|
| 58 |
public static void main(String... args) throws ClientProtocolException, IOException, TTransportException, CatalogServiceException, TException{
|
59 |
public static void main(String... args) throws ClientProtocolException, IOException, TTransportException, CatalogServiceException, TException{
|
| 59 |
Item item = new CatalogClient().getClient().getItem(2231);
|
60 |
Item item = new CatalogClient("catalog_service_server_host_amazon","catalog_service_server_port").getClient().getItem(2231);
|
| 60 |
UpdateSDPricingUsingPanel updatePriceOnSnapdeal = new UpdateSDPricingUsingPanel(22200f,"1108903",item,System.currentTimeMillis());
|
61 |
UpdateSDPricingUsingPanel updatePriceOnSnapdeal = new UpdateSDPricingUsingPanel(22200f,"1108903",item,System.currentTimeMillis());
|
| 61 |
logger.info("Calling Thread to update price at snapdeal");
|
62 |
logger.info("Calling Thread to update price at snapdeal");
|
| 62 |
updatePriceOnSnapdeal.start();
|
63 |
updatePriceOnSnapdeal.start();
|
| 63 |
|
64 |
|
| 64 |
}
|
65 |
}
|
| Line 184... |
Line 185... |
| 184 |
"SUPC : " +this.supc +"\n"+
|
185 |
"SUPC : " +this.supc +"\n"+
|
| 185 |
"Updated Price : " +this.price;
|
186 |
"Updated Price : " +this.price;
|
| 186 |
mailer.sendSSLMessage(sendTo, "Price updated on Snapdeal Item ID " + this.item.getId(),text, emailFromAddress , password,new ArrayList<File>());
|
187 |
mailer.sendSSLMessage(sendTo, "Price updated on Snapdeal Item ID " + this.item.getId(),text, emailFromAddress , password,new ArrayList<File>());
|
| 187 |
ArrayList<Long> updateList = new ArrayList<Long>();
|
188 |
ArrayList<Long> updateList = new ArrayList<Long>();
|
| 188 |
try {
|
189 |
try {
|
| 189 |
Client catalogClient = new CatalogClient().getClient();
|
190 |
Client catalogClient = new CatalogClient("catalog_service_server_host_amazon","catalog_service_server_port").getClient();
|
| 190 |
|
191 |
|
| 191 |
updateList.add(this.item.getId());
|
192 |
updateList.add(this.item.getId());
|
| 192 |
catalogClient.updateMarketPlacePriceUpdateStatus(updateList,this.timestamp,7L);
|
193 |
catalogClient.updateMarketPlacePriceUpdateStatus(updateList,this.timestamp,OrderSource.SNAPDEAL.getValue());
|
| 193 |
} catch (TException e) {
|
194 |
} catch (TException e) {
|
| 194 |
try {
|
195 |
try {
|
| 195 |
new CatalogClient().getClient().updateMarketPlacePriceUpdateStatus(updateList, timestamp,8);
|
196 |
new CatalogClient("catalog_service_server_host_amazon","catalog_service_server_port").getClient().updateMarketPlacePriceUpdateStatus(updateList, timestamp,OrderSource.SNAPDEAL.getValue());
|
| 196 |
} catch (TTransportException e1) {
|
197 |
} catch (TTransportException e1) {
|
| 197 |
e1.printStackTrace();
|
198 |
e1.printStackTrace();
|
| 198 |
logger.info("Exception" + e1);
|
199 |
logger.info("Exception" + e1);
|
| 199 |
} catch (TException e1) {
|
200 |
} catch (TException e1) {
|
| 200 |
e1.printStackTrace();
|
201 |
e1.printStackTrace();
|