Subversion Repositories SmartDukaan

Rev

Rev 24439 | Rev 27124 | 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 java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import com.spice.profitmandi.dao.entity.fofo.ActivityType;

/**
 * @author amit
 *
 */
@Entity
@Table(name="cs.ticket", schema = "cs")
public class Ticket {
        
        public static final int L2EscalationDays = 5;
        public static final int L3EscalationDays = 10;
        public 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="happy_code")
        private String happyCode;

        @Column(name="last_activity")
        @Enumerated(EnumType.STRING)
        private ActivityType lastActivity;
        
        @Column(name="l2_escalation_timestamp")
        private LocalDateTime l2EscalationTimestamp;
        
        @Column(name="l3_escalation_timestamp")
        private LocalDateTime l3EscalationTimestamp;
        
        @Column(name="last_escalation_timestamp")
        private LocalDateTime lastEscalationTimestamp;
        
        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 LocalDateTime getL2EscalationTimestamp() {
                return l2EscalationTimestamp;
        }

        public void setL2EscalationTimestamp(LocalDateTime l2EscalationTimestamp) {
                this.l2EscalationTimestamp = l2EscalationTimestamp;
        }

        public LocalDateTime getL3EscalationTimestamp() {
                return l3EscalationTimestamp;
        }

        public void setL3EscalationTimestamp(LocalDateTime l3EscalationTimestamp) {
                this.l3EscalationTimestamp = l3EscalationTimestamp;
        }

        public LocalDateTime getLastEscalationTimestamp() {
                return lastEscalationTimestamp;
        }

        public void setLastEscalationTimestamp(LocalDateTime lastEscalationTimestamp) {
                this.lastEscalationTimestamp = lastEscalationTimestamp;
        }

        public static int getL2escalationdays() {
                return L2EscalationDays;
        }

        public static int getL3escalationdays() {
                return L3EscalationDays;
        }

        public static int getFinalescalationdays() {
                return FinalEscalationDays;
        }

        @Override
        public int hashCode() {
                final int prime = 31;
                int result = 1;
                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 + ((l2EscalationTimestamp == null) ? 0 : l2EscalationTimestamp.hashCode());
                result = prime * result + l3AuthUser;
                result = prime * result + ((l3EscalationTimestamp == null) ? 0 : l3EscalationTimestamp.hashCode());
                result = prime * result + ((lastActivity == null) ? 0 : lastActivity.hashCode());
                result = prime * result + ((lastEscalationTimestamp == null) ? 0 : lastEscalationTimestamp.hashCode());
                result = prime * result + subCategoryId;
                result = prime * result + ((updateTimestamp == null) ? 0 : updateTimestamp.hashCode());
                return result;
        }

        @Override
        public 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 (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 (l2EscalationTimestamp == null) {
                        if (other.l2EscalationTimestamp != null)
                                return false;
                } else if (!l2EscalationTimestamp.equals(other.l2EscalationTimestamp))
                        return false;
                if (l3AuthUser != other.l3AuthUser)
                        return false;
                if (l3EscalationTimestamp == null) {
                        if (other.l3EscalationTimestamp != null)
                                return false;
                } else if (!l3EscalationTimestamp.equals(other.l3EscalationTimestamp))
                        return false;
                if (lastActivity != other.lastActivity)
                        return false;
                if (lastEscalationTimestamp == null) {
                        if (other.lastEscalationTimestamp != null)
                                return false;
                } else if (!lastEscalationTimestamp.equals(other.lastEscalationTimestamp))
                        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;
        }

        @Override
        public String toString() {
                return "Ticket [id=" + id + ", fofoId=" + fofoId + "subCategoryId="
                                + subCategoryId + ", createTimestamp=" + createTimestamp + ", updateTimestamp=" + updateTimestamp
                                + ", closeTimestamp=" + closeTimestamp + ", l1AuthUser=" + l1AuthUser + ", l2AuthUser=" + l2AuthUser
                                + ", l3AuthUser=" + l3AuthUser + ", happyCode=" + happyCode + ", lastActivity=" + lastActivity
                                + ", l2EscalationTimestamp=" + l2EscalationTimestamp + ", l3EscalationTimestamp="
                                + l3EscalationTimestamp + ", lastEscalationTimestamp=" + lastEscalationTimestamp + "]";
        }

        
        
        
}