Rev 32923 | Rev 35614 | Go to most recent revision | View as "text/plain" | Blame | Compare with Previous | Last modification | View Log | RSS feed
package com.spice.profitmandi.dao.entity.cs;import com.spice.profitmandi.dao.entity.fofo.ActivityType;import javax.persistence.*;import java.time.LocalDateTime;import java.time.format.DateTimeFormatter;/*** @author amit**/@Entity@Table(name = "cs.ticket")@NamedQueries({@NamedQuery(name = "Ticket.selectRecentClosedTicket", query = "select new com.spice.profitmandi.dao.model.TicketViewModel(t.id,tc.name,tbc.name,"+ "t.closeTimestamp" + ")"+ " 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"),})public class Ticket {public int getL4AuthUser() {return l4AuthUser;}public void setL4AuthUser(int l4AuthUser) {this.l4AuthUser = l4AuthUser;}// Escalation thresholds in WORKING days (excludes weekends)public static final int L2_ESCALATION_WORKING_DAYS = 3; // L1 -> L2 after 3 working dayspublic static final int L3_ESCALATION_WORKING_DAYS = 3; // L2 -> L3 after 3 more working days (6 total)public static final int FINAL_ESCALATION_WORKING_DAYS = 2; // L3 -> Final after 2 more working days (8 total)// Legacy constants (deprecated - use working days instead)@Deprecatedpublic static final int L2EscalationDays = 5;@Deprecatedpublic static final int L3EscalationDays = 10;@Deprecatedpublic static final int FinalEscalationDays = 15;@Id@Column@GeneratedValue(strategy = GenerationType.IDENTITY)private int id;@Column(name = "fofo_id")private int fofoId;@Column(name = "subcategory_id")private int subCategoryId;@Column(name = "create_timestamp")private LocalDateTime createTimestamp;@Column(name = "update_timestamp")private LocalDateTime updateTimestamp;@Column(name = "close_timestamp")private LocalDateTime closeTimestamp;@Column(name = "l1_auth_user")private int l1AuthUser;@Column(name = "l2_auth_user")private int l2AuthUser;@Column(name = "l3_auth_user")private int l3AuthUser;@Column(name = "l4_auth_user")private int l4AuthUser;@Column(name = "l5_auth_user")private int l5AuthUser;@Column(name = "happy_code")private String happyCode;@Column(name = "assignment_id")private int assignmentId;@Column(name = "last_activity")@Enumerated(EnumType.STRING)private ActivityType lastActivity;@Column(name = "last_activity_id")private int lastActivityId;@Column(name = "first_activity_id")private int firstActivityId;@Transientprivate TicketAssigned lastAassignment;public TicketAssigned getLastAassignment() {return lastAassignment;}public void setLastAassignment(TicketAssigned lastAassignment) {this.lastAassignment = lastAassignment;}public int getLastActivityId() {return lastActivityId;}public void setLastActivityId(int lastActivityId) {this.lastActivityId = lastActivityId;}public int getFirstActivityId() {return firstActivityId;}public void setFirstActivityId(int firstActivityId) {this.firstActivityId = firstActivityId;}public int getAssignmentId() {return assignmentId;}public void setAssignmentId(int assignmentId) {this.assignmentId = assignmentId;}public String getFormattedCreateTimestamp() {if (createTimestamp == null) {return null;}DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm");return createTimestamp.format(formatter);}public String getFormattedCloseTimestamp() {if (closeTimestamp == null) {return null;}DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm");return closeTimestamp.format(formatter);}public int getId() {return id;}public void setId(int id) {this.id = id;}public int getFofoId() {return fofoId;}public void setFofoId(int fofoId) {this.fofoId = fofoId;}public int getSubCategoryId() {return subCategoryId;}public void setSubCategoryId(int subCategoryId) {this.subCategoryId = subCategoryId;}public LocalDateTime getCreateTimestamp() {return createTimestamp;}public void setCreateTimestamp(LocalDateTime createTimestamp) {this.createTimestamp = createTimestamp;}public LocalDateTime getUpdateTimestamp() {return updateTimestamp;}public void setUpdateTimestamp(LocalDateTime updateTimestamp) {this.updateTimestamp = updateTimestamp;}public LocalDateTime getCloseTimestamp() {return closeTimestamp;}public void setCloseTimestamp(LocalDateTime closeTimestamp) {this.closeTimestamp = closeTimestamp;}public int getL1AuthUser() {return l1AuthUser;}public void setL1AuthUser(int l1AuthUser) {this.l1AuthUser = l1AuthUser;}public int getL2AuthUser() {return l2AuthUser;}public void setL2AuthUser(int l2AuthUser) {this.l2AuthUser = l2AuthUser;}public int getL3AuthUser() {return l3AuthUser;}public void setL3AuthUser(int l3AuthUser) {this.l3AuthUser = l3AuthUser;}public String getHappyCode() {return happyCode;}public void setHappyCode(String happyCode) {this.happyCode = happyCode;}public ActivityType getLastActivity() {return lastActivity;}public void setLastActivity(ActivityType lastActivity) {this.lastActivity = lastActivity;}public static int getL2escalationdays() {return L2EscalationDays;}public static int getL3escalationdays() {return L3EscalationDays;}public static int getFinalescalationdays() {return FinalEscalationDays;}public int getL5AuthUser() {return l5AuthUser;}public void setL5AuthUser(int l5AuthUser) {this.l5AuthUser = l5AuthUser;}@Overridepublic int hashCode() {final int prime = 31;int result = 1;result = prime * result + assignmentId;result = prime * result + ((closeTimestamp == null) ? 0 : closeTimestamp.hashCode());result = prime * result + ((createTimestamp == null) ? 0 : createTimestamp.hashCode());result = prime * result + fofoId;result = prime * result + ((happyCode == null) ? 0 : happyCode.hashCode());result = prime * result + id;result = prime * result + l1AuthUser;result = prime * result + l2AuthUser;result = prime * result + l3AuthUser;result = prime * result + l4AuthUser;result = prime * result + l5AuthUser;result = prime * result + ((lastActivity == null) ? 0 : lastActivity.hashCode());result = prime * result + lastActivityId;result = prime * result + firstActivityId;result = prime * result + subCategoryId;result = prime * result + ((updateTimestamp == null) ? 0 : updateTimestamp.hashCode());return result;}@Overridepublic boolean equals(Object obj) {if (this == obj)return true;if (obj == null)return false;if (getClass() != obj.getClass())return false;Ticket other = (Ticket) obj;if (assignmentId != other.assignmentId)return false;if (closeTimestamp == null) {if (other.closeTimestamp != null)return false;} else if (!closeTimestamp.equals(other.closeTimestamp))return false;if (createTimestamp == null) {if (other.createTimestamp != null)return false;} else if (!createTimestamp.equals(other.createTimestamp))return false;if (fofoId != other.fofoId)return false;if (happyCode == null) {if (other.happyCode != null)return false;} else if (!happyCode.equals(other.happyCode))return false;if (id != other.id)return false;if (l1AuthUser != other.l1AuthUser)return false;if (l2AuthUser != other.l2AuthUser)return false;if (l3AuthUser != other.l3AuthUser)return false;if (l4AuthUser != other.l4AuthUser)return false;if (l5AuthUser != other.l5AuthUser)return false;if (lastActivity != other.lastActivity)return false;if (lastActivityId != other.lastActivityId)return false;if (firstActivityId != other.firstActivityId)return false;if (subCategoryId != other.subCategoryId)return false;if (updateTimestamp == null) {if (other.updateTimestamp != null)return false;} else if (!updateTimestamp.equals(other.updateTimestamp))return false;return true;}@Overridepublic String toString() {return "Ticket{" +"id=" + id +", fofoId=" + fofoId +", subCategoryId=" + subCategoryId +", createTimestamp=" + createTimestamp +", updateTimestamp=" + updateTimestamp +", closeTimestamp=" + closeTimestamp +", l1AuthUser=" + l1AuthUser +", l2AuthUser=" + l2AuthUser +", l3AuthUser=" + l3AuthUser +", l4AuthUser=" + l4AuthUser +", l5AuthUser=" + l5AuthUser +", happyCode='" + happyCode + '\'' +", assignmentId=" + assignmentId +", lastActivity=" + lastActivity +", lastActivityId=" + lastActivityId +", firstActivityId=" + firstActivityId +", lastAassignment=" + lastAassignment +'}';}}