| Line 18... |
Line 18... |
| 18 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
18 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
| 19 |
import com.spice.profitmandi.dao.entity.catalog.TagListing;
|
19 |
import com.spice.profitmandi.dao.entity.catalog.TagListing;
|
| 20 |
import com.spice.profitmandi.dao.entity.dtr.GadgetCopsInsuranceCalc;
|
20 |
import com.spice.profitmandi.dao.entity.dtr.GadgetCopsInsuranceCalc;
|
| 21 |
import com.spice.profitmandi.dao.entity.fofo.InventoryItem;
|
21 |
import com.spice.profitmandi.dao.entity.fofo.InventoryItem;
|
| 22 |
import com.spice.profitmandi.dao.entity.user.Address;
|
22 |
import com.spice.profitmandi.dao.entity.user.Address;
|
| 23 |
import com.spice.profitmandi.dao.repository.catalog.PinCodeTagRepository;
|
- |
|
| 24 |
import com.spice.profitmandi.dao.repository.catalog.RetailerTagRepository;
|
- |
|
| 25 |
import com.spice.profitmandi.dao.repository.catalog.TagListingRepository;
|
23 |
import com.spice.profitmandi.dao.repository.catalog.TagListingRepository;
|
| 26 |
import com.spice.profitmandi.dao.repository.dtr.GadgetCopsInsuranceCalcRepository;
|
24 |
import com.spice.profitmandi.dao.repository.dtr.GadgetCopsInsuranceCalcRepository;
|
| 27 |
import com.spice.profitmandi.dao.repository.dtr.InsuranceProviderRepository;
|
25 |
import com.spice.profitmandi.dao.repository.dtr.InsuranceProviderRepository;
|
| 28 |
import com.spice.profitmandi.dao.repository.dtr.RetailerRegisteredAddressRepository;
|
26 |
import com.spice.profitmandi.dao.repository.dtr.RetailerRegisteredAddressRepository;
|
| 29 |
import com.spice.profitmandi.dao.repository.fofo.InventoryItemRepository;
|
27 |
import com.spice.profitmandi.dao.repository.fofo.InventoryItemRepository;
|
| Line 32... |
Line 30... |
| 32 |
|
30 |
|
| 33 |
@Component
|
31 |
@Component
|
| 34 |
public class PricingServiceImpl implements PricingService{
|
32 |
public class PricingServiceImpl implements PricingService{
|
| 35 |
|
33 |
|
| 36 |
@Autowired
|
34 |
@Autowired
|
| 37 |
RetailerRegisteredAddressRepository retailerRegisteredAddressRepository;
|
35 |
private RetailerRegisteredAddressRepository retailerRegisteredAddressRepository;
|
| 38 |
|
36 |
|
| 39 |
@Autowired
|
37 |
@Autowired
|
| 40 |
AddressRepository addressRepository;
|
38 |
private AddressRepository addressRepository;
|
| 41 |
|
39 |
|
| 42 |
@Autowired
|
40 |
@Autowired
|
| 43 |
PinCodeTagRepository pinCodeTagRepository;
|
41 |
private TagService tagService;
|
| 44 |
|
42 |
|
| 45 |
@Autowired
|
43 |
@Autowired
|
| 46 |
TagService tagService;
|
44 |
private TagListingRepository tagListingRepository;
|
| 47 |
|
45 |
|
| 48 |
@Autowired
|
46 |
@Autowired
|
| 49 |
RetailerTagRepository retailerTagRepository;
|
47 |
private InsuranceProviderRepository insuranceProviderRepository;
|
| 50 |
|
48 |
|
| 51 |
@Autowired
|
49 |
@Autowired
|
| 52 |
TagListingRepository tagListingRepository;
|
50 |
private GadgetCopsInsuranceCalcRepository gadgetCopsInsuranceCalcRepository;
|
| 53 |
|
51 |
|
| 54 |
@Autowired
|
52 |
@Autowired
|
| 55 |
InsuranceProviderRepository insuranceProviderRepository;
|
- |
|
| 56 |
|
- |
|
| 57 |
@Autowired
|
- |
|
| 58 |
GadgetCopsInsuranceCalcRepository gadgetCopsInsuranceCalcRepository;
|
- |
|
| 59 |
|
- |
|
| 60 |
@Autowired
|
- |
|
| 61 |
InventoryItemRepository inventoryItemRepository;
|
53 |
private InventoryItemRepository inventoryItemRepository;
|
| 62 |
|
54 |
|
| 63 |
private static final Logger LOGGER = LoggerFactory.getLogger(PricingServiceImpl.class);
|
55 |
private static final Logger LOGGER = LoggerFactory.getLogger(PricingServiceImpl.class);
|
| 64 |
|
56 |
|
| 65 |
@Override
|
57 |
@Override
|
| 66 |
public Map<Integer, Float> getPrices(Set<Integer> itemIds, int retailerId) {
|
58 |
public Map<Integer, Float> getPrices(Set<Integer> itemIds, int retailerId) {
|
| Line 209... |
Line 201... |
| 209 |
return mopPriceModelMap;
|
201 |
return mopPriceModelMap;
|
| 210 |
}
|
202 |
}
|
| 211 |
|
203 |
|
| 212 |
//Currently it only handles fofos
|
204 |
//Currently it only handles fofos
|
| 213 |
@SuppressWarnings("unchecked")
|
205 |
@SuppressWarnings("unchecked")
|
| 214 |
public List<Integer> getTagsIdsByRetailerId(int retailerId) throws Throwable{
|
206 |
public List<Integer> getTagsIdsByRetailerId(int retailerId){
|
| 215 |
Set<Integer> pinCodeTagIds = tagService.getFofoTagIdsByPinCode("110001");
|
207 |
Set<Integer> pinCodeTagIds = tagService.getFofoTagIdsByPinCode("110001");
|
| 216 |
Set<Integer> pinNegativeTagIds = tagService.getPinCodeNegativeTagIds();
|
208 |
Set<Integer> pinNegativeTagIds = tagService.getPinCodeNegativeTagIds();
|
| 217 |
Set<Integer> pinCodeIntersection = new HashSet<>(CollectionUtils.intersection(pinCodeTagIds, pinNegativeTagIds));
|
209 |
Set<Integer> pinCodeIntersection = new HashSet<>(CollectionUtils.intersection(pinCodeTagIds, pinNegativeTagIds));
|
| 218 |
|
210 |
|
| 219 |
Set<Integer> validTagIds = new HashSet<>(CollectionUtils.subtract(pinNegativeTagIds, pinCodeIntersection));
|
211 |
Set<Integer> validTagIds = new HashSet<>(CollectionUtils.subtract(pinNegativeTagIds, pinCodeIntersection));
|