| Line 547... |
Line 547... |
| 547 |
|
547 |
|
| 548 |
if (isAdmin) {
|
548 |
if (isAdmin) {
|
| 549 |
int authUserId = currentAuthUser.getId();
|
549 |
int authUserId = currentAuthUser.getId();
|
| 550 |
|
550 |
|
| 551 |
if (isCrmUser) {
|
551 |
if (isCrmUser) {
|
| 552 |
// CRM users see ALL tickets to respond to partner communications
|
552 |
// CRM users see ALL tickets EXCEPT Sales Escalation and RBM Escalation subcategories
|
| 553 |
if (ticketStatus.equals(TicketStatus.RESOLVED)) {
|
553 |
if (ticketStatus.equals(TicketStatus.RESOLVED)) {
|
| 554 |
tickets = ticketRepository.selectAllTickets(Optional.empty(), sortOrder, ticketSearchType, searchTerm);
|
554 |
tickets = ticketRepository.selectAllTickets(Optional.empty(), sortOrder, ticketSearchType, searchTerm);
|
| 555 |
size = ticketRepository.selectAllTicketsCount(Optional.empty(), ticketSearchType, searchTerm);
|
- |
|
| 556 |
} else {
|
555 |
} else {
|
| 557 |
tickets = ticketRepository.selectAllTickets(Optional.of(TicketStatus.CLOSED.equals(ticketStatus)), sortOrder, ticketSearchType, searchTerm);
|
556 |
tickets = ticketRepository.selectAllTickets(Optional.of(TicketStatus.CLOSED.equals(ticketStatus)), sortOrder, ticketSearchType, searchTerm);
|
| 558 |
size = ticketRepository.selectAllTicketsCount(Optional.of(TicketStatus.CLOSED.equals(ticketStatus)), ticketSearchType, searchTerm);
|
- |
|
| 559 |
}
|
557 |
}
|
| - |
|
558 |
|
| - |
|
559 |
// Filter out Sales Escalation and RBM Escalation subcategory tickets for CRM users
|
| - |
|
560 |
tickets = tickets.stream()
|
| - |
|
561 |
.filter(t -> t.getSubCategoryId() != ProfitMandiConstants.TICKET_SUBCATEGORY_SALES_ESCALATION
|
| - |
|
562 |
&& t.getSubCategoryId() != ProfitMandiConstants.TICKET_SUBCATEGORY_RBM_ESCALATION)
|
| - |
|
563 |
.collect(Collectors.toList());
|
| - |
|
564 |
size = tickets.size();
|
| 560 |
} else {
|
565 |
} else {
|
| 561 |
// Non-CRM admins see only tickets assigned to them
|
566 |
// Non-CRM admins see only tickets assigned to them
|
| 562 |
if (ticketSearchType == null) {
|
567 |
if (ticketSearchType == null) {
|
| 563 |
if (ticketStatus.equals(TicketStatus.RESOLVED)) {
|
568 |
if (ticketStatus.equals(TicketStatus.RESOLVED)) {
|
| 564 |
tickets = ticketRepository.selectAllByAssignee(authUserId, Optional.empty(), sortOrder, null, searchTerm);
|
569 |
tickets = ticketRepository.selectAllByAssignee(authUserId, Optional.empty(), sortOrder, null, searchTerm);
|