| Line 2480... |
Line 2480... |
| 2480 |
|
2480 |
|
| 2481 |
int grnStockQty = grnPendingQty + inStockQty;
|
2481 |
int grnStockQty = grnPendingQty + inStockQty;
|
| 2482 |
int totalQty = processingQty + grnPendingQty + inStockQty;
|
2482 |
int totalQty = processingQty + grnPendingQty + inStockQty;
|
| 2483 |
|
2483 |
|
| 2484 |
int shortageQty = minQty - totalQty;
|
2484 |
int shortageQty = minQty - totalQty;
|
| 2485 |
List<Item> item = itemRepository.selectAllByCatalogItemId(entry.getKey());
|
2485 |
List<Item> items = itemRepository.selectAllByCatalogItemId(entry.getKey());
|
| 2486 |
FofoStore fofoStore = fofoStoreRepository.selectByRetailerId(fofoId);
|
2486 |
FofoStore fofoStore = fofoStoreRepository.selectByRetailerId(fofoId);
|
| 2487 |
|
2487 |
|
| 2488 |
Map<Integer, List<SaholicCIS>> itemAvailabilityMap = warehouseItemAvailabilityMap
|
2488 |
Map<Integer, List<SaholicCIS>> itemAvailabilityMap = warehouseItemAvailabilityMap
|
| 2489 |
.get(fofoStore.getWarehouseId());
|
2489 |
.get(fofoStore.getWarehouseId());
|
| 2490 |
|
2490 |
|
| 2491 |
Map<Integer, List<SaholicPOItem>> poItemAvailabilityMap = warehousePoItemAvailabilityMap
|
2491 |
Map<Integer, List<SaholicPOItem>> poItemAvailabilityMap = warehousePoItemAvailabilityMap
|
| 2492 |
.get(fofoStore.getWarehouseId());
|
2492 |
.get(fofoStore.getWarehouseId());
|
| 2493 |
|
2493 |
|
| 2494 |
for (Item it : item) {
|
2494 |
for (Item item : items) {
|
| 2495 |
List<SaholicCIS> currentAvailability = null;
|
2495 |
List<SaholicCIS> currentAvailability = null;
|
| 2496 |
List<SaholicPOItem> poItemAvailability = null;
|
2496 |
List<SaholicPOItem> poItemAvailability = null;
|
| 2497 |
if (itemAvailabilityMap != null) {
|
2497 |
if (itemAvailabilityMap != null) {
|
| 2498 |
currentAvailability = itemAvailabilityMap.get(it.getId());
|
2498 |
currentAvailability = itemAvailabilityMap.get(item.getId());
|
| 2499 |
}
|
2499 |
}
|
| 2500 |
|
2500 |
|
| 2501 |
if (poItemAvailabilityMap != null) {
|
2501 |
if (poItemAvailabilityMap != null) {
|
| 2502 |
poItemAvailability = poItemAvailabilityMap.get(it.getId());
|
2502 |
poItemAvailability = poItemAvailabilityMap.get(item.getId());
|
| 2503 |
}
|
2503 |
}
|
| 2504 |
if (currentAvailability != null) {
|
2504 |
if (currentAvailability != null) {
|
| 2505 |
allColorNetAvailability += currentAvailability.stream()
|
2505 |
allColorNetAvailability += currentAvailability.stream()
|
| 2506 |
.collect(Collectors.summingInt(SaholicCIS::getNetavailability));
|
2506 |
.collect(Collectors.summingInt(SaholicCIS::getNetavailability));
|
| 2507 |
}
|
2507 |
}
|
| Line 2515... |
Line 2515... |
| 2515 |
|
2515 |
|
| 2516 |
FocusedModelShortageModel fm = new FocusedModelShortageModel();
|
2516 |
FocusedModelShortageModel fm = new FocusedModelShortageModel();
|
| 2517 |
fm.setFofoId(fofoId);
|
2517 |
fm.setFofoId(fofoId);
|
| 2518 |
fm.setStoreCode(fofoStore.getCode());
|
2518 |
fm.setStoreCode(fofoStore.getCode());
|
| 2519 |
fm.setStoreName(customRetailer.getBusinessName());
|
2519 |
fm.setStoreName(customRetailer.getBusinessName());
|
| 2520 |
fm.setBrandName(item.get(0).getBrand());
|
2520 |
fm.setBrandName(items.get(0).getBrand());
|
| 2521 |
fm.setModelName(item.get(0).getModelName());
|
2521 |
fm.setModelName(items.get(0).getModelName());
|
| 2522 |
fm.setModelNumber(item.get(0).getModelNumber());
|
2522 |
fm.setModelNumber(items.get(0).getModelNumber());
|
| 2523 |
fm.setGrnStockQty(grnStockQty);
|
2523 |
fm.setGrnStockQty(grnStockQty);
|
| 2524 |
fm.setPendingIndentQty(processingQty);
|
2524 |
fm.setPendingIndentQty(processingQty);
|
| 2525 |
fm.setShortageQty(shortageQty);
|
2525 |
fm.setShortageQty(shortageQty);
|
| 2526 |
fm.setPoAvailabitiy(allColorPoAvailability);
|
2526 |
fm.setPoAvailabitiy(allColorPoAvailability);
|
| 2527 |
fm.setWarehouseName(warehouseMap.get(customRetailer.getWarehouseId()));
|
2527 |
fm.setWarehouseName(warehouseMap.get(customRetailer.getWarehouseId()));
|
| 2528 |
fm.setStateManager(partnerIdSalesHeadersMap.get(fofoId).getRegionalManager());
|
2528 |
fm.setStateManager(partnerIdSalesHeadersMap.get(fofoId).getRegionalManager());
|
| 2529 |
fm.setTerritoryManager(partnerIdSalesHeadersMap.get(fofoId).getTerritoryManager());
|
2529 |
fm.setTerritoryManager(partnerIdSalesHeadersMap.get(fofoId).getTerritoryManager());
|
| 2530 |
fm.setItemName(item.get(0).getBrand() + item.get(0).getModelNumber() + item.get(0).getModelName());
|
2530 |
fm.setItemName(items.get(0).getBrand() + items.get(0).getModelNumber() + items.get(0).getModelName());
|
| 2531 |
fm.setAvailabitiy(allColorNetAvailability);
|
2531 |
fm.setAvailabitiy(allColorNetAvailability);
|
| 2532 |
|
2532 |
|
| 2533 |
focusedModelShortageList.add(fm);
|
2533 |
focusedModelShortageList.add(fm);
|
| 2534 |
}
|
2534 |
}
|
| 2535 |
|
2535 |
|