Subversion Repositories SmartDukaan

Rev

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

Rev 3269 Rev 3390
Line 20... Line 20...
20
    // Basic attributes of activity
20
    // Basic attributes of activity
21
    private long           id;
21
    private long           id;
22
    private String         description;
22
    private String         description;
23
    private ActivityType   type;
23
    private ActivityType   type;
24
    private Long           customerId;
24
    private Long           customerId;
25
    private String         customerMobileNumber;
-
 
26
    private Long           emailId;
25
    private Long           userEmailId;
27
 
26
 
28
    // time at which the activity happened
27
    // time at which the activity happened
29
    private Date           creationTimestamp;
28
    private Date           creationTimestamp;
30
    private long           creatorId;
29
    private long           creatorId;
31
 
30
 
Line 35... Line 34...
35
    private TicketCategory ticketCategory;
34
    private TicketCategory ticketCategory;
36
    private Long           ticketAssigneeId;
35
    private Long           ticketAssigneeId;
37
    private TicketPriority ticketPriority;
36
    private TicketPriority ticketPriority;
38
    private String         ticketDescription;
37
    private String         ticketDescription;
39
 
38
 
-
 
39
    // relevant only for the activities generated by customer
-
 
40
    // tracks whether its being read by any agent or not
-
 
41
    private boolean        isRead = true;
-
 
42
 
-
 
43
    // fields for unregistered users
-
 
44
    private String         customerEmailId;
-
 
45
    private String         customerName;
-
 
46
    private String         customerMobileNumber;
-
 
47
 
-
 
48
    private Agent          ticketAssignee;
-
 
49
    private Agent          creator;
-
 
50
 
40
    /**
51
    /**
41
     * Converts a thrift activity object to our domain object for activity
52
     * Converts a thrift activity object to our domain object for activity
42
     * 
53
     * 
43
     * @param tactivity
54
     * @param tactivity
44
     * @return
55
     * @return
Line 46... Line 57...
46
     */
57
     */
47
    public static Activity create(in.shop2020.crm.Activity tactivity)
58
    public static Activity create(in.shop2020.crm.Activity tactivity)
48
            throws ParseException {
59
            throws ParseException {
49
        Activity activity = new Activity();
60
        Activity activity = new Activity();
50
        activity.id = tactivity.getId();
61
        activity.id = tactivity.getId();
51
        activity.emailId = tactivity.getEmailId();
62
        activity.userEmailId = tactivity.getUserEmailId();
52
        activity.creationTimestamp = new Date(tactivity.getCreationTimestamp());
63
        activity.creationTimestamp = new Date(tactivity.getCreationTimestamp());
53
        activity.creatorId = tactivity.getCreatorId();
64
        activity.creatorId = tactivity.getCreatorId();
54
        activity.ticketPriority = tactivity.getTicketPriority();
65
        activity.ticketPriority = tactivity.getTicketPriority();
55
        activity.ticketStatus = tactivity.getTicketStatus();
66
        activity.ticketStatus = tactivity.getTicketStatus();
56
        activity.ticketCategory = tactivity.getTicketCategory();
67
        activity.ticketCategory = tactivity.getTicketCategory();
57
        activity.ticketDescription = tactivity.getTicketDescription();
68
        activity.ticketDescription = tactivity.getTicketDescription();
58
        activity.description = tactivity.getDescription();
69
        activity.description = tactivity.getDescription();
59
        activity.type = tactivity.getType();
70
        activity.type = tactivity.getType();
60
        
71
        activity.isRead = tactivity.isIsRead();
-
 
72
 
61
        if (tactivity.isSetCustomerId()) {
73
        if (tactivity.isSetCustomerId()) {
62
            activity.customerId = tactivity.getCustomerId();
74
            activity.customerId = tactivity.getCustomerId();
63
        }
75
        }
64
 
76
 
65
        if (tactivity.isSetEmailId()) {
77
        if (tactivity.isSetUserEmailId()) {
66
            activity.emailId = tactivity.getEmailId();
78
            activity.userEmailId = tactivity.getUserEmailId();
-
 
79
        }
-
 
80
 
-
 
81
        if (tactivity.isSetCustomerName()) {
-
 
82
            activity.customerName = tactivity.getCustomerName();
-
 
83
        }
-
 
84
 
-
 
85
        if (tactivity.isSetCustomerEmailId()) {
-
 
86
            activity.customerEmailId = tactivity.getCustomerEmailId();
67
        }
87
        }
68
 
88
 
69
        if (tactivity.isSetCustomerMobileNumber()) {
89
        if (tactivity.isSetCustomerMobileNumber()) {
70
            activity.customerMobileNumber = tactivity.getCustomerMobileNumber();
90
            activity.customerMobileNumber = tactivity.getCustomerMobileNumber();
71
        }
91
        }
72
 
92
 
73
        if (tactivity.isSetTicketId() && tactivity.getTicketId() != 0) {
93
        if (tactivity.isSetTicketId()) {
74
            activity.ticketId = tactivity.getTicketId();
94
            activity.ticketId = tactivity.getTicketId();
75
        }
95
        }
76
 
96
 
-
 
97
        if (tactivity.isSetCreator()) {
-
 
98
            activity.creator = Agent.create(tactivity.getCreator());
-
 
99
        }
-
 
100
 
-
 
101
        if (tactivity.isSetTicketAssignee()) {
-
 
102
            activity.ticketAssignee = Agent.create(tactivity.getTicketAssignee());
-
 
103
        }
-
 
104
 
77
        if (tactivity.isSetTicketAssigneeId()) {
105
        if (tactivity.isSetTicketAssigneeId()) {
78
            activity.ticketAssigneeId = tactivity.getTicketAssigneeId();
106
            activity.ticketAssigneeId = tactivity.getTicketAssigneeId();
79
        }
107
        }
80
 
108
 
81
        return activity;
109
        return activity;
Line 95... Line 123...
95
        tactivity.setTicketStatus(ticketStatus);
123
        tactivity.setTicketStatus(ticketStatus);
96
        tactivity.setTicketCategory(ticketCategory);
124
        tactivity.setTicketCategory(ticketCategory);
97
        tactivity.setTicketDescription(ticketDescription);
125
        tactivity.setTicketDescription(ticketDescription);
98
        tactivity.setCreationTimestamp(creationTimestamp.getTime());
126
        tactivity.setCreationTimestamp(creationTimestamp.getTime());
99
        tactivity.setCreatorId(creatorId);
127
        tactivity.setCreatorId(creatorId);
-
 
128
        tactivity.setIsRead(isRead);
100
 
129
 
101
        if (customerId != null) {
130
        if (customerId != null) {
102
            tactivity.setCustomerId(customerId);            
131
            tactivity.setCustomerId(customerId);            
103
        }
132
        }
104
 
133
 
105
        if (customerMobileNumber != null) {
-
 
106
            tactivity.setCustomerMobileNumber(customerMobileNumber);
-
 
107
        }
-
 
108
 
-
 
109
        if (emailId != null) {
134
        if (userEmailId != null) {
110
            tactivity.setEmailId(emailId);
135
            tactivity.setUserEmailId(userEmailId);
111
        }
136
        }
112
 
137
 
113
        if (ticketId != null) {
138
        if (ticketId != null) {
114
            tactivity.setTicketId(ticketId);
139
            tactivity.setTicketId(ticketId);
115
        }
140
        }
116
        
141
        
117
        if (ticketAssigneeId != null) {
142
        if (ticketAssigneeId != null) {
118
            tactivity.setTicketAssigneeId(ticketAssigneeId);
143
            tactivity.setTicketAssigneeId(ticketAssigneeId);
119
        }
144
        }
120
 
145
 
-
 
146
        if (customerMobileNumber != null) {
-
 
147
            tactivity.setCustomerMobileNumber(customerMobileNumber);
-
 
148
        }
-
 
149
 
-
 
150
        if (customerName != null) {
-
 
151
            tactivity.setCustomerName(customerName);
-
 
152
        }
-
 
153
 
-
 
154
        if (customerEmailId != null) {
-
 
155
            tactivity.setCustomerEmailId(customerEmailId);
-
 
156
        }
-
 
157
 
-
 
158
        if (creator != null) {
-
 
159
            tactivity.setCreator(creator.getThriftAgent());
-
 
160
        }
-
 
161
 
-
 
162
        if (ticketAssignee != null) {
-
 
163
            tactivity.setTicketAssignee(ticketAssignee.getThriftAgent());
-
 
164
        }
-
 
165
 
121
        return tactivity;
166
        return tactivity;
122
    }
167
    }
