Subversion Repositories SmartDukaan

Rev

Rev 7255 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
7226 anupam.sin 1
package in.shop2020.serving.controllers;
2
 
3
import in.shop2020.model.v1.order.DeviceNumberInfo;
4
import in.shop2020.model.v1.order.FRC;
5
import in.shop2020.model.v1.order.HotspotStore;
6
import in.shop2020.model.v1.order.RechargeDenomination;
7
import in.shop2020.model.v1.order.RechargePlan;
8
import in.shop2020.model.v1.order.RechargeType;
9
import in.shop2020.thrift.clients.TransactionClient;
10
 
11
import java.util.HashMap;
12
import java.util.List;
13
import java.util.Map;
14
 
15
import org.apache.log4j.Logger;
16
import org.apache.struts2.convention.annotation.Result;
17
import org.apache.struts2.convention.annotation.Results;
18
 
19
import com.google.gson.Gson;
20
 
21
@Results({
22
    @Result(name = "redirect", location = "${redirectUrl}", type = "redirect")
23
})
24
 
25
public class HomeController extends BaseController {
26
 
27
    /**
28
     * 
29
     */
30
    private String deviceType = null; //Default is Mobile , 2 is for DTH
31
    private String deviceNumber = "";
32
    private String form = "";
33
    private String error = "";
34
    private String operatorId;
35
    private String operatorName;
36
    private String serviceName;
37
    private String denominationType;
38
    private String circlecode;
39
    private List<RechargeDenomination> rechargeDenominations = null;
40
    private static final long serialVersionUID = 2079308723099307749L;
41
 
42
    private Long storeId;
43
    private static Logger log = Logger.getLogger(Class.class);
44
    private static Map<Long, String> mobileProvidersMap;
45
    private static Map<Long, String> dthProvidersMap;
46
    private static Map<Long, List<RechargePlan>> operatorPlanMap;
47
    public static Map<Long, HotspotStore> hotspotStores = new HashMap<Long, HotspotStore>();
48
    private String errorMsg = "";
49
    private String redirectUrl;
50
 
51
 
52
    public String index() {
53
        return "index";
54
    }
55
 
56
    public void setDeviceType(String incomingdeviceType) {
57
        deviceType = incomingdeviceType;
58
    }
59
 
60
    public void setDeviceNumber(String deviceNumber){
61
        this.deviceNumber = deviceNumber;
62
    }
63
 
64
    public String getDeviceType() {
65
        return deviceType;
66
    }
67
 
68
    public String getForm() {
69
        return form;
70
    }
71
 
72
    public void setForm(String form) {
73
        this.form = form;
74
    }
75
 
76
    public String getError() {
77
        return error;
78
    }
79
 
80
    public void setError(String error) {
81
        this.error = error;
82
    }
83
 
84
    public String getPageName() {
85
        return operatorName  + " online recharge";
86
    }
87
 
88
    public String getPageTitle() {
89
        return operatorName  + " online recharge";
90
    }
91
 
92
    public String getPageMetaDesc() {
93
        return "Recharge your " + this.operatorName +  " " + this.serviceName +  " online for all cities using Credit/Debit card & net banking. Fast, Secure and Hassle Free Recharge";
94
    }
95
 
96
    public String getPageMetaKeywords() {
97
        return "mobile, recharge";
98
    }
99
 
100
    public long getOperatorId(){
101
        return Long.parseLong(this.operatorId);
102
    }
103
 
104
    public String getDenominationType() {
105
        return denominationType;
106
    }
107
 
108
    public void setDenominationType(String denominationType) {
109
        this.denominationType = denominationType;
110
    }
111
 
112
    public String getCirclecode() {
113
        return circlecode;
114
    }
115
 
116
    public void setCircleCode(String circlecode) {
117
        this.circlecode = circlecode;
118
    }
119
 
120
    public List<RechargeDenomination> getRechargeDenominations() {
121
        return rechargeDenominations;
122
    }
123
 
124
    public void setRechargeDenominations(
125
            List<RechargeDenomination> rechargeDenominations) {
126
        this.rechargeDenominations = rechargeDenominations;
127
    }
128
 
129
    public void setOperatorId(String operatorId) {
130
        this.operatorId = operatorId;
131
    }
132
 
133
    public void setErrorMsg(String errorMsg) {
134
        this.errorMsg = errorMsg;
135
    }
136
 
137
    public String getErrorMsg() {
138
        return errorMsg;
139
    }
140
 
141
    public static void setDthProvidersMap(Map<Long, String> dthProvidersMap) {
142
        HomeController.dthProvidersMap = dthProvidersMap;
143
    }
144
 
145
    public static Map<Long, String> getDthProvidersMap() {
146
        return dthProvidersMap;
147
    }
148
 
149
    public static void setMobileProvidersMap(Map<Long, String> mobileProvidersMap) {
150
        HomeController.mobileProvidersMap = mobileProvidersMap;
151
    }
152
 
153
    public static Map<Long, String> getMobileProvidersMap() {
154
        return mobileProvidersMap;
155
    }
156
 
157
    public Long getStoreId() {
158
        return storeId;
159
    }
160
 
161
    public void setStoreId(Long storeId) {
162
        this.storeId = storeId;
163
    }
164
 
165
    public String getStoreCircleCode() {
166
    	return (String)(request.getSession().getAttribute("STORE_CIRCLE_CODE"));
167
    }
168
 
169
    public String getRedirectUrl() {
170
        return redirectUrl;
171
    }
172
 
173
    public void setRedirectUrl(String redirectUrl) {
174
        this.redirectUrl = redirectUrl;
175
    }
176
 
177
    public String getStoreCode(){
178
    	return hotspotStores.get(storeId).getHotspotId();	
179
    }
180
 
181
    public String getCollectedAmount(){
182
    	return hotspotStores.get(storeId).getCollectedAmount()+"";
183
    }
184
 
185
}