| Line 632... |
Line 632... |
| 632 |
throw new ProfitMandiBusinessException("Ticket", ticketId, "Happy Code can't match");
|
632 |
throw new ProfitMandiBusinessException("Ticket", ticketId, "Happy Code can't match");
|
| 633 |
}
|
633 |
}
|
| 634 |
return "response";
|
634 |
return "response";
|
| 635 |
}
|
635 |
}
|
| 636 |
|
636 |
|
| - |
|
637 |
@GetMapping(value = "/cs/myPartyTicketTicket")
|
| - |
|
638 |
public String getMyPartyTicketTicket(HttpServletRequest request, @RequestParam(name = "orderby", defaultValue = "DESCENDING") SortOrder sortOrder, @RequestParam(name = "ticketStatus", defaultValue = "OPENED") TicketStatus ticketStatus, @RequestParam(name = "ticketSearchType", defaultValue = "") TicketSearchType ticketSearchType, @RequestParam(name = "searchTerm", defaultValue = "0") int searchTerm, Model model) throws ProfitMandiBusinessException {
|
| - |
|
639 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
| - |
|
640 |
long size = 0;
|
| - |
|
641 |
AuthUser authUser = authRepository.selectByEmailOrMobile(loginDetails.getEmailId());
|
| - |
|
642 |
List<Ticket> tickets = new ArrayList<>();
|
| - |
|
643 |
Map<String, Set<Integer>> storeGuyMap = csService.getAuthUserPartnerIdMapping();
|
| - |
|
644 |
Set<Integer> fofoIds = storeGuyMap.get(authUser.getEmailId());
|
| - |
|
645 |
|
| - |
|
646 |
Map<Integer, List<AuthUser>> authUserListMap = null;
|
| - |
|
647 |
if (fofoIds != null && !fofoIds.isEmpty()) {
|
| - |
|
648 |
for (Integer fofoId : fofoIds) {
|
| - |
|
649 |
List<Ticket> partnerWiseTickets = ticketRepository.selectAllOpenTicketByRetailer(fofoId);
|
| - |
|
650 |
|
| - |
|
651 |
if (partnerWiseTickets != null && !partnerWiseTickets.isEmpty()) {
|
| - |
|
652 |
// Filter tickets where last_activity is not "RESOLVED"
|
| - |
|
653 |
List<Ticket> filteredTickets = partnerWiseTickets.stream()
|
| - |
|
654 |
.filter(ticket -> ticket.getLastActivity() == null ||
|
| - |
|
655 |
ticket.getLastActivity() != ActivityType.RESOLVED)
|
| - |
|
656 |
.collect(Collectors.toList());
|
| - |
|
657 |
|
| - |
|
658 |
tickets.addAll(filteredTickets);
|
| - |
|
659 |
}
|
| - |
|
660 |
}
|
| - |
|
661 |
}
|
| - |
|
662 |
|
| - |
|
663 |
authUserListMap = csService.getAssignedAuthList(tickets);
|
| - |
|
664 |
|
| - |
|
665 |
|
| - |
|
666 |
if (tickets.size() > 0) {
|
| - |
|
667 |
Map<Integer, CustomRetailer> fofoIdsAndCustomRetailer = csService.getPartnerByFofoIds(tickets);
|
| - |
|
668 |
model.addAttribute("fofoIdsAndCustomRetailer", fofoIdsAndCustomRetailer);
|
| - |
|
669 |
}
|
| - |
|
670 |
|
| - |
|
671 |
model.addAttribute("size", tickets.size());
|
| - |
|
672 |
model.addAttribute("tickets", tickets);
|
| - |
|
673 |
|
| - |
|
674 |
List<Integer> subCategoryIds = tickets.stream().map(x -> x.getSubCategoryId()).collect(Collectors.toList());
|
| - |
|
675 |
Map<Integer, TicketSubCategory> subCategoryIdAndSubCategoryMap = csService.getSubCategoryIdAndSubCategoryMap(subCategoryIds);
|
| - |
|
676 |
|
| - |
|
677 |
Map<Integer, TicketCategory> subCategoryIdAndCategoryMap = csService.getSubCategoryIdAndCategoryMap(subCategoryIds);
|
| - |
|
678 |
|
| - |
|
679 |
List<Integer> ticketIds = tickets.stream().map(x -> x.getId()).collect(Collectors.toList());
|
| - |
|
680 |
Map<Integer, List<Activity>> activityMap = new HashMap<>();
|
| - |
|
681 |
Map<Integer, List<Activity>> activityMapWithActivityId = new HashMap<>();
|
| - |
|
682 |
|
| - |
|
683 |
if (!ticketIds.isEmpty()) {
|
| - |
|
684 |
activityMap = activityRepository.selectAll(ticketIds).stream().collect(Collectors.groupingBy(x -> x.getTicketId()));
|
| - |
|
685 |
activityMapWithActivityId = activityRepository.selectAll(ticketIds).stream().collect(Collectors.groupingBy(x -> x.getId()));
|
| - |
|
686 |
|
| - |
|
687 |
}
|
| - |
|
688 |
|
| - |
|
689 |
List<AuthUser> authUsersList = authRepository.selectAll();
|
| - |
|
690 |
Map<Integer, AuthUser> authUserMap = authUsersList.stream().collect(Collectors.toMap(x -> x.getId(), x -> x));
|
| - |
|
691 |
|
| - |
|
692 |
model.addAttribute("ticketStatusValues", TicketStatus.values());
|
| - |
|
693 |
model.addAttribute("orderByValues", SortOrder.values());
|
| - |
|
694 |
model.addAttribute("selectedticketStatus", ticketStatus);
|
| - |
|
695 |
model.addAttribute("selectedorderby", sortOrder);
|
| - |
|
696 |
model.addAttribute("tickets", tickets);
|
| - |
|
697 |
model.addAttribute("ticketSearchTypes", TicketSearchType.values());
|
| - |
|
698 |
model.addAttribute("ticketSearchType", ticketSearchType);
|
| - |
|
699 |
model.addAttribute("searchTerm", searchTerm);
|
| - |
|
700 |
model.addAttribute("authUserListMap", authUserListMap);
|
| - |
|
701 |
model.addAttribute("subCategoryIdAndSubCategoryMap", subCategoryIdAndSubCategoryMap);
|
| - |
|
702 |
|
| - |
|
703 |
model.addAttribute("subCategoryIdAndCategoryMap", subCategoryIdAndCategoryMap);
|
| - |
|
704 |
|
| - |
|
705 |
model.addAttribute("activityMap", activityMap);
|
| - |
|
706 |
model.addAttribute("authUserMap", authUserMap);
|
| - |
|
707 |
model.addAttribute("activityMapWithActivityId", activityMapWithActivityId);
|
| - |
|
708 |
|
| - |
|
709 |
return "my-partner-tickets";
|
| - |
|
710 |
}
|
| - |
|
711 |
|
| 637 |
@GetMapping(value = "/cs/managerTicket")
|
712 |
@GetMapping(value = "/cs/managerTicket")
|
| 638 |
public String getManagerTickets(HttpServletRequest request, @RequestParam(name = "orderby", defaultValue = "DESCENDING") SortOrder sortOrder, @RequestParam(name = "ticketStatus", defaultValue = "OPENED") TicketStatus ticketStatus, @RequestParam(name = "ticketSearchType", defaultValue = "") TicketSearchType ticketSearchType, @RequestParam(name = "searchTerm", defaultValue = "0") int searchTerm, Model model) throws ProfitMandiBusinessException {
|
713 |
public String getManagerTickets(HttpServletRequest request, @RequestParam(name = "orderby", defaultValue = "DESCENDING") SortOrder sortOrder, @RequestParam(name = "ticketStatus", defaultValue = "OPENED") TicketStatus ticketStatus, @RequestParam(name = "ticketSearchType", defaultValue = "") TicketSearchType ticketSearchType, @RequestParam(name = "searchTerm", defaultValue = "0") int searchTerm, Model model) throws ProfitMandiBusinessException {
|
| 639 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
714 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
| 640 |
long size = 0;
|
715 |
long size = 0;
|
| 641 |
AuthUser authUser = authRepository.selectByEmailOrMobile(loginDetails.getEmailId());
|
716 |
AuthUser authUser = authRepository.selectByEmailOrMobile(loginDetails.getEmailId());
|
| Line 721... |
Line 796... |
| 721 |
model.addAttribute("ticketSubCategory", ticketSubCategory);
|
796 |
model.addAttribute("ticketSubCategory", ticketSubCategory);
|
| 722 |
model.addAttribute("authUsers", authUsers);
|
797 |
model.addAttribute("authUsers", authUsers);
|
| 723 |
return "edit-ticket-modal";
|
798 |
return "edit-ticket-modal";
|
| 724 |
}
|
799 |
}
|
| 725 |
|
800 |
|
| - |
|
801 |
@GetMapping(value = "/cs/edit-partner-ticket")
|
| - |
|
802 |
public String getEditPartnerTicket(HttpServletRequest request, @RequestParam(name = "ticketId", defaultValue = "0") int ticketId, Model model) {
|
| - |
|
803 |
Ticket ticket = ticketRepository.selectById(ticketId);
|
| - |
|
804 |
List<TicketCategory> ticketCategories = csService.getAllTicketCategotyFromSubCategory();
|
| - |
|
805 |
TicketSubCategory ticketSubCategory = ticketSubCategoryRepository.selectById(ticket.getSubCategoryId());
|
| - |
|
806 |
List<TicketSubCategory> ticketSubCategories = ticketSubCategoryRepository.selectAll(ticketSubCategory.getCategoryId());
|
| - |
|
807 |
List<AuthUser> authUsers = authRepository.selectAllActiveUser();
|
| - |
|
808 |
model.addAttribute("ticket", ticket);
|
| - |
|
809 |
model.addAttribute("ticketCategories", ticketCategories);
|
| - |
|
810 |
model.addAttribute("ticketSubCategories", ticketSubCategories);
|
| - |
|
811 |
model.addAttribute("ticketSubCategory", ticketSubCategory);
|
| - |
|
812 |
model.addAttribute("authUsers", authUsers);
|
| - |
|
813 |
return "edit-ticket-partner-modal";
|
| - |
|
814 |
}
|
| - |
|
815 |
|
| 726 |
@PostMapping(value = "/cs/edit-ticket")
|
816 |
@PostMapping(value = "/cs/edit-ticket")
|
| 727 |
public String editTicket(HttpServletRequest request, @RequestParam(name = "ticketId", defaultValue = "0") int ticketId, @RequestParam(name = "subCategoryId", defaultValue = "0") int subCategoryId, @RequestParam(name = "categoryId", defaultValue = "0") int categoryId, @RequestParam(name = "authUserId", defaultValue = "0") int authUserId, @RequestParam(name = "escalationType", defaultValue = "L1") EscalationType escalationType, Model model) throws Exception {
|
817 |
public String editTicket(HttpServletRequest request, @RequestParam(name = "ticketId", defaultValue = "0") int ticketId, @RequestParam(name = "subCategoryId", defaultValue = "0") int subCategoryId, @RequestParam(name = "categoryId", defaultValue = "0") int categoryId, @RequestParam(name = "authUserId", defaultValue = "0") int authUserId, @RequestParam(name = "escalationType", defaultValue = "L1") EscalationType escalationType, Model model) throws Exception {
|
| 728 |
LOGGER.info("Ticket Id {}, CategoryId {}, SubCategory Id {} authUserId {}", ticketId, categoryId, subCategoryId, authUserId);
|
818 |
LOGGER.info("Ticket Id {}, CategoryId {}, SubCategory Id {} authUserId {}", ticketId, categoryId, subCategoryId, authUserId);
|
| 729 |
Ticket ticket = ticketRepository.selectById(ticketId);
|
819 |
Ticket ticket = ticketRepository.selectById(ticketId);
|
| 730 |
csService.updateTicket(categoryId, subCategoryId, ticket, authUserId, escalationType);
|
820 |
csService.updateTicket(categoryId, subCategoryId, ticket, authUserId, escalationType);
|
| 731 |
model.addAttribute("response1", mvcResponseSender.createResponseString(true));
|
821 |
model.addAttribute("response1", mvcResponseSender.createResponseString(true));
|
| 732 |
return "response";
|
822 |
return "response";
|
| - |
|
823 |
|
| - |
|
824 |
}
|
| - |
|
825 |
|
| - |
|
826 |
@PostMapping(value = "/cs/edit-partner-ticket")
|
| - |
|
827 |
public String editPartnerTicket(HttpServletRequest request, @RequestParam(name = "ticketId", defaultValue = "0") int ticketId, @RequestParam(name = "subCategoryId", defaultValue = "0") int subCategoryId, @RequestParam(name = "categoryId", defaultValue = "0") int categoryId, @RequestParam(name = "authUserId", defaultValue = "0") int authUserId, @RequestParam(name = "escalationType", defaultValue = "L1") EscalationType escalationType, Model model) throws Exception {
|
| - |
|
828 |
LOGGER.info("Ticket Id {}, CategoryId {}, SubCategory Id {} authUserId {}", ticketId, categoryId, subCategoryId, authUserId);
|
| - |
|
829 |
Ticket ticket = ticketRepository.selectById(ticketId);
|
| - |
|
830 |
csService.updateTicket(categoryId, subCategoryId, ticket, authUserId, escalationType);
|
| - |
|
831 |
model.addAttribute("response1", mvcResponseSender.createResponseString(true));
|
| - |
|
832 |
return "response";
|
| 733 |
|
833 |
|
| 734 |
}
|
834 |
}
|
| 735 |
|
835 |
|
| 736 |
@PostMapping(value = "/cs/changeTicketAssignee")
|
836 |
@PostMapping(value = "/cs/changeTicketAssignee")
|
| 737 |
public String changeTicketAssignee(HttpServletRequest request, @RequestParam(name = "positionId", defaultValue = "0") int positionId, Model model) throws Exception {
|
837 |
public String changeTicketAssignee(HttpServletRequest request, @RequestParam(name = "positionId", defaultValue = "0") int positionId, Model model) throws Exception {
|