Subversion Repositories SmartDukaan

Rev

Rev 3106 | Rev 3390 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3106 Rev 3269
Line 17... Line 17...
17
 * 
17
 * 
18
 * @author mandeep
18
 * @author mandeep
19
 */
19
 */
20
public class Ticket {
20
public class Ticket {
21
    private long           id;
21
    private long           id;
22
    private long           customerId;
22
    private Long           customerId;
-
 
23
    private String         customerEmailId;
23
    private Date           openDate;
24
    private Date           openDate;
24
    private Date           closeDate;
25
    private Date           closeDate;
25
    private long           creatorId;
26
    private long           creatorId;
26
    private String         description;
27
    private String         description;
27
    private TicketStatus   status;
28
    private TicketStatus   status;
Line 43... Line 44...
43
     */
44
     */
44
    public static Ticket create(in.shop2020.crm.Ticket tticket)
45
    public static Ticket create(in.shop2020.crm.Ticket tticket)
45
            throws ParseException {
46
            throws ParseException {
46
        Ticket ticket = new Ticket();
47
        Ticket ticket = new Ticket();
47
        ticket.id = tticket.getId();
48
        ticket.id = tticket.getId();
48
        ticket.customerId = tticket.getCustomerId();
-
 
49
        ticket.creatorId = tticket.getCreatorId();
49
        ticket.creatorId = tticket.getCreatorId();
50
        ticket.description = tticket.getDescription();
-
 
51
        
-
 
52
        if (tticket.isSetAssigneeId()) {
-
 
53
            ticket.assigneeId = tticket.getAssigneeId();
-
 
54
        }
-
 
55
 
-
 
56
        ticket.category = tticket.getCategory();
50
        ticket.category = tticket.getCategory();
57
        ticket.priority = tticket.getPriority();
51
        ticket.priority = tticket.getPriority();
58
        ticket.status = tticket.getStatus();
52
        ticket.status = tticket.getStatus();
-
 
53
        ticket.airwayBillNo = tticket.getAirwayBillNo();
-
 
54
        ticket.productName = tticket.getProductName();
-
 
55
 
-
 
56
        if (tticket.isSetDescription()) {
-
 
57
            ticket.description = tticket.getDescription();
-
 
58
        }
-
 
59
 
-
 
60
        if (tticket.isSetCustomerId()) {
-
 
61
            ticket.customerId = tticket.getCustomerId();
-
 
62
        }
-
 
63
 
-
 
64
        if (tticket.isSetCustomerEmailId()) {
-
 
65
            ticket.customerEmailId = tticket.getCustomerEmailId();
-
 
66
        }
-
 
67
 
-
 
68
        if (tticket.isSetAssigneeId()) {
-
 
69
            ticket.assigneeId = tticket.getAssigneeId();
-
 
70
        }
59
 
71
 
60
        if (tticket.isSetOpenDate()) {
72
        if (tticket.isSetOpenDate()) {
61
            ticket.openDate = new Date(tticket.getOpenDate());
73
            ticket.openDate = new Date(tticket.getOpenDate());
62
        }
74
        }
63
 
75
 
64
        // Trying to set close date as null in database!
76
        // Trying to set close date as null in database!
65
        if (tticket.isSetCloseDate() && tticket.getCloseDate() != 0) {
77
        if (tticket.isSetCloseDate()) {
66
            ticket.closeDate = new Date(tticket.getCloseDate());
78
            ticket.closeDate = new Date(tticket.getCloseDate());
67
        }
79
        }
68
 
80
 
69
        if (tticket.isSetOrderId()) {
81
        if (tticket.isSetOrderId()) {
70
            ticket.orderId = tticket.getOrderId();
82
            ticket.orderId = tticket.getOrderId();
71
        }
83
        }
72
 
84
 
73
        ticket.airwayBillNo = tticket.getAirwayBillNo();
-
 
74
        ticket.productName = tticket.getProductName();
-
 
75
 
-
 
76
        return ticket;
85
        return ticket;
77
    }
86
    }
78
 
87
 
79
    /**
88
    /**
80
     * Converts this object to its corresponding thrift representation.
89
     * Converts this object to its corresponding thrift representation.
Line 82... Line 91...
82
     * @return
91
     * @return
83
     */
92
     */
84
    public in.shop2020.crm.Ticket getThriftTicket() {
93
    public in.shop2020.crm.Ticket getThriftTicket() {
85
        in.shop2020.crm.Ticket tticket = new in.shop2020.crm.Ticket();
94
        in.shop2020.crm.Ticket tticket = new in.shop2020.crm.Ticket();
86
        tticket.setId(id);
95
        tticket.setId(id);
87
        tticket.setCustomerId(customerId);
-
 
88
        tticket.setCreatorId(creatorId);
96
        tticket.setCreatorId(creatorId);
89
        tticket.setDescription(description);
97
        tticket.setDescription(description);
-
 
98
        tticket.setCategory(category);
-
 
99
        tticket.setPriority(priority);
-
 
100
        tticket.setStatus(status);
-
 
101
        tticket.setAirwayBillNo(airwayBillNo);
-
 
102
        tticket.setProductName(productName);
-
 
103
 
-
 
104
        if (customerId != null) {
-
 
105
            tticket.setCustomerId(customerId);
-
 
106
        }
-
 
107
 
-
 
108
        if (customerEmailId != null) {
-
 
109
            tticket.setCustomerEmailId(customerEmailId);
-
 
110
        }
90
 
111
 
91
        if (assigneeId != null) {
112
        if (assigneeId != null) {
92
            tticket.setAssigneeId(assigneeId);
113
            tticket.setAssigneeId(assigneeId);
93
        }
114
        }
94
        else {
-
 
95
            tticket.setAssigneeIdIsSet(false);
-
 
96
        }
-
 
97
 
115
 
98
        tticket.setCategory(category);
-
 
99
        tticket.setPriority(priority);
-
 
100
        tticket.setStatus(status);
-
 
101
        
-
 
102
        if (orderId != null) {
116
        if (orderId != null) {
103
            tticket.setOrderId(orderId);
117
            tticket.setOrderId(orderId);
104
        }
118
        }
105
        else {
-
 
106
            tticket.setOrderIdIsSet(false);
-
 
107
        }
-
 
108
 
-
 
109
        tticket.setAirwayBillNo(airwayBillNo);
-
 
110
        tticket.setProductName(productName);
-
 
111
 
119
 
112
        if (openDate != null) {
120
        if (openDate != null) {
113
            tticket.setOpenDate(openDate.getTime());
121
            tticket.setOpenDate(openDate.getTime());
114
        }
122
        }
115
        else {
-
 
116
            tticket.setOpenDateIsSet(false);
-
 
117
        }
-
 
118
 
123
 
119
        if (closeDate != null) {
124
        if (closeDate != null) {
120
            tticket.setCloseDate(closeDate.getTime());
125
            tticket.setCloseDate(closeDate.getTime());
121
        }
126
        }
122
        else {
-
 
123
            tticket.setCloseDateIsSet(false);
-
 
124
        }
-
 
125
 
127
 
126
        return tticket;
128
        return tticket;
127
    }
129
    }
128
 
130
 
129
    public long getId() {
131
    public long getId() {
Line 132... Line 134...
132
 
134
 
133
    public void setId(long id) {
135
    public void setId(long id) {
134
        this.id = id;
136
        this.id = id;
135
    }
137
    }
136
 
138
 
137
    public long getCustomerId() {
139
    public Long getCustomerId() {
138
        return customerId;
140
        return customerId;
139
    }
141
    }
140
 
142
 
141
    public void setCustomerId(long customerId) {
143
    public void setCustomerId(Long customerId) {
142
        this.customerId = customerId;
144
        this.customerId = customerId;
143
    }
145
    }
144
 
146
 
145
    public Date getOpenDate() {
147
    public Date getOpenDate() {
146
        return openDate;
148
        return openDate;
Line 227... Line 229...
227
    }
229
    }
228
 
230
 
229
    public void setAssigneeId(Long assigneeId) {
231
    public void setAssigneeId(Long assigneeId) {
230
        this.assigneeId = assigneeId;
232
        this.assigneeId = assigneeId;
231
    }
233
    }
-
 
234
 
-
 
235
    public String getCustomerEmailId() {
-
 
236
        return customerEmailId;
-
 
237
    }
-
 
238
 
-
 
239
    public void setCustomerEmailId(String customerEmailId) {
-
 
240
        this.customerEmailId = customerEmailId;
-
 
241
    }
232
}
242
}