Subversion Repositories SmartDukaan

Rev

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

Rev 3516 Rev 3560
Line 4... Line 4...
4
import in.shop2020.metamodel.core.EntityStatus;
4
import in.shop2020.metamodel.core.EntityStatus;
5
import in.shop2020.metamodel.util.CreationUtils;
5
import in.shop2020.metamodel.util.CreationUtils;
6
import in.shop2020.metamodel.util.ExpandedEntity;
6
import in.shop2020.metamodel.util.ExpandedEntity;
7
import in.shop2020.model.v1.catalog.InventoryService.Client;
7
import in.shop2020.model.v1.catalog.InventoryService.Client;
8
import in.shop2020.model.v1.catalog.Item;
8
import in.shop2020.model.v1.catalog.Item;
-
 
9
import in.shop2020.model.v1.catalog.Source;
9
import in.shop2020.model.v1.catalog.status;
10
import in.shop2020.model.v1.catalog.status;
10
import in.shop2020.thrift.clients.CatalogClient;
11
import in.shop2020.thrift.clients.CatalogClient;
11
import in.shop2020.ui.util.CatalogUploderToGAE;
12
import in.shop2020.ui.util.CatalogUploderToGAE;
12
import in.shop2020.ui.util.ComparisonStatsFetcher;
13
import in.shop2020.ui.util.ComparisonStatsFetcher;
13
import in.shop2020.ui.util.NewVUI;
14
import in.shop2020.ui.util.NewVUI;
Line 48... Line 49...
48
    private static String ENTITY_ID = "ALL";
49
    private static String ENTITY_ID = "ALL";
49
    Map<Long, Entity> entities;
50
    Map<Long, Entity> entities;
50
    List<Item> items;
51
    List<Item> items;
51
    List<Item> contentCompleteItems  = new ArrayList<Item>();
52
    List<Item> contentCompleteItems  = new ArrayList<Item>();
52
    List<Item> phasedOutItems;
53
    List<Item> phasedOutItems;
-
 
54
    List<Source> sources;
53
    CatalogClient csc;
55
    CatalogClient csc;
54
    Client client;
56
    Client client;
55
    Map<Long, List<Item>> entityIdItemMap = new LinkedHashMap<Long, List<Item>>();
57
    Map<Long, List<Item>> entityIdItemMap = new LinkedHashMap<Long, List<Item>>();
56
    private CommandLine cmd = null; // Command Line arguments
58
    private CommandLine cmd = null; // Command Line arguments
57
    Long lastGenerationTime;
59
    Long lastGenerationTime;
Line 228... Line 230...
228
        PriceInsertor priceInserter = new PriceInsertor();
230
        PriceInsertor priceInserter = new PriceInsertor();
229
		
231
		
230
        for(Map.Entry<Long, List<Item>> entry: entityIdItemMap.entrySet()){
232
        for(Map.Entry<Long, List<Item>> entry: entityIdItemMap.entrySet()){
231
        	long entityId = entry.getKey();
233
        	long entityId = entry.getKey();
232
        	List<Item> items = entry.getValue();
234
        	List<Item> items = entry.getValue();
233
            //TODO Domain name and destination  directory should be read from properties file
235
        	//TODO Domain name and destination  directory should be read from properties file
234
        	priceInserter.insertPriceInHtml(items, entityId, "saholic.com", Utils.EXPORT_ENTITIES_PATH_SAHOLIC);
236
        	double minPrice = priceInserter.insertPriceInHtml(items, entityId, "saholic.com", Utils.EXPORT_ENTITIES_PATH_SAHOLIC, null);
235
        	priceInserter.insertPriceInHtml(items, entityId, "shop2020.in", Utils.EXPORT_ENTITIES_PATH_SHOP2020);
237
        	priceInserter.insertPriceInHtml(items, entityId, "shop2020.in", Utils.EXPORT_ENTITIES_PATH_SHOP2020, null);
236
        	priceInserter.insertPriceInHtml(items, entityId, "localhost:8090", Utils.EXPORT_ENTITIES_PATH_LOCALHOST);
238
        	priceInserter.insertPriceInHtml(items, entityId, "localhost:8090", Utils.EXPORT_ENTITIES_PATH_LOCALHOST, null);
-
 
239
        	StringBuilder priceString = new StringBuilder("<field name=\"F_50002\">"+ minPrice +"</field>"); 
-
 
240
        	
-
 
241
        	if(sources != null){
-
 
242
        		for(Source source: sources){
-
 
243
            		minPrice = priceInserter.insertPriceInHtml(items, entityId, "saholic.com", Utils.EXPORT_ENTITIES_PATH_SAHOLIC, source);
-
 
244
            		priceInserter.insertPriceInHtml(items, entityId, "shop2020.in", Utils.EXPORT_ENTITIES_PATH_SHOP2020, source);
-
 
245
                	priceInserter.insertPriceInHtml(items, entityId, "localhost:8090", Utils.EXPORT_ENTITIES_PATH_LOCALHOST, source);
-
 
246
                	priceString.append("<field name=\"F_50002_" + source.getId() + "\">" + minPrice +"</field>");
-
 
247
            	}
-
 
248
        	}
-
 
249
        	
237
        	priceInserter.insertPriceInSolrData(entityId, getMinPrice(items));
250
        	priceInserter.insertPriceInSolrData(entityId, priceString.toString());
238
        }
251
        }
239
        
252
        
240
        //Generate partners and json objects for phones only
253
        //Generate partners and json objects for phones only
241
        if(!GENERATION_TYPE.equals("ONE")) {
254
        if(!GENERATION_TYPE.equals("ONE")) {
242
        	ProductListGenerator generator = new ProductListGenerator(entityIdItemMap);
255
        	ProductListGenerator generator = new ProductListGenerator(entityIdItemMap);