Subversion Repositories SmartDukaan

Rev

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

Rev 3561 Rev 3950
Line 9... Line 9...
9
import java.util.HashMap;
9
import java.util.HashMap;
10
import java.util.List;
10
import java.util.List;
11
import java.util.Map;
11
import java.util.Map;
12
 
12
 
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.order.Order;
15
import in.shop2020.model.v1.order.Order;
15
import in.shop2020.model.v1.order.OrderStatus;
16
import in.shop2020.model.v1.order.OrderStatus;
16
import in.shop2020.serving.utils.FormattingUtils;
17
import in.shop2020.serving.utils.FormattingUtils;
17
import in.shop2020.thrift.clients.CatalogClient;
18
import in.shop2020.thrift.clients.CatalogClient;
18
import in.shop2020.thrift.clients.TransactionClient;
19
import in.shop2020.thrift.clients.TransactionClient;
Line 20... Line 21...
20
import org.apache.log4j.Logger;
21
import org.apache.log4j.Logger;
21
import org.apache.struts2.convention.annotation.InterceptorRef;
22
import org.apache.struts2.convention.annotation.InterceptorRef;
22
import org.apache.struts2.convention.annotation.InterceptorRefs;
23
import org.apache.struts2.convention.annotation.InterceptorRefs;
23
import org.apache.struts2.convention.annotation.Result;
24
import org.apache.struts2.convention.annotation.Result;
24
import org.apache.struts2.convention.annotation.Results;
25
import org.apache.struts2.convention.annotation.Results;
-
 
26
import org.apache.thrift.TException;
25
 
27
 
26
 
28
 
27
/**
29
/**
28
 * @author rajveer
30
 * @author rajveer
29
 *
31
 *
Line 92... Line 94...
92
    	Date date = new Date(timestamp);
94
    	Date date = new Date(timestamp);
93
    	SimpleDateFormat dateformat = new SimpleDateFormat("dd/MM/yyyy");
95
    	SimpleDateFormat dateformat = new SimpleDateFormat("dd/MM/yyyy");
94
    	return dateformat.format(date);
96
    	return dateformat.format(date);
95
    }
97
    }
96
    
98
    
-
 
99
    public long getCatalogId(long itemId){
-
 
100
    	long catalogId = 0;
-
 
101
    	try {
-
 
102
    		catalogId = csc.getClient().getItem(itemId).getCatalogItemId();
-
 
103
		} catch (InventoryServiceException e) {
-
 
104
			logger.error("Unable to get item information." + e);
-
 
105
		} catch (TException e) {
-
 
106
			logger.error("Unable to get item information." + e);
-
 
107
		}
-
 
108
		return catalogId;
-
 
109
    }
-
 
110
    
97
	public String getWarrantyDate(long timestamp, String brand){
111
	public String getWarrantyDate(long timestamp, String brand){
98
    	Calendar cd = Calendar.getInstance();
112
    	Calendar cd = Calendar.getInstance();
99
    	cd.setTimeInMillis(timestamp);
113
    	cd.setTimeInMillis(timestamp);
100
    	int addition = 12;
114
    	int addition = 12;
101
    	if(brand.equalsIgnoreCase(brand.trim())){
115
    	if(brand.equalsIgnoreCase(brand.trim())){