| Line 31... |
Line 31... |
| 31 |
import com.spice.profitmandi.dao.entity.cs.TicketAssigned;
|
31 |
import com.spice.profitmandi.dao.entity.cs.TicketAssigned;
|
| 32 |
import com.spice.profitmandi.dao.entity.cs.TicketCategory;
|
32 |
import com.spice.profitmandi.dao.entity.cs.TicketCategory;
|
| 33 |
import com.spice.profitmandi.dao.entity.cs.TicketSubCategory;
|
33 |
import com.spice.profitmandi.dao.entity.cs.TicketSubCategory;
|
| 34 |
import com.spice.profitmandi.dao.entity.fofo.ActivityType;
|
34 |
import com.spice.profitmandi.dao.entity.fofo.ActivityType;
|
| 35 |
import com.spice.profitmandi.dao.enumuration.cs.EscalationType;
|
35 |
import com.spice.profitmandi.dao.enumuration.cs.EscalationType;
|
| - |
|
36 |
import com.spice.profitmandi.dao.enumuration.cs.TicketStatus;
|
| 36 |
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
|
37 |
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
|
| 37 |
import com.spice.profitmandi.dao.repository.cs.ActivityRepository;
|
38 |
import com.spice.profitmandi.dao.repository.cs.ActivityRepository;
|
| 38 |
import com.spice.profitmandi.dao.repository.cs.CsService;
|
39 |
import com.spice.profitmandi.dao.repository.cs.CsService;
|
| - |
|
40 |
import com.spice.profitmandi.dao.repository.cs.PartnerRegionRepository;
|
| 39 |
import com.spice.profitmandi.dao.repository.cs.PositionRepository;
|
41 |
import com.spice.profitmandi.dao.repository.cs.PositionRepository;
|
| 40 |
import com.spice.profitmandi.dao.repository.cs.RegionRepository;
|
42 |
import com.spice.profitmandi.dao.repository.cs.RegionRepository;
|
| 41 |
import com.spice.profitmandi.dao.repository.cs.TicketAssignedRepository;
|
43 |
import com.spice.profitmandi.dao.repository.cs.TicketAssignedRepository;
|
| 42 |
import com.spice.profitmandi.dao.repository.cs.TicketCategoryRepository;
|
44 |
import com.spice.profitmandi.dao.repository.cs.TicketCategoryRepository;
|
| 43 |
import com.spice.profitmandi.dao.repository.cs.TicketRepository;
|
45 |
import com.spice.profitmandi.dao.repository.cs.TicketRepository;
|
| Line 94... |
Line 96... |
| 94 |
@Autowired
|
96 |
@Autowired
|
| 95 |
private ActivityRepository activityRepository;
|
97 |
private ActivityRepository activityRepository;
|
| 96 |
|
98 |
|
| 97 |
@Autowired
|
99 |
@Autowired
|
| 98 |
private TicketAssignedRepository ticketAssignedRepository;
|
100 |
private TicketAssignedRepository ticketAssignedRepository;
|
| - |
|
101 |
|
| - |
|
102 |
@Autowired
|
| - |
|
103 |
private PartnerRegionRepository partnerRegionRepository;
|
| 99 |
|
104 |
|
| 100 |
@GetMapping(value = "/cs/createCategory")
|
105 |
@GetMapping(value = "/cs/createCategory")
|
| 101 |
public String getCreateCategory(HttpServletRequest request, Model model) {
|
106 |
public String getCreateCategory(HttpServletRequest request, Model model) {
|
| 102 |
List<TicketCategory> ticketCategories = ticketCategoryRepository.selectAll();
|
107 |
List<TicketCategory> ticketCategories = ticketCategoryRepository.selectAll();
|
| 103 |
model.addAttribute("ticketCategories", ticketCategories);
|
108 |
model.addAttribute("ticketCategories", ticketCategories);
|
| Line 175... |
Line 180... |
| 175 |
regionRepository.persist(region);
|
180 |
regionRepository.persist(region);
|
| 176 |
model.addAttribute("response", mvcResponseSender.createResponseString(true));
|
181 |
model.addAttribute("response", mvcResponseSender.createResponseString(true));
|
| 177 |
return "response";
|
182 |
return "response";
|
| 178 |
}
|
183 |
}
|
| 179 |
|
184 |
|
| - |
|
185 |
@GetMapping(value = "/cs/getPartners")
|
| - |
|
186 |
public String getPartners(HttpServletRequest request,@RequestParam(name="regionId",defaultValue="0")int regionId,Model model) {
|
| - |
|
187 |
List<Integer> fofoIds = targetSlabService.getfofoIdsFromfofoStore();
|
| - |
|
188 |
List<Integer> addedfofoIds=partnerRegionRepository.selectByRegionId(regionId).stream().map(x->x.getFofoId()).collect(Collectors.toList());
|
| - |
|
189 |
Map<Integer, CustomRetailer> fofoRetailers = retailerService.getFofoRetailers(fofoIds);
|
| - |
|
190 |
model.addAttribute("fofoRetailers", fofoRetailers);
|
| - |
|
191 |
model.addAttribute("addedfofoIds", addedfofoIds);
|
| - |
|
192 |
return "added-region-partners";
|
| - |
|
193 |
}
|
| 180 |
@GetMapping(value = "/cs/createPartnerRegion")
|
194 |
@GetMapping(value = "/cs/createPartnerRegion")
|
| 181 |
public String createPartnerRegion(HttpServletRequest request, Model model) {
|
195 |
public String createPartnerRegion(HttpServletRequest request, Model model) {
|
| 182 |
List<Region> regions = regionRepository.selectAll();
|
196 |
List<Region> regions = regionRepository.selectAll();
|
| 183 |
List<Integer> fofoIds = targetSlabService.getfofoIdsFromfofoStore();
|
- |
|
| 184 |
Map<Integer, CustomRetailer> fofoRetailers = retailerService.getFofoRetailers(fofoIds);
|
- |
|
| 185 |
model.addAttribute("regions", regions);
|
197 |
model.addAttribute("regions", regions);
|
| 186 |
model.addAttribute("fofoRetailers", fofoRetailers);
|
- |
|
| 187 |
return "create-partner-region";
|
198 |
return "create-partner-region";
|
| 188 |
}
|
199 |
}
|
| 189 |
|
200 |
|
| 190 |
@PostMapping(value = "/cs/createPartnerRegion")
|
201 |
@PostMapping(value = "/cs/createPartnerRegion")
|
| 191 |
public String createPartnerRegion(HttpServletRequest request, @RequestParam(name = "regionId") int regionId,
|
202 |
public String createPartnerRegion(HttpServletRequest request, @RequestParam(name = "regionId") int regionId,
|
| 192 |
@RequestBody List<Integer> selectedFofoIds, Model model) throws Exception {
|
203 |
@RequestBody List<Integer> selectedFofoIds, Model model) throws Exception {
|
| 193 |
|
- |
|
| - |
|
204 |
partnerRegionRepository.delete(regionId);
|
| - |
|
205 |
LOGGER.info("successfully removed");
|
| - |
|
206 |
LOGGER.info(selectedFofoIds.size());
|
| 194 |
csService.addPartnerToRegion(regionId, selectedFofoIds);
|
207 |
csService.addPartnerToRegion(regionId, selectedFofoIds);
|
| 195 |
model.addAttribute("response", mvcResponseSender.createResponseString(true));
|
208 |
model.addAttribute("response", mvcResponseSender.createResponseString(true));
|
| 196 |
return "response";
|
209 |
return "response";
|
| 197 |
}
|
210 |
}
|
| 198 |
|
211 |
|
| Line 483... |
Line 496... |
| 483 |
@RequestParam(name = "offset", defaultValue = "0") int offset,
|
496 |
@RequestParam(name = "offset", defaultValue = "0") int offset,
|
| 484 |
@RequestParam(name = "limit", defaultValue = "10") int limit, Model model)
|
497 |
@RequestParam(name = "limit", defaultValue = "10") int limit, Model model)
|
| 485 |
throws ProfitMandiBusinessException {
|
498 |
throws ProfitMandiBusinessException {
|
| 486 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
499 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
| 487 |
AuthUser authUser = authRepository.selectByEmailOrMobile(loginDetails.getEmailId());
|
500 |
AuthUser authUser = authRepository.selectByEmailOrMobile(loginDetails.getEmailId());
|
| 488 |
Map<Integer, List<AuthUser>> authUserListMap=null;
|
501 |
Map<Integer, List<AuthUser>> authUserListMap = null;
|
| 489 |
List<Ticket> tickets = null;
|
502 |
List<Ticket> tickets = null;
|
| 490 |
if (loginDetails.getEmailId().equals("amandeep.singh@smartdukaan.com")) {
|
503 |
if (loginDetails.getEmailId().equals("amandeep.singh@smartdukaan.com")) {
|
| 491 |
tickets = ticketRepository.selectAll(offset, limit, Optional.empty());
|
504 |
tickets = ticketRepository.selectAll(offset, limit, Optional.empty());
|
| 492 |
authUserListMap=csService.getAuthUserList(tickets, EscalationType.L4);
|
505 |
authUserListMap = csService.getAuthUserList(tickets, EscalationType.L4);
|
| 493 |
} else {
|
506 |
} else {
|
| 494 |
tickets = ticketRepository.selectAllByEscalatedUserType(authUser.getId(), EscalationType.L2, offset, limit);
|
507 |
tickets = ticketRepository.selectAllByEscalatedUserType(authUser.getId(), EscalationType.L2, offset, limit);
|
| 495 |
if (tickets.size() == 0) {
|
508 |
if (tickets.size() == 0) {
|
| 496 |
tickets = ticketRepository.selectAllByEscalatedUserType(authUser.getId(), EscalationType.L3, offset,
|
509 |
tickets = ticketRepository.selectAllByEscalatedUserType(authUser.getId(), EscalationType.L3, offset,
|
| 497 |
limit);
|
510 |
limit);
|
| 498 |
authUserListMap=csService.getAuthUserList(tickets, EscalationType.L3);
|
511 |
authUserListMap = csService.getAuthUserList(tickets, EscalationType.L3);
|
| 499 |
Map<Integer, CustomRetailer> fofoIdsAndCustomRetailer = csService.getPartnerByFofoIds(tickets);
|
512 |
Map<Integer, CustomRetailer> fofoIdsAndCustomRetailer = csService.getPartnerByFofoIds(tickets);
|
| 500 |
model.addAttribute("fofoIdsAndCustomRetailer", fofoIdsAndCustomRetailer);
|
513 |
model.addAttribute("fofoIdsAndCustomRetailer", fofoIdsAndCustomRetailer);
|
| 501 |
} else {
|
514 |
} else {
|
| 502 |
Map<Integer, CustomRetailer> fofoIdsAndCustomRetailer = csService.getPartnerByFofoIds(tickets);
|
515 |
Map<Integer, CustomRetailer> fofoIdsAndCustomRetailer = csService.getPartnerByFofoIds(tickets);
|
| 503 |
authUserListMap=csService.getAuthUserList(tickets, EscalationType.L2);
|
516 |
authUserListMap=csService.getAuthUserList(tickets, EscalationType.L2);
|
| Line 519... |
Line 532... |
| 519 |
Ticket ticket = ticketRepository.selectById(ticketId);
|
532 |
Ticket ticket = ticketRepository.selectById(ticketId);
|
| 520 |
List<TicketCategory> ticketCategories = csService.getAllTicketCategotyFromSubCategory();
|
533 |
List<TicketCategory> ticketCategories = csService.getAllTicketCategotyFromSubCategory();
|
| 521 |
TicketSubCategory ticketSubCategory = ticketSubCategoryRepository.selectById(ticket.getSubCategoryId());
|
534 |
TicketSubCategory ticketSubCategory = ticketSubCategoryRepository.selectById(ticket.getSubCategoryId());
|
| 522 |
List<TicketSubCategory> ticketSubCategories = ticketSubCategoryRepository
|
535 |
List<TicketSubCategory> ticketSubCategories = ticketSubCategoryRepository
|
| 523 |
.selectAll(ticketSubCategory.getcategoryId());
|
536 |
.selectAll(ticketSubCategory.getcategoryId());
|
| 524 |
List<Position> positions=positionRepository.selectPositionByCategoryId(ticketSubCategoryRepository.selectById(ticket.getSubCategoryId()).getcategoryId());
|
- |
|
| 525 |
List<Integer> authUserids=positions.stream().map(x->x.getAuthUserId()).collect(Collectors.toList());
|
- |
|
| 526 |
List<AuthUser> authUsers=authRepository.selectAllAuthUserByIds(authUserids);
|
537 |
List<AuthUser> authUsers=authRepository.selectAll();
|
| 527 |
model.addAttribute("ticket", ticket);
|
538 |
model.addAttribute("ticket", ticket);
|
| 528 |
model.addAttribute("ticketCategories", ticketCategories);
|
539 |
model.addAttribute("ticketCategories", ticketCategories);
|
| 529 |
model.addAttribute("ticketSubCategories", ticketSubCategories);
|
540 |
model.addAttribute("ticketSubCategories", ticketSubCategories);
|
| 530 |
model.addAttribute("authUsers", authUsers);
|
541 |
model.addAttribute("authUsers", authUsers);
|
| 531 |
return "edit-ticket-modal";
|
542 |
return "edit-ticket-modal";
|