| Line 10... |
Line 10... |
| 10 |
import java.util.Map;
|
10 |
import java.util.Map;
|
| 11 |
|
11 |
|
| 12 |
import in.shop2020.logistics.Provider;
|
12 |
import in.shop2020.logistics.Provider;
|
| 13 |
import in.shop2020.model.v1.order.Order;
|
13 |
import in.shop2020.model.v1.order.Order;
|
| 14 |
import in.shop2020.model.v1.order.OrderStatus;
|
14 |
import in.shop2020.model.v1.order.OrderStatus;
|
| - |
|
15 |
import in.shop2020.model.v1.order.OrderStatusGroups;
|
| 15 |
import in.shop2020.serving.utils.FormattingUtils;
|
16 |
import in.shop2020.serving.utils.FormattingUtils;
|
| 16 |
import in.shop2020.thrift.clients.LogisticsClient;
|
17 |
import in.shop2020.thrift.clients.LogisticsClient;
|
| 17 |
import in.shop2020.thrift.clients.TransactionClient;
|
18 |
import in.shop2020.thrift.clients.TransactionClient;
|
| 18 |
|
19 |
|
| 19 |
import org.apache.log4j.Logger;
|
20 |
import org.apache.log4j.Logger;
|
| Line 38... |
Line 39... |
| 38 |
params = {"actionName" , "login"})
|
39 |
params = {"actionName" , "login"})
|
| 39 |
})
|
40 |
})
|
| 40 |
public class MyaccountController extends BaseController {
|
41 |
public class MyaccountController extends BaseController {
|
| 41 |
|
42 |
|
| 42 |
private static Logger logger = Logger.getLogger(Class.class);
|
43 |
private static Logger logger = Logger.getLogger(Class.class);
|
| 43 |
private static final List<OrderStatus> statuses = Arrays.asList(
|
- |
|
| 44 |
new OrderStatus[] {
|
- |
|
| 45 |
OrderStatus.PAYMENT_PENDING,
|
- |
|
| 46 |
OrderStatus.COD_VERIFICATION_PENDING,
|
- |
|
| 47 |
OrderStatus.SUBMITTED_FOR_PROCESSING,
|
- |
|
| 48 |
OrderStatus.INVENTORY_LOW,
|
- |
|
| 49 |
OrderStatus.ACCEPTED,
|
- |
|
| 50 |
OrderStatus.BILLED,
|
- |
|
| 51 |
OrderStatus.PAYMENT_FLAGGED,
|
- |
|
| 52 |
OrderStatus.SHIPPED_FROM_WH,
|
- |
|
| 53 |
OrderStatus.SHIPPED_TO_LOGST,
|
- |
|
| 54 |
OrderStatus.PAYMENT_FLAGGED_DENIED,
|
- |
|
| 55 |
OrderStatus.CANCEL_REQUEST_RECEIVED,
|
- |
|
| 56 |
OrderStatus.CANCEL_REQUEST_CONFIRMED,
|
- |
|
| 57 |
OrderStatus.CANCELLED_ON_CUSTOMER_REQUEST,
|
- |
|
| 58 |
OrderStatus.CANCELLED_DUE_TO_LOW_INVENTORY,
|
- |
|
| 59 |
|
- |
|
| 60 |
OrderStatus.RTO_IN_TRANSIT,
|
- |
|
| 61 |
OrderStatus.RTO_RECEIVED_PRESTINE,
|
- |
|
| 62 |
|
- |
|
| 63 |
OrderStatus.DOA_PICKUP_REQUEST_RAISED,
|
- |
|
| 64 |
OrderStatus.DOA_PICKUP_CONFIRMED,
|
- |
|
| 65 |
OrderStatus.DOA_RETURN_IN_TRANSIT,
|
- |
|
| 66 |
OrderStatus.DOA_RECEIVED_PRESTINE,
|
- |
|
| 67 |
OrderStatus.DOA_CERT_INVALID,
|
- |
|
| 68 |
OrderStatus.DOA_CERT_VALID
|
- |
|
| 69 |
}
|
- |
|
| 70 |
);
|
44 |
|
| 71 |
private FormattingUtils formattingUtils = new FormattingUtils();
|
45 |
private FormattingUtils formattingUtils = new FormattingUtils();
|
| 72 |
|
46 |
|
| 73 |
Map<Long, String> providerNames = new HashMap<Long, String>();
|
47 |
Map<Long, String> providerNames = new HashMap<Long, String>();
|
| 74 |
List<Order> orders = null;
|
48 |
List<Order> orders = null;
|
| 75 |
List<String> orderDate = new ArrayList<String>();
|
49 |
List<String> orderDate = new ArrayList<String>();
|
| 76 |
|
50 |
|
| 77 |
public MyaccountController() {
|
51 |
public MyaccountController() {
|
| 78 |
super();
|
52 |
super();
|
| 79 |
}
|
53 |
}
|
| 80 |
|
54 |
|
| 81 |
public String index(){
|
55 |
public String index(){
|
| 82 |
logger.info("this.request=" + this.request);
|
56 |
logger.info("this.request=" + this.request);
|
| 83 |
|
57 |
|
| 84 |
try {
|
58 |
try {
|
| - |
|
59 |
OrderStatusGroups statusGroup = new OrderStatusGroups();
|
| - |
|
60 |
List<OrderStatus> openOrderStatuses = statusGroup.getOpenOrders();
|
| 85 |
TransactionClient transactionServiceClient = new TransactionClient();
|
61 |
TransactionClient transactionServiceClient = new TransactionClient();
|
| 86 |
in.shop2020.model.v1.order.TransactionService.Client orderClient = transactionServiceClient.getClient();
|
62 |
in.shop2020.model.v1.order.TransactionService.Client orderClient = transactionServiceClient.getClient();
|
| 87 |
orders = orderClient.getOrdersForCustomer(userinfo.getUserId(), 0, (new Date()).getTime(), statuses);
|
63 |
orders = orderClient.getOrdersForCustomer(userinfo.getUserId(), 0, (new Date()).getTime(), openOrderStatuses);
|
| 88 |
//Reverse the list of order. Last come first displayed
|
64 |
//Reverse the list of order. Last come first displayed
|
| 89 |
Collections.reverse(orders);
|
65 |
Collections.reverse(orders);
|
| 90 |
LogisticsClient logisticsServiceClient = new LogisticsClient();
|
66 |
LogisticsClient logisticsServiceClient = new LogisticsClient();
|
| 91 |
in.shop2020.logistics.LogisticsService.Client logisticsClient = logisticsServiceClient.getClient();
|
67 |
in.shop2020.logistics.LogisticsService.Client logisticsClient = logisticsServiceClient.getClient();
|
| 92 |
List<Provider> providers = logisticsClient.getAllProviders();
|
68 |
List<Provider> providers = logisticsClient.getAllProviders();
|