| 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: L3 or above in EITHER RBM or Sales category unlocks all active stores.
|
| 497 |
// RBM category: only L3 and above can see all stores
|
498 |
// Everyone else (L1/L2 in any category, or non-RBM/non-Sales categories) stays
|
| 498 |
boolean isRbmL3OrAbove = positions.stream().anyMatch(pos ->
|
499 |
// territory-scoped via csService1.getAuthFofoIds.
|
| 499 |
pos.getCategoryId() == ProfitMandiConstants.TICKET_CATEGORY_RBM
|
500 |
boolean canSeeAllStores = positions.stream().anyMatch(pos ->
|
| 500 |
&& pos.getEscalationType() != null
|
501 |
pos.getEscalationType() != null
|
| 501 |
&& pos.getEscalationType() != EscalationType.L1
|
502 |
&& pos.getEscalationType() != EscalationType.L1
|
| 502 |
&& pos.getEscalationType() != EscalationType.L2);
|
503 |
&& pos.getEscalationType() != EscalationType.L2
|
| - |
|
504 |
&& (pos.getCategoryId() == ProfitMandiConstants.TICKET_CATEGORY_RBM
|
| - |
|
505 |
|| pos.getCategoryId() == ProfitMandiConstants.TICKET_CATEGORY_SALES));
|
| 503 |
model.addAttribute("isRBM", isRBM);
|
506 |
model.addAttribute("isRBM", isRBM);
|
| 504 |
model.addAttribute("authEmail", email);
|
507 |
model.addAttribute("authEmail", email);
|
| 505 |
Set<Integer> fofoIds = new HashSet<>();
|
508 |
Set<Integer> fofoIds = new HashSet<>();
|
| 506 |
if (isRbmL3OrAbove) {
|
509 |
if (canSeeAllStores) {
|
| 507 |
fofoIds = fofoStoreRepository.selectActiveStores().stream().map(x -> x.getId()).collect(Collectors.toSet());
|
510 |
fofoIds = fofoStoreRepository.selectActiveStores().stream().map(x -> x.getId()).collect(Collectors.toSet());
|
| 508 |
} else {
|
511 |
} else {
|
| 509 |
fofoIds = csService1.getAuthFofoIds(email, true);
|
512 |
fofoIds = csService1.getAuthFofoIds(email, true);
|
| 510 |
}
|
513 |
}
|
| 511 |
|
514 |
|