Subversion Repositories SmartDukaan

Rev

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