Subversion Repositories SmartDukaan

Rev

Rev 24384 | Rev 24439 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
24383 amit.gupta 1
package com.spice.profitmandi.dao.entity.cs;
2
 
3
import java.time.LocalDateTime;
24417 govind 4
import java.time.format.DateTimeFormatter;
24383 amit.gupta 5
 
6
import javax.persistence.Column;
7
import javax.persistence.Entity;
8
import javax.persistence.EnumType;
9
import javax.persistence.Enumerated;
24417 govind 10
import javax.persistence.GeneratedValue;
11
import javax.persistence.GenerationType;
24383 amit.gupta 12
import javax.persistence.Id;
13
import javax.persistence.Table;
14
 
15
import com.spice.profitmandi.dao.entity.fofo.ActivityType;
16
 
17
/**
18
 * @author amit
19
 *
20
 */
21
@Entity
22
@Table(name="cs.ticket", schema = "cs")
23
public class Ticket {
24
 
25
	public static final int L2EscalationDays = 5;
26
	public static final int L3EscalationDays = 10;
27
	public static final int FinalEscalationDays = 15;
28
 
29
	@Id
30
	@Column
24417 govind 31
	@GeneratedValue(strategy=GenerationType.IDENTITY)
24383 amit.gupta 32
	private int id;
33
 
34
	@Column(name="fofo_id")
35
	private int fofoId;
36
 
37
	@Column(name="assignee_id")
38
	private int assigneeId;
39
 
40
	@Column(name="subcategory_id")
41
	private int subCategoryId;
42
 
43
	@Column(name="create_timestamp")
44
	private LocalDateTime createTimestamp;
45
 
46
	@Column(name="update_timestamp")
47
	private LocalDateTime updateTimestamp;
48
 
49
	@Column(name="close_timestamp")
50
	private LocalDateTime closeTimestamp;
51
 
52
	@Column(name="happy_code")
53
	private String happyCode;
54
 
24384 amit.gupta 55
	@Column(name="last_activity")
24383 amit.gupta 56
	@Enumerated(EnumType.STRING)
57
	private ActivityType lastActivity;
58
 
59
	@Column(name="l2_escalation_timestamp")
60
	private LocalDateTime l2EscalationTimestamp;
61
 
62
	@Column(name="l3_escalation_timestamp")
63
	private LocalDateTime l3EscalationTimestamp;
64
 
65
	@Column(name="last_escalation_timestamp")
66
	private LocalDateTime lastEscalationTimestamp;
67
 
68
 
69
	@Override
70
	public int hashCode() {
71
		final int prime = 31;
72
		int result = 1;
73
		result = prime * result + assigneeId;
74
		result = prime * result + ((closeTimestamp == null) ? 0 : closeTimestamp.hashCode());
75
		result = prime * result + ((createTimestamp == null) ? 0 : createTimestamp.hashCode());
76
		result = prime * result + fofoId;
77
		result = prime * result + ((happyCode == null) ? 0 : happyCode.hashCode());
78
		result = prime * result + id;
79
		result = prime * result + ((l2EscalationTimestamp == null) ? 0 : l2EscalationTimestamp.hashCode());
80
		result = prime * result + ((l3EscalationTimestamp == null) ? 0 : l3EscalationTimestamp.hashCode());
81
		result = prime * result + ((lastActivity == null) ? 0 : lastActivity.hashCode());
82
		result = prime * result + ((lastEscalationTimestamp == null) ? 0 : lastEscalationTimestamp.hashCode());
83
		result = prime * result + subCategoryId;
84
		result = prime * result + ((updateTimestamp == null) ? 0 : updateTimestamp.hashCode());
85
		return result;
86
	}
87
 
88
 
89
	@Override
90
	public boolean equals(Object obj) {
91
		if (this == obj)
92
			return true;
93
		if (obj == null)
94
			return false;
95
		if (getClass() != obj.getClass())
96
			return false;
97
		Ticket other = (Ticket) obj;
98
		if (assigneeId != other.assigneeId)
99
			return false;
100
		if (closeTimestamp == null) {
101
			if (other.closeTimestamp != null)
102
				return false;
103
		} else if (!closeTimestamp.equals(other.closeTimestamp))
104
			return false;
105
		if (createTimestamp == null) {
106
			if (other.createTimestamp != null)
107
				return false;
108
		} else if (!createTimestamp.equals(other.createTimestamp))
109
			return false;
110
		if (fofoId != other.fofoId)
111
			return false;
112
		if (happyCode == null) {
113
			if (other.happyCode != null)
114
				return false;
115
		} else if (!happyCode.equals(other.happyCode))
116
			return false;
117
		if (id != other.id)
118
			return false;
119
		if (l2EscalationTimestamp == null) {
120
			if (other.l2EscalationTimestamp != null)
121
				return false;
122
		} else if (!l2EscalationTimestamp.equals(other.l2EscalationTimestamp))
123
			return false;
124
		if (l3EscalationTimestamp == null) {
125
			if (other.l3EscalationTimestamp != null)
126
				return false;
127
		} else if (!l3EscalationTimestamp.equals(other.l3EscalationTimestamp))
128
			return false;
129
		if (lastActivity != other.lastActivity)
130
			return false;
131
		if (lastEscalationTimestamp == null) {
132
			if (other.lastEscalationTimestamp != null)
133
				return false;
134
		} else if (!lastEscalationTimestamp.equals(other.lastEscalationTimestamp))
135
			return false;
136
		if (subCategoryId != other.subCategoryId)
137
			return false;
138
		if (updateTimestamp == null) {
139
			if (other.updateTimestamp != null)
140
				return false;
141
		} else if (!updateTimestamp.equals(other.updateTimestamp))
142
			return false;
143
		return true;
144
	}
145
 
146
 
147
	public int getId() {
148
		return id;
149
	}
150
 
151
 
152
	public void setId(int id) {
153
		this.id = id;
154
	}
155
 
156
 
157
	public int getFofoId() {
158
		return fofoId;
159
	}
160
 
161
 
162
	public void setFofoId(int fofoId) {
163
		this.fofoId = fofoId;
164
	}
165
 
166
 
167
	public int getAssigneeId() {
168
		return assigneeId;
169
	}
170
 
171
 
172
	public void setAssigneeId(int assigneeId) {
173
		this.assigneeId = assigneeId;
174
	}
175
 
176
 
177
	public int getSubCategoryId() {
178
		return subCategoryId;
179
	}
180
 
181
 
182
	public void setSubCategoryId(int subCategoryId) {
183
		this.subCategoryId = subCategoryId;
184
	}
185
 
186
 
187
	public LocalDateTime getCreateTimestamp() {
188
		return createTimestamp;
189
	}
190
 
191
 
192
	public void setCreateTimestamp(LocalDateTime createTimestamp) {
193
		this.createTimestamp = createTimestamp;
194
	}
195
 
196
 
197
	public LocalDateTime getUpdateTimestamp() {
198
		return updateTimestamp;
199
	}
200
 
201
 
202
	public void setUpdateTimestamp(LocalDateTime updateTimestamp) {
203
		this.updateTimestamp = updateTimestamp;
204
	}
205
 
206
 
207
	public LocalDateTime getCloseTimestamp() {
208
		return closeTimestamp;
209
	}
210
 
211
 
212
	public void setCloseTimestamp(LocalDateTime closeTimestamp) {
213
		this.closeTimestamp = closeTimestamp;
214
	}
215
 
216
 
217
	public String getHappyCode() {
218
		return happyCode;
219
	}
220
 
221
 
222
	public void setHappyCode(String happyCode) {
223
		this.happyCode = happyCode;
224
	}
225
 
226
 
227
	public ActivityType getLastActivity() {
228
		return lastActivity;
229
	}
230
 
231
 
232
	public void setLastActivity(ActivityType lastActivity) {
233
		this.lastActivity = lastActivity;
234
	}
235
 
236
 
237
	public LocalDateTime getL2EscalationTimestamp() {
238
		return l2EscalationTimestamp;
239
	}
240
 
241
 
242
	public void setL2EscalationTimestamp(LocalDateTime l2EscalationTimestamp) {
243
		this.l2EscalationTimestamp = l2EscalationTimestamp;
244
	}
245
 
246
 
247
	public LocalDateTime getL3EscalationTimestamp() {
248
		return l3EscalationTimestamp;
249
	}
250
 
251
 
252
	public void setL3EscalationTimestamp(LocalDateTime l3EscalationTimestamp) {
253
		this.l3EscalationTimestamp = l3EscalationTimestamp;
254
	}
255
 
256
 
257
	public LocalDateTime getLastEscalationTimestamp() {
258
		return lastEscalationTimestamp;
259
	}
260
 
261
 
262
	public void setLastEscalationTimestamp(LocalDateTime lastEscalationTimestamp) {
263
		this.lastEscalationTimestamp = lastEscalationTimestamp;
264
	}
265
 
266
 
267
	public static int getL2escalationdays() {
268
		return L2EscalationDays;
269
	}
270
 
271
 
272
	public static int getL3escalationdays() {
273
		return L3EscalationDays;
274
	}
275
 
276
 
277
	public static int getFinalescalationdays() {
278
		return FinalEscalationDays;
279
	}
280
 
24417 govind 281
	public String getFormattedCreateTimestamp(){
282
		if(createTimestamp == null){
283
			return null;
284
		}
285
		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm");
286
		return createTimestamp.format(formatter);
287
    }
288
	public String getFormattedCloseTimestamp(){
289
		if(closeTimestamp == null){
290
			return null;
291
		}
292
		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm");
293
		return closeTimestamp.format(formatter);
294
    }
24383 amit.gupta 295
	@Override
296
	public String toString() {
297
		return "Ticket [id=" + id + ", fofoId=" + fofoId + ", assigneeId=" + assigneeId + ", subCategoryId="
298
				+ subCategoryId + ", createTimestamp=" + createTimestamp + ", updateTimestamp=" + updateTimestamp
299
				+ ", closeTimestamp=" + closeTimestamp + ", happyCode=" + happyCode + ", lastActivity=" + lastActivity
300
				+ ", l2EscalationTimestamp=" + l2EscalationTimestamp + ", l3EscalationTimestamp="
301
				+ l3EscalationTimestamp + ", lastEscalationTimestamp=" + lastEscalationTimestamp + "]";
302
	}
303
 
304
 
305
 
306
 
307
 
308
}