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