| 24383 |
amit.gupta |
1 |
package com.spice.profitmandi.dao.entity.cs;
|
|
|
2 |
|
| 32923 |
ranu |
3 |
import com.spice.profitmandi.dao.entity.fofo.ActivityType;
|
| 37145 |
ranu |
4 |
import com.spice.profitmandi.dao.enumuration.cs.EscalationType;
|
| 32923 |
ranu |
5 |
|
|
|
6 |
import javax.persistence.*;
|
| 24383 |
amit.gupta |
7 |
import java.time.LocalDateTime;
|
| 24417 |
govind |
8 |
import java.time.format.DateTimeFormatter;
|
| 24383 |
amit.gupta |
9 |
|
|
|
10 |
/**
|
|
|
11 |
* @author amit
|
|
|
12 |
*
|
|
|
13 |
*/
|
|
|
14 |
@Entity
|
| 31860 |
tejbeer |
15 |
@Table(name = "cs.ticket")
|
| 30416 |
tejbeer |
16 |
|
|
|
17 |
@NamedQueries({
|
|
|
18 |
|
|
|
19 |
@NamedQuery(name = "Ticket.selectRecentClosedTicket", query = "select new com.spice.profitmandi.dao.model.TicketViewModel(t.id,tc.name,tbc.name,"
|
|
|
20 |
+ "t.closeTimestamp" + ")"
|
| 35618 |
amit |
21 |
+ " from Ticket t left join TicketSubCategory tbc on t.subCategoryId = tbc.id left join TicketCategory tc on tbc.categoryId = tc.id where t.closeTimestamp > :startDate and t.fofoId = :fofoId"),
|
| 30416 |
tejbeer |
22 |
|
|
|
23 |
})
|
| 24383 |
amit.gupta |
24 |
public class Ticket {
|
| 27124 |
amit.gupta |
25 |
|
| 35567 |
amit |
26 |
// Escalation thresholds in WORKING days (excludes weekends)
|
|
|
27 |
public static final int L2_ESCALATION_WORKING_DAYS = 3; // L1 -> L2 after 3 working days
|
|
|
28 |
public static final int L3_ESCALATION_WORKING_DAYS = 3; // L2 -> L3 after 3 more working days (6 total)
|
|
|
29 |
public static final int FINAL_ESCALATION_WORKING_DAYS = 2; // L3 -> Final after 2 more working days (8 total)
|
|
|
30 |
|
|
|
31 |
// Legacy constants (deprecated - use working days instead)
|
|
|
32 |
@Deprecated
|
| 24383 |
amit.gupta |
33 |
public static final int L2EscalationDays = 5;
|
| 35567 |
amit |
34 |
@Deprecated
|
| 24383 |
amit.gupta |
35 |
public static final int L3EscalationDays = 10;
|
| 35567 |
amit |
36 |
@Deprecated
|
| 24383 |
amit.gupta |
37 |
public static final int FinalEscalationDays = 15;
|
| 27124 |
amit.gupta |
38 |
|
| 24383 |
amit.gupta |
39 |
@Id
|
|
|
40 |
@Column
|
| 27124 |
amit.gupta |
41 |
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
| 24383 |
amit.gupta |
42 |
private int id;
|
| 27124 |
amit.gupta |
43 |
|
|
|
44 |
@Column(name = "fofo_id")
|
| 24383 |
amit.gupta |
45 |
private int fofoId;
|
| 27124 |
amit.gupta |
46 |
|
|
|
47 |
@Column(name = "subcategory_id")
|
| 24383 |
amit.gupta |
48 |
private int subCategoryId;
|
| 27124 |
amit.gupta |
49 |
|
|
|
50 |
@Column(name = "create_timestamp")
|
| 24383 |
amit.gupta |
51 |
private LocalDateTime createTimestamp;
|
| 27124 |
amit.gupta |
52 |
|
|
|
53 |
@Column(name = "update_timestamp")
|
| 24383 |
amit.gupta |
54 |
private LocalDateTime updateTimestamp;
|
| 27124 |
amit.gupta |
55 |
|
|
|
56 |
@Column(name = "close_timestamp")
|
| 24383 |
amit.gupta |
57 |
private LocalDateTime closeTimestamp;
|
| 27124 |
amit.gupta |
58 |
|
| 37145 |
ranu |
59 |
@Column(name = "current_assignee_id")
|
|
|
60 |
private int currentAssigneeId;
|
| 27124 |
amit.gupta |
61 |
|
| 37145 |
ranu |
62 |
@Column(name = "current_manager_id")
|
|
|
63 |
private int currentManagerId;
|
| 27124 |
amit.gupta |
64 |
|
| 37145 |
ranu |
65 |
@Column(name = "current_escalation_level")
|
|
|
66 |
@Enumerated(EnumType.STRING)
|
|
|
67 |
private EscalationType currentEscalationLevel;
|
| 27124 |
amit.gupta |
68 |
|
|
|
69 |
@Column(name = "happy_code")
|
| 24383 |
amit.gupta |
70 |
private String happyCode;
|
|
|
71 |
|
| 27124 |
amit.gupta |
72 |
@Column(name = "assignment_id")
|
|
|
73 |
private int assignmentId;
|
|
|
74 |
|
|
|
75 |
@Column(name = "last_activity")
|
| 24383 |
amit.gupta |
76 |
@Enumerated(EnumType.STRING)
|
|
|
77 |
private ActivityType lastActivity;
|
| 27124 |
amit.gupta |
78 |
|
|
|
79 |
@Column(name = "last_activity_id")
|
|
|
80 |
private int lastActivityId;
|
| 30416 |
tejbeer |
81 |
|
| 32923 |
ranu |
82 |
@Column(name = "first_activity_id")
|
|
|
83 |
private int firstActivityId;
|
|
|
84 |
|
| 27124 |
amit.gupta |
85 |
@Transient
|
|
|
86 |
private TicketAssigned lastAassignment;
|
|
|
87 |
|
|
|
88 |
public TicketAssigned getLastAassignment() {
|
|
|
89 |
return lastAassignment;
|
|
|
90 |
}
|
|
|
91 |
|
|
|
92 |
public void setLastAassignment(TicketAssigned lastAassignment) {
|
|
|
93 |
this.lastAassignment = lastAassignment;
|
|
|
94 |
}
|
|
|
95 |
|
|
|
96 |
public int getLastActivityId() {
|
|
|
97 |
return lastActivityId;
|
|
|
98 |
}
|
|
|
99 |
|
|
|
100 |
public void setLastActivityId(int lastActivityId) {
|
|
|
101 |
this.lastActivityId = lastActivityId;
|
|
|
102 |
}
|
|
|
103 |
|
| 32923 |
ranu |
104 |
public int getFirstActivityId() {
|
|
|
105 |
return firstActivityId;
|
|
|
106 |
}
|
|
|
107 |
|
|
|
108 |
public void setFirstActivityId(int firstActivityId) {
|
|
|
109 |
this.firstActivityId = firstActivityId;
|
|
|
110 |
}
|
|
|
111 |
|
| 27124 |
amit.gupta |
112 |
public int getAssignmentId() {
|
|
|
113 |
return assignmentId;
|
|
|
114 |
}
|
|
|
115 |
|
|
|
116 |
public void setAssignmentId(int assignmentId) {
|
|
|
117 |
this.assignmentId = assignmentId;
|
|
|
118 |
}
|
|
|
119 |
|
|
|
120 |
public String getFormattedCreateTimestamp() {
|
|
|
121 |
if (createTimestamp == null) {
|
| 24439 |
govind |
122 |
return null;
|
|
|
123 |
}
|
|
|
124 |
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm");
|
|
|
125 |
return createTimestamp.format(formatter);
|
| 27124 |
amit.gupta |
126 |
}
|
|
|
127 |
|
|
|
128 |
public String getFormattedCloseTimestamp() {
|
|
|
129 |
if (closeTimestamp == null) {
|
| 24439 |
govind |
130 |
return null;
|
|
|
131 |
}
|
|
|
132 |
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm");
|
|
|
133 |
return closeTimestamp.format(formatter);
|
| 27124 |
amit.gupta |
134 |
}
|
| 24383 |
amit.gupta |
135 |
|
|
|
136 |
public int getId() {
|
|
|
137 |
return id;
|
|
|
138 |
}
|
|
|
139 |
|
|
|
140 |
public void setId(int id) {
|
|
|
141 |
this.id = id;
|
|
|
142 |
}
|
|
|
143 |
|
|
|
144 |
public int getFofoId() {
|
|
|
145 |
return fofoId;
|
|
|
146 |
}
|
|
|
147 |
|
|
|
148 |
public void setFofoId(int fofoId) {
|
|
|
149 |
this.fofoId = fofoId;
|
|
|
150 |
}
|
| 27124 |
amit.gupta |
151 |
|
| 24383 |
amit.gupta |
152 |
public int getSubCategoryId() {
|
|
|
153 |
return subCategoryId;
|
|
|
154 |
}
|
|
|
155 |
|
|
|
156 |
public void setSubCategoryId(int subCategoryId) {
|
|
|
157 |
this.subCategoryId = subCategoryId;
|
|
|
158 |
}
|
|
|
159 |
|
|
|
160 |
public LocalDateTime getCreateTimestamp() {
|
|
|
161 |
return createTimestamp;
|
|
|
162 |
}
|
|
|
163 |
|
|
|
164 |
public void setCreateTimestamp(LocalDateTime createTimestamp) {
|
|
|
165 |
this.createTimestamp = createTimestamp;
|
|
|
166 |
}
|
|
|
167 |
|
|
|
168 |
public LocalDateTime getUpdateTimestamp() {
|
|
|
169 |
return updateTimestamp;
|
|
|
170 |
}
|
|
|
171 |
|
|
|
172 |
public void setUpdateTimestamp(LocalDateTime updateTimestamp) {
|
|
|
173 |
this.updateTimestamp = updateTimestamp;
|
|
|
174 |
}
|
|
|
175 |
|
|
|
176 |
public LocalDateTime getCloseTimestamp() {
|
|
|
177 |
return closeTimestamp;
|
|
|
178 |
}
|
|
|
179 |
|
|
|
180 |
public void setCloseTimestamp(LocalDateTime closeTimestamp) {
|
|
|
181 |
this.closeTimestamp = closeTimestamp;
|
|
|
182 |
}
|
|
|
183 |
|
| 37145 |
ranu |
184 |
public int getCurrentAssigneeId() {
|
|
|
185 |
return currentAssigneeId;
|
| 24439 |
govind |
186 |
}
|
| 24383 |
amit.gupta |
187 |
|
| 37145 |
ranu |
188 |
public void setCurrentAssigneeId(int currentAssigneeId) {
|
|
|
189 |
this.currentAssigneeId = currentAssigneeId;
|
| 24439 |
govind |
190 |
}
|
|
|
191 |
|
| 37145 |
ranu |
192 |
public int getCurrentManagerId() {
|
|
|
193 |
return currentManagerId;
|
| 24439 |
govind |
194 |
}
|
|
|
195 |
|
| 37145 |
ranu |
196 |
public void setCurrentManagerId(int currentManagerId) {
|
|
|
197 |
this.currentManagerId = currentManagerId;
|
| 24439 |
govind |
198 |
}
|
|
|
199 |
|
| 37145 |
ranu |
200 |
public EscalationType getCurrentEscalationLevel() {
|
|
|
201 |
return currentEscalationLevel;
|
| 24439 |
govind |
202 |
}
|
|
|
203 |
|
| 37145 |
ranu |
204 |
public void setCurrentEscalationLevel(EscalationType currentEscalationLevel) {
|
|
|
205 |
this.currentEscalationLevel = currentEscalationLevel;
|
| 24439 |
govind |
206 |
}
|
|
|
207 |
|
| 24383 |
amit.gupta |
208 |
public String getHappyCode() {
|
|
|
209 |
return happyCode;
|
|
|
210 |
}
|
|
|
211 |
|
|
|
212 |
public void setHappyCode(String happyCode) {
|
|
|
213 |
this.happyCode = happyCode;
|
|
|
214 |
}
|
|
|
215 |
|
|
|
216 |
public ActivityType getLastActivity() {
|
|
|
217 |
return lastActivity;
|
|
|
218 |
}
|
|
|
219 |
|
|
|
220 |
public void setLastActivity(ActivityType lastActivity) {
|
|
|
221 |
this.lastActivity = lastActivity;
|
|
|
222 |
}
|
|
|
223 |
|
|
|
224 |
public static int getL2escalationdays() {
|
|
|
225 |
return L2EscalationDays;
|
|
|
226 |
}
|
|
|
227 |
|
|
|
228 |
public static int getL3escalationdays() {
|
|
|
229 |
return L3EscalationDays;
|
|
|
230 |
}
|
|
|
231 |
|
|
|
232 |
public static int getFinalescalationdays() {
|
|
|
233 |
return FinalEscalationDays;
|
|
|
234 |
}
|
|
|
235 |
|
|
|
236 |
@Override
|
| 24439 |
govind |
237 |
public int hashCode() {
|
|
|
238 |
final int prime = 31;
|
|
|
239 |
int result = 1;
|
| 27124 |
amit.gupta |
240 |
result = prime * result + assignmentId;
|
| 24439 |
govind |
241 |
result = prime * result + ((closeTimestamp == null) ? 0 : closeTimestamp.hashCode());
|
|
|
242 |
result = prime * result + ((createTimestamp == null) ? 0 : createTimestamp.hashCode());
|
|
|
243 |
result = prime * result + fofoId;
|
|
|
244 |
result = prime * result + ((happyCode == null) ? 0 : happyCode.hashCode());
|
|
|
245 |
result = prime * result + id;
|
| 37145 |
ranu |
246 |
result = prime * result + currentAssigneeId;
|
|
|
247 |
result = prime * result + currentManagerId;
|
|
|
248 |
result = prime * result + ((currentEscalationLevel == null) ? 0 : currentEscalationLevel.hashCode());
|
| 24439 |
govind |
249 |
result = prime * result + ((lastActivity == null) ? 0 : lastActivity.hashCode());
|
| 27124 |
amit.gupta |
250 |
result = prime * result + lastActivityId;
|
| 32923 |
ranu |
251 |
result = prime * result + firstActivityId;
|
| 24439 |
govind |
252 |
result = prime * result + subCategoryId;
|
|
|
253 |
result = prime * result + ((updateTimestamp == null) ? 0 : updateTimestamp.hashCode());
|
|
|
254 |
return result;
|
|
|
255 |
}
|
|
|
256 |
|
|
|
257 |
@Override
|
|
|
258 |
public boolean equals(Object obj) {
|
|
|
259 |
if (this == obj)
|
|
|
260 |
return true;
|
|
|
261 |
if (obj == null)
|
|
|
262 |
return false;
|
|
|
263 |
if (getClass() != obj.getClass())
|
|
|
264 |
return false;
|
|
|
265 |
Ticket other = (Ticket) obj;
|
| 27124 |
amit.gupta |
266 |
if (assignmentId != other.assignmentId)
|
|
|
267 |
return false;
|
| 24439 |
govind |
268 |
if (closeTimestamp == null) {
|
|
|
269 |
if (other.closeTimestamp != null)
|
|
|
270 |
return false;
|
|
|
271 |
} else if (!closeTimestamp.equals(other.closeTimestamp))
|
|
|
272 |
return false;
|
|
|
273 |
if (createTimestamp == null) {
|
|
|
274 |
if (other.createTimestamp != null)
|
|
|
275 |
return false;
|
|
|
276 |
} else if (!createTimestamp.equals(other.createTimestamp))
|
|
|
277 |
return false;
|
|
|
278 |
if (fofoId != other.fofoId)
|
|
|
279 |
return false;
|
|
|
280 |
if (happyCode == null) {
|
|
|
281 |
if (other.happyCode != null)
|
|
|
282 |
return false;
|
|
|
283 |
} else if (!happyCode.equals(other.happyCode))
|
|
|
284 |
return false;
|
|
|
285 |
if (id != other.id)
|
|
|
286 |
return false;
|
| 37145 |
ranu |
287 |
if (currentAssigneeId != other.currentAssigneeId)
|
| 24439 |
govind |
288 |
return false;
|
| 37145 |
ranu |
289 |
if (currentManagerId != other.currentManagerId)
|
| 24439 |
govind |
290 |
return false;
|
| 37145 |
ranu |
291 |
if (currentEscalationLevel != other.currentEscalationLevel)
|
| 24439 |
govind |
292 |
return false;
|
|
|
293 |
if (lastActivity != other.lastActivity)
|
|
|
294 |
return false;
|
| 27124 |
amit.gupta |
295 |
if (lastActivityId != other.lastActivityId)
|
| 24439 |
govind |
296 |
return false;
|
| 32923 |
ranu |
297 |
if (firstActivityId != other.firstActivityId)
|
|
|
298 |
return false;
|
| 24439 |
govind |
299 |
if (subCategoryId != other.subCategoryId)
|
|
|
300 |
return false;
|
|
|
301 |
if (updateTimestamp == null) {
|
|
|
302 |
if (other.updateTimestamp != null)
|
|
|
303 |
return false;
|
|
|
304 |
} else if (!updateTimestamp.equals(other.updateTimestamp))
|
|
|
305 |
return false;
|
|
|
306 |
return true;
|
|
|
307 |
}
|
|
|
308 |
|
|
|
309 |
@Override
|
| 24383 |
amit.gupta |
310 |
public String toString() {
|
| 32923 |
ranu |
311 |
return "Ticket{" +
|
|
|
312 |
"id=" + id +
|
|
|
313 |
", fofoId=" + fofoId +
|
|
|
314 |
", subCategoryId=" + subCategoryId +
|
|
|
315 |
", createTimestamp=" + createTimestamp +
|
|
|
316 |
", updateTimestamp=" + updateTimestamp +
|
|
|
317 |
", closeTimestamp=" + closeTimestamp +
|
| 37145 |
ranu |
318 |
", currentAssigneeId=" + currentAssigneeId +
|
|
|
319 |
", currentManagerId=" + currentManagerId +
|
|
|
320 |
", currentEscalationLevel=" + currentEscalationLevel +
|
| 32923 |
ranu |
321 |
", happyCode='" + happyCode + '\'' +
|
|
|
322 |
", assignmentId=" + assignmentId +
|
|
|
323 |
", lastActivity=" + lastActivity +
|
|
|
324 |
", lastActivityId=" + lastActivityId +
|
|
|
325 |
", firstActivityId=" + firstActivityId +
|
|
|
326 |
", lastAassignment=" + lastAassignment +
|
|
|
327 |
'}';
|
| 24383 |
amit.gupta |
328 |
}
|
| 24439 |
govind |
329 |
|
| 24383 |
amit.gupta |
330 |
}
|