| Line 68... |
Line 68... |
| 68 |
|
68 |
|
| 69 |
private static final Logger logger = LogManager.getLogger(FofoSolr.class);
|
69 |
private static final Logger logger = LogManager.getLogger(FofoSolr.class);
|
| 70 |
|
70 |
|
| 71 |
private static final List<Integer> CATEGORY_MASTER = Arrays.asList(10006, 10010, 14202, 14203);
|
71 |
private static final List<Integer> CATEGORY_MASTER = Arrays.asList(10006, 10010, 14202, 14203);
|
| 72 |
|
72 |
|
| 73 |
String solrPath = "http://"+solrUrl+"8984/solr/demo";
|
73 |
String solrPath = "http://" + solrUrl + "8984/solr/demo";
|
| 74 |
String mongoHost = "localhost";
|
74 |
String mongoHost = "localhost";
|
| 75 |
SolrClient solr = new HttpSolrClient.Builder(solrPath).build();
|
75 |
SolrClient solr = new HttpSolrClient.Builder(solrPath).build();
|
| 76 |
|
76 |
|
| 77 |
private String getAvailabilityJSON() {
|
77 |
private String getAvailabilityJSON() {
|
| 78 |
String url = "http://50.116.10.120/reports/run.php?execute_mode=EXECUTE&xmlin=warehousecisnew.xml&project=FOCOR&project_password=focor&target_format=JSON";
|
78 |
String url = "http://50.116.10.120/reports/run.php?execute_mode=EXECUTE&xmlin=warehousecisnew.xml&project=FOCOR&project_password=focor&target_format=JSON";
|
| Line 256... |
Line 256... |
| 256 |
}
|
256 |
}
|
| 257 |
|
257 |
|
| 258 |
return catalogLabelMap;
|
258 |
return catalogLabelMap;
|
| 259 |
}
|
259 |
}
|
| 260 |
|
260 |
|
| 261 |
public void populateTagItems() throws Exception {
|
261 |
public void populateTagItems() throws Exception {
|
| 262 |
Map<String, Map<String, Map<String, Integer>>> availabilityItemMap = getItemMap();
|
262 |
Map<String, Map<String, Map<String, Integer>>> availabilityItemMap = getItemMap();
|
| 263 |
List<TagRanking> tagRankingList = tagRankingRepository.getAllTagRanking();
|
263 |
List<TagRanking> tagRankingList = tagRankingRepository.getAllTagRanking();
|
| 264 |
List<Integer> rankingList = new ArrayList<>();
|
264 |
List<Integer> rankingList = new ArrayList<>();
|
| 265 |
Map<Integer, String> featureMap = new HashMap<>();
|
265 |
Map<Integer, String> featureMap = new HashMap<>();
|
| 266 |
for (TagRanking tagRanking : tagRankingList) {
|
266 |
for (TagRanking tagRanking : tagRankingList) {
|
| Line 313... |
Line 313... |
| 313 |
catalogObj.put("items", new HashMap<Integer, Map<String, Object>>());
|
313 |
catalogObj.put("items", new HashMap<Integer, Map<String, Object>>());
|
| 314 |
Map<String, Object> filterMap = new HashMap<>();
|
314 |
Map<String, Object> filterMap = new HashMap<>();
|
| 315 |
filterMap.put("_id", item.getCatalogItemId());
|
315 |
filterMap.put("_id", item.getCatalogItemId());
|
| 316 |
// Don't include if catalog not available
|
316 |
// Don't include if catalog not available
|
| 317 |
try {
|
317 |
try {
|
| - |
|
318 |
String imageUrl = contentMongoClient.getEntityById(item.getCatalogItemId()).getDefaultImageUrl();
|
| 318 |
|
319 |
|
| 319 |
catalogObj.put("imageUrl",
|
320 |
if (imageUrl != null) {
|
| 320 |
contentMongoClient.getEntityById(item.getCatalogItemId()).getDefaultImageUrl());
|
321 |
catalogObj.put("imageUrl", imageUrl);
|
| - |
|
322 |
} else {
|
| 321 |
System.out.println(catalogObj.get("imageUrl"));
|
323 |
catalogObj.put("imageUrl",
|
| - |
|
324 |
"https://images.smartdukaan.com/uploads/campaigns/" + item.getCatalogItemId() + ".jpg");
|
| - |
|
325 |
}
|
| 322 |
} catch (Exception e) {
|
326 |
} catch (Exception e) {
|
| 323 |
try {
|
327 |
try {
|
| 324 |
catalogObj.put("imageUrl",
|
328 |
catalogObj.put("imageUrl",
|
| 325 |
"https://images.smartdukaan.com/uploads/campaigns/" + item.getCatalogItemId() + ".jpg");
|
329 |
"https://images.smartdukaan.com/uploads/campaigns/" + item.getCatalogItemId() + ".jpg");
|
| 326 |
} catch (Exception e2) {
|
330 |
} catch (Exception e2) {
|