Subversion Repositories SmartDukaan

Rev

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

Rev 2980 Rev 3125
Line 1... Line 1...
1
package in.shop2020.support.controllers;
1
package in.shop2020.support.controllers;
2
 
2
 
3
import in.shop2020.model.v1.order.LineItem;
3
import in.shop2020.model.v1.order.LineItem;
4
import in.shop2020.model.v1.order.Order;
4
import in.shop2020.model.v1.order.Order;
5
import in.shop2020.model.v1.order.OrderStatus;
5
import in.shop2020.model.v1.order.OrderStatus;
6
import in.shop2020.model.v1.order.TransactionServiceException;
-
 
7
import in.shop2020.model.v1.user.Affiliate;
6
import in.shop2020.model.v1.user.Affiliate;
8
import in.shop2020.model.v1.user.MasterAffiliate;
7
import in.shop2020.model.v1.user.MasterAffiliate;
9
import in.shop2020.model.v1.user.TrackLog;
8
import in.shop2020.model.v1.user.TrackLog;
10
import in.shop2020.model.v1.user.UserContextService.Client;
9
import in.shop2020.model.v1.user.UserContextService.Client;
11
import in.shop2020.payments.Payment;
10
import in.shop2020.payments.Payment;
12
import in.shop2020.thrift.clients.PaymentServiceClient;
11
import in.shop2020.thrift.clients.PaymentClient;
13
import in.shop2020.thrift.clients.TransactionServiceClient;
12
import in.shop2020.thrift.clients.TransactionClient;
14
import in.shop2020.thrift.clients.UserContextServiceClient;
13
import in.shop2020.thrift.clients.UserClient;
15
 
14
 
16
import java.io.ByteArrayOutputStream;
15
import java.io.ByteArrayOutputStream;
17
import java.io.IOException;
16
import java.io.IOException;
18
import java.text.ParseException;
-
 
19
import java.util.ArrayList;
17
import java.util.ArrayList;
20
import java.util.Date;
18
import java.util.Date;
21
import java.util.HashMap;
19
import java.util.HashMap;
22
import java.util.HashSet;
20
import java.util.HashSet;
23
import java.util.LinkedList;
21
import java.util.LinkedList;
Line 67... Line 65...
67
    }
65
    }
68
	
66
	
69
	public String index()  {
67
	public String index()  {
70
	    
68
	    
71
        try {
69
        try {
72
            UserContextServiceClient userContextServiceClient = new UserContextServiceClient();
70
        	UserClient userContextServiceClient = new UserClient();
73
            Client userClient = userContextServiceClient.getClient();
71
            Client userClient = userContextServiceClient.getClient();
74
            masterAffiliates = userClient.getAllMasterAffiliates();
72
            masterAffiliates = userClient.getAllMasterAffiliates();
75
        } catch (Exception e) {
73
        } catch (Exception e) {
76
            e.printStackTrace();
74
            e.printStackTrace();
77
        }
75
        }
Line 79... Line 77...
79
    }
77
    }
80
	
78
	
81
	public String create()	{
79
	public String create()	{
82
	    try   {
80
	    try   {
83
	        long mAfId = Long.parseLong(request.getParameter("masterAffiliate"));
81
	        long mAfId = Long.parseLong(request.getParameter("masterAffiliate"));
84
            UserContextServiceClient userContextServiceClient = new UserContextServiceClient();
82
	        UserClient userContextServiceClient = new UserClient();
85
            PaymentServiceClient paymentServiceClient = new PaymentServiceClient();
83
            PaymentClient paymentServiceClient = new PaymentClient();
86
            TransactionServiceClient transactionServiceClient = new TransactionServiceClient();
84
            TransactionClient transactionServiceClient = new TransactionClient();
87
            
85
            
88
            Client userClient = userContextServiceClient.getClient();
86
            Client userClient = userContextServiceClient.getClient();
89
            in.shop2020.payments.PaymentService.Client paymentClient = paymentServiceClient.getClient();
87
            in.shop2020.payments.PaymentService.Client paymentClient = paymentServiceClient.getClient();
90
            
88
            
91
            Set<Long> Payments = new HashSet<Long>();
89
            Set<Long> Payments = new HashSet<Long>();
Line 166... Line 164...
166
                sos.flush();
164
                sos.flush();
167
            } catch (IOException e) {
165
            } catch (IOException e) {
168
                errorMsg = "Failed to write to response.";
166
                errorMsg = "Failed to write to response.";
169
                e.printStackTrace();
167
                e.printStackTrace();
170
            }
168
            }
171
 
-
 
172
        } catch (ParseException e)  {
-
 
173
            errorMsg = e.getMessage();
-
 
174
            e.printStackTrace();
-
 
175
        } catch (TransactionServiceException e) {
-
 
176
            errorMsg = e.getMessage();
-
 
177
            e.printStackTrace();
-
 
178
        } catch (Exception e)   {
169
        } catch (Exception e)   {
179
            errorMsg = e.getMessage();
170
            errorMsg = e.getMessage();
180
            e.printStackTrace();
171
            e.printStackTrace();
181
        }
172
        }
182
        return null;
173
        return null;