Subversion Repositories SmartDukaan

Rev

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

Rev 4882 Rev 4934
Line 3... Line 3...
3
 */
3
 */
4
package in.shop2020.serving.controllers;
4
package in.shop2020.serving.controllers;
5
 
5
 
6
 
6
 
7
import in.shop2020.datalogger.EventType;
7
import in.shop2020.datalogger.EventType;
-
 
8
import in.shop2020.logistics.DeliveryType;
-
 
9
import in.shop2020.logistics.LogisticsService;
8
import in.shop2020.model.v1.catalog.Item;
10
import in.shop2020.model.v1.catalog.Item;
9
import in.shop2020.model.v1.user.UserContextService.Client;
11
import in.shop2020.model.v1.user.UserContextService.Client;
10
import in.shop2020.serving.cache.EhcacheWrapper;
12
import in.shop2020.serving.cache.EhcacheWrapper;
11
import in.shop2020.serving.services.ContentServingService;
13
import in.shop2020.serving.services.ContentServingService;
12
import in.shop2020.serving.utils.SnippetType;
14
import in.shop2020.serving.utils.SnippetType;
13
import in.shop2020.thrift.clients.CatalogClient;
15
import in.shop2020.thrift.clients.CatalogClient;
-
 
16
import in.shop2020.thrift.clients.LogisticsClient;
14
import in.shop2020.thrift.clients.PromotionClient;
17
import in.shop2020.thrift.clients.PromotionClient;
15
import in.shop2020.thrift.clients.UserClient;
18
import in.shop2020.thrift.clients.UserClient;
16
import in.shop2020.utils.DataLogger;
19
import in.shop2020.utils.DataLogger;
17
 
20
 
18
import java.io.IOException;
21
import java.io.IOException;
19
import java.util.HashMap;
22
import java.util.HashMap;
-
 
23
import java.util.List;
20
import java.util.Map;
24
import java.util.Map;
21
 
25
 
22
import net.sf.ehcache.CacheManager;
26
import net.sf.ehcache.CacheManager;
23
 
27
 
24
import org.apache.log4j.Logger;
28
import org.apache.log4j.Logger;
Line 27... Line 31...
27
import org.apache.struts2.convention.annotation.Result;
31
import org.apache.struts2.convention.annotation.Result;
28
import org.apache.struts2.convention.annotation.Results;
32
import org.apache.struts2.convention.annotation.Results;
29
import org.json.JSONException;
33
import org.json.JSONException;
30
import org.json.JSONObject;
34
import org.json.JSONObject;
31
 
35
 
-
 
36
import com.google.gson.Gson;
-
 
37
 
32
/**
38
/**
33
 * 
39
 * 
34
 * @author rajveer
40
 * @author rajveer
35
 *
41
 *
36
 */
42
 */
Line 266... Line 272...
266
    }
272
    }
267
    
273
    
268
    public Map<String, Double> getDiscounts()	{
274
    public Map<String, Double> getDiscounts()	{
269
    	return discounts;
275
    	return discounts;
270
    }
276
    }
-
 
277
    
-
 
278
    public String getEntityLogisticsEstimation(){
-
 
279
    	List<Long> items=null; 
-
 
280
    	try {
-
 
281
    		LogisticsClient cl = new LogisticsClient();
-
 
282
            LogisticsService.Client client = cl.getClient();
-
 
283
            items = client.getEntityLogisticsEstimation(productId, userinfo.getPincode(), DeliveryType.PREPAID );
-
 
284
        } catch (Exception e1) {
-
 
285
            log.error("Unable to get items by catalog item id", e1);
-
 
286
        }
-
 
287
        return new Gson().toJson(items);
-
 
288
    }
271
}
289
}
272
290