Subversion Repositories SmartDukaan

Rev

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

Rev 3719 Rev 4025
Line 55... Line 55...
55
		s = s.replaceAll("<field name=\"F_50002\">.*</field>", priceString);
55
		s = s.replaceAll("<field name=\"F_50002\">.*</field>", priceString);
56
		File f1 = new File(finalFile);
56
		File f1 = new File(finalFile);
57
		FileUtils.writeStringToFile(f1, s);
57
		FileUtils.writeStringToFile(f1, s);
58
	}
58
	}
59
	
59
	
-
 
60
	/**
-
 
61
	 * 
-
 
62
	 * 
-
 
63
	 * @param items
-
 
64
	 * @param catalogId
-
 
65
	 * @param domain
-
 
66
	 * @param exportPath
-
 
67
	 * @param source
-
 
68
	 * @return
-
 
69
	 */
60
	public double insertPriceInHtml(List<Item> items, long catalogId, String domain, String exportPath, Source source){
70
	public double insertPriceInHtml(List<Item> items, long catalogId, String domain, String exportPath, Source source){
61
		List<Map<String, String>> itemDetails = new ArrayList<Map<String,String>>(); 
71
		List<Map<String, String>> itemDetails = new ArrayList<Map<String,String>>();
-
 
72
		String offerText = null;
62
		Item minPriceItem = null;
73
		Item minPriceItem = null;
63
		for(Item item: items){
74
		for(Item item: items){
64
			Map<String, String> itemDetail = new HashMap<String, String>();
75
			Map<String, String> itemDetail = new HashMap<String, String>();
65
			boolean showmrp = true;
76
			boolean showmrp = true;
66
			double sellingPrice = item.getSellingPrice();
77
			double sellingPrice = item.getSellingPrice();
Line 93... Line 104...
93
			itemDetail.put("COLOR", item.getColor());
104
			itemDetail.put("COLOR", item.getColor());
94
			itemDetail.put("CATALOG_ID", ((int)item.getCatalogItemId())+"");
105
			itemDetail.put("CATALOG_ID", ((int)item.getCatalogItemId())+"");
95
			itemDetail.put("SHOWMRP", showmrp +"");
106
			itemDetail.put("SHOWMRP", showmrp +"");
96
			itemDetail.put("IS_SELECTED", item.isDefaultForEntity() ? "SELECTED" : "");
107
			itemDetail.put("IS_SELECTED", item.isDefaultForEntity() ? "SELECTED" : "");
97
			itemDetails.add(itemDetail);
108
			itemDetails.add(itemDetail);
-
 
109
			
-
 
110
			String bestDealsText = item.getBestDealText();
-
 
111
			if( bestDealsText != null && bestDealsText.length() > 0 && offerText == null){
-
 
112
				offerText = bestDealsText;
-
 
113
			}
98
		}
114
		}
99
		
115
		
100
		
116
		
101
		
117
		
102
		
118
		
Line 120... Line 136...
120
		VelocityContext context = new VelocityContext();
136
		VelocityContext context = new VelocityContext();
121
		context.put("itemDetails", itemDetails);
137
		context.put("itemDetails", itemDetails);
122
		context.put("minPriceItem", minPriceItem);
138
		context.put("minPriceItem", minPriceItem);
123
		context.put("domain", domain);
139
		context.put("domain", domain);
124
		context.put("staticurl", staticurl);
140
		context.put("staticurl", staticurl);
-
 
141
		context.put("OFFER_TEXT", offerText);
125
	
142
		
126
		List<String> filenames = new ArrayList<String>();
143
		List<String> filenames = new ArrayList<String>();
127
		filenames.add("ProductDetail");
144
		filenames.add("ProductDetail");
128
		filenames.add("WidgetSnippet");
145
		filenames.add("WidgetSnippet");
129
		filenames.add("HomeSnippet");
146
		filenames.add("HomeSnippet");
130
		filenames.add("SearchSnippet");
147
		filenames.add("SearchSnippet");