| Line 717... |
Line 717... |
| 717 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
717 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
| 718 |
long size = 0;
|
718 |
long size = 0;
|
| 719 |
AuthUser authUser = authRepository.selectByEmailOrMobile(loginDetails.getEmailId());
|
719 |
AuthUser authUser = authRepository.selectByEmailOrMobile(loginDetails.getEmailId());
|
| 720 |
List<Ticket> tickets = null;
|
720 |
List<Ticket> tickets = null;
|
| 721 |
Map<Integer, List<AuthUser>> authUserListMap = null;
|
721 |
Map<Integer, List<AuthUser>> authUserListMap = null;
|
| - |
|
722 |
if (ticketSearchType == null) {
|
| 722 |
if (loginDetails.getEmailId().equals("amandeep.singh@smartdukaan.com")) {
|
723 |
if (ticketStatus.equals(TicketStatus.RESOLVED)) {
|
| 723 |
tickets = ticketRepository.selectAll(offset, limit, Optional.empty());
|
724 |
tickets = ticketRepository.selectAllManagerTicket(authUser.getId(), sortOrder, Optional.empty(), null,
|
| - |
|
725 |
searchTerm, offset, limit);
|
| - |
|
726 |
size = ticketRepository.selectAllCountByManagerTicket(authUser.getId(), Optional.empty(), null, 0);
|
| - |
|
727 |
} else {
|
| 724 |
authUserListMap = csService.getAssignedAuthList(tickets);
|
728 |
tickets = ticketRepository.selectAllManagerTicket(authUser.getId(), sortOrder,
|
| - |
|
729 |
Optional.of(TicketStatus.CLOSED.equals(ticketStatus)), null, searchTerm, offset, limit);
|
| 725 |
size = ticketRepository.selectAllCount();
|
730 |
size = ticketRepository.selectAllCountByManagerTicket(authUser.getId(),
|
| - |
|
731 |
Optional.of(TicketStatus.CLOSED.equals(ticketStatus)), null, 0);
|
| - |
|
732 |
}
|
| 726 |
} else {
|
733 |
} else {
|
| 727 |
if (ticketSearchType == null) {
|
- |
|
| 728 |
if (ticketStatus.equals(TicketStatus.RESOLVED)) {
|
734 |
if (ticketStatus.equals(TicketStatus.RESOLVED)) {
|
| 729 |
tickets = ticketRepository.selectAllManagerTicket(authUser.getId(), sortOrder, Optional.empty(),
|
735 |
tickets = ticketRepository.selectAllManagerTicket(authUser.getId(), sortOrder, Optional.empty(),
|
| 730 |
null, searchTerm, offset, limit);
|
736 |
ticketSearchType, searchTerm, offset, limit);
|
| 731 |
size = ticketRepository.selectAllCountByManagerTicket(authUser.getId(), Optional.empty(), null, 0);
|
737 |
size = ticketRepository.selectAllCountByManagerTicket(authUser.getId(), Optional.empty(),
|
| 732 |
} else {
|
- |
|
| 733 |
tickets = ticketRepository.selectAllManagerTicket(authUser.getId(), sortOrder,
|
- |
|
| 734 |
Optional.of(TicketStatus.CLOSED.equals(ticketStatus)), null, searchTerm, offset, limit);
|
- |
|
| 735 |
size = ticketRepository.selectAllCountByManagerTicket(authUser.getId(),
|
- |
|
| 736 |
Optional.of(TicketStatus.CLOSED.equals(ticketStatus)), null, 0);
|
738 |
ticketSearchType, searchTerm);
|
| 737 |
}
|
- |
|
| 738 |
} else {
|
739 |
} else {
|
| 739 |
if (ticketStatus.equals(TicketStatus.RESOLVED)) {
|
- |
|
| 740 |
tickets = ticketRepository.selectAllManagerTicket(authUser.getId(), sortOrder, Optional.empty(),
|
- |
|
| 741 |
ticketSearchType, searchTerm, offset, limit);
|
- |
|
| 742 |
size = ticketRepository.selectAllCountByManagerTicket(authUser.getId(), Optional.empty(),
|
- |
|
| 743 |
ticketSearchType, searchTerm);
|
- |
|
| 744 |
} else {
|
- |
|
| 745 |
tickets = ticketRepository.selectAllManagerTicket(authUser.getId(), sortOrder,
|
740 |
tickets = ticketRepository.selectAllManagerTicket(authUser.getId(), sortOrder,
|
| 746 |
Optional.of(TicketStatus.CLOSED.equals(ticketStatus)), ticketSearchType, searchTerm, offset,
|
741 |
Optional.of(TicketStatus.CLOSED.equals(ticketStatus)), ticketSearchType, searchTerm, offset,
|
| 747 |
limit);
|
742 |
limit);
|
| 748 |
size = ticketRepository.selectAllCountByManagerTicket(authUser.getId(),
|
743 |
size = ticketRepository.selectAllCountByManagerTicket(authUser.getId(),
|
| 749 |
Optional.of(TicketStatus.CLOSED.equals(ticketStatus)), ticketSearchType, searchTerm);
|
744 |
Optional.of(TicketStatus.CLOSED.equals(ticketStatus)), ticketSearchType, searchTerm);
|
| 750 |
}
|
- |
|
| 751 |
|
- |
|
| 752 |
}
|
745 |
}
|
| 753 |
authUserListMap = csService.getAssignedAuthList(tickets);
|
- |
|
| 754 |
|
746 |
|
| - |
|
747 |
}
|
| - |
|
748 |
authUserListMap = csService.getAssignedAuthList(tickets);
|
| - |
|
749 |
|
| 755 |
if (tickets.size() > 0) {
|
750 |
if (tickets.size() > 0) {
|
| 756 |
Map<Integer, CustomRetailer> fofoIdsAndCustomRetailer = csService.getPartnerByFofoIds(tickets);
|
751 |
Map<Integer, CustomRetailer> fofoIdsAndCustomRetailer = csService.getPartnerByFofoIds(tickets);
|
| 757 |
model.addAttribute("fofoIdsAndCustomRetailer", fofoIdsAndCustomRetailer);
|
752 |
model.addAttribute("fofoIdsAndCustomRetailer", fofoIdsAndCustomRetailer);
|
| 758 |
}
|
- |
|
| 759 |
}
|
753 |
}
|
| 760 |
if (size < limit) {
|
754 |
if (size < limit) {
|
| 761 |
model.addAttribute("end", offset + size);
|
755 |
model.addAttribute("end", offset + size);
|
| 762 |
} else {
|
756 |
} else {
|
| 763 |
model.addAttribute("end", offset + limit);
|
757 |
model.addAttribute("end", offset + limit);
|
| Line 792... |
Line 786... |
| 792 |
throws ProfitMandiBusinessException {
|
786 |
throws ProfitMandiBusinessException {
|
| 793 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
787 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
| 794 |
AuthUser authUser = authRepository.selectByEmailOrMobile(loginDetails.getEmailId());
|
788 |
AuthUser authUser = authRepository.selectByEmailOrMobile(loginDetails.getEmailId());
|
| 795 |
Map<Integer, List<AuthUser>> authUserListMap = null;
|
789 |
Map<Integer, List<AuthUser>> authUserListMap = null;
|
| 796 |
List<Ticket> tickets = null;
|
790 |
List<Ticket> tickets = null;
|
| 797 |
if (loginDetails.getEmailId().equals("amandeep.singh@smartdukaan.com")) {
|
- |
|
| 798 |
tickets = ticketRepository.selectAll(offset, limit, Optional.empty());
|
- |
|
| 799 |
authUserListMap = csService.getAssignedAuthList(tickets);
|
- |
|
| 800 |
} else {
|
- |
|
| 801 |
if (ticketSearchType == null) {
|
791 |
if (ticketSearchType == null) {
|
| 802 |
if (ticketStatus.equals(TicketStatus.RESOLVED)) {
|
792 |
if (ticketStatus.equals(TicketStatus.RESOLVED)) {
|
| 803 |
tickets = ticketRepository.selectAllManagerTicket(authUser.getId(), sortOrder, Optional.empty(),
|
793 |
tickets = ticketRepository.selectAllManagerTicket(authUser.getId(), sortOrder, Optional.empty(), null,
|
| 804 |
null, searchTerm, offset, limit);
|
794 |
searchTerm, offset, limit);
|
| 805 |
|
- |
|
| 806 |
} else {
|
- |
|
| 807 |
tickets = ticketRepository.selectAllManagerTicket(authUser.getId(), sortOrder,
|
- |
|
| 808 |
Optional.of(TicketStatus.CLOSED.equals(ticketStatus)), null, searchTerm, offset, limit);
|
- |
|
| 809 |
|
795 |
|
| 810 |
}
|
- |
|
| 811 |
} else {
|
796 |
} else {
|
| 812 |
if (ticketStatus.equals(TicketStatus.RESOLVED)) {
|
- |
|
| 813 |
tickets = ticketRepository.selectAllManagerTicket(authUser.getId(), sortOrder, Optional.empty(),
|
- |
|
| 814 |
ticketSearchType, searchTerm, offset, limit);
|
- |
|
| 815 |
|
- |
|
| 816 |
} else {
|
- |
|
| 817 |
tickets = ticketRepository.selectAllManagerTicket(authUser.getId(), sortOrder,
|
797 |
tickets = ticketRepository.selectAllManagerTicket(authUser.getId(), sortOrder,
|
| 818 |
Optional.of(TicketStatus.CLOSED.equals(ticketStatus)), ticketSearchType, searchTerm, offset,
|
798 |
Optional.of(TicketStatus.CLOSED.equals(ticketStatus)), null, searchTerm, offset, limit);
|
| 819 |
limit);
|
- |
|
| 820 |
}
|
- |
|
| 821 |
|
799 |
|
| 822 |
}
|
800 |
}
|
| - |
|
801 |
} else {
|
| - |
|
802 |
if (ticketStatus.equals(TicketStatus.RESOLVED)) {
|
| - |
|
803 |
tickets = ticketRepository.selectAllManagerTicket(authUser.getId(), sortOrder, Optional.empty(),
|
| 823 |
authUserListMap = csService.getAssignedAuthList(tickets);
|
804 |
ticketSearchType, searchTerm, offset, limit);
|
| - |
|
805 |
|
| 824 |
if (tickets.size() > 0) {
|
806 |
} else {
|
| 825 |
Map<Integer, CustomRetailer> fofoIdsAndCustomRetailer = csService.getPartnerByFofoIds(tickets);
|
807 |
tickets = ticketRepository.selectAllManagerTicket(authUser.getId(), sortOrder,
|
| 826 |
model.addAttribute("fofoIdsAndCustomRetailer", fofoIdsAndCustomRetailer);
|
808 |
Optional.of(TicketStatus.CLOSED.equals(ticketStatus)), ticketSearchType, searchTerm, offset,
|
| - |
|
809 |
limit);
|
| 827 |
}
|
810 |
}
|
| - |
|
811 |
|
| - |
|
812 |
}
|
| - |
|
813 |
authUserListMap = csService.getAssignedAuthList(tickets);
|
| - |
|
814 |
if (tickets.size() > 0) {
|
| - |
|
815 |
Map<Integer, CustomRetailer> fofoIdsAndCustomRetailer = csService.getPartnerByFofoIds(tickets);
|
| - |
|
816 |
model.addAttribute("fofoIdsAndCustomRetailer", fofoIdsAndCustomRetailer);
|
| 828 |
}
|
817 |
}
|
| 829 |
model.addAttribute("tickets", tickets);
|
818 |
model.addAttribute("tickets", tickets);
|
| 830 |
Map<Integer, TicketSubCategory> subCategoryIdAndSubCategoryMap = csService
|
819 |
Map<Integer, TicketSubCategory> subCategoryIdAndSubCategoryMap = csService
|
| 831 |
.getSubCategoryIdAndSubCategoryMap(tickets);
|
820 |
.getSubCategoryIdAndSubCategoryMap(tickets);
|
| 832 |
model.addAttribute("tickets", tickets);
|
821 |
model.addAttribute("tickets", tickets);
|