Subversion Repositories SmartDukaan

Rev

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

Rev 9280 Rev 9283
Line 73... Line 73...
73
            e.printStackTrace();
73
            e.printStackTrace();
74
        }
74
        }
75
    }
75
    }
76
    CatalogClient csc;
76
    CatalogClient csc;
77
    Client client;
77
    Client client;
-
 
78
    PojoCreator creator;
78
 
79
 
79
	public PriceInsertor() throws TTransportException{
80
	public PriceInsertor() throws TTransportException{
-
 
81
        creator = new PojoCreator();
80
        csc = new CatalogClient();
82
        csc = new CatalogClient();
81
        client = csc.getClient();
83
        client = csc.getClient();
82
	}
84
	}
83
	
85
	
84
	public void copySolrSchemaFiles() throws IOException{
86
	public void copySolrSchemaFiles() throws IOException{
Line 159... Line 161...
159
			itemDetails.add(itemDetail);
161
			itemDetails.add(itemDetail);
160
			itemPojo.setId(item.getId());
162
			itemPojo.setId(item.getId());
161
			itemPojo.setSellingPrice(item.getSellingPrice());
163
			itemPojo.setSellingPrice(item.getSellingPrice());
162
			itemPojo.setMrp(mrp);
164
			itemPojo.setMrp(mrp);
163
			itemPojo.setColor(item.getColor());
165
			itemPojo.setColor(item.getColor());
-
 
166
			String em = getEMI(item.getSellingPrice());
-
 
167
			if(em!=null){
164
			itemPojo.setMinEmi(Double.parseDouble(getEMI(item.getSellingPrice())));
168
				itemPojo.setMinEmi(Double.parseDouble(em));
-
 
169
			}
-
 
170
			itemPojos.add(itemPojo);
165
			
171
			
166
			if(item.getItemStatus().equals(status.COMING_SOON)){
172
			if(item.getItemStatus().equals(status.COMING_SOON)){
167
				afterArrival = "after arrival";
173
				afterArrival = "after arrival";
168
				if(!item.isShowSellingPrice()){
174
				if(!item.isShowSellingPrice()){
169
					showPrice = "FALSE";
175
					showPrice = "FALSE";
Line 255... Line 261...
255
            }
261
            }
256
        }
262
        }
257
        getHtmlFromVelocity(filenames,exportPath,context,catalogId);
263
        getHtmlFromVelocity(filenames,exportPath,context,catalogId);
258
        
264
        
259
        //Update catalogInfo to catalog
265
        //Update catalogInfo to catalog
260
        
-
 
261
        PojoCreator creator = new PojoCreator();
-
 
262
        creator.updateCatalogInfo(catalogId, minPriceItem.getSellingPrice(), minPriceItem.getMrp(), offerText, Double.parseDouble(emiString), itemPojos);
266
        creator.updateCatalogInfo(catalogId, minPriceItem.getSellingPrice(), minPriceItem.getMrp(), offerText, emiString!=null?Double.parseDouble(emiString):null, itemPojos);
263
        return minPriceItem.getSellingPrice();
267
        return minPriceItem.getSellingPrice();
264
    }
268
    }
265
    
269
    
266
    private static String getEMI(double sellingPrice) {
270
    private static String getEMI(double sellingPrice) {
267
        String returnString = null;
271
        String returnString = null;