Subversion Repositories SmartDukaan

Rev

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

Rev 3126 Rev 3561
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;
-
 
15
import in.shop2020.model.v1.order.Order;
14
import in.shop2020.model.v1.order.Order;
16
import in.shop2020.model.v1.order.OrderStatus;
15
import in.shop2020.model.v1.order.OrderStatus;
17
import in.shop2020.serving.utils.FormattingUtils;
16
import in.shop2020.serving.utils.FormattingUtils;
18
import in.shop2020.thrift.clients.CatalogClient;
17
import in.shop2020.thrift.clients.CatalogClient;
19
import in.shop2020.thrift.clients.TransactionClient;
18
import in.shop2020.thrift.clients.TransactionClient;
Line 21... Line 20...
21
import org.apache.log4j.Logger;
20
import org.apache.log4j.Logger;
22
import org.apache.struts2.convention.annotation.InterceptorRef;
21
import org.apache.struts2.convention.annotation.InterceptorRef;
23
import org.apache.struts2.convention.annotation.InterceptorRefs;
22
import org.apache.struts2.convention.annotation.InterceptorRefs;
24
import org.apache.struts2.convention.annotation.Result;
23
import org.apache.struts2.convention.annotation.Result;
25
import org.apache.struts2.convention.annotation.Results;
24
import org.apache.struts2.convention.annotation.Results;
26
import org.apache.thrift.TException;
-
 
-
 
25
 
27
 
26
 
28
/**
27
/**
29
 * @author rajveer
28
 * @author rajveer
30
 *
29
 *
31
 */
30
 */
Line 104... Line 103...
104
    	}
103
    	}
105
    	cd.add(Calendar.MONTH, addition);
104
    	cd.add(Calendar.MONTH, addition);
106
    	SimpleDateFormat dateformat = new SimpleDateFormat("dd/MM/yyyy");
105
    	SimpleDateFormat dateformat = new SimpleDateFormat("dd/MM/yyyy");
107
    	return dateformat.format(cd.getTime());
106
    	return dateformat.format(cd.getTime());
108
    }
107
    }
109
	
-
 
110
	public long getCatalogId(long itemId){
-
 
111
		if(client != null){
-
 
112
			try {
-
 
113
				return client.getItem(itemId).getCatalogItemId();
-
 
114
			} catch (InventoryServiceException e) {
-
 
115
				logger.error("Not able to get item information from service.", e);
-
 
116
			} catch (TException e) {
-
 
117
				logger.error("Not able to get item information from service.", e);
-
 
118
			}
-
 
119
		}
-
 
120
		return 0;
-
 
121
	}
-
 
122
}
108
}
123
109