| Line 12... |
Line 12... |
| 12 |
import com.spice.profitmandi.dao.entity.user.CartLine;
|
12 |
import com.spice.profitmandi.dao.entity.user.CartLine;
|
| 13 |
import com.spice.profitmandi.dao.entity.user.User;
|
13 |
import com.spice.profitmandi.dao.entity.user.User;
|
| 14 |
import com.spice.profitmandi.dao.model.*;
|
14 |
import com.spice.profitmandi.dao.model.*;
|
| 15 |
import com.spice.profitmandi.dao.repository.catalog.FocusedModelRepository;
|
15 |
import com.spice.profitmandi.dao.repository.catalog.FocusedModelRepository;
|
| 16 |
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
|
16 |
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
|
| 17 |
import com.spice.profitmandi.dao.repository.catalog.ModelHotDealRepository;
|
17 |
import com.spice.profitmandi.dao.repository.catalog.CatalogRepository;
|
| 18 |
import com.spice.profitmandi.dao.repository.catalog.TagListingRepository;
|
18 |
import com.spice.profitmandi.dao.repository.catalog.TagListingRepository;
|
| 19 |
import com.spice.profitmandi.dao.repository.cs.PartnerRegionRepository;
|
19 |
import com.spice.profitmandi.dao.repository.cs.PartnerRegionRepository;
|
| 20 |
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
|
20 |
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
|
| 21 |
import com.spice.profitmandi.dao.repository.fofo.CurrentInventorySnapshotRepository;
|
21 |
import com.spice.profitmandi.dao.repository.fofo.CurrentInventorySnapshotRepository;
|
| 22 |
import com.spice.profitmandi.dao.repository.fofo.PartnerTypeChangeService;
|
22 |
import com.spice.profitmandi.dao.repository.fofo.PartnerTypeChangeService;
|
| Line 72... |
Line 72... |
| 72 |
|
72 |
|
| 73 |
@Autowired
|
73 |
@Autowired
|
| 74 |
ItemRepository itemRepository;
|
74 |
ItemRepository itemRepository;
|
| 75 |
|
75 |
|
| 76 |
@Autowired
|
76 |
@Autowired
|
| 77 |
ModelHotDealRepository modelHotDealRepository;
|
77 |
CatalogRepository catalogRepository;
|
| 78 |
|
78 |
|
| 79 |
|
79 |
|
| 80 |
@Autowired
|
80 |
@Autowired
|
| 81 |
CurrentInventorySnapshotRepository currentInventorySnapshotRepository;
|
81 |
CurrentInventorySnapshotRepository currentInventorySnapshotRepository;
|
| 82 |
|
82 |
|
| Line 151... |
Line 151... |
| 151 |
|
151 |
|
| 152 |
// As of now it only works for Fofo Partners need to be refactored later
|
152 |
// As of now it only works for Fofo Partners need to be refactored later
|
| 153 |
private Map<Integer, Integer> getAvailabilityMap(User user, Set<Integer> itemIds) {
|
153 |
private Map<Integer, Integer> getAvailabilityMap(User user, Set<Integer> itemIds) {
|
| 154 |
Map<Integer, Integer> itemAvailabilityMap = new HashMap<>();
|
154 |
Map<Integer, Integer> itemAvailabilityMap = new HashMap<>();
|
| 155 |
List<TagListing> tags = tagListingRepository.selectByItemIdsAndTagIds(itemIds, tagIds);
|
155 |
List<TagListing> tags = tagListingRepository.selectByItemIdsAndTagIds(itemIds, tagIds);
|
| 156 |
// Hot deals live in catalog.model_hot_deal (date-windowed), not tag_listing.hot_deals
|
156 |
// Hot deals are brand-driven: catalog.brand = 'Hot Deal'. No date window.
|
| 157 |
Set<Integer> hotDealCatalogIds = modelHotDealRepository.selectActiveCatalogIds(LocalDate.now());
|
157 |
Set<Integer> hotDealCatalogIds = catalogRepository
|
| - |
|
158 |
.selectCatalogIdsByBrand(ProfitMandiConstants.HOT_DEAL_BRAND);
|
| 158 |
Map<Integer, Integer> itemCatalogMap = new HashMap<>();
|
159 |
Map<Integer, Integer> itemCatalogMap = new HashMap<>();
|
| 159 |
try {
|
160 |
try {
|
| 160 |
for (Item item : itemRepository.selectByIds(itemIds)) {
|
161 |
for (Item item : itemRepository.selectByIds(itemIds)) {
|
| 161 |
itemCatalogMap.put(item.getId(), item.getCatalogItemId());
|
162 |
itemCatalogMap.put(item.getId(), item.getCatalogItemId());
|
| 162 |
}
|
163 |
}
|