Subversion Repositories SmartDukaan

Rev

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

Rev 2066 Rev 2068
Line 1... Line 1...
1
package in.shop2020.catalog.dashboard.server;
1
package in.shop2020.catalog.dashboard.server;
2
 
2
 
3
import in.shop2020.catalog.dashboard.client.CatalogService;
3
import in.shop2020.catalog.dashboard.client.CatalogService;
4
import in.shop2020.catalog.dashboard.shared.Item;
4
import in.shop2020.catalog.dashboard.shared.Item;
-
 
5
import in.shop2020.catalog.dashboard.shared.ItemsComparator;
5
import in.shop2020.model.v1.catalog.InventoryService;
6
import in.shop2020.model.v1.catalog.InventoryService;
6
import in.shop2020.model.v1.catalog.VendorItemPricing;
7
import in.shop2020.model.v1.catalog.VendorItemPricing;
7
import in.shop2020.thrift.clients.CatalogServiceClient;
8
import in.shop2020.thrift.clients.CatalogServiceClient;
8
 
9
 
9
import java.util.ArrayList;
10
import java.util.ArrayList;
-
 
11
import java.util.Collections;
-
 
12
import java.util.Comparator;
10
import java.util.HashMap;
13
import java.util.HashMap;
11
import java.util.List;
14
import java.util.List;
12
import java.util.Map;
15
import java.util.Map;
13
import java.util.Map.Entry;
16
import java.util.Map.Entry;
14
 
17
 
Line 32... Line 35...
32
                itemList.add(getItemFromThriftItem(thriftItem, vip));
35
                itemList.add(getItemFromThriftItem(thriftItem, vip));
33
            }
36
            }
34
        } catch (Exception e) {
37
        } catch (Exception e) {
35
            e.printStackTrace();
38
            e.printStackTrace();
36
        }
39
        }
37
        
40
        Collections.sort(itemList, new ItemsComparator());
38
        return itemList;
41
        return itemList;
39
    }
42
    }
40
    
43
    
41
    public List<Item> getBestDeals(){
44
    public List<Item> getBestDeals(){
42
        List<Item> itemList = new ArrayList<Item>();
45
        List<Item> itemList = new ArrayList<Item>();
Line 51... Line 54...
51
                itemList.add(getItemFromThriftItem(thriftItem, vip));
54
                itemList.add(getItemFromThriftItem(thriftItem, vip));
52
            }
55
            }
53
        } catch(Exception e){
56
        } catch(Exception e){
54
            e.printStackTrace();
57
            e.printStackTrace();
55
        }
58
        }
56
        
59
        Collections.sort(itemList, new ItemsComparator());
57
        return itemList;
60
        return itemList;
58
    }
61
    }
59
    
62
    
60
    public List<Item> getBestSellers(){
63
    public List<Item> getBestSellers(){
61
        List<Item> itemList = new ArrayList<Item>();
64
        List<Item> itemList = new ArrayList<Item>();
Line 70... Line 73...
70
                itemList.add(getItemFromThriftItem(thriftItem, vip));
73
                itemList.add(getItemFromThriftItem(thriftItem, vip));
71
            }
74
            }
72
        } catch(Exception e){
75
        } catch(Exception e){
73
            e.printStackTrace();
76
            e.printStackTrace();
74
        }
77
        }
75
        
78
        Collections.sort(itemList, new ItemsComparator());
76
        return itemList;        
79
        return itemList;        
77
    }
80
    }
78
    
81
    
79
    public List<Item> getLatestArrivals(){
82
    public List<Item> getLatestArrivals(){
80
        List<Item> itemList = new ArrayList<Item>();
83
        List<Item> itemList = new ArrayList<Item>();
Line 89... Line 92...
89
                itemList.add(getItemFromThriftItem(thriftItem, vip));
92
                itemList.add(getItemFromThriftItem(thriftItem, vip));
90
            }
93
            }
91
        } catch(Exception e){
94
        } catch(Exception e){
92
            e.printStackTrace();
95
            e.printStackTrace();
93
        }
96
        }
94
        
97
        Collections.sort(itemList, new ItemsComparator());
95
        return itemList;
98
        return itemList;
96
    }
99
    }
97
    
100
    
98
    public Item getItem(long itemId){
101
    public Item getItem(long itemId){
99
        try{
102
        try{
Line 198... Line 201...
198
            tItem.setBestDealText(item.getBestDealsText());
201
            tItem.setBestDealText(item.getBestDealsText());
199
            tItem.setBestDealValue(item.getBestDealsValue());
202
            tItem.setBestDealValue(item.getBestDealsValue());
200
            tItem.setBestSellingRank(item.getBestSellingRank());
203
            tItem.setBestSellingRank(item.getBestSellingRank());
201
            tItem.setDefaultForEntity(item.isDefaultForEntity());
204
            tItem.setDefaultForEntity(item.isDefaultForEntity());
202
            
205
            
-
 
206
            tItem.setStartDate(item.getStartDate());
203
//          tItem.setAddedOn(item.getAddedOn());
207
//          tItem.setAddedOn(item.getAddedOn());
204
            
208
            
205
//          tItem.setCatalogItemId(item.getCatalogItemId());
209
//          tItem.setCatalogItemId(item.getCatalogItemId());
206
//          tItem.setCategory(item.getCategory());
210
//          tItem.setCategory(item.getCategory());
207
             
211