Subversion Repositories SmartDukaan

Rev

Rev 24417 | Rev 24500 | 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
 
24439 govind 52
	@Column(name="l1_auth_user")
53
	private int l1AuthUser;
54
 
55
	@Column(name="l2_auth_user")
56
	private int l2AuthUser;
57
 
58
	@Column(name="l3_auth_user")
59
	private int l3AuthUser;
60
 
24383 amit.gupta 61
	@Column(name="happy_code")
62
	private String happyCode;
63
 
24384 amit.gupta 64
	@Column(name="last_activity")
24383 amit.gupta 65
	@Enumerated(EnumType.STRING)
66
	private ActivityType lastActivity;
67
 
68
	@Column(name="l2_escalation_timestamp")
69
	private LocalDateTime l2EscalationTimestamp;
70
 
71
	@Column(name="l3_escalation_timestamp")
72
	private LocalDateTime l3EscalationTimestamp;
73
 
74
	@Column(name="last_escalation_timestamp")
75
	private LocalDateTime lastEscalationTimestamp;
76
 
24439 govind 77
	public String getFormattedCreateTimestamp(){
78
		if(createTimestamp == null){
79
			return null;
80
		}
81
		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm");
82
		return createTimestamp.format(formatter);
83
    }
84
	public String getFormattedCloseTimestamp(){
85
		if(closeTimestamp == null){
86
			return null;
87
		}
88
		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm");
89
		return closeTimestamp.format(formatter);
90
    }
91
 
24383 amit.gupta 92
 
93
	public int getId() {
94
		return id;
95
	}
96
 
97
	public void setId(int id) {
98
		this.id = id;
99
	}
100
 
101
	public int getFofoId() {
102
		return fofoId;
103
	}
104
 
105
	public void setFofoId(int fofoId) {
106
		this.fofoId = fofoId;
107
	}
108
 
109
	public int getAssigneeId() {
110
		return assigneeId;
111
	}
112
 
113
	public void setAssigneeId(int assigneeId) {
114
		this.assigneeId = assigneeId;
115
	}
116
 
117
	public int getSubCategoryId() {
118
		return subCategoryId;
119
	}
120
 
121
	public void setSubCategoryId(int subCategoryId) {
122
		this.subCategoryId = subCategoryId;
123
	}
124
 
125
	public LocalDateTime getCreateTimestamp() {
126
		return createTimestamp;
127
	}
128
 
129
	public void setCreateTimestamp(LocalDateTime createTimestamp) {
130
		this.createTimestamp = createTimestamp;
131
	}
132
 
133
	public LocalDateTime getUpdateTimestamp() {
134
		return updateTimestamp;
135
	}
136
 
137
	public void setUpdateTimestamp(LocalDateTime updateTimestamp) {
138
		this.updateTimestamp = updateTimestamp;
139
	}
140
 
141
	public LocalDateTime getCloseTimestamp() {
142
		return closeTimestamp;
143
	}
144
 
145
	public void setCloseTimestamp(LocalDateTime closeTimestamp) {
146
		this.closeTimestamp = closeTimestamp;
147
	}
148
 
24439 govind 149
	public int getL1AuthUser() {
150
		return l1AuthUser;
151
	}
24383 amit.gupta 152
 
24439 govind 153
	public void setL1AuthUser(int l1AuthUser) {
154
		this.l1AuthUser = l1AuthUser;
155
	}
156
 
157
	public int getL2AuthUser() {
158
		return l2AuthUser;
159
	}
160
 
161
	public void setL2AuthUser(int l2AuthUser) {
162
		this.l2AuthUser = l2AuthUser;
163
	}
164
 
165
	public int getL3AuthUser() {
166
		return l3AuthUser;
167
	}
168
 
169
	public void setL3AuthUser(int l3AuthUser) {
170
		this.l3AuthUser = l3AuthUser;
171
	}
172
 
24383 amit.gupta 173
	public String getHappyCode() {
174
		return happyCode;
175
	}
176
 
177
	public void setHappyCode(String happyCode) {
178
		this.happyCode = happyCode;
179
	}
180
 
181
	public ActivityType getLastActivity() {
182
		return lastActivity;
183
	}
184
 
185
	public void setLastActivity(ActivityType lastActivity) {
186
		this.lastActivity = lastActivity;
187
	}
188
 
189
	public LocalDateTime getL2EscalationTimestamp() {
190
		return l2EscalationTimestamp;
191
	}
192
 
193
	public void setL2EscalationTimestamp(LocalDateTime l2EscalationTimestamp) {
194
		this.l2EscalationTimestamp = l2EscalationTimestamp;
195
	}
196
 
197
	public LocalDateTime getL3EscalationTimestamp() {
198
		return l3EscalationTimestamp;
199
	}
200
 
201
	public void setL3EscalationTimestamp(LocalDateTime l3EscalationTimestamp) {
202
		this.l3EscalationTimestamp = l3EscalationTimestamp;
203
	}
204
 
205
	public LocalDateTime getLastEscalationTimestamp() {
206
		return lastEscalationTimestamp;
207
	}
208
 