123
 
168
 
124
    public long getId() {
169
    public long getId() {
125
        return id;
170
        return id;
Line 215... Line 260...
215
 
260
 
216
    public void setType(ActivityType type) {
261
    public void setType(ActivityType type) {
217
        this.type = type;
262
        this.type = type;
218
    }
263
    }
219
 
264
 
220
    public Long getEmailId() {
265
    public Long getUserEmailId() {
221
        return emailId;
266
        return userEmailId;
222
    }
267
    }
223
 
268
 
224
    public void setEmailId(Long emailId) {
269
    public void setUserEmailId(Long emailId) {
225
        this.emailId = emailId;
270
        this.userEmailId = emailId;
226
    }
271
    }
227
 
272
 
228
    public String getCustomerMobileNumber() {
273
    public String getCustomerMobileNumber() {
229
        return customerMobileNumber;
274
        return customerMobileNumber;
230
    }
275
    }
231
 
276
 
232
    public void setCustomerMobileNumber(String customerMobileNumber) {
277
    public void setCustomerMobileNumber(String customerMobileNumber) {
233
        this.customerMobileNumber = customerMobileNumber;
278
        this.customerMobileNumber = customerMobileNumber;
234
    }
279
    }
-
 
280
 
-
 
281
    public boolean isRead() {
-
 
282
        return isRead;
-
 
283
    }
-
 
284
 
-
 
285
    public void setRead(boolean isRead) {
-
 
286
        this.isRead = isRead;
-
 
287
    }
-
 
288
 
-
 
289
    public String getCustomerEmailId() {
-
 
290
        return customerEmailId;
-
 
291
    }
-
 
292
 
-
 
293
    public void setCustomerEmailId(String customerEmailId) {
-
 
294
        this.customerEmailId = customerEmailId;
-
 
295
    }
-
 
296
 
-
 
297
    public String getCustomerName() {
-
 
298
        return customerName;
-
 
299
    }
-
 
300
 
-
 
301
    public void setCustomerName(String customerName) {
-
 
302
        this.customerName = customerName;
-
 
303
    }
-
 
304
 
-
 
305
    public Agent getTicketAssignee() {
-
 
306
        return ticketAssignee;
-
 
307
    }
-
 
308
 
-
 
309
    public void setTicketAssignee(Agent ticketAssignee) {
-
 
310
        this.ticketAssignee = ticketAssignee;
-
 
311
    }
-
 
312
 
-
 
313
    public Agent getCreator() {
-
 
314
        return creator;
-
 
315
    }
-
 
316
 
-
 
317
    public void setCreator(Agent creator) {
-
 
318
        this.creator = creator;
-
 
319
    }
235
}
320
}