Subversion Repositories SmartDukaan

Rev

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

Rev 5775 Rev 5814
Line 1... Line 1...
1
package in.shop2020.support.controllers;
1
package in.shop2020.support.controllers;
2
 
2
 
3
 
3
 
4
 
4
 
5
import in.shop2020.logistics.LogisticsServiceException;
5
import in.shop2020.logistics.LogisticsServiceException;
-
 
6
import in.shop2020.logistics.PickupStore;
6
import in.shop2020.logistics.Provider;
7
import in.shop2020.logistics.Provider;
7
import in.shop2020.model.v1.order.Attribute;
8
import in.shop2020.model.v1.order.Attribute;
8
import in.shop2020.model.v1.order.LineItem;
9
import in.shop2020.model.v1.order.LineItem;
9
import in.shop2020.model.v1.order.Order;
10
import in.shop2020.model.v1.order.Order;
10
import in.shop2020.model.v1.order.TransactionService.Client;
11
import in.shop2020.model.v1.order.TransactionService.Client;
11
import in.shop2020.model.v1.order.TransactionServiceException;
12
import in.shop2020.model.v1.order.TransactionServiceException;
-
 
13
import in.shop2020.support.utils.ReportsUtils;
12
import in.shop2020.thrift.clients.LogisticsClient;
14
import in.shop2020.thrift.clients.LogisticsClient;
13
import in.shop2020.thrift.clients.TransactionClient;
15
import in.shop2020.thrift.clients.TransactionClient;
14
 
16
 
15
import java.io.ByteArrayOutputStream;
17
import java.io.ByteArrayOutputStream;
16
import java.io.IOException;
18
import java.io.IOException;
Line 120... Line 122...
120
    	}
122
    	}
121
    	return "index";
123
    	return "index";
122
    }
124
    }
123
 
125
 
124
    public String show(){
126
    public String show(){
-
 
127
    	if(id.equalsIgnoreCase("admin")){
-
 
128
    		if(!ReportsUtils.canAccessReport((Long)request.getSession().getAttribute(ReportsUtils.ROLE), request.getServletPath())) {
-
 
129
                return "authfail";
-
 
130
            }
-
 
131
    		return "admin";
-
 
132
    	}
125
    	storeIdString = (String) request.getSession().getAttribute("STORE_ID");
133
    	storeIdString = (String) request.getSession().getAttribute("STORE_ID");
126
    	if(storeIdString == null){
134
    	if(storeIdString == null){
127
    		storeIdString = request.getParameter("storeid");
135
    		storeIdString = request.getParameter("storeid");
128
    		if(storeIdString == null){
136
    		if(storeIdString == null){
129
    			return "authfail";
137
    			return "authfail";
Line 381... Line 389...
381
    }
389
    }
382
	
390
	
383
	public  List<Provider> getAllProviders() throws TTransportException, LogisticsServiceException, TException{
391
	public  List<Provider> getAllProviders() throws TTransportException, LogisticsServiceException, TException{
384
		return (new LogisticsClient()).getClient().getAllProviders();
392
		return (new LogisticsClient()).getClient().getAllProviders();
385
	}
393
	}
-
 
394
	
-
 
395
	public List<PickupStore> getAllStores() throws TTransportException, TException{
-
 
396
		return (new LogisticsClient()).getClient().getAllPickupStores();
-
 
397
	}
386
}
398
}