| Line 10... |
Line 10... |
| 10 |
import in.shop2020.crm.ActivityType;
|
10 |
import in.shop2020.crm.ActivityType;
|
| 11 |
import in.shop2020.crm.Agent;
|
11 |
import in.shop2020.crm.Agent;
|
| 12 |
import in.shop2020.crm.CRMService.Iface;
|
12 |
import in.shop2020.crm.CRMService.Iface;
|
| 13 |
import in.shop2020.crm.SearchFilter;
|
13 |
import in.shop2020.crm.SearchFilter;
|
| 14 |
import in.shop2020.crm.Ticket;
|
14 |
import in.shop2020.crm.Ticket;
|
| - |
|
15 |
import in.shop2020.crm.TicketCategory;
|
| 15 |
import in.shop2020.crm.handler.ActivityHandler;
|
16 |
import in.shop2020.crm.handler.ActivityHandler;
|
| 16 |
import in.shop2020.crm.handler.AgentHandler;
|
17 |
import in.shop2020.crm.handler.AgentHandler;
|
| 17 |
import in.shop2020.crm.handler.TicketHandler;
|
18 |
import in.shop2020.crm.handler.TicketHandler;
|
| 18 |
import in.shop2020.thrift.clients.AlertClient;
|
19 |
import in.shop2020.thrift.clients.AlertClient;
|
| 19 |
|
20 |
|
| Line 85... |
Line 86... |
| 85 |
activityHandler.insertActivity(in.shop2020.crm.domain.Activity
|
86 |
activityHandler.insertActivity(in.shop2020.crm.domain.Activity
|
| 86 |
.create(activity));
|
87 |
.create(activity));
|
| 87 |
try{
|
88 |
try{
|
| 88 |
/*For now monitoring is only done for New tickets and hence once any
|
89 |
/*For now monitoring is only done for New tickets and hence once any
|
| 89 |
* activity is done on a ticket after its creation, we stop monitoring that ticket*/
|
90 |
* activity is done on a ticket after its creation, we stop monitoring that ticket*/
|
| - |
|
91 |
if(activity.getType()== ActivityType.SEND_EMAIL_TO_CUSTOMER ||
|
| - |
|
92 |
activity.getType()== ActivityType.ESCALATE_TICKET ||
|
| - |
|
93 |
activity.getType()== ActivityType.CALLED_CUSTOMER) {
|
| 90 |
AlertService.Client alertClient = new AlertClient().getClient();
|
94 |
AlertService.Client alertClient = new AlertClient().getClient();
|
| 91 |
alertClient.endMonitoringEntity(EntityType.TICKET, "ticketId = " + ticket.getId());
|
95 |
alertClient.endMonitoringEntity(EntityType.TICKET, "ticketId = " + ticket.getId());
|
| - |
|
96 |
}
|
| 92 |
} catch(Exception ex) {
|
97 |
} catch(Exception ex) {
|
| 93 |
log.error("Exception while ending monitoring for ticketId " + ticket.getId());
|
98 |
log.error("Exception while ending monitoring for ticketId " + ticket.getId());
|
| 94 |
log.error(ex);
|
99 |
log.error(ex);
|
| 95 |
}
|
100 |
}
|
| 96 |
} catch (ParseException e) {
|
101 |
} catch (ParseException e) {
|
| Line 106... |
Line 111... |
| 106 |
.insertTicket(in.shop2020.crm.domain.Ticket.create(ticket));
|
111 |
.insertTicket(in.shop2020.crm.domain.Ticket.create(ticket));
|
| 107 |
activity.setTicketId(ticketId);
|
112 |
activity.setTicketId(ticketId);
|
| 108 |
activityHandler.insertActivity(in.shop2020.crm.domain.Activity
|
113 |
activityHandler.insertActivity(in.shop2020.crm.domain.Activity
|
| 109 |
.create(activity));
|
114 |
.create(activity));
|
| 110 |
try {
|
115 |
try {
|
| - |
|
116 |
if(ticket.getCategory()!= TicketCategory.COD_VERIFICATION &&
|
| - |
|
117 |
ticket.getCategory()!= TicketCategory.UNDELIVERED &&
|
| - |
|
118 |
ticket.getCategory()!= TicketCategory.STORE_PICKUP) {
|
| 111 |
MonitoredEntity entity = new MonitoredEntity();
|
119 |
MonitoredEntity entity = new MonitoredEntity();
|
| 112 |
entity.setEntityType(EntityType.TICKET);
|
120 |
entity.setEntityType(EntityType.TICKET);
|
| 113 |
entity.setEventType(0);
|
121 |
entity.setEventType(0);
|
| 114 |
entity.setEntityIdentifier("ticketId = " + new Long(ticketId).toString());
|
122 |
entity.setEntityIdentifier("ticketId = " + new Long(ticketId).toString());
|
| 115 |
entity.setDescription(ticket.getDescription());
|
123 |
entity.setDescription(ticket.getDescription());
|
| 116 |
Calendar thresholdTime = Calendar.getInstance();
|
124 |
Calendar thresholdTime = Calendar.getInstance();
|
| 117 |
thresholdTime.add(Calendar.HOUR, 4);
|
125 |
thresholdTime.add(Calendar.HOUR, 4);
|
| 118 |
entity.setWarnExpiryTime(thresholdTime.getTimeInMillis());
|
126 |
entity.setWarnExpiryTime(thresholdTime.getTimeInMillis());
|
| 119 |
thresholdTime.add(Calendar.HOUR, 2);
|
127 |
thresholdTime.add(Calendar.HOUR, 2);
|
| 120 |
entity.setCriticalExpiryTime(thresholdTime.getTimeInMillis());
|
128 |
entity.setCriticalExpiryTime(thresholdTime.getTimeInMillis());
|
| 121 |
AlertService.Client alertClient = new AlertClient().getClient();
|
129 |
AlertService.Client alertClient = new AlertClient().getClient();
|
| 122 |
alertClient.scheduleAlert(entity);
|
130 |
alertClient.scheduleAlert(entity);
|
| - |
|
131 |
}
|
| 123 |
} catch (Exception ex) {
|
132 |
} catch (Exception ex) {
|
| 124 |
log.error("Exception while scheduling alert for Ticket Id "+ticketId);
|
133 |
log.error("Exception while scheduling alert for Ticket Id "+ticketId);
|
| 125 |
log.error(ex);
|
134 |
log.error(ex);
|
| 126 |
}
|
135 |
}
|
| 127 |
return ticketId;
|
136 |
return ticketId;
|