Subversion Repositories SmartDukaan

Rev

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

Rev 3206 Rev 3269
Line 19... Line 19...
19
public class Activity {
19
public class Activity {
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;
25
    private Long           emailId;
26
    private Long           emailId;
26
 
27
 
27
    // time at which the activity happened
28
    // time at which the activity happened
28
    private Date           creationTimestamp;
29
    private Date           creationTimestamp;
29
    private long           creatorId;
30
    private long           creatorId;
Line 45... Line 46...
45
     */
46
     */
46
    public static Activity create(in.shop2020.crm.Activity tactivity)
47
    public static Activity create(in.shop2020.crm.Activity tactivity)
47
            throws ParseException {
48
            throws ParseException {
48
        Activity activity = new Activity();
49
        Activity activity = new Activity();
49
        activity.id = tactivity.getId();
50
        activity.id = tactivity.getId();
-
 
51
        activity.emailId = tactivity.getEmailId();
-
 
52
        activity.creationTimestamp = new Date(tactivity.getCreationTimestamp());
50
        activity.customerId = tactivity.getCustomerId();
53
        activity.creatorId = tactivity.getCreatorId();
-
 
54
        activity.ticketPriority = tactivity.getTicketPriority();
-
 
55
        activity.ticketStatus = tactivity.getTicketStatus();
-
 
56
        activity.ticketCategory = tactivity.getTicketCategory();
-
 
57
        activity.ticketDescription = tactivity.getTicketDescription();
51
        activity.description = tactivity.getDescription();
58
        activity.description = tactivity.getDescription();
-
 
59
        activity.type = tactivity.getType();
-
 
60
        
-
 
61
        if (tactivity.isSetCustomerId()) {
-
 
62
            activity.customerId = tactivity.getCustomerId();
-
 
63
        }
52
 
64
 
53
        if (tactivity.isSetEmailId()) {
65
        if (tactivity.isSetEmailId()) {
54
            activity.emailId = tactivity.getEmailId();
66
            activity.emailId = tactivity.getEmailId();
55
        }
67
        }
56
 
68
 
57
        activity.emailId = tactivity.getEmailId();
69
        if (tactivity.isSetCustomerMobileNumber()) {
58
        activity.creationTimestamp = new Date(tactivity.getCreationTimestamp());
70
            activity.customerMobileNumber = tactivity.getCustomerMobileNumber();
59
        activity.creatorId = tactivity.getCreatorId();
71
        }
60
 
72
 
61
        if (tactivity.isSetTicketId() && tactivity.getTicketId() != 0) {
73
        if (tactivity.isSetTicketId() && tactivity.getTicketId() != 0) {
62
            activity.ticketId = tactivity.getTicketId();
74
            activity.ticketId = tactivity.getTicketId();
63
        }
75
        }
64
 
76
 
65
        activity.ticketPriority = tactivity.getTicketPriority();
-
 
66
        activity.ticketStatus = tactivity.getTicketStatus();
-
 
67
        activity.ticketCategory = tactivity.getTicketCategory();
-
 
68
        activity.ticketDescription = tactivity.getTicketDescription();
-
 
69
 
-
 
70
        if (tactivity.isSetTicketAssigneeId()) {
77
        if (tactivity.isSetTicketAssigneeId()) {
71
            activity.ticketAssigneeId = tactivity.getTicketAssigneeId();
78
            activity.ticketAssigneeId = tactivity.getTicketAssigneeId();
72
        }
79
        }
73
 
80
 
74
        activity.type = tactivity.getType();
-
 
75
        return activity;
81
        return activity;
76
    }
82
    }
77
 
83
 
78
    /**
84
    /**
79
     * Converts our domain object to its corresponding thrift model object.
85
     * Converts our domain object to its corresponding thrift model object.
Line 81... Line 87...
81
     * @return
87
     * @return
82
     */
88
     */
83
    public in.shop2020.crm.Activity getThriftActivity() {
89
    public in.shop2020.crm.Activity getThriftActivity() {
84
        in.shop2020.crm.Activity tactivity = new in.shop2020.crm.Activity();
90
        in.shop2020.crm.Activity tactivity = new in.shop2020.crm.Activity();
85
        tactivity.setId(id);
91
        tactivity.setId(id);
86
        tactivity.setCustomerId(customerId);
-
 
87
        tactivity.setDescription(description);
92
        tactivity.setDescription(description);
88
        tactivity.setType(type);
93
        tactivity.setType(type);
-
 
94
        tactivity.setTicketPriority(ticketPriority);
-
 
95
        tactivity.setTicketStatus(ticketStatus);
-
 
96
        tactivity.setTicketCategory(ticketCategory);
-
 
97
        tactivity.setTicketDescription(ticketDescription);
-
 
98
        tactivity.setCreationTimestamp(creationTimestamp.getTime());
-
 
99
        tactivity.setCreatorId(creatorId);
-
 
100
 
-
 
101
        if (customerId != null) {
-
 
102
            tactivity.setCustomerId(customerId);            
89
        
103
        }
-
 
104
 
-
 
105
        if (customerMobileNumber != null) {
-
 
106
            tactivity.setCustomerMobileNumber(customerMobileNumber);
-
 
107
        }
-
 
108
 
90
        if (emailId != null) {
109
        if (emailId != null) {
91
            tactivity.setEmailId(emailId);
110
            tactivity.setEmailId(emailId);
92
        }
111
        }
93
        else {
-
 
94
            tactivity.setEmailIdIsSet(false);
-
 
95
        }
-
 
96
 
112
 
97
        if (ticketId != null) {
113
        if (ticketId != null) {
98
            tactivity.setTicketId(ticketId);
114
            tactivity.setTicketId(ticketId);
99
        }
115
        }
100
        else {
-
 
101
            tactivity.setTicketIdIsSet(false);
-
 
102
        }
-
 
103
 
-
 
104
        tactivity.setCreationTimestamp(creationTimestamp.getTime());
-
 
105
        tactivity.setCreatorId(creatorId);
-
 
106
        
116
        
107
        if (ticketAssigneeId != null) {
117
        if (ticketAssigneeId != null) {
108
            tactivity.setTicketAssigneeId(ticketAssigneeId);
118
            tactivity.setTicketAssigneeId(ticketAssigneeId);
109
        }
119
        }
110
        else {
-
 
111
            tactivity.setTicketAssigneeIdIsSet(false);
-
 
112
        }
-
 
113
 
120
 
114
        tactivity.setTicketPriority(ticketPriority);
-
 
115
        tactivity.setTicketStatus(ticketStatus);
-
 
116
        tactivity.setTicketCategory(ticketCategory);
-
 
117
        tactivity.setTicketDescription(ticketDescription);
-
 
118
        return tactivity;
121
        return tactivity;
119
    }
122
    }
120
 
123
 
121
    public long getId() {
124
    public long getId() {
122
        return id;
125
        return id;
Line 148... Line 151...
148
 
151
 
149
    public void setTicketPriority(TicketPriority ticketPriority) {
152
    public void setTicketPriority(TicketPriority ticketPriority) {
150
        this.ticketPriority = ticketPriority;
153
        this.ticketPriority = ticketPriority;
151
    }
154
    }
152
 
155
 
153
    public long getCustomerId() {
156
    public Long getCustomerId() {
154
        return customerId;
157
        return customerId;
155
    }
158
    }
156
 
159
 
157
    public void setCustomerId(long customerId) {
160
    public void setCustomerId(Long customerId) {
158
        this.customerId = customerId;
161
        this.customerId = customerId;
159
    }
162
    }
160
 
163
 
161
    public Long getTicketId() {
164
    public Long getTicketId() {
162
        return ticketId;
165
        return ticketId;
Line 219... Line 222...
219
    }
222
    }
220
 
223
 
221
    public void setEmailId(Long emailId) {
224
    public void setEmailId(Long emailId) {
222
        this.emailId = emailId;
225
        this.emailId = emailId;
223
    }
226
    }
-
 
227
 
-
 
228
    public String getCustomerMobileNumber() {
-
 
229
        return customerMobileNumber;
-
 
230
    }
-
 
231
 
-
 
232
    public void setCustomerMobileNumber(String customerMobileNumber) {
-
 
233
        this.customerMobileNumber = customerMobileNumber;
-
 
234
    }
224
}
235
}