| Line 86... |
Line 86... |
| 86 |
ineligibleBrands.removeAll(wodCompleteBrands);
|
86 |
ineligibleBrands.removeAll(wodCompleteBrands);
|
| 87 |
return ineligibleBrands;
|
87 |
return ineligibleBrands;
|
| 88 |
}
|
88 |
}
|
| 89 |
|
89 |
|
| 90 |
@Override
|
90 |
@Override
|
| - |
|
91 |
public List<BrandCatalog> getAllActiveBrands() throws ProfitMandiBusinessException {
|
| - |
|
92 |
List<BrandCategory> brandCategories = brandCategoryRepository.selectAllActive();
|
| - |
|
93 |
|
| - |
|
94 |
Map<Integer, BrandCategory> brandCategoryMap = brandCategories.stream()
|
| - |
|
95 |
.collect(Collectors.toMap(BrandCategory::getBrandId, x -> x, (a, b) -> a));
|
| - |
|
96 |
|
| - |
|
97 |
List<Integer> brandIds = brandCategories.stream()
|
| - |
|
98 |
.map(BrandCategory::getBrandId)
|
| - |
|
99 |
.distinct()
|
| - |
|
100 |
.collect(Collectors.toList());
|
| - |
|
101 |
|
| - |
|
102 |
if (brandIds.isEmpty()) {
|
| - |
|
103 |
return new ArrayList<>();
|
| - |
|
104 |
}
|
| - |
|
105 |
|
| - |
|
106 |
List<BrandCatalog> brands = brandCatalogRepository.selectByIds(brandIds);
|
| - |
|
107 |
for (BrandCatalog brand : brands) {
|
| - |
|
108 |
brand.setBrandCategory(brandCategoryMap.get(brand.getId()));
|
| - |
|
109 |
}
|
| - |
|
110 |
return brands;
|
| - |
|
111 |
}
|
| - |
|
112 |
|
| - |
|
113 |
@Override
|
| 91 |
public BrandAndAddToCartEligibleModel wodcompletBrands(int fofoId) throws ProfitMandiBusinessException {
|
114 |
public BrandAndAddToCartEligibleModel wodcompletBrands(int fofoId) throws ProfitMandiBusinessException {
|
| 92 |
FofoStore fofoStore = fofoStoreRepository.selectByRetailerId(fofoId);
|
115 |
FofoStore fofoStore = fofoStoreRepository.selectByRetailerId(fofoId);
|
| 93 |
if(!fofoStore.isInternal()){
|
116 |
if(!fofoStore.isInternal()){
|
| 94 |
PartnerOnBoardingPanel partnerOnBoardingPanel = partnerOnBoardingPanelRepository.selectByCode(fofoStore.getCode());
|
117 |
PartnerOnBoardingPanel partnerOnBoardingPanel = partnerOnBoardingPanelRepository.selectByCode(fofoStore.getCode());
|
| 95 |
List<PartnerDealerMapping> partnerDealerMappingList = new ArrayList<>();
|
118 |
List<PartnerDealerMapping> partnerDealerMappingList = new ArrayList<>();
|