| Line 34... |
Line 34... |
| 34 |
@Component
|
34 |
@Component
|
| 35 |
public class CsServiceImpl implements CsService {
|
35 |
public class CsServiceImpl implements CsService {
|
| 36 |
|
36 |
|
| 37 |
private static final Logger LOGGER = LogManager.getLogger(CsServiceImpl.class);
|
37 |
private static final Logger LOGGER = LogManager.getLogger(CsServiceImpl.class);
|
| 38 |
|
38 |
|
| 39 |
private static final String ASSIGNED_TICKET = "Dear %s,You have assigned a ticket by %s with ticketId=%s.Regards\nSmartdukaan";
|
39 |
private static final String ASSIGNED_TICKET = "Dear %s,You have assigned a ticket by %s with ticketId#%s.Regards\nSmartdukaan";
|
| 40 |
private static final String ASSINMENT_SUBJECT = "Assignment Ticket";
|
40 |
private static final String ASSINMENT_SUBJECT = "Assignment Ticket";
|
| 41 |
|
41 |
|
| 42 |
@Autowired
|
42 |
@Autowired
|
| 43 |
TicketRepository ticketRepository;
|
43 |
TicketRepository ticketRepository;
|
| 44 |
|
44 |
|
| Line 325... |
Line 325... |
| 325 |
}
|
325 |
}
|
| 326 |
return regionIdAndRegionMap;
|
326 |
return regionIdAndRegionMap;
|
| 327 |
}
|
327 |
}
|
| 328 |
|
328 |
|
| 329 |
@Override
|
329 |
@Override
|
| 330 |
public Map<Integer, List<AuthUser>> getAuthUserList(List<Ticket> tickets, EscalationType escalationType) {
|
330 |
public Map<Integer, List<AuthUser>> getAuthUserList(List<Ticket> tickets,AuthUser authUser) {
|
| 331 |
Map<Integer, List<AuthUser>> authUserListMap = new HashMap<>();
|
331 |
Map<Integer, List<AuthUser>> authUserListMap = new HashMap<>();
|
| 332 |
for (Ticket ticket : tickets) {
|
332 |
for (Ticket ticket : tickets) {
|
| 333 |
if (escalationType == EscalationType.L2) {
|
333 |
if (ticket.getL2AuthUser() == authUser.getId()) {
|
| 334 |
List<AuthUser> authUsers = new ArrayList<>();
|
334 |
List<AuthUser> authUsers = new ArrayList<>();
|
| 335 |
authUsers.add(authRepository.selectById(ticket.getL1AuthUser()));
|
335 |
authUsers.add(authRepository.selectById(ticket.getL1AuthUser()));
|
| 336 |
authUserListMap.put(ticket.getId(), authUsers);
|
336 |
authUserListMap.put(ticket.getId(), authUsers);
|
| 337 |
|
337 |
|
| 338 |
} else if (escalationType == EscalationType.L3) {
|
338 |
} else if (ticket.getL3AuthUser() == authUser.getId()) {
|
| 339 |
TicketAssigned ticketAssigned = ticketAssignedRepository
|
339 |
TicketAssigned ticketAssigned = ticketAssignedRepository
|
| 340 |
.selectByAssigneeIdAndTicketId(ticket.getL2AuthUser(), ticket.getId());
|
340 |
.selectByAssigneeIdAndTicketId(ticket.getL2AuthUser(), ticket.getId());
|
| 341 |
if (ticketAssigned == null) {
|
341 |
if (ticketAssigned == null) {
|
| 342 |
List<AuthUser> authUsers = new ArrayList<>();
|
342 |
List<AuthUser> authUsers = new ArrayList<>();
|
| 343 |
authUsers.add(authRepository.selectById(ticket.getL1AuthUser()));
|
343 |
authUsers.add(authRepository.selectById(ticket.getL1AuthUser()));
|