209
	public void setLastEscalationTimestamp(LocalDateTime lastEscalationTimestamp) {
210
		this.lastEscalationTimestamp = lastEscalationTimestamp;
211
	}
212
 
213
	public static int getL2escalationdays() {
214
		return L2EscalationDays;
215
	}
216
 
217
	public static int getL3escalationdays() {
218
		return L3EscalationDays;
219
	}
220
 
221
	public static int getFinalescalationdays() {
222
		return FinalEscalationDays;
223
	}
224
 
225
	@Override
24439 govind 226
	public int hashCode() {
227
		final int prime = 31;
228
		int result = 1;
229
		result = prime * result + assigneeId;
230
		result = prime * result + ((closeTimestamp == null) ? 0 : closeTimestamp.hashCode());
231
		result = prime * result + ((createTimestamp == null) ? 0 : createTimestamp.hashCode());
232
		result = prime * result + fofoId;
233
		result = prime * result + ((happyCode == null) ? 0 : happyCode.hashCode());
234
		result = prime * result + id;
235
		result = prime * result + l1AuthUser;
236
		result = prime * result + l2AuthUser;
237
		result = prime * result + ((l2EscalationTimestamp == null) ? 0 : l2EscalationTimestamp.hashCode());
238
		result = prime * result + l3AuthUser;
239
		result = prime * result + ((l3EscalationTimestamp == null) ? 0 : l3EscalationTimestamp.hashCode());
240
		result = prime * result + ((lastActivity == null) ? 0 : lastActivity.hashCode());
241
		result = prime * result + ((lastEscalationTimestamp == null) ? 0 : lastEscalationTimestamp.hashCode());
242
		result = prime * result + subCategoryId;
243
		result = prime * result + ((updateTimestamp == null) ? 0 : updateTimestamp.hashCode());
244
		return result;
245
	}
246
 
247
	@Override
248
	public boolean equals(Object obj) {
249
		if (this == obj)
250
			return true;
251
		if (obj == null)
252
			return false;
253
		if (getClass() != obj.getClass())
254
			return false;
255
		Ticket other = (Ticket) obj;
256
		if (assigneeId != other.assigneeId)
257
			return false;
258
		if (closeTimestamp == null) {
259
			if (other.closeTimestamp != null)
260
				return false;
261
		} else if (!closeTimestamp.equals(other.closeTimestamp))
262
			return false;
263
		if (createTimestamp == null) {
264
			if (other.createTimestamp != null)
265
				return false;
266
		} else if (!createTimestamp.equals(other.createTimestamp))
267
			return false;
268
		if (fofoId != other.fofoId)
269
			return false;
270
		if (happyCode == null) {
271
			if (other.happyCode != null)
272
				return false;
273
		} else if (!happyCode.equals(other.happyCode))
274
			return false;
275
		if (id != other.id)
276
			return false;
277
		if (l1AuthUser != other.l1AuthUser)
278
			return false;
279
		if (l2AuthUser != other.l2AuthUser)
280
			return false;
281
		if (l2EscalationTimestamp == null) {
282
			if (other.l2EscalationTimestamp != null)
283
				return false;
284
		} else if (!l2EscalationTimestamp.equals(other.l2EscalationTimestamp))
285
			return false;
286
		if (l3AuthUser != other.l3AuthUser)
287
			return false;
288
		if (l3EscalationTimestamp == null) {
289
			if (other.l3EscalationTimestamp != null)
290
				return false;
291
		} else if (!l3EscalationTimestamp.equals(other.l3EscalationTimestamp))
292
			return false;
293
		if (lastActivity != other.lastActivity)
294
			return false;
295
		if (lastEscalationTimestamp == null) {
296
			if (other.lastEscalationTimestamp != null)
297
				return false;
298
		} else if (!lastEscalationTimestamp.equals(other.lastEscalationTimestamp))
299
			return false;
300
		if (subCategoryId != other.subCategoryId)
301
			return false;
302
		if (updateTimestamp == null) {
303
			if (other.updateTimestamp != null)
304
				return false;
305
		} else if (!updateTimestamp.equals(other.updateTimestamp))
306
			return false;
307
		return true;
308
	}
309
 
310
	@Override
24383 amit.gupta 311
	public String toString() {
312
		return "Ticket [id=" + id + ", fofoId=" + fofoId + ", assigneeId=" + assigneeId + ", subCategoryId="
313
				+ subCategoryId + ", createTimestamp=" + createTimestamp + ", updateTimestamp=" + updateTimestamp
24439 govind 314
				+ ", closeTimestamp=" + closeTimestamp + ", l1AuthUser=" + l1AuthUser + ", l2AuthUser=" + l2AuthUser
315
				+ ", l3AuthUser=" + l3AuthUser + ", happyCode=" + happyCode + ", lastActivity=" + lastActivity
24383 amit.gupta 316
				+ ", l2EscalationTimestamp=" + l2EscalationTimestamp + ", l3EscalationTimestamp="
317
				+ l3EscalationTimestamp + ", lastEscalationTimestamp=" + lastEscalationTimestamp + "]";
318
	}
24439 govind 319
 
24383 amit.gupta 320
 
321
 
322
 
323
}