Subversion Repositories SmartDukaan

Rev

Rev 34665 | Rev 35189 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 34665 Rev 34779
Line 458... Line 458...
458
    public String adminPanel(int fofoId, String email, Model model) throws Exception {
458
    public String adminPanel(int fofoId, String email, Model model) throws Exception {
459
        List<Menu> menus = null;
459
        List<Menu> menus = null;
460
        try {
460
        try {
461
            AuthUser authUser = authRepository.selectByEmailOrMobile(email);
461
            AuthUser authUser = authRepository.selectByEmailOrMobile(email);
462
            List<Position> positions = positionRepository.selectAll(authUser.getId());
462
            List<Position> positions = positionRepository.selectAll(authUser.getId());
-
 
463
            LOGGER.info("positionslist - {}", positions);
463
            Map<Integer, PartnerDetailModel> warehousePartnerDetailMap = null;
464
            Map<Integer, PartnerDetailModel> warehousePartnerDetailMap = null;
464
 
465
 
465
            Map<Integer, WarehouseWiseStockModel> warehouseStockMap = new HashMap<>();
466
            Map<Integer, WarehouseWiseStockModel> warehouseStockMap = new HashMap<>();
466
            LinkedHashMap<Integer, WarehouseWiseStockModel> warehouseStockSortedMap = new LinkedHashMap<>();
467
            LinkedHashMap<Integer, WarehouseWiseStockModel> warehouseStockSortedMap = new LinkedHashMap<>();
467
 
468
 
Line 481... Line 482...
481
            long stockValue = 0;
482
            long stockValue = 0;
482
            long stockQty = 0;
483
            long stockQty = 0;
483
            long pendingIndent = 0;
484
            long pendingIndent = 0;
484
            long tertiary = 0;
485
            long tertiary = 0;
485
 
486
 
-
 
487
            boolean isAboveL1 = positions.stream().anyMatch(pos -> pos.getEscalationType() != EscalationType.L1);
-
 
488
            boolean isRBM = positions.stream().anyMatch(pos -> pos.getCategoryId() == ProfitMandiConstants.TICKET_CATEGORY_RBM);
-
 
489
 
-
 
490
            Set<Integer> fofoIds = new HashSet<>();
-
 
491
            if (isAboveL1 && isRBM) {
-
 
492
                fofoIds = fofoStoreRepository.selectActiveStores().stream().map(x -> x.getId()).collect(Collectors.toSet());
-
 
493
            } else {
486
            Set<Integer> fofoIds = csService1.getAuthFofoIds(email, true);
494
                fofoIds = csService1.getAuthFofoIds(email, true);
-
 
495
            }
-
 
496
 
487
 
497
 
488
            if (fofoIds != null && fofoIds.size() > 0) {
498
            if (fofoIds != null && fofoIds.size() > 0) {
489
                Map<Integer, List<Integer>> warehouseIdFofoIdMap = fofoStoreRepository
499
                Map<Integer, List<Integer>> warehouseIdFofoIdMap = fofoStoreRepository
490
                        .selectActivePartnersByRetailerIds(new ArrayList<>(fofoIds)).stream()
500
                        .selectActivePartnersByRetailerIds(new ArrayList<>(fofoIds)).stream()
491
                        .collect(Collectors.groupingBy(FofoStore::getWarehouseId,
501
                        .collect(Collectors.groupingBy(FofoStore::getWarehouseId,