Subversion Repositories SmartDukaan

Rev

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

Rev 37285 Rev 37286
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
        // Same see-all rule as AdminUser.adminPanel:
-
 
1616
        //   - RBM  L3 and above
-
 
1617
        //   - Sales L4 and above
-
 
1618
        boolean isRbmL3OrAbove = positions.stream().anyMatch(pos ->
1616
        // Keeps this warehouse-brand drilldown consistent with the dashboard visibility.
1619
                pos.getCategoryId() == ProfitMandiConstants.TICKET_CATEGORY_RBM
-
 
1620
                        && pos.getEscalationType() != null
-
 
1621
                        && pos.getEscalationType() != EscalationType.L1
-
 
1622
                        && pos.getEscalationType() != EscalationType.L2);
1617
        boolean canSeeAllStores = positions.stream().anyMatch(pos ->
1623
        boolean isSalesL4OrAbove = positions.stream().anyMatch(pos ->
-
 
1624
                pos.getCategoryId() == ProfitMandiConstants.TICKET_CATEGORY_SALES
1618
                pos.getEscalationType() != null
1625
                        && pos.getEscalationType() != null
1619
                        && pos.getEscalationType() != EscalationType.L1
1626
                        && pos.getEscalationType() != EscalationType.L1
1620
                        && pos.getEscalationType() != EscalationType.L2
1627
                        && pos.getEscalationType() != EscalationType.L2
1621
                        && (pos.getCategoryId() == ProfitMandiConstants.TICKET_CATEGORY_RBM
1628
                        && pos.getEscalationType() != EscalationType.L3);
1622
                        || pos.getCategoryId() == ProfitMandiConstants.TICKET_CATEGORY_SALES));
1629
        boolean canSeeAllStores = isRbmL3OrAbove || isSalesL4OrAbove;
1623
 
1630
 
1624
        Set<Integer> fofoIds;
1631
        Set<Integer> fofoIds;
1625
        if (canSeeAllStores) {
1632
        if (canSeeAllStores) {
1626
            fofoIds = fofoStoreRepository.selectActiveStores().stream()
1633
            fofoIds = fofoStoreRepository.selectActiveStores().stream()
1627
                    .map(x -> x.getId()).collect(Collectors.toSet());
1634
                    .map(x -> x.getId()).collect(Collectors.toSet());