Subversion Repositories SmartDukaan

Rev

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

Rev 7387 Rev 7572
Line 6... Line 6...
6
import in.shop2020.crm.SearchFilter;
6
import in.shop2020.crm.SearchFilter;
7
import in.shop2020.crm.Ticket;
7
import in.shop2020.crm.Ticket;
8
import in.shop2020.crm.TicketCategory;
8
import in.shop2020.crm.TicketCategory;
9
import in.shop2020.crm.TicketStatus;
9
import in.shop2020.crm.TicketStatus;
10
import in.shop2020.model.v1.order.Order;
10
import in.shop2020.model.v1.order.Order;
-
 
11
import in.shop2020.model.v1.order.OrderSource;
11
import in.shop2020.model.v1.order.OrderStatus;
12
import in.shop2020.model.v1.order.OrderStatus;
12
import in.shop2020.model.v1.order.RechargeOrder;
13
import in.shop2020.model.v1.order.RechargeOrder;
13
import in.shop2020.model.v1.order.RechargeOrderStatus;
14
import in.shop2020.model.v1.order.RechargeOrderStatus;
14
import in.shop2020.model.v1.order.TransactionServiceException;
15
import in.shop2020.model.v1.order.TransactionServiceException;
15
import in.shop2020.model.v1.order.UserWallet;
16
import in.shop2020.model.v1.order.UserWallet;
Line 80... Line 81...
80
 
81
 
81
    private long                orderCancellationCount;
82
    private long                orderCancellationCount;
82
 
83
 
83
    private long                rechargeOrderCount = 0;
84
    private long                rechargeOrderCount = 0;
84
    
85
    
-
 
86
    private String              amazonOrderItemCode;
-
 
87
    
85
    //Start:- Added by Manish Sharma for Displaying wallet amount at user page on June-05-2013
88
    //Start:- Added by Manish Sharma for Displaying wallet amount at user page on June-05-2013
86
    private UserWallet          wallet = null;
89
    private UserWallet          wallet = null;
87
    
90
    
88
    private long                walletAmount;
91
    private long                walletAmount;
89
    //End:- Added by Manish Sharma for Displaying wallet amount at user page on June-05-2013
92
    //End:- Added by Manish Sharma for Displaying wallet amount at user page on June-05-2013
-
 
93
    
-
 
94
    private List<Order> orders = new ArrayList<Order>();
-
 
95
    
-
 
96
    private String amazonId;
-
 
97
    
90
 
98
 
91
    @Action("/")
99
    @Action("/")
92
    public String index() throws Exception {
100
    public String index() throws Exception {
93
        String returnValue = INPUT;
101
        String returnValue = INPUT;
94
 
102
 
Line 96... Line 104...
96
            if (email == null) {
104
            if (email == null) {
97
                loadTicketCounts();
105
                loadTicketCounts();
98
                loadCustomerActivities();
106
                loadCustomerActivities();
99
                return returnValue;
107
                return returnValue;
100
            }
108
            }
-
 
109
            
-
 
110
            if (mobileNumber != null && !mobileNumber.isEmpty()) {
-
 
111
                transactionServiceClient = new TransactionClient().getClient();
-
 
112
                setOrders(transactionServiceClient.getOrdersByMobileNumber(mobileNumber));
-
 
113
                return "orders-index";
-
 
114
            }
101
 
115
            
-
 
116
            if (amazonId != null && !amazonId.isEmpty()) {
-
 
117
                transactionServiceClient = new TransactionClient().getClient();
-
 
118
                setOrders(transactionServiceClient.getOrdersByAmazonOrderItemCode(amazonId));
-
 
119
                return "orders-index";
-
 
120
            }
-
 
121
            
102
            userContextServiceClient = new UserClient().getClient();
122
            userContextServiceClient = new UserClient().getClient();
103
            if (email != null && !email.isEmpty()) {
123
            if (email != null && !email.isEmpty()) {
104
                user = userContextServiceClient.getUserByEmail(email);
124
                user = userContextServiceClient.getUserByEmail(email);
105
            } else if (mobileNumber != null && !mobileNumber.isEmpty()) {
-
 
106
                user = userContextServiceClient.getUserByMobileNumber(Long
-
 
107
                        .parseLong(mobileNumber));
-
 
108
            } else if (orderId != null && !orderId.isEmpty()) {
125
            } else if (orderId != null && !orderId.isEmpty()) {
109
                transactionServiceClient = new TransactionClient().getClient();
126
                transactionServiceClient = new TransactionClient().getClient();
110
                Order order = transactionServiceClient.getOrder(Long
127
                Order order = transactionServiceClient.getOrder(Long
111
                        .parseLong(orderId));
128
                        .parseLong(orderId));
112
                user = userContextServiceClient.getUserById(order
129
                user = userContextServiceClient.getUserById(order
Line 384... Line 401...
384
                    closedTicketCount++;
401
                    closedTicketCount++;
385
                }
402
                }
386
            }
403
            }
387
        }
404
        }
388
    }
405
    }
-
 
406
    
-
 
407
    public String getSourceName(long source) {
-
 
408
        return OrderSource.findByValue((int) source).toString();
-
 
409
    }
-
 
410
    
389
 
411
 
390
    public String getToday() {
412
    public String getToday() {
391
        return SDF.format(new Date());
413
        return SDF.format(new Date());
392
    }
414
    }
393
 
415
 
Line 649... Line 671...
649
	public void setWalletAmount(long walletAmount) {
671
	public void setWalletAmount(long walletAmount) {
650
		this.walletAmount = walletAmount;
672
		this.walletAmount = walletAmount;
651
	}
673
	}
652
	//End:- Added by Manish Sharma for Displaying wallet amount at user page on June-05-2013
674
	//End:- Added by Manish Sharma for Displaying wallet amount at user page on June-05-2013
653
 
675
 
-
 
676
    public void setOrders(List<Order> orders) {
-
 
677
        this.orders = orders;
-
 
678
    }
-
 
679
 
-
 
680
    public List<Order> getOrders() {
-
 
681
        return orders;
-
 
682
    }
-
 
683
 
-
 
684
    public void setAmazonOrderItemCode(String amazonOrderItemCode) {
-
 
685
        this.amazonOrderItemCode = amazonOrderItemCode;
-
 
686
    }
-
 
687
 
-
 
688
    public String getAmazonOrderItemCode() {
-
 
689
        return amazonOrderItemCode;
-
 
690
    }
-
 
691
 
-
 
692
    public void setAmazonId(String amazonId) {
-
 
693
        this.amazonId = amazonId;
-
 
694
    }
-
 
695
 
-
 
696
    public String getAmazonId() {
-
 
697
        return amazonId;
-
 
698
    }
-
 
699
 
654
}
700
}
655
701