Subversion Repositories SmartDukaan

Rev

Rev 37283 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 37283 Rev 37640
Line 6... Line 6...
6
import com.spice.profitmandi.dao.entity.catalog.Item;
6
import com.spice.profitmandi.dao.entity.catalog.Item;
7
import com.spice.profitmandi.dao.entity.catalog.TagListing;
7
import com.spice.profitmandi.dao.entity.catalog.TagListing;
8
import com.spice.profitmandi.dao.entity.dtr.GadgetCopsInsuranceCalc;
8
import com.spice.profitmandi.dao.entity.dtr.GadgetCopsInsuranceCalc;
9
import com.spice.profitmandi.dao.entity.user.Address;
9
import com.spice.profitmandi.dao.entity.user.Address;
10
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
10
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
11
import com.spice.profitmandi.dao.repository.catalog.ModelHotDealRepository;
11
import com.spice.profitmandi.dao.repository.catalog.CatalogRepository;
12
import com.spice.profitmandi.dao.repository.catalog.TagListingRepository;
12
import com.spice.profitmandi.dao.repository.catalog.TagListingRepository;
13
import com.spice.profitmandi.dao.repository.dtr.GadgetCopsInsuranceCalcRepository;
13
import com.spice.profitmandi.dao.repository.dtr.GadgetCopsInsuranceCalcRepository;
14
import com.spice.profitmandi.dao.repository.dtr.InsuranceProviderRepository;
14
import com.spice.profitmandi.dao.repository.dtr.InsuranceProviderRepository;
15
import com.spice.profitmandi.dao.repository.dtr.RetailerRegisteredAddressRepository;
15
import com.spice.profitmandi.dao.repository.dtr.RetailerRegisteredAddressRepository;
16
import com.spice.profitmandi.dao.repository.fofo.InventoryItemRepository;
16
import com.spice.profitmandi.dao.repository.fofo.InventoryItemRepository;
Line 39... Line 39...
39
	
39
	
40
	@Autowired
40
	@Autowired
41
	private ItemRepository itemRepository;
41
	private ItemRepository itemRepository;
42
 
42
 
43
	@Autowired
43
	@Autowired
44
	private ModelHotDealRepository modelHotDealRepository;
44
	private CatalogRepository catalogRepository;
45
	
45
	
46
	@Autowired
46
	@Autowired
47
	private SchemeService schemeService;
47
	private SchemeService schemeService;
48
	
48
	
49
	@Autowired
49
	@Autowired
Line 158... Line 158...
158
	@Override
158
	@Override
159
    public Map<Integer, PriceModel> getMopPrices(Set<Integer> itemIds, int retailerId) throws ProfitMandiBusinessException {
159
    public Map<Integer, PriceModel> getMopPrices(Set<Integer> itemIds, int retailerId) throws ProfitMandiBusinessException {
160
		//Set Price with max value
160
		//Set Price with max value
161
		Map<Integer, PriceModel> itemPriceMap = this.preparePriceModelDefaultValues(itemIds);
161
		Map<Integer, PriceModel> itemPriceMap = this.preparePriceModelDefaultValues(itemIds);
162
		List<TagListing> tagListings = this.getTagListing(itemIds, retailerId);
162
		List<TagListing> tagListings = this.getTagListing(itemIds, retailerId);
163
		//Hot deals live in catalog.model_hot_deal (date-windowed), not tag_listing.hot_deals
163
		//Hot deals are brand-driven: catalog.brand = 'Hot Deal'. No date window.
164
		Set<Integer> hotDealCatalogIds = modelHotDealRepository.selectActiveCatalogIds(LocalDate.now());
164
		Set<Integer> hotDealCatalogIds = catalogRepository
-
 
165
				.selectCatalogIdsByBrand(ProfitMandiConstants.HOT_DEAL_BRAND);
165
		for(TagListing tagListing : tagListings){
166
		for(TagListing tagListing : tagListings){
166
			Item item = null;
167
			Item item = null;
167
			try {
168
			try {
168
				item = itemRepository.selectById(tagListing.getItemId());
169
				item = itemRepository.selectById(tagListing.getItemId());
169
			} catch (Exception e) {
170
			} catch (Exception e) {