Subversion Repositories SmartDukaan

Rev

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

Rev 37278 Rev 37286
Line 492... Line 492...
492
            long pendingIndent = 0;
492
            long pendingIndent = 0;
493
            long tertiary = 0;
493
            long tertiary = 0;
494
 
494
 
495
            isAboveL1 = positions.stream().anyMatch(pos -> pos.getEscalationType() != EscalationType.L1);
495
            isAboveL1 = positions.stream().anyMatch(pos -> pos.getEscalationType() != EscalationType.L1);
496
            boolean isRBM = positions.stream().anyMatch(pos -> pos.getCategoryId() == ProfitMandiConstants.TICKET_CATEGORY_RBM);
496
            boolean isRBM = positions.stream().anyMatch(pos -> pos.getCategoryId() == ProfitMandiConstants.TICKET_CATEGORY_RBM);
-
 
497
            // See-all rule:
497
            // See-all rule: L3 or above in EITHER RBM or Sales category unlocks all active stores.
498
            //   - RBM  category: L3 and above  (i.e. not L1, not L2)
498
            // Everyone else (L1/L2 in any category, or non-RBM/non-Sales categories) stays
499
            //   - Sales category: L4 and above (i.e. not L1, not L2, not L3)
499
            // territory-scoped via csService1.getAuthFofoIds.
500
            // Everyone else stays territory-scoped via csService1.getAuthFofoIds.
500
            boolean canSeeAllStores = positions.stream().anyMatch(pos ->
501
            boolean isRbmL3OrAbove = positions.stream().anyMatch(pos ->
-
 
502
                    pos.getCategoryId() == ProfitMandiConstants.TICKET_CATEGORY_RBM
-
 
503
                            && pos.getEscalationType() != null
-
 
504
                            && pos.getEscalationType() != EscalationType.L1
-
 
505
                            && pos.getEscalationType() != EscalationType.L2);
-
 
506
            boolean isSalesL4OrAbove = positions.stream().anyMatch(pos ->
-
 
507
                    pos.getCategoryId() == ProfitMandiConstants.TICKET_CATEGORY_SALES
501
                    pos.getEscalationType() != null
508
                            && pos.getEscalationType() != null
502
                            && pos.getEscalationType() != EscalationType.L1
509
                            && pos.getEscalationType() != EscalationType.L1
503
                            && pos.getEscalationType() != EscalationType.L2
510
                            && pos.getEscalationType() != EscalationType.L2
504
                            && (pos.getCategoryId() == ProfitMandiConstants.TICKET_CATEGORY_RBM
511
                            && pos.getEscalationType() != EscalationType.L3);
505
                            || pos.getCategoryId() == ProfitMandiConstants.TICKET_CATEGORY_SALES));
512
            boolean canSeeAllStores = isRbmL3OrAbove || isSalesL4OrAbove;
506
            model.addAttribute("isRBM", isRBM);
513
            model.addAttribute("isRBM", isRBM);
507
            model.addAttribute("authEmail", email);
514
            model.addAttribute("authEmail", email);
508
            Set<Integer> fofoIds = new HashSet<>();
515
            Set<Integer> fofoIds = new HashSet<>();
509
            if (canSeeAllStores) {
516
            if (canSeeAllStores) {
510
                fofoIds = fofoStoreRepository.selectActiveStores().stream().map(x -> x.getId()).collect(Collectors.toSet());
517
                fofoIds = fofoStoreRepository.selectActiveStores().stream().map(x -> x.getId()).collect(Collectors.toSet());