| Line 4852... |
Line 4852... |
| 4852 |
}
|
4852 |
}
|
| 4853 |
}
|
4853 |
}
|
| 4854 |
|
4854 |
|
| 4855 |
public void getSpecialSupport() throws ProfitMandiBusinessException {
|
4855 |
public void getSpecialSupport() throws ProfitMandiBusinessException {
|
| 4856 |
WebListing webListing = webListingRepository.selectByUrl("special-support");
|
4856 |
WebListing webListing = webListingRepository.selectByUrl("special-support");
|
| - |
|
4857 |
webProductListingRepository.deleteByEqual(webListing.getId());
|
| 4857 |
|
4858 |
|
| 4858 |
List<Integer> catalogItemIds = schemeRepository.getActiveScheme(SchemeType.SPECIAL_SUPPORT,
|
4859 |
List<Integer> catalogItemIds = schemeRepository.getActiveScheme(SchemeType.SPECIAL_SUPPORT,
|
| 4859 |
LocalDate.now().plusDays(1));
|
4860 |
LocalDate.now().plusDays(1));
|
| 4860 |
|
4861 |
|
| 4861 |
LOGGER.info("catalogItemIds {}", catalogItemIds);
|
4862 |
LOGGER.info("catalogItemIds {}", catalogItemIds);
|
| 4862 |
if (!catalogItemIds.isEmpty()) {
|
4863 |
if (!catalogItemIds.isEmpty()) {
|
| 4863 |
webProductListingRepository.deleteByEqual(webListing.getId());
|
- |
|
| 4864 |
int count = 0;
|
4864 |
int count = 0;
|
| 4865 |
for (Integer catalogItemId : catalogItemIds) {
|
4865 |
for (Integer catalogItemId : catalogItemIds) {
|
| 4866 |
|
4866 |
|
| 4867 |
WebProductListing webProductListing = new WebProductListing();
|
4867 |
WebProductListing webProductListing = new WebProductListing();
|
| 4868 |
webProductListing.setEntityId(catalogItemId);
|
4868 |
webProductListing.setEntityId(catalogItemId);
|
| Line 4876... |
Line 4876... |
| 4876 |
}
|
4876 |
}
|
| 4877 |
}
|
4877 |
}
|
| 4878 |
|
4878 |
|
| 4879 |
public void getUpgradeOffer() throws ProfitMandiBusinessException {
|
4879 |
public void getUpgradeOffer() throws ProfitMandiBusinessException {
|
| 4880 |
WebListing webListing = webListingRepository.selectByUrl("upgrade-offer");
|
4880 |
WebListing webListing = webListingRepository.selectByUrl("upgrade-offer");
|
| - |
|
4881 |
webProductListingRepository.deleteByEqual(webListing.getId());
|
| 4881 |
|
4882 |
|
| 4882 |
List<Integer> customerOfferIds = customerOfferRepository.selectOffers(LocalDate.now()).stream()
|
4883 |
List<Integer> customerOfferIds = customerOfferRepository.selectOffers(LocalDate.now()).stream()
|
| 4883 |
.map(x -> x.getId()).collect(Collectors.toList());
|
4884 |
.map(x -> x.getId()).collect(Collectors.toList());
|
| 4884 |
|
4885 |
|
| 4885 |
List<Integer> catalogItemIds = customerOfferItemRepository
|
4886 |
List<Integer> catalogItemIds = customerOfferItemRepository
|
| 4886 |
.selectByOfferIdsRange(customerOfferIds, LocalDate.now()).stream().map(x -> x.getCatalogId()).distinct()
|
4887 |
.selectByOfferIdsRange(customerOfferIds, LocalDate.now()).stream().map(x -> x.getCatalogId()).distinct()
|
| 4887 |
.collect(Collectors.toList());
|
4888 |
.collect(Collectors.toList());
|
| 4888 |
|
4889 |
|
| 4889 |
LOGGER.info("catalogItemIds {}", catalogItemIds);
|
4890 |
LOGGER.info("catalogItemIds {}", catalogItemIds);
|
| 4890 |
if (!catalogItemIds.isEmpty()) {
|
4891 |
if (!catalogItemIds.isEmpty()) {
|
| 4891 |
webProductListingRepository.deleteByEqual(webListing.getId());
|
- |
|
| 4892 |
int count = 0;
|
4892 |
int count = 0;
|
| 4893 |
for (Integer catalogItemId : catalogItemIds) {
|
4893 |
for (Integer catalogItemId : catalogItemIds) {
|
| 4894 |
|
4894 |
|
| 4895 |
WebProductListing webProductListing = new WebProductListing();
|
4895 |
WebProductListing webProductListing = new WebProductListing();
|
| 4896 |
webProductListing.setEntityId(catalogItemId);
|
4896 |
webProductListing.setEntityId(catalogItemId);
|