Subversion Repositories SmartDukaan

Rev

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