Subversion Repositories SmartDukaan

Rev

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

Rev 37190 Rev 37285
Line 1610... Line 1610...
1610
        LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
1610
        LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
1611
        String email = loginDetails.getEmailId();
1611
        String email = loginDetails.getEmailId();
1612
        AuthUser authUser = authRepository.selectByEmailOrMobile(email);
1612
        AuthUser authUser = authRepository.selectByEmailOrMobile(email);
1613
        List<Position> positions = positionRepository.selectAllByAuthUserId(authUser.getId());
1613
        List<Position> positions = positionRepository.selectAllByAuthUserId(authUser.getId());
1614
 
1614
 
-
 
1615
        // Same see-all rule as AdminUser.adminPanel: L3+ in EITHER RBM or Sales category.
1615
        boolean isRbmL3OrAbove = positions.stream().anyMatch(pos ->
1616
        // Keeps this warehouse-brand drilldown consistent with the dashboard visibility.
1616
                pos.getCategoryId() == ProfitMandiConstants.TICKET_CATEGORY_RBM
1617
        boolean canSeeAllStores = positions.stream().anyMatch(pos ->
1617
                        && pos.getEscalationType() != null
1618
                pos.getEscalationType() != null
1618
                        && pos.getEscalationType() != EscalationType.L1
1619
                        && pos.getEscalationType() != EscalationType.L1
1619
                        && pos.getEscalationType() != EscalationType.L2);
1620
                        && pos.getEscalationType() != EscalationType.L2
-
 
1621
                        && (pos.getCategoryId() == ProfitMandiConstants.TICKET_CATEGORY_RBM
-
 
1622
                        || pos.getCategoryId() == ProfitMandiConstants.TICKET_CATEGORY_SALES));
1620
 
1623
 
1621
        Set<Integer> fofoIds;
1624
        Set<Integer> fofoIds;
1622
        if (isRbmL3OrAbove) {
1625
        if (canSeeAllStores) {
1623
            fofoIds = fofoStoreRepository.selectActiveStores().stream()
1626
            fofoIds = fofoStoreRepository.selectActiveStores().stream()
1624
                    .map(x -> x.getId()).collect(Collectors.toSet());
1627
                    .map(x -> x.getId()).collect(Collectors.toSet());
1625
        } else {
1628
        } else {
1626
            fofoIds = csService1.getAuthFofoIds(email, true);
1629
            fofoIds = csService1.getAuthFofoIds(email, true);
1627
        }
1630
        }