| Line 1... |
Line 1... |
| 1 |
package in.shop2020.serving.utils;
|
1 |
package in.shop2020.serving.utils;
|
| 2 |
|
2 |
|
| 3 |
import in.shop2020.config.ConfigException;
|
3 |
import in.shop2020.config.ConfigException;
|
| - |
|
4 |
import in.shop2020.model.v1.catalog.ExclusiveAffiliateItemInfo;
|
| 4 |
import in.shop2020.model.v1.order.LineItem;
|
5 |
import in.shop2020.model.v1.order.LineItem;
|
| 5 |
import in.shop2020.model.v1.order.Order;
|
6 |
import in.shop2020.model.v1.order.Order;
|
| 6 |
import in.shop2020.model.v1.order.RechargeOrderStatus;
|
7 |
import in.shop2020.model.v1.order.RechargeOrderStatus;
|
| 7 |
import in.shop2020.model.v1.order.RechargePlan;
|
8 |
import in.shop2020.model.v1.order.RechargePlan;
|
| 8 |
import in.shop2020.model.v1.order.RechargeType;
|
9 |
import in.shop2020.model.v1.order.RechargeType;
|
| 9 |
import in.shop2020.model.v1.user.Cart;
|
10 |
import in.shop2020.model.v1.user.Cart;
|
| 10 |
import in.shop2020.model.v1.user.Line;
|
11 |
import in.shop2020.model.v1.user.Line;
|
| - |
|
12 |
import in.shop2020.thrift.clients.CatalogClient;
|
| 11 |
import in.shop2020.thrift.clients.TransactionClient;
|
13 |
import in.shop2020.thrift.clients.TransactionClient;
|
| 12 |
import in.shop2020.thrift.clients.config.ConfigClient;
|
14 |
import in.shop2020.thrift.clients.config.ConfigClient;
|
| 13 |
|
15 |
|
| 14 |
import java.util.ArrayList;
|
16 |
import java.util.ArrayList;
|
| 15 |
import java.util.Arrays;
|
17 |
import java.util.Arrays;
|
| 16 |
import java.util.Collections;
|
18 |
import java.util.Collections;
|
| - |
|
19 |
import java.util.Date;
|
| 17 |
import java.util.HashMap;
|
20 |
import java.util.HashMap;
|
| 18 |
import java.util.List;
|
21 |
import java.util.List;
|
| 19 |
import java.util.Map;
|
22 |
import java.util.Map;
|
| 20 |
|
23 |
|
| 21 |
import javax.mail.internet.AddressException;
|
24 |
import javax.mail.internet.AddressException;
|
| Line 37... |
Line 40... |
| 37 |
public static final long CAMERAS_CATEGORY = 11001;
|
40 |
public static final long CAMERAS_CATEGORY = 11001;
|
| 38 |
|
41 |
|
| 39 |
static Map<Long, String> providersMap;
|
42 |
static Map<Long, String> providersMap;
|
| 40 |
static Map<Long, String> mobileProvidersMap;
|
43 |
static Map<Long, String> mobileProvidersMap;
|
| 41 |
static Map<Long, String> dthProvidersMap;
|
44 |
static Map<Long, String> dthProvidersMap;
|
| - |
|
45 |
static Map<Long, ExclusiveAffiliateItemInfo> exclusiveAffiliateItems = null;
|
| 42 |
static Map<Long, List<RechargePlan>> operatorPlanMap = new HashMap<Long, List<RechargePlan>>();
|
46 |
static Map<Long, List<RechargePlan>> operatorPlanMap = new HashMap<Long, List<RechargePlan>>();
|
| 43 |
private static Map<String, Map<String, String>> uriOperatorMap = new HashMap<String, Map<String,String>>();
|
47 |
private static Map<String, Map<String, String>> uriOperatorMap = new HashMap<String, Map<String,String>>();
|
| - |
|
48 |
static long fifteenMinsCounter = 0l;
|
| 44 |
|
49 |
|
| 45 |
public static final List<RechargeOrderStatus> refundableRechargeStatusList = new ArrayList<RechargeOrderStatus>(Arrays.asList(new RechargeOrderStatus[]
|
50 |
public static final List<RechargeOrderStatus> refundableRechargeStatusList = new ArrayList<RechargeOrderStatus>(Arrays.asList(new RechargeOrderStatus[]
|
| 46 |
{RechargeOrderStatus.RECHARGE_FAILED,
|
51 |
{RechargeOrderStatus.RECHARGE_FAILED,
|
| 47 |
RechargeOrderStatus.RECHARGE_FAILED_REFUNDED}));
|
52 |
RechargeOrderStatus.RECHARGE_FAILED_REFUNDED}));
|
| 48 |
|
53 |
|
| Line 163... |
Line 168... |
| 163 |
exportPath = "/var/lib/tomcat6/webapps/export/html/entities/";
|
168 |
exportPath = "/var/lib/tomcat6/webapps/export/html/entities/";
|
| 164 |
}
|
169 |
}
|
| 165 |
return exportPath;
|
170 |
return exportPath;
|
| 166 |
}
|
171 |
}
|
| 167 |
|
172 |
|
| - |
|
173 |
|
| - |
|
174 |
public static Map<Long, ExclusiveAffiliateItemInfo> getExclusiveAffiliateItems(){
|
| - |
|
175 |
try{
|
| - |
|
176 |
CatalogClient client = new CatalogClient();
|
| - |
|
177 |
if(exclusiveAffiliateItems == null || fifteenMinsCounter > new Date().getTime()) {
|
| - |
|
178 |
exclusiveAffiliateItems = client.getClient().getExAffiliateItemInfo();
|
| - |
|
179 |
fifteenMinsCounter = new Date().getTime() + 15*60000;
|
| - |
|
180 |
}
|
| - |
|
181 |
}catch(Exception ce){
|
| - |
|
182 |
logger.error("Unable to fetch exclusive items from catalog", ce);
|
| - |
|
183 |
}
|
| - |
|
184 |
return exclusiveAffiliateItems;
|
| - |
|
185 |
}
|
| - |
|
186 |
|
| 168 |
public static boolean validatePin(String pincode) {
|
187 |
public static boolean validatePin(String pincode) {
|
| 169 |
int pin;
|
188 |
int pin;
|
| 170 |
try {
|
189 |
try {
|
| 171 |
pin = Integer.parseInt(pincode);
|
190 |
pin = Integer.parseInt(pincode);
|
| 172 |
}
|
191 |
}
|