| Line 1... |
Line 1... |
| 1 |
package com.spice.profitmandi.dao.service.solr;
|
1 |
package com.spice.profitmandi.dao.service.solr;
|
| 2 |
|
2 |
|
| 3 |
import java.io.BufferedReader;
|
3 |
import com.google.gson.Gson;
|
| 4 |
import java.io.IOException;
|
4 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
| 5 |
import java.io.InputStream;
|
5 |
import com.spice.profitmandi.dao.entity.catalog.TagListing;
|
| 6 |
import java.io.InputStreamReader;
|
6 |
import com.spice.profitmandi.dao.entity.catalog.TagRanking;
|
| 7 |
import java.net.HttpURLConnection;
|
7 |
import com.spice.profitmandi.dao.entity.dtr.WebProductListing;
|
| 8 |
import java.net.URL;
|
- |
|
| 9 |
import java.net.URLConnection;
|
8 |
import com.spice.profitmandi.dao.repository.catalog.TagListingRepository;
|
| 10 |
import java.time.ZoneId;
|
- |
|
| 11 |
import java.util.ArrayList;
|
9 |
import com.spice.profitmandi.dao.repository.catalog.TagRankingRepository;
|
| 12 |
import java.util.Arrays;
|
- |
|
| 13 |
import java.util.HashMap;
|
10 |
import com.spice.profitmandi.dao.repository.dtr.Mongo;
|
| 14 |
import java.util.List;
|
11 |
import com.spice.profitmandi.dao.repository.dtr.WebListingRepository;
|
| 15 |
import java.util.Map;
|
- |
|
| 16 |
import java.util.Map.Entry;
|
12 |
import com.spice.profitmandi.dao.repository.dtr.WebProductListingRepository;
|
| 17 |
import java.util.stream.Collectors;
|
13 |
import com.spice.profitmandi.service.tag.ItemTagModel;
|
| 18 |
import java.util.zip.GZIPInputStream;
|
14 |
import in.shop2020.model.v1.catalog.status;
|
| 19 |
|
- |
|
| 20 |
import org.apache.logging.log4j.LogManager;
|
15 |
import org.apache.logging.log4j.LogManager;
|
| 21 |
import org.apache.logging.log4j.Logger;
|
16 |
import org.apache.logging.log4j.Logger;
|
| 22 |
import org.apache.solr.client.solrj.SolrClient;
|
17 |
import org.apache.solr.client.solrj.SolrClient;
|
| 23 |
import org.apache.solr.client.solrj.impl.HttpSolrClient;
|
18 |
import org.apache.solr.client.solrj.impl.HttpSolrClient;
|
| 24 |
import org.apache.solr.common.SolrInputDocument;
|
19 |
import org.apache.solr.common.SolrInputDocument;
|
| Line 27... |
Line 22... |
| 27 |
import org.json.JSONObject;
|
22 |
import org.json.JSONObject;
|
| 28 |
import org.springframework.beans.factory.annotation.Autowired;
|
23 |
import org.springframework.beans.factory.annotation.Autowired;
|
| 29 |
import org.springframework.beans.factory.annotation.Value;
|
24 |
import org.springframework.beans.factory.annotation.Value;
|
| 30 |
import org.springframework.stereotype.Component;
|
25 |
import org.springframework.stereotype.Component;
|
| 31 |
|
26 |
|
| 32 |
import com.google.gson.Gson;
|
27 |
import java.io.BufferedReader;
|
| 33 |
import com.spice.profitmandi.dao.entity.catalog.TagListing;
|
28 |
import java.io.IOException;
|
| 34 |
import com.spice.profitmandi.dao.entity.catalog.TagRanking;
|
29 |
import java.io.InputStream;
|
| 35 |
import com.spice.profitmandi.dao.entity.dtr.WebProductListing;
|
30 |
import java.io.InputStreamReader;
|
| 36 |
import com.spice.profitmandi.dao.repository.catalog.TagListingRepository;
|
31 |
import java.net.HttpURLConnection;
|
| - |
|
32 |
import java.net.URL;
|
| 37 |
import com.spice.profitmandi.dao.repository.catalog.TagRankingRepository;
|
33 |
import java.net.URLConnection;
|
| 38 |
import com.spice.profitmandi.dao.repository.dtr.Mongo;
|
34 |
import java.time.ZoneId;
|
| 39 |
import com.spice.profitmandi.dao.repository.dtr.WebListingRepository;
|
35 |
import java.util.*;
|
| 40 |
import com.spice.profitmandi.dao.repository.dtr.WebProductListingRepository;
|
36 |
import java.util.Map.Entry;
|
| 41 |
import com.spice.profitmandi.service.tag.ItemTagModel;
|
37 |
import java.util.stream.Collectors;
|
| 42 |
|
- |
|
| 43 |
import in.shop2020.model.v1.catalog.status;
|
38 |
import java.util.zip.GZIPInputStream;
|
| 44 |
|
39 |
|
| 45 |
@Component
|
40 |
@Component
|
| 46 |
public class FofoSolr {
|
41 |
public class FofoSolr {
|
| 47 |
|
42 |
|
| 48 |
@Autowired
|
43 |
@Autowired
|
| Line 224... |
Line 219... |
| 224 |
}
|
219 |
}
|
| 225 |
return availabilityItemMap;
|
220 |
return availabilityItemMap;
|
| 226 |
|
221 |
|
| 227 |
}
|
222 |
}
|
| 228 |
|
223 |
|
| 229 |
public Map<Integer, List<String>> getLabels() {
|
224 |
public Map<Integer, List<String>> getLabels() throws ProfitMandiBusinessException {
|
| 230 |
List<String> labels = Arrays.asList("partner-best-sellers", "partner-price-drop", "new-launches",
|
225 |
List<String> labels = Arrays.asList("partner-best-sellers", "partner-price-drop", "new-launches",
|
| 231 |
"upgrade-offer", "special-support");
|
226 |
"upgrade-offer", "special-support");
|
| 232 |
|
227 |
|
| 233 |
Map<Integer, String> webListing = webListingRepository.selectByUrls(labels).stream()
|
228 |
Map<Integer, String> webListing = webListingRepository.selectByUrls(labels).stream()
|
| 234 |
.collect(Collectors.toMap(x -> x.getId(), x -> x.getUrl()));
|
229 |
.collect(Collectors.toMap(x -> x.getId(), x -> x.getUrl()));
|