Subversion Repositories SmartDukaan

Rev

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

Rev 3022 Rev 3126
Line 13... Line 13...
13
import in.shop2020.model.v1.catalog.InventoryService.Client;
13
import in.shop2020.model.v1.catalog.InventoryService.Client;
14
import in.shop2020.model.v1.catalog.InventoryServiceException;
14
import in.shop2020.model.v1.catalog.InventoryServiceException;
15
import in.shop2020.model.v1.order.Order;
15
import in.shop2020.model.v1.order.Order;
16
import in.shop2020.model.v1.order.OrderStatus;
16
import in.shop2020.model.v1.order.OrderStatus;
17
import in.shop2020.serving.utils.FormattingUtils;
17
import in.shop2020.serving.utils.FormattingUtils;
18
import in.shop2020.thrift.clients.CatalogServiceClient;
18
import in.shop2020.thrift.clients.CatalogClient;
19
import in.shop2020.thrift.clients.TransactionServiceClient;
19
import in.shop2020.thrift.clients.TransactionClient;
20
 
20
 
21
import org.apache.log4j.Logger;
21
import org.apache.log4j.Logger;
22
import org.apache.struts2.convention.annotation.InterceptorRef;
22
import org.apache.struts2.convention.annotation.InterceptorRef;
23
import org.apache.struts2.convention.annotation.InterceptorRefs;
23
import org.apache.struts2.convention.annotation.InterceptorRefs;
24
import org.apache.struts2.convention.annotation.Result;
24
import org.apache.struts2.convention.annotation.Result;
Line 49... Line 49...
49
 
49
 
50
    Map<Long, String> providerNames = new HashMap<Long, String>();
50
    Map<Long, String> providerNames = new HashMap<Long, String>();
51
    List<Order> orders = null;
51
    List<Order> orders = null;
52
    List<String> orderDate = new ArrayList<String>();
52
    List<String> orderDate = new ArrayList<String>();
53
	
53
	
54
    CatalogServiceClient csc = null;
54
    CatalogClient csc = null;
55
    Client client = null;
55
    Client client = null;
56
	public MyPurchasesController() {
56
	public MyPurchasesController() {
57
		super();
57
		super();
58
		try {
58
		try {
59
			csc = new CatalogServiceClient();
59
			csc = new CatalogClient();
60
			client = csc.getClient();
60
			client = csc.getClient();
61
		} catch (Exception e) {
61
		} catch (Exception e) {
62
			logger.error("Unable to get catalog service client", e);
62
			logger.error("Unable to get catalog service client", e);
63
		}
63
		}
64
	}
64
	}
65
    
65
    
66
	public String index(){
66
	public String index(){
67
        TransactionServiceClient transactionServiceClient = null;
67
        TransactionClient transactionServiceClient = null;
68
        in.shop2020.model.v1.order.TransactionService.Client orderClient = null;
68
        in.shop2020.model.v1.order.TransactionService.Client orderClient = null;
69
        try{
69
        try{
70
            transactionServiceClient = new TransactionServiceClient();
70
            transactionServiceClient = new TransactionClient();
71
            orderClient = transactionServiceClient.getClient();
71
            orderClient = transactionServiceClient.getClient();
72
            orders = orderClient.getOrdersForCustomer(userinfo.getUserId(), 0, (new Date()).getTime(), statuses);
72
            orders = orderClient.getOrdersForCustomer(userinfo.getUserId(), 0, (new Date()).getTime(), statuses);
73
            Collections.reverse(orders);
73
            Collections.reverse(orders);
74
        } catch (Exception e)   {
74
        } catch (Exception e)   {
75
        	logger.error("Not able to get order information from service.");
75
        	logger.error("Not able to get order information from service.");