Subversion Repositories SmartDukaan

Rev

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

Rev 7117 Rev 7125
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
 
-
 
5
import in.shop2020.model.v1.order.DenominationType;
-
 
6
import in.shop2020.model.v1.order.DeviceNumberInfo;
3
import in.shop2020.model.v1.order.DeviceNumberInfo;
-
 
4
import in.shop2020.model.v1.order.FRC;
7
import in.shop2020.model.v1.order.HotspotStore;
5
import in.shop2020.model.v1.order.HotspotStore;
8
import in.shop2020.model.v1.order.RechargeDenomination;
6
import in.shop2020.model.v1.order.RechargeDenomination;
9
import in.shop2020.model.v1.order.RechargePlan;
7
import in.shop2020.model.v1.order.RechargePlan;
10
import in.shop2020.model.v1.order.RechargeType;
8
import in.shop2020.model.v1.order.RechargeType;
11
import in.shop2020.thrift.clients.TransactionClient;
9
import in.shop2020.thrift.clients.TransactionClient;
Line 39... Line 37...
39
    private String denominationType;
37
    private String denominationType;
40
    private String circlecode;
38
    private String circlecode;
41
    private List<RechargeDenomination> rechargeDenominations = null;
39
    private List<RechargeDenomination> rechargeDenominations = null;
42
    private static final long serialVersionUID = 2079308723099307749L;
40
    private static final long serialVersionUID = 2079308723099307749L;
43
 
41
 
44
    private String storeIdString;
-
 
45
    private Long storeId;
42
    private Long storeId;
46
    private static Logger log = Logger.getLogger(Class.class);
43
    private static Logger log = Logger.getLogger(Class.class);
47
    private static Map<Long, String> mobileProvidersMap;
44
    private static Map<Long, String> mobileProvidersMap;
48
    private static Map<Long, String> dthProvidersMap;
45
    private static Map<Long, String> dthProvidersMap;
49
    private static Map<Long, List<RechargePlan>> operatorPlanMap;
46
    private static Map<Long, List<RechargePlan>> operatorPlanMap;
Line 106... Line 103...
106
//    }
103
//    }
107
//    
104
//    
108
    public String getServiceProvider() {
105
    public String getServiceProvider() {
109
        return "service-provider";
106
        return "service-provider";
110
    }
107
    }
-
 
108
 
-
 
109
    public String getFRC() {
-
 
110
    	return "frc-result";
-
 
111
    }
-
 
112
    
-
 
113
    public String getFRCJSONString(){
-
 
114
    	long circleId = Long.parseLong((String)(request.getSession().getAttribute("CIRCLE_ID")));
-
 
115
    	TransactionClient tcl;
-
 
116
        try {
-
 
117
            tcl = new TransactionClient();
-
 
118
            List<FRC> frcList =  tcl.getClient().getFRCs(circleId, Long.parseLong(operatorId));
-
 
119
            return new Gson().toJson(frcList);
-
 
120
        } catch (Exception e) {
-
 
121
            log.error("Unable to get service provider for Device number " + deviceNumber + " and rechargeType : " +  deviceType, e);
-
 
122
            return "";
-
 
123
        }
-
 
124
    }
111
    
125
    
112
    public String getProvider(){
126
    public String getProvider(){
113
        TransactionClient tcl;
127
        TransactionClient tcl;
114
        try {
128
        try {
115
            tcl = new TransactionClient();
129
            tcl = new TransactionClient();
Line 228... Line 242...
228
 
242
 
229
    public void setStoreId(Long storeId) {
243
    public void setStoreId(Long storeId) {
230
        this.storeId = storeId;
244
        this.storeId = storeId;
231
    }
245
    }
232
 
246
 
-
 
247
    public String getStoreCircleCode() {
-
 
248
    	return (String)(request.getSession().getAttribute("STORE_CIRCLE_CODE"));
-
 
249
    }
-
 
250
 
233
    public String getRedirectUrl() {
251
    public String getRedirectUrl() {
234
        return redirectUrl;
252
        return redirectUrl;
235
    }
253
    }
236
 
254
 
237
    public void setRedirectUrl(String redirectUrl) {
255
    public void setRedirectUrl(String redirectUrl) {