Subversion Repositories SmartDukaan

Rev

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

Rev 11446 Rev 12827
Line 3... Line 3...
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.thrift.clients.CatalogClient;
6
import in.shop2020.thrift.clients.CatalogClient;
7
import in.shop2020.utils.GmailUtils;
7
import in.shop2020.utils.GmailUtils;
-
 
8
import in.shop2020.serving.services.FlipkartPricingPannel;
8
 
9
 
9
import java.io.BufferedReader;
10
import java.io.BufferedReader;
10
import java.io.File;
11
import java.io.File;
11
import java.io.IOException;
12
import java.io.IOException;
12
import java.io.InputStreamReader;
13
import java.io.InputStreamReader;
Line 110... Line 111...
110
		String line;
111
		String line;
111
		boolean updated = false;
112
		boolean updated = false;
112
		try {
113
		try {
113
			while ((line = rd.readLine()) != null) {
114
			while ((line = rd.readLine()) != null) {
114
				logger.info("Response " + line);
115
				logger.info("Response " + line);
115
				if(line.equalsIgnoreCase("{\"status\":\"success\"}")){
116
				if(line.equalsIgnoreCase("{\"status\":\"succes\"}")){
116
					updated = true;
117
					updated = true;
117
				}
118
				}
118
			}
119
			}
119
		} catch (IOException e2) {
120
		} catch (IOException e2) {
120
			e2.printStackTrace();
121
			e2.printStackTrace();
Line 122... Line 123...
122
		GmailUtils mailer = new GmailUtils();
123
		GmailUtils mailer = new GmailUtils();
123
		String text = "Product : " +getProductName(this.item) +"\n"+ 
124
		String text = "Product : " +getProductName(this.item) +"\n"+ 
124
		"Item ID : " +this.item.getId() +"\n"+
125
		"Item ID : " +this.item.getId() +"\n"+
125
		"SKU at Flipkart : " +this.fksku +"\n"+
126
		"SKU at Flipkart : " +this.fksku +"\n"+
126
		"Updated Price : " +this.price;
127
		"Updated Price : " +this.price;
-
 
128
		if(!updated){
-
 
129
		    FlipkartPricingPannel fkPricingPannel = new FlipkartPricingPannel();
-
 
130
		    try {
-
 
131
                updated = fkPricingPannel.updatePrice(this.fksku, String.valueOf(this.price));
-
 
132
            } catch (Exception e) {
-
 
133
                logger.info("Exception" + e);
-
 
134
            }
-
 
135
		}
127
		if(updated){
136
		if(updated){
128
			ArrayList<Long> updateList = new ArrayList<Long>();
137
			ArrayList<Long> updateList = new ArrayList<Long>();
129
			try {
138
			try {
130
				Client catalogClient = new CatalogClient("catalog_service_server_host_amazon","catalog_service_server_port").getClient();
139
				Client catalogClient = new CatalogClient("catalog_service_server_host_amazon","catalog_service_server_port").getClient();
131
 
140