| Line 841... |
Line 841... |
| 841 |
private Map<Integer, List<Integer>> getWarehouseIdFofoIdMap(Set<Integer> fofoIds) throws ProfitMandiBusinessException {
|
841 |
private Map<Integer, List<Integer>> getWarehouseIdFofoIdMap(Set<Integer> fofoIds) throws ProfitMandiBusinessException {
|
| 842 |
Map<Integer, List<Integer>> warehouseIdFofoIdMap = fofoStoreRepository
|
842 |
Map<Integer, List<Integer>> warehouseIdFofoIdMap = fofoStoreRepository
|
| 843 |
.selectActivePartnersByRetailerIds(new ArrayList<>(fofoIds)).stream()
|
843 |
.selectActivePartnersByRetailerIds(new ArrayList<>(fofoIds)).stream()
|
| 844 |
.collect(Collectors.groupingBy(FofoStore::getWarehouseId,
|
844 |
.collect(Collectors.groupingBy(FofoStore::getWarehouseId,
|
| 845 |
Collectors.mapping(FofoStore::getId, Collectors.toList())));
|
845 |
Collectors.mapping(FofoStore::getId, Collectors.toList())));
|
| 846 |
// warehouseStock
|
846 |
// Every warehouse holding stock gets a row, even with no franchise store of its own - a hub such as the
|
| - |
|
847 |
// HR warehouses carries only internal movement stores, so the store grouping above never lists it.
|
| 847 |
if (!warehouseIdFofoIdMap.containsKey(7573)) {
|
848 |
for (Integer stockWarehouseId : saholicInventoryCISRepository.selectWarehouseIdsWithStock()) {
|
| 848 |
warehouseIdFofoIdMap.put(7573, new ArrayList<>());
|
849 |
warehouseIdFofoIdMap.putIfAbsent(stockWarehouseId, new ArrayList<>());
|
| 849 |
}
|
850 |
}
|
| 850 |
return warehouseIdFofoIdMap;
|
851 |
return warehouseIdFofoIdMap;
|
| 851 |
}
|
852 |
}
|
| 852 |
|
853 |
|
| 853 |
private List<Menu> prepareMenu(List<Menu> menus) {
|
854 |
private List<Menu> prepareMenu(List<Menu> menus) {
|