| 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.order.LineItem;
|
4 |
import in.shop2020.model.v1.order.LineItem;
|
| 5 |
import in.shop2020.model.v1.order.Order;
|
5 |
import in.shop2020.model.v1.order.Order;
|
| - |
|
6 |
import in.shop2020.model.v1.order.RechargeOrderStatus;
|
| 6 |
import in.shop2020.model.v1.order.RechargePlan;
|
7 |
import in.shop2020.model.v1.order.RechargePlan;
|
| 7 |
import in.shop2020.model.v1.order.RechargeType;
|
8 |
import in.shop2020.model.v1.order.RechargeType;
|
| 8 |
import in.shop2020.model.v1.user.Cart;
|
9 |
import in.shop2020.model.v1.user.Cart;
|
| 9 |
import in.shop2020.model.v1.user.Line;
|
10 |
import in.shop2020.model.v1.user.Line;
|
| 10 |
import in.shop2020.thrift.clients.TransactionClient;
|
11 |
import in.shop2020.thrift.clients.TransactionClient;
|
| 11 |
import in.shop2020.thrift.clients.config.ConfigClient;
|
12 |
import in.shop2020.thrift.clients.config.ConfigClient;
|
| 12 |
|
13 |
|
| 13 |
import java.util.ArrayList;
|
14 |
import java.util.ArrayList;
|
| - |
|
15 |
import java.util.Arrays;
|
| 14 |
import java.util.HashMap;
|
16 |
import java.util.HashMap;
|
| 15 |
import java.util.List;
|
17 |
import java.util.List;
|
| 16 |
import java.util.Map;
|
18 |
import java.util.Map;
|
| 17 |
|
19 |
|
| 18 |
import javax.mail.internet.AddressException;
|
20 |
import javax.mail.internet.AddressException;
|
| Line 37... |
Line 39... |
| 37 |
static Map<Long, String> mobileProvidersMap;
|
39 |
static Map<Long, String> mobileProvidersMap;
|
| 38 |
static Map<Long, String> dthProvidersMap;
|
40 |
static Map<Long, String> dthProvidersMap;
|
| 39 |
static Map<Long, List<RechargePlan>> operatorPlanMap = new HashMap<Long, List<RechargePlan>>();
|
41 |
static Map<Long, List<RechargePlan>> operatorPlanMap = new HashMap<Long, List<RechargePlan>>();
|
| 40 |
private static Map<String, Map<String, String>> uriOperatorMap = new HashMap<String, Map<String,String>>();
|
42 |
private static Map<String, Map<String, String>> uriOperatorMap = new HashMap<String, Map<String,String>>();
|
| 41 |
|
43 |
|
| - |
|
44 |
public static final List<RechargeOrderStatus> refundableRechargeStatusList = new ArrayList<RechargeOrderStatus>(Arrays.asList(new RechargeOrderStatus[]
|
| - |
|
45 |
{RechargeOrderStatus.RECHARGE_FAILED,
|
| - |
|
46 |
RechargeOrderStatus.RECHARGE_FAILED_REFUNDED,
|
| - |
|
47 |
RechargeOrderStatus.PAYMENT_SUCCESSFUL}));
|
| - |
|
48 |
|
| - |
|
49 |
public static Map<RechargeOrderStatus, String> statusMap = new HashMap<RechargeOrderStatus, String>();
|
| - |
|
50 |
|
| 42 |
public static String[] facetDefIDs = new String[] {
|
51 |
public static String[] facetDefIDs = new String[] {
|
| 43 |
"F_50010","F_50011","F_50002","F_50001", "F_50006", "F_50007", "F_50012", "F_50013", "F_50014", "F_50015", "F_50017", "F_50018", "F_50019", "F_50020", "F_50021", "F_50022", "F_50023", "F_50024", "F_50025", "F_50026", "F_50027" };
|
52 |
"F_50010","F_50011","F_50002","F_50001", "F_50006", "F_50007", "F_50012", "F_50013", "F_50014", "F_50015", "F_50017", "F_50018", "F_50019", "F_50020", "F_50021", "F_50022", "F_50023", "F_50024", "F_50025", "F_50026", "F_50027" };
|
| 44 |
public static String[] facetLabels = new String[] {"Category","Sub Category","Price", "Brand", "Data Connectivity",
|
53 |
public static String[] facetLabels = new String[] {"Category","Sub Category","Price", "Brand", "Data Connectivity",
|
| 45 |
"Camera Resolution", "Display", "Operating System", "RAM", "Storage Capacity", "Processor",
|
54 |
"Camera Resolution", "Display", "Operating System", "RAM", "Storage Capacity", "Processor",
|
| 46 |
"Capacity", "Class", "Capacity", "Capacity", "Type", "Interface", "Resolution", "Optical Zoom", "Display Size", "Effective Resolution" };
|
55 |
"Capacity", "Class", "Capacity", "Capacity", "Type", "Interface", "Resolution", "Optical Zoom", "Display Size", "Effective Resolution" };
|
| 47 |
public static String[] rootfacetDefIDs = new String[] {"F_50010","F_50011","F_50002","F_50001"};
|
56 |
public static String[] rootfacetDefIDs = new String[] {"F_50010","F_50011","F_50002","F_50001"};
|
| 48 |
public static String[] rootfacetLabels = new String[] {"Category","Sub Category","Price", "Brand"};
|
57 |
public static String[] rootfacetLabels = new String[] {"Category","Sub Category","Price", "Brand"};
|
| 49 |
|
58 |
|
| 50 |
static {
|
59 |
static {
|
| - |
|
60 |
statusMap.put(RechargeOrderStatus.PAYMENT_FAILED, "Payment Unsuccessful");
|
| - |
|
61 |
statusMap.put(RechargeOrderStatus.PAYMENT_SUCCESSFUL, "Processing Recharge");
|
| - |
|
62 |
statusMap.put(RechargeOrderStatus.RECHARGE_FAILED, "Recharge Failed");
|
| - |
|
63 |
statusMap.put(RechargeOrderStatus.RECHARGE_FAILED_REFUNDED, "Recharge Failed");
|
| - |
|
64 |
statusMap.put(RechargeOrderStatus.RECHARGE_SUCCESSFUL, "Recharge Successful");
|
| - |
|
65 |
statusMap.put(RechargeOrderStatus.REFUNDED, "Amount Refunded");
|
| - |
|
66 |
statusMap.put(RechargeOrderStatus.PARTIALLY_REFUNDED, "Amount Refunded");
|
| - |
|
67 |
|
| 51 |
TransactionClient tcl;
|
68 |
TransactionClient tcl;
|
| 52 |
try {
|
69 |
try {
|
| 53 |
tcl = new TransactionClient();
|
70 |
tcl = new TransactionClient();
|
| 54 |
mobileProvidersMap = tcl.getClient().getServiceProviders(RechargeType.MOBILE, true);
|
71 |
mobileProvidersMap = tcl.getClient().getServiceProviders(RechargeType.MOBILE, true);
|
| 55 |
dthProvidersMap = tcl.getClient().getServiceProviders(RechargeType.DTH, true);
|
72 |
dthProvidersMap = tcl.getClient().getServiceProviders(RechargeType.DTH, true);
|
| Line 75... |
Line 92... |
| 75 |
valueMap.put("Name", dthProvidersMap.get(operatorId)+"");
|
92 |
valueMap.put("Name", dthProvidersMap.get(operatorId)+"");
|
| 76 |
valueMap.put("ServiceType", "2");
|
93 |
valueMap.put("ServiceType", "2");
|
| 77 |
valueMap.put("ServiceName", "DTH TV");
|
94 |
valueMap.put("ServiceName", "DTH TV");
|
| 78 |
uriOperatorMap.put(dthProvidersMap.get(operatorId).toLowerCase().trim().replace(" ", "-")+"-online-recharge", valueMap);
|
95 |
uriOperatorMap.put(dthProvidersMap.get(operatorId).toLowerCase().trim().replace(" ", "-")+"-online-recharge", valueMap);
|
| 79 |
}
|
96 |
}
|
| - |
|
97 |
|
| 80 |
Map<String,String> valueMap = new HashMap<String,String>();
|
98 |
Map<String,String> valueMap = new HashMap<String,String>();
|
| 81 |
valueMap.put("Id", "0");
|
99 |
valueMap.put("Id", "0");
|
| 82 |
valueMap.put("Name", "Mobile and DTH");
|
100 |
valueMap.put("Name", "Mobile and DTH");
|
| 83 |
valueMap.put("ServiceType", "1");
|
101 |
valueMap.put("ServiceType", "1");
|
| 84 |
valueMap.put("ServiceName", "");
|
102 |
valueMap.put("ServiceName", "");
|
| 85 |
uriOperatorMap.put("recharge", valueMap);
|
103 |
uriOperatorMap.put("recharge", valueMap);
|
| 86 |
// providersMap.putAll(tcl.getClient().getServiceProviders(RechargeType.DTH));
|
104 |
// providersMap.putAll(tcl.getClient().getServiceProviders(RechargeType.DTH));
|
| - |
|
105 |
|
| - |
|
106 |
|
| 87 |
} catch (Exception e) {
|
107 |
} catch (Exception e) {
|
| 88 |
logger.error("Could not get providers", e);
|
108 |
logger.error("Could not get providers", e);
|
| 89 |
}
|
109 |
}
|
| 90 |
}
|
110 |
}
|
| 91 |
|
111 |
|