| Line 3... |
Line 3... |
| 3 |
import in.shop2020.metamodel.definitions.Catalog;
|
3 |
import in.shop2020.metamodel.definitions.Catalog;
|
| 4 |
import in.shop2020.metamodel.definitions.Category;
|
4 |
import in.shop2020.metamodel.definitions.Category;
|
| 5 |
import in.shop2020.metamodel.util.CreationUtils;
|
5 |
import in.shop2020.metamodel.util.CreationUtils;
|
| 6 |
import in.shop2020.metamodel.util.ItemPojo;
|
6 |
import in.shop2020.metamodel.util.ItemPojo;
|
| 7 |
import in.shop2020.metamodel.util.PrivateDealPojo;
|
7 |
import in.shop2020.metamodel.util.PrivateDealPojo;
|
| - |
|
8 |
import in.shop2020.metamodel.util.QtyPricePojo;
|
| 8 |
import in.shop2020.model.v1.catalog.CatalogService.Client;
|
9 |
import in.shop2020.model.v1.catalog.CatalogService.Client;
|
| - |
|
10 |
import in.shop2020.model.v1.catalog.BulkItemPricing;
|
| 9 |
import in.shop2020.model.v1.catalog.CatalogServiceException;
|
11 |
import in.shop2020.model.v1.catalog.CatalogServiceException;
|
| 10 |
import in.shop2020.model.v1.catalog.Item;
|
12 |
import in.shop2020.model.v1.catalog.Item;
|
| 11 |
import in.shop2020.model.v1.catalog.PrivateDeal;
|
13 |
import in.shop2020.model.v1.catalog.PrivateDeal;
|
| 12 |
import in.shop2020.model.v1.catalog.Source;
|
14 |
import in.shop2020.model.v1.catalog.Source;
|
| 13 |
import in.shop2020.model.v1.catalog.SourceItemPricing;
|
15 |
import in.shop2020.model.v1.catalog.SourceItemPricing;
|
| Line 79... |
Line 81... |
| 79 |
}
|
81 |
}
|
| 80 |
CatalogClient csc;
|
82 |
CatalogClient csc;
|
| 81 |
Client client;
|
83 |
Client client;
|
| 82 |
PojoCreator creator;
|
84 |
PojoCreator creator;
|
| 83 |
private Map<Long, PrivateDeal> privateDealsMap;
|
85 |
private Map<Long, PrivateDeal> privateDealsMap;
|
| - |
|
86 |
private Map<Long, List<BulkItemPricing>> bulkItemPricingMap;
|
| 84 |
|
87 |
|
| 85 |
public PriceInsertor() throws Exception{
|
88 |
public PriceInsertor() throws Exception{
|
| 86 |
creator = new PojoCreator();
|
89 |
creator = new PojoCreator();
|
| 87 |
csc = new CatalogClient();
|
90 |
csc = new CatalogClient();
|
| 88 |
client = csc.getClient();
|
91 |
client = csc.getClient();
|
| 89 |
privateDealsMap = client.getAllActivePrivateDeals(null,0);
|
92 |
privateDealsMap = client.getAllActivePrivateDeals(null,0);
|
| - |
|
93 |
bulkItemPricingMap = client.getBulkPricingForItems(new ArrayList<Long>());
|
| 90 |
}
|
94 |
}
|
| 91 |
|
95 |
|
| 92 |
public void copySolrSchemaFiles() throws IOException{
|
96 |
public void copySolrSchemaFiles() throws IOException{
|
| 93 |
String source = Utils.EXPORT_PATH + "xml/final/irmetadata_solrschema.xml";
|
97 |
String source = Utils.EXPORT_PATH + "xml/final/irmetadata_solrschema.xml";
|
| 94 |
String destination = Utils.EXPORT_PATH + "solr/irmetadata_solrschema.xml";
|
98 |
String destination = Utils.EXPORT_PATH + "solr/irmetadata_solrschema.xml";
|
| Line 223... |
Line 227... |
| 223 |
itemPojo.setDealPojo(dealPojo);
|
227 |
itemPojo.setDealPojo(dealPojo);
|
| 224 |
if(minDealPrice == 0d || minDealPrice > pd.getDealPrice()){
|
228 |
if(minDealPrice == 0d || minDealPrice > pd.getDealPrice()){
|
| 225 |
minDealPrice = pd.getDealPrice();
|
229 |
minDealPrice = pd.getDealPrice();
|
| 226 |
}
|
230 |
}
|
| 227 |
}
|
231 |
}
|
| - |
|
232 |
if(bulkItemPricingMap.containsKey(item.getId())){
|
| - |
|
233 |
List<QtyPricePojo> qpl = new ArrayList<QtyPricePojo>();
|
| - |
|
234 |
for(BulkItemPricing bip : bulkItemPricingMap.get(item.getId())) {
|
| - |
|
235 |
QtyPricePojo qp = new QtyPricePojo();
|
| - |
|
236 |
qp.setQuantity(bip.getQuantity());
|
| - |
|
237 |
qp.setPrice(bip.getPrice());
|
| - |
|
238 |
qpl.add(qp);
|
| - |
|
239 |
}
|
| - |
|
240 |
itemPojo.setBulkItemPricing(qpl);
|
| - |
|
241 |
}
|
| 228 |
}
|
242 |
}
|
| 229 |
if( bestDealsText != null && bestDealsText.length() > 0 && offerText == null && status.ACTIVE.equals(item.getItemStatus())){
|
243 |
if( bestDealsText != null && bestDealsText.length() > 0 && offerText == null && status.ACTIVE.equals(item.getItemStatus())){
|
| 230 |
offerText = bestDealsText;
|
244 |
offerText = bestDealsText;
|
| 231 |
String bestDealsDetailsText = item.getBestDealsDetailsText();
|
245 |
String bestDealsDetailsText = item.getBestDealsDetailsText();
|
| 232 |
if( bestDealsDetailsText != null && bestDealsDetailsText.length() > 0){
|
246 |
if( bestDealsDetailsText != null && bestDealsDetailsText.length() > 0){
|