Subversion Repositories SmartDukaan

Rev

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

Rev 4142 Rev 4241
Line 10... Line 10...
10
import in.shop2020.crm.TicketCategory;
10
import in.shop2020.crm.TicketCategory;
11
import in.shop2020.model.v1.user.User;
11
import in.shop2020.model.v1.user.User;
12
import in.shop2020.model.v1.user.UserContextException;
12
import in.shop2020.model.v1.user.UserContextException;
13
import in.shop2020.serving.auth.CRMAuthorizingRealm;
13
import in.shop2020.serving.auth.CRMAuthorizingRealm;
14
import in.shop2020.thrift.clients.CRMClient;
14
import in.shop2020.thrift.clients.CRMClient;
15
import in.shop2020.thrift.clients.HelperClient;
-
 
16
import in.shop2020.thrift.clients.UserClient;
15
import in.shop2020.thrift.clients.UserClient;
17
import in.shop2020.util.CRMConstants;
16
import in.shop2020.util.CRMConstants;
18
import in.shop2020.utils.HelperService.Client;
-
 
19
 
17
 
20
import java.text.ParseException;
18
import java.text.ParseException;
21
import java.util.ArrayList;
19
import java.util.ArrayList;
22
import java.util.Collections;
20
import java.util.Collections;
23
import java.util.List;
21
import java.util.List;
Line 36... Line 34...
36
    private List<Activity>    activities;
34
    private List<Activity>    activities;
37
    private String            activityId;
35
    private String            activityId;
38
    private String            description;
36
    private String            description;
39
    private String            type;
37
    private String            type;
40
    private String            category;
38
    private String            category;
41
    private String            subject;
-
 
42
    private String            body;
-
 
43
    private String            customerMobileNumber;
39
    private String            customerMobileNumber;
44
    private String            creatorId;
40
    private String            creatorId;
45
    private String[]          agentIds;
41
    private String[]          agentIds;
46
    private String            startTimestamp;
42
    private String            startTimestamp;
47
    private String            endTimestamp;
43
    private String            endTimestamp;
Line 106... Line 102...
106
 
102
 
107
        return INDEX;
103
        return INDEX;
108
    }
104
    }
109
 
105
 
110
    public String editNew() {
106
    public String editNew() {
111
        subject = "";
-
 
112
        return EDIT_NEW;
107
        return EDIT_NEW;
113
    }
108
    }
114
 
109
 
115
    public String create() throws Exception {
110
    public String create() throws Exception {
116
        Activity activity = new Activity();
111
        Activity activity = new Activity();
Line 151... Line 146...
151
            if (user != null && user.getUserId() != -1) {
146
            if (user != null && user.getUserId() != -1) {
152
                activity.setCustomerId(user.getUserId());
147
                activity.setCustomerId(user.getUserId());
153
            }
148
            }
154
        }
149
        }
155
 
150
 
156
        if (ActivityType.SEND_EMAIL_TO_CUSTOMER.equals(activity.getType())) {
-
 
157
            log.info("Sending mail");
-
 
158
            Client helperClient = new HelperClient().getClient();
-
 
159
            activity.setUserEmailId(helperClient.saveUserEmailForSending(
-
 
160
                    customerEmailId, CRMConstants.CRM_EMAIL_SENDOR, subject,
-
 
161
                    body, null, CRMConstants.CRM_EMAIL_TYPE));
-
 
162
 
-
 
163
            activity.setDescription("Subject: " + subject + "\n\n" + "Body: "
-
 
164
                    + body);
-
 
165
        }
-
 
166
 
-
 
167
        crmServiceClient = new CRMClient().getClient();
151
        crmServiceClient = new CRMClient().getClient();
168
        activityId = String.valueOf(crmServiceClient.insertActivity(activity));
152
        activityId = String.valueOf(crmServiceClient.insertActivity(activity));
169
 
153
 
170
        return index();
154
        return index();
171
    }
155
    }
Line 226... Line 210...
226
 
210
 
227
    public void setType(String type) {
211
    public void setType(String type) {
228
        this.type = type;
212
        this.type = type;
229
    }
213
    }
230
 
214
 
231
    public String getSubject() {
-
 
232
        return subject;
-
 
233
    }
-
 
234
 
-
 
235
    public void setSubject(String subject) {
-
 
236
        this.subject = subject;
-
 
237
    }
-
 
238
 
-
 
239
    public String getBody() {
-
 
240
        return body;
-
 
241
    }
-
 
242
 
-
 
243
    public void setBody(String body) {
-
 
244
        this.body = body;
-
 
245
    }
-
 
246
 
-
 
247
    public String getCustomerMobileNumber() {
215
    public String getCustomerMobileNumber() {
248
        return customerMobileNumber;
216
        return customerMobileNumber;
249
    }
217
    }
250
 
218
 
251
    public void setCustomerMobileNumber(String customerMobileNumber) {
219
    public void setCustomerMobileNumber(String customerMobileNumber) {