Subversion Repositories SmartDukaan

Rev

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

Rev 5714 Rev 5719
Line 5... Line 5...
5
import in.shop2020.model.v1.order.Attribute;
5
import in.shop2020.model.v1.order.Attribute;
6
import in.shop2020.model.v1.order.LineItem;
6
import in.shop2020.model.v1.order.LineItem;
7
import in.shop2020.model.v1.order.Order;
7
import in.shop2020.model.v1.order.Order;
8
import in.shop2020.model.v1.order.TransactionService.Client;
8
import in.shop2020.model.v1.order.TransactionService.Client;
9
import in.shop2020.model.v1.order.TransactionServiceException;
9
import in.shop2020.model.v1.order.TransactionServiceException;
-
 
10
import in.shop2020.thrift.clients.LogisticsClient;
10
import in.shop2020.thrift.clients.TransactionClient;
11
import in.shop2020.thrift.clients.TransactionClient;
11
 
12
 
12
import java.io.ByteArrayOutputStream;
13
import java.io.ByteArrayOutputStream;
13
import java.io.IOException;
14
import java.io.IOException;
14
import java.text.DateFormat;
15
import java.text.DateFormat;
Line 82... Line 83...
82
 
83
 
83
    public String getServletContextPath() {
84
    public String getServletContextPath() {
84
        return context.getContextPath();
85
        return context.getContextPath();
85
    }
86
    }
86
 
87
 
87
    public String index(){
88
    public String index() throws TTransportException, TException{
88
    	storeIdString = (String) request.getSession().getAttribute("STORE_ID");
89
    	storeIdString = (String) request.getSession().getAttribute("STORE_ID");
89
    	if(storeIdString == null){
90
    	if(storeIdString == null){
90
    		storeIdString = request.getParameter("storeid");
91
    		storeIdString = request.getParameter("storeid");
91
    		if(storeIdString == null){
92
    		if(storeIdString == null){
92
    			return "authfail";
93
    			return "authfail";
93
    		}else{
94
    		}else{
-
 
95
    			try {
-
 
96
					storeIdString = Long.toString((new LogisticsClient()).getClient().getPickupStoreByHotspotId(storeIdString).getId());
-
 
97
				} catch (TTransportException e) {
-
 
98
					e.printStackTrace();
-
 
99
					return "authfail";
-
 
100
				} catch (TException e) {
-
 
101
					e.printStackTrace();
-
 
102
					return "authfail";
-
 
103
				}
94
    			request.getSession().setAttribute("STORE_ID", storeIdString);
104
    			request.getSession().setAttribute("STORE_ID", storeIdString);
95
    		}
105
    		}
96
    	}
106
    	}
97
    	storeId = Long.parseLong(storeIdString);
107
    	storeId = Long.parseLong(storeIdString);
98
    	return "index";
108
    	return "index";
Line 103... Line 113...
103
    	if(storeIdString == null){
113
    	if(storeIdString == null){
104
    		storeIdString = request.getParameter("storeid");
114
    		storeIdString = request.getParameter("storeid");
105
    		if(storeIdString == null){
115
    		if(storeIdString == null){
106
    			return "authfail";
116
    			return "authfail";
107
    		}else{
117
    		}else{
-
 
118
    			try {
-
 
119
					storeIdString = Long.toString((new LogisticsClient()).getClient().getPickupStoreByHotspotId(storeIdString).getId());
-
 
120
				} catch (TTransportException e) {
-
 
121
					e.printStackTrace();
-
 
122
					return "authfail";
-
 
123
				} catch (TException e) {
-
 
124
					e.printStackTrace();
-
 
125
					return "authfail";
-
 
126
				}
108
    			request.getSession().setAttribute("STORE_ID", storeIdString);
127
    			request.getSession().setAttribute("STORE_ID", storeIdString);
109
    		}
128
    		}
110
    	}
129
    	}
111
    	storeId = Long.parseLong(storeIdString);
130
    	storeId = Long.parseLong(storeIdString);
112
    	return "show";
131
    	return "show";