Subversion Repositories SmartDukaan

Rev

Rev 37286 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 37286 Rev 37287
Line 493... Line 493...
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:
498
            //   - RBM  category: L3 and above  (i.e. not L1, not L2)
498
            //   - RBM  category: L3 and above  (not L1, not L2)
499
            //   - Sales category: L4 and above (i.e. not L1, not L2, not L3)
499
            //   - Sales category: L5 and above (not L1, not L2, not L3, not L4)
500
            // Everyone else stays territory-scoped via csService1.getAuthFofoIds.
500
            // Everyone else stays territory-scoped via csService1.getAuthFofoIds.
501
            boolean isRbmL3OrAbove = positions.stream().anyMatch(pos ->
501
            boolean isRbmL3OrAbove = positions.stream().anyMatch(pos ->
502
                    pos.getCategoryId() == ProfitMandiConstants.TICKET_CATEGORY_RBM
502
                    pos.getCategoryId() == ProfitMandiConstants.TICKET_CATEGORY_RBM
503
                            && pos.getEscalationType() != null
503
                            && pos.getEscalationType() != null
504
                            && pos.getEscalationType() != EscalationType.L1
504
                            && pos.getEscalationType() != EscalationType.L1
505
                            && pos.getEscalationType() != EscalationType.L2);
505
                            && pos.getEscalationType() != EscalationType.L2);
506
            boolean isSalesL4OrAbove = positions.stream().anyMatch(pos ->
506
            boolean isSalesL5OrAbove = positions.stream().anyMatch(pos ->
507
                    pos.getCategoryId() == ProfitMandiConstants.TICKET_CATEGORY_SALES
507
                    pos.getCategoryId() == ProfitMandiConstants.TICKET_CATEGORY_SALES
508
                            && pos.getEscalationType() != null
508
                            && pos.getEscalationType() != null
509
                            && pos.getEscalationType() != EscalationType.L1
509
                            && pos.getEscalationType() != EscalationType.L1
510
                            && pos.getEscalationType() != EscalationType.L2
510
                            && pos.getEscalationType() != EscalationType.L2
-
 
511
                            && pos.getEscalationType() != EscalationType.L3
511
                            && pos.getEscalationType() != EscalationType.L3);
512
                            && pos.getEscalationType() != EscalationType.L4);
512
            boolean canSeeAllStores = isRbmL3OrAbove || isSalesL4OrAbove;
513
            boolean canSeeAllStores = isRbmL3OrAbove || isSalesL5OrAbove;
513
            model.addAttribute("isRBM", isRBM);
514
            model.addAttribute("isRBM", isRBM);
514
            model.addAttribute("authEmail", email);
515
            model.addAttribute("authEmail", email);
515
            Set<Integer> fofoIds = new HashSet<>();
516
            Set<Integer> fofoIds = new HashSet<>();
516
            if (canSeeAllStores) {
517
            if (canSeeAllStores) {
517
                fofoIds = fofoStoreRepository.selectActiveStores().stream().map(x -> x.getId()).collect(Collectors.toSet());
518
                fofoIds = fofoStoreRepository.selectActiveStores().stream().map(x -> x.getId()).collect(Collectors.toSet());