| Line 2261... |
Line 2261... |
| 2261 |
boolean isLoanPending = false;
|
2261 |
boolean isLoanPending = false;
|
| 2262 |
if (loans.size() > 0) {
|
2262 |
if (loans.size() > 0) {
|
| 2263 |
isLoanPending = true;
|
2263 |
isLoanPending = true;
|
| 2264 |
}
|
2264 |
}
|
| 2265 |
|
2265 |
|
| 2266 |
List<String> sortedBrandsByMtd = brandToMtdMap.entrySet()
|
- |
|
| 2267 |
.stream()
|
- |
|
| 2268 |
.sorted((e1, e2) -> Long.compare(e2.getValue(), e1.getValue())) // Descending MTD
|
- |
|
| 2269 |
.map(Map.Entry::getKey)
|
- |
|
| 2270 |
.collect(Collectors.toList());
|
- |
|
| 2271 |
|
- |
|
| 2272 |
List<String> remainingBrands = ProfitMandiConstants.BRANDS.stream()
|
- |
|
| 2273 |
.filter(x -> !brandToMtdMap.containsKey(x))
|
- |
|
| 2274 |
.collect(Collectors.toList());
|
- |
|
| 2275 |
|
- |
|
| 2276 |
List<String> finalSortedBrands = new ArrayList<>();
|
- |
|
| 2277 |
finalSortedBrands.addAll(sortedBrandsByMtd);
|
- |
|
| 2278 |
finalSortedBrands.addAll(remainingBrands);
|
- |
|
| 2279 |
|
2266 |
|
| 2280 |
List<PartnerWarehouseStockSummaryModel> partnerWarehouseStockSummaryModels = saholicInventoryService.getSaholicAndPartnerStock(fofoId, fofoStore.getWarehouseId());
|
2267 |
List<PartnerWarehouseStockSummaryModel> partnerWarehouseStockSummaryModels = saholicInventoryService.getSaholicAndPartnerStock(fofoId, fofoStore.getWarehouseId());
|
| 2281 |
|
2268 |
|
| 2282 |
Set<Integer> catalogIds = partnerWarehouseStockSummaryModels.stream().map(x -> x.getCatalogId()).collect(Collectors.toSet());
|
2269 |
Set<Integer> catalogIds = partnerWarehouseStockSummaryModels.stream().map(x -> x.getCatalogId()).collect(Collectors.toSet());
|
| 2283 |
LOGGER.info("fofoid {} , catalogIds {}", catalogIds, fofoId);
|
2270 |
LOGGER.info("fofoid {} , catalogIds {}", catalogIds, fofoId);
|
| Line 2350... |
Line 2337... |
| 2350 |
},
|
2337 |
},
|
| 2351 |
(v1, v2) -> v1,
|
2338 |
(v1, v2) -> v1,
|
| 2352 |
LinkedHashMap::new // Maintain order of brands
|
2339 |
LinkedHashMap::new // Maintain order of brands
|
| 2353 |
));
|
2340 |
));
|
| 2354 |
|
2341 |
|
| - |
|
2342 |
List<String> sortedBrandsByMtd = brandToMtdMap.entrySet()
|
| - |
|
2343 |
.stream()
|
| - |
|
2344 |
.sorted((e1, e2) -> Long.compare(e2.getValue(), e1.getValue())) // Descending MTD
|
| - |
|
2345 |
.map(Map.Entry::getKey)
|
| - |
|
2346 |
.collect(Collectors.toList());
|
| - |
|
2347 |
|
| - |
|
2348 |
List<String> remainingBrands = ProfitMandiConstants.BRANDS.stream()
|
| - |
|
2349 |
.filter(x -> !brandToMtdMap.containsKey(x))
|
| - |
|
2350 |
.filter(x -> sortedBrandStatusWiseStockListMap.containsKey(x))
|
| - |
|
2351 |
.collect(Collectors.toList());
|
| - |
|
2352 |
List<String> remainingBrandsWithoutStock = ProfitMandiConstants.BRANDS.stream()
|
| - |
|
2353 |
.filter(x -> !brandToMtdMap.containsKey(x))
|
| - |
|
2354 |
.filter(x -> !sortedBrandStatusWiseStockListMap.containsKey(x)) // no stock
|
| - |
|
2355 |
.collect(Collectors.toList());
|
| - |
|
2356 |
|
| - |
|
2357 |
List<String> finalSortedBrands = new ArrayList<>();
|
| - |
|
2358 |
finalSortedBrands.addAll(sortedBrandsByMtd);
|
| - |
|
2359 |
finalSortedBrands.addAll(remainingBrands);
|
| - |
|
2360 |
finalSortedBrands.addAll(remainingBrandsWithoutStock);
|
| - |
|
2361 |
|
| 2355 |
model.addAttribute("brandStatusWiseStockListMap", sortedBrandStatusWiseStockListMap);
|
2362 |
model.addAttribute("brandStatusWiseStockListMap", sortedBrandStatusWiseStockListMap);
|
| 2356 |
model.addAttribute("brands", finalSortedBrands);
|
2363 |
model.addAttribute("brands", finalSortedBrands);
|
| 2357 |
model.addAttribute("brandToMtdMap", brandToMtdMap);
|
2364 |
model.addAttribute("brandToMtdMap", brandToMtdMap);
|
| 2358 |
model.addAttribute("brand", brand);
|
2365 |
model.addAttribute("brand", brand);
|
| 2359 |
model.addAttribute("fofoId", fofoId);
|
2366 |
model.addAttribute("fofoId", fofoId);
|