Subversion Repositories SmartDukaan

Rev

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

Rev 2355 Rev 2897
Line 35... Line 35...
35
    		params = {"actionName" , "login"})
35
    		params = {"actionName" , "login"})
36
})
36
})
37
public class MyaccountController extends BaseController {
37
public class MyaccountController extends BaseController {
38
 
38
 
39
	private static final long serialVersionUID = 1L;
39
	private static final long serialVersionUID = 1L;
40
	private static Logger log = Logger.getLogger(Class.class);
40
	private static Logger logger = Logger.getLogger(Class.class);
41
    private FormattingUtils formattingUtils = new FormattingUtils();
41
    private FormattingUtils formattingUtils = new FormattingUtils();
42
 
42
 
43
    Map<Long, String> providerNames = new HashMap<Long, String>();
43
    Map<Long, String> providerNames = new HashMap<Long, String>();
44
    List<Order> orders = null;
44
    List<Order> orders = null;
45
    List<String> orderDate = new ArrayList<String>();
45
    List<String> orderDate = new ArrayList<String>();
Line 47... Line 47...
47
	public MyaccountController() {
47
	public MyaccountController() {
48
		super();
48
		super();
49
	}
49
	}
50
    
50
    
51
	public String index(){
51
	public String index(){
52
    	log.info("this.request=" + this.request);
52
    	logger.info("this.request=" + this.request);
53
 
53
 
54
        try {
54
        try {
55
            TransactionServiceClient transactionServiceClient = new TransactionServiceClient();
55
            TransactionServiceClient transactionServiceClient = new TransactionServiceClient();
56
            in.shop2020.model.v1.order.TransactionService.Client orderClient = transactionServiceClient.getClient();
56
            in.shop2020.model.v1.order.TransactionService.Client orderClient = transactionServiceClient.getClient();
57
            orders = orderClient.getOrdersForCustomer(userinfo.getUserId(), 0, (new Date()).getTime(), null);
57
            orders = orderClient.getOrdersForCustomer(userinfo.getUserId(), 0, (new Date()).getTime(), null);
Line 63... Line 63...
63
            
63
            
64
            for(Provider provider: providers)
64
            for(Provider provider: providers)
65
                providerNames.put(provider.getId(), provider.getName());
65
                providerNames.put(provider.getId(), provider.getName());
66
            
66
            
67
        } catch (Exception e)   {
67
        } catch (Exception e)   {
68
            e.printStackTrace();
68
            logger.error("Error while getting the orders for the user", e);
69
        }
69
        }
70
        SimpleDateFormat dateformat = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss aa");
70
        SimpleDateFormat dateformat = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss aa");
71
        
71
        
72
        if(orders != null && !orders.isEmpty()){
72
        if(orders != null && !orders.isEmpty()){
73
            for(Order order: orders)    {
73
            for(Order order: orders)    {