Subversion Repositories SmartDukaan

Rev

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

Rev 7096 Rev 7113
Line 1... Line 1...
1
package in.shop2020.recharge.controllers;
1
package in.shop2020.recharge.controllers;
2
 
2
 
-
 
3
import in.shop2020.model.v1.order.HotspotStore;
-
 
4
 
3
import in.shop2020.model.v1.order.DenominationType;
5
import in.shop2020.model.v1.order.DenominationType;
4
import in.shop2020.model.v1.order.DeviceNumberInfo;
6
import in.shop2020.model.v1.order.DeviceNumberInfo;
-
 
7
import in.shop2020.model.v1.order.HotspotStore;
5
import in.shop2020.model.v1.order.RechargeDenomination;
8
import in.shop2020.model.v1.order.RechargeDenomination;
6
import in.shop2020.model.v1.order.RechargePlan;
9
import in.shop2020.model.v1.order.RechargePlan;
7
import in.shop2020.model.v1.order.RechargeType;
10
import in.shop2020.model.v1.order.RechargeType;
8
import in.shop2020.thrift.clients.TransactionClient;
11
import in.shop2020.thrift.clients.TransactionClient;
9
 
12
 
Line 42... Line 45...
42
    private Long storeId;
45
    private Long storeId;
43
    private static Logger log = Logger.getLogger(Class.class);
46
    private static Logger log = Logger.getLogger(Class.class);
44
    private static Map<Long, String> mobileProvidersMap;
47
    private static Map<Long, String> mobileProvidersMap;
45
    private static Map<Long, String> dthProvidersMap;
48
    private static Map<Long, String> dthProvidersMap;
46
    private static Map<Long, List<RechargePlan>> operatorPlanMap;
49
    private static Map<Long, List<RechargePlan>> operatorPlanMap;
-
 
50
    private static Map<Long, HotspotStore> hotspotStores = new HashMap<Long, HotspotStore>();
47
    private String errorMsg = "";
51
    private String errorMsg = "";
48
    private String redirectUrl;
52
    private String redirectUrl;
49
    
53
    
50
    
54
    
51
    static {
55
    static {
Line 73... Line 77...
73
    
77
    
74
    public String index() {
78
    public String index() {
75
        
79
        
76
        String loginStatus = (String) request.getSession().getAttribute("LOGGED_IN");
80
        String loginStatus = (String) request.getSession().getAttribute("LOGGED_IN");
77
        if(loginStatus != null && loginStatus.equals("TRUE")){
81
        if(loginStatus != null && loginStatus.equals("TRUE")){
-
 
82
        	storeId = Long.parseLong((String) request.getSession().getAttribute("storeid"));
-
 
83
        	if(!hotspotStores.containsKey(storeId)){
-
 
84
        		HotspotStore hotSpotStore = (new TransactionClient()).getClient().getHotspotStore(storeId, "");
-
 
85
        		hotspotStores.put(storeId, hotSpotStore);
-
 
86
        	}
78
            return "index";
87
            return "index";
79
        }
88
        }
80
        return "authfail";
89
        return "authfail";
81
    }
90
    }
82
    
91
    
Line 222... Line 231...
222
    }
231
    }
223
 
232
 
224
    public void setRedirectUrl(String redirectUrl) {
233
    public void setRedirectUrl(String redirectUrl) {
225
        this.redirectUrl = redirectUrl;
234
        this.redirectUrl = redirectUrl;
226
    }
235
    }
-
 
236
    
-
 
237
    public String getStoreCode(){
-
 
238
    	return hotspotStores.get(storeId).getHotspotId();	
-
 
239
    }
-
 
240
	
-
 
241
    public String getCollectedAmount(){
-
 
242
    	return hotspotStores.get(storeId).getCollectedAmount()+"";
-
 
243
    }
-
 
244
	
227
}
245
}
228
246