| Line 1... |
Line 1... |
| 1 |
package com.spice.profitmandi.service.pricing;
|
1 |
package com.spice.profitmandi.service.pricing;
|
| 2 |
|
2 |
|
| 3 |
import java.util.ArrayList;
|
- |
|
| 4 |
import java.util.HashMap;
|
- |
|
| 5 |
import java.util.HashSet;
|
- |
|
| 6 |
import java.util.List;
|
- |
|
| 7 |
import java.util.Map;
|
- |
|
| 8 |
import java.util.Set;
|
- |
|
| 9 |
|
- |
|
| 10 |
import org.apache.commons.collections.CollectionUtils;
|
- |
|
| 11 |
import org.apache.logging.log4j.LogManager;
|
- |
|
| 12 |
import org.apache.logging.log4j.Logger;
|
- |
|
| 13 |
import org.springframework.beans.factory.annotation.Autowired;
|
- |
|
| 14 |
import org.springframework.beans.factory.annotation.Qualifier;
|
- |
|
| 15 |
import org.springframework.stereotype.Component;
|
- |
|
| 16 |
|
- |
|
| 17 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
3 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
| 18 |
import com.spice.profitmandi.common.model.PriceModel;
|
4 |
import com.spice.profitmandi.common.model.PriceModel;
|
| 19 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
5 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
| 20 |
import com.spice.profitmandi.dao.entity.catalog.Item;
|
6 |
import com.spice.profitmandi.dao.entity.catalog.Item;
|
| 21 |
import com.spice.profitmandi.dao.entity.catalog.TagListing;
|
7 |
import com.spice.profitmandi.dao.entity.catalog.TagListing;
|
| Line 28... |
Line 14... |
| 28 |
import com.spice.profitmandi.dao.repository.dtr.RetailerRegisteredAddressRepository;
|
14 |
import com.spice.profitmandi.dao.repository.dtr.RetailerRegisteredAddressRepository;
|
| 29 |
import com.spice.profitmandi.dao.repository.fofo.InventoryItemRepository;
|
15 |
import com.spice.profitmandi.dao.repository.fofo.InventoryItemRepository;
|
| 30 |
import com.spice.profitmandi.dao.repository.user.AddressRepository;
|
16 |
import com.spice.profitmandi.dao.repository.user.AddressRepository;
|
| 31 |
import com.spice.profitmandi.service.scheme.SchemeService;
|
17 |
import com.spice.profitmandi.service.scheme.SchemeService;
|
| 32 |
import com.spice.profitmandi.service.tag.TagService;
|
18 |
import com.spice.profitmandi.service.tag.TagService;
|
| - |
|
19 |
import org.apache.commons.collections.CollectionUtils;
|
| - |
|
20 |
import org.apache.logging.log4j.LogManager;
|
| - |
|
21 |
import org.apache.logging.log4j.Logger;
|
| - |
|
22 |
import org.springframework.beans.factory.annotation.Autowired;
|
| - |
|
23 |
import org.springframework.beans.factory.annotation.Qualifier;
|
| - |
|
24 |
import org.springframework.stereotype.Component;
|
| - |
|
25 |
|
| - |
|
26 |
import java.util.*;
|
| 33 |
|
27 |
|
| 34 |
@Component
|
28 |
@Component
|
| 35 |
public class PricingServiceImpl implements PricingService{
|
29 |
public class PricingServiceImpl implements PricingService{
|
| 36 |
|
30 |
|
| 37 |
@Autowired
|
31 |
@Autowired
|
| Line 163... |
Line 157... |
| 163 |
priceModel.setPurchasePrice(tagListing.getSellingPrice());
|
157 |
priceModel.setPurchasePrice(tagListing.getSellingPrice());
|
| 164 |
priceModel.setMrp(tagListing.getMrp());
|
158 |
priceModel.setMrp(tagListing.getMrp());
|
| 165 |
if(tagListing.isHotDeals()) {
|
159 |
if(tagListing.isHotDeals()) {
|
| 166 |
priceModel.setMop(true);
|
160 |
priceModel.setMop(true);
|
| 167 |
priceModel.setPrice(tagListing.getSellingPrice());
|
161 |
priceModel.setPrice(tagListing.getSellingPrice());
|
| 168 |
} else if(itemPriceMap.get(tagListing.getItemId()).getPrice() > tagListing.getMop()){
|
162 |
} else if(itemPriceMap.get(tagListing.getItemId()).getPrice() > tagListing.getMop()) {
|
| 169 |
priceModel.setPrice(tagListing.getMop());
|
163 |
priceModel.setPrice(tagListing.getMop());
|
| 170 |
priceModel.setMop(true);
|
164 |
priceModel.setMop(true);
|
| 171 |
if(schemeService.getItemSchemeCashBack().get(tagListing.getItemId())!= null) {
|
165 |
if (schemeService.getCatalogSchemeCashBack().get(tagListing.getItemId()) != null) {
|
| 172 |
priceModel.setMaxDiscountAmount(schemeService.getItemSchemeCashBack().get(tagListing.getItemId()));
|
166 |
priceModel.setMaxDiscountAmount(schemeService.getCatalogSchemeCashBack().get(item.getCatalogItemId()));
|
| 173 |
}
|
167 |
}
|
| 174 |
} else if (item.getHsnCode().equals("85171210")) {
|
168 |
} else if (item.getHsnCode().equals("85171210")) {
|
| 175 |
priceModel.setMop(false);
|
169 |
priceModel.setMop(false);
|
| 176 |
priceModel.setPrice(tagListing.getSellingPrice());
|
170 |
priceModel.setPrice(tagListing.getSellingPrice());
|
| 177 |
}
|
171 |
}
|