Subversion Repositories SmartDukaan

Rev

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

Rev 3090 Rev 3096
Line 58... Line 58...
58
    private long failedOrderCount;
58
    private long failedOrderCount;
59
    private long userCommunicationCount;
59
    private long userCommunicationCount;
60
    private long ticketCount;
60
    private long ticketCount;
61
    private long openTicketCount;
61
    private long openTicketCount;
62
    private long closedTicketCount;
62
    private long closedTicketCount;
-
 
63
    private String ticketId;
63
    private String lastLogin;
64
    private String lastLogin;
64
    private double cartItems;
65
    private double cartItems;
65
    private String couponCode = "";
66
    private String couponCode = "";
66
 
67
 
67
    @Action("/")
68
    @Action("/")
68
    public String index() throws Exception {
69
    public String index() throws Exception {
69
        try {
70
        try {
70
            createServiceClients();
71
            createServiceClients();
71
 
72
 
72
            if (email == null) {
73
            if (email != null && !email.isEmpty()) {
73
                return INPUT;
74
                user = userContextServiceClient.getUserByEmail(email);
74
            }
75
            }
75
 
-
 
76
            if (email.isEmpty()) {
-
 
77
                if (mobileNumber != null && !mobileNumber.isEmpty()) {
76
            else if (mobileNumber != null && !mobileNumber.isEmpty()) {
78
                    user = userContextServiceClient.getUserByMobileNumber(Long.parseLong(mobileNumber));
77
                user = userContextServiceClient.getUserByMobileNumber(Long.parseLong(mobileNumber));
79
                }
-
 
80
                else {
-
 
81
                    if (orderId != 0) {
-
 
82
                        Order order = transactionServiceClient.getOrder(orderId);
-
 
83
                        user = userContextServiceClient.getUserById(order.getCustomer_id());
-
 
84
                    }
-
 
85
                }
-
 
86
            }
78
            }
-
 
79
            else if (orderId != 0) {
-
 
80
                Order order = transactionServiceClient.getOrder(orderId);
-
 
81
                user = userContextServiceClient.getUserById(order.getCustomer_id());
87
            else {
82
            }
-
 
83
            else if (ticketId != null && !ticketId.isEmpty()) {
-
 
84
                Ticket ticket = crmServiceClient.getTicket(Long.parseLong(ticketId));
88
                user = userContextServiceClient.getUserByEmail(email);
85
                user = userContextServiceClient.getUserById(ticket.getCustomerId());
89
            }
86
            }
90
 
87
 
91
            if (user == null || user.getUserId() <= 0) {
88
            if (user == null || user.getUserId() <= 0) {
92
                addActionError("Invalid Input");
89
                addActionError("Invalid Input");
93
                return INPUT;
90
                return INPUT;
Line 246... Line 243...
246
    }
243
    }
247
 
244
 
248
    public void setMobileNumber(String mobileNumber) {
245
    public void setMobileNumber(String mobileNumber) {
249
        this.mobileNumber = mobileNumber;
246
        this.mobileNumber = mobileNumber;
250
    }
247
    }
-
 
248
 
-
 
249
    public String getTicketId() {
-
 
250
        return ticketId;
-
 
251
    }
-
 
252
 
-
 
253
    public void setTicketId(String ticketId) {
-
 
254
        this.ticketId = ticketId;
-
 
255
    }
251
}
256
}
252
257