Subversion Repositories SmartDukaan

Rev

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

Rev 3422 Rev 3499
Line 2... Line 2...
2
 
2
 
3
import in.shop2020.crm.Activity;
3
import in.shop2020.crm.Activity;
4
import in.shop2020.crm.Agent;
4
import in.shop2020.crm.Agent;
5
import in.shop2020.crm.SearchFilter;
5
import in.shop2020.crm.SearchFilter;
6
import in.shop2020.crm.Ticket;
6
import in.shop2020.crm.Ticket;
-
 
7
import in.shop2020.crm.TicketCategory;
7
import in.shop2020.crm.TicketStatus;
8
import in.shop2020.crm.TicketStatus;
-
 
9
 
8
import in.shop2020.model.v1.order.Order;
10
import in.shop2020.model.v1.order.Order;
9
import in.shop2020.model.v1.order.OrderStatus;
11
import in.shop2020.model.v1.order.OrderStatus;
10
import in.shop2020.model.v1.order.TransactionServiceException;
12
import in.shop2020.model.v1.order.TransactionServiceException;
11
import in.shop2020.model.v1.user.Cart;
13
import in.shop2020.model.v1.user.Cart;
12
import in.shop2020.model.v1.user.Line;
14
import in.shop2020.model.v1.user.Line;
13
import in.shop2020.model.v1.user.User;
15
import in.shop2020.model.v1.user.User;
14
import in.shop2020.model.v1.user.UserCommunication;
16
import in.shop2020.model.v1.user.UserCommunication;
15
import in.shop2020.model.v1.user.UserCommunicationException;
17
import in.shop2020.model.v1.user.UserCommunicationException;
16
import in.shop2020.model.v1.user.UserContextException;
18
import in.shop2020.model.v1.user.UserContextException;
17
import in.shop2020.model.v1.user.UserState;
19
import in.shop2020.model.v1.user.UserState;
-
 
20
 
18
import in.shop2020.serving.auth.CRMAuthorizingRealm;
21
import in.shop2020.serving.auth.CRMAuthorizingRealm;
19
import in.shop2020.thrift.clients.CRMClient;
22
import in.shop2020.thrift.clients.CRMClient;
20
import in.shop2020.thrift.clients.TransactionClient;
23
import in.shop2020.thrift.clients.TransactionClient;
21
import in.shop2020.thrift.clients.UserClient;
24
import in.shop2020.thrift.clients.UserClient;
22
import in.shop2020.util.CRMConstants;
25
import in.shop2020.util.CRMConstants;
Line 56... Line 59...
56
    private String              couponCode = "";
59
    private String              couponCode = "";
57
    private long                agentOpenTicketCount;
60
    private long                agentOpenTicketCount;
58
    private long                unassignedTicketCount;
61
    private long                unassignedTicketCount;
59
    private long                activityCount;
62
    private long                activityCount;
60
    private long                customerActivityCount;
63
    private long                customerActivityCount;
-
 
64
    private long                pendingCodVerificationCount;
61
 
65
 
62
    @Action("/")
66
    @Action("/")
63
    public String index() throws Exception {
67
    public String index() throws Exception {
64
        String returnValue = INPUT;
68
        String returnValue = INPUT;
65
 
69
 
Line 152... Line 156...
152
    }
156
    }
153
 
157
 
154
    private void loadTicketCounts() throws TException {
158
    private void loadTicketCounts() throws TException {
155
        SearchFilter searchFilter = new SearchFilter();
159
        SearchFilter searchFilter = new SearchFilter();
156
        searchFilter.setTicketAssigneeIds(Collections
160
        searchFilter.setTicketAssigneeIds(Collections
157
                .singletonList(CRMAuthorizingRealm
-
 
158
                        .getAgent(currentAgentEmailId).getId()));
161
                .singletonList(CRMAuthorizingRealm.getAgent(currentAgentEmailId).getId()));
159
 
162
 
160
        crmServiceClient = new CRMClient().getClient();
163
        crmServiceClient = new CRMClient().getClient();
161
        List<Ticket> tickets = crmServiceClient.getTickets(searchFilter);
164
        agentOpenTicketCount = crmServiceClient.getTickets(searchFilter).size();
162
        for (Ticket ticket : tickets) {
-
 
163
            if (TicketStatus.OPEN.equals(ticket.getStatus())) {
165
        unassignedTicketCount = crmServiceClient.getUnassignedTickets().size();
164
                agentOpenTicketCount++;
-
 
165
            }
-
 
166
        }
-
 
167
 
166
 
-
 
167
        searchFilter = new SearchFilter();
168
        List<Ticket> unassignedTickets = crmServiceClient
168
        searchFilter.setTicketCategory(TicketCategory.COD_VERIFICATION);
169
                .getUnassignedTickets();
169
        searchFilter.setTicketStatus(TicketStatus.OPEN);
170
        unassignedTicketCount = unassignedTickets.size();
170
        crmServiceClient = new CRMClient().getClient();
-
 
171
        pendingCodVerificationCount = crmServiceClient.getTickets(searchFilter).size();
171
    }
172
    }
172
 
173
 
173
    private void loadUserCommunicationDetails()
174
    private void loadUserCommunicationDetails()
174
            throws UserCommunicationException, TException {
175
            throws UserCommunicationException, TException {
175
        userContextServiceClient = new UserClient().getClient();
176
        userContextServiceClient = new UserClient().getClient();
Line 288... Line 289...
288
 
289
 
289
    public long getFailedOrderCount() {
290
    public long getFailedOrderCount() {
290
        return failedOrderCount;
291
        return failedOrderCount;
291
    }
292
    }
292
 
293
 
293
    public double getCartItems() {
294
    public int getCartItems() {
294
        return cartItems;
295
        return (int)cartItems;
295
    }
296
    }
296
 
297
 
297
    public String getLastLogin() {
298
    public String getLastLogin() {
298
        return lastLogin;
299
        return lastLogin;
299
    }
300
    }
Line 351... Line 352...
351
    }
352
    }
352
 
353
 
353
    public void setCustomerActivityCount(long customerActivityCount) {
354
    public void setCustomerActivityCount(long customerActivityCount) {
354
        this.customerActivityCount = customerActivityCount;
355
        this.customerActivityCount = customerActivityCount;
355
    }
356
    }
-
 
357
 
-
 
358
    public long getPendingCodVerificationCount() {
-
 
359
        return pendingCodVerificationCount;
-
 
360
    }
-
 
361
 
-
 
362
    public void setPendingCodVerificationCount(long pendingCodVerificationCount) {
-
 
363
        this.pendingCodVerificationCount = pendingCodVerificationCount;
-
 
364
    }
356
}
365
}
357
366