| Line 5... |
Line 5... |
| 5 |
|
5 |
|
| 6 |
import in.shop2020.logistics.Provider;
|
6 |
import in.shop2020.logistics.Provider;
|
| 7 |
import in.shop2020.model.v1.order.Order;
|
7 |
import in.shop2020.model.v1.order.Order;
|
| 8 |
import in.shop2020.model.v1.order.OrderStatus;
|
8 |
import in.shop2020.model.v1.order.OrderStatus;
|
| 9 |
import in.shop2020.serving.utils.FormattingUtils;
|
9 |
import in.shop2020.serving.utils.FormattingUtils;
|
| 10 |
import in.shop2020.thrift.clients.LogisticsServiceClient;
|
10 |
import in.shop2020.thrift.clients.LogisticsClient;
|
| 11 |
import in.shop2020.thrift.clients.TransactionServiceClient;
|
11 |
import in.shop2020.thrift.clients.TransactionClient;
|
| 12 |
|
12 |
|
| 13 |
import java.io.UnsupportedEncodingException;
|
13 |
import java.io.UnsupportedEncodingException;
|
| 14 |
import java.text.SimpleDateFormat;
|
14 |
import java.text.SimpleDateFormat;
|
| 15 |
import java.util.ArrayList;
|
15 |
import java.util.ArrayList;
|
| 16 |
import java.util.Arrays;
|
16 |
import java.util.Arrays;
|
| Line 57... |
Line 57... |
| 57 |
|
57 |
|
| 58 |
// GET /completed-orders
|
58 |
// GET /completed-orders
|
| 59 |
public String index() throws UnsupportedEncodingException {
|
59 |
public String index() throws UnsupportedEncodingException {
|
| 60 |
log.info("this.request=" + this.request);
|
60 |
log.info("this.request=" + this.request);
|
| 61 |
|
61 |
|
| 62 |
TransactionServiceClient transactionServiceClient = null;
|
62 |
TransactionClient transactionServiceClient = null;
|
| 63 |
in.shop2020.model.v1.order.TransactionService.Client orderClient = null;
|
63 |
in.shop2020.model.v1.order.TransactionService.Client orderClient = null;
|
| 64 |
|
64 |
|
| 65 |
try{
|
65 |
try{
|
| 66 |
transactionServiceClient = new TransactionServiceClient();
|
66 |
transactionServiceClient = new TransactionClient();
|
| 67 |
orderClient = transactionServiceClient.getClient();
|
67 |
orderClient = transactionServiceClient.getClient();
|
| 68 |
orders = orderClient.getOrdersForCustomer(userinfo.getUserId(), 0, (new Date()).getTime(), statuses);
|
68 |
orders = orderClient.getOrdersForCustomer(userinfo.getUserId(), 0, (new Date()).getTime(), statuses);
|
| 69 |
Collections.reverse(orders);
|
69 |
Collections.reverse(orders);
|
| 70 |
LogisticsServiceClient logisticsServiceClient = new LogisticsServiceClient();
|
70 |
LogisticsClient logisticsServiceClient = new LogisticsClient();
|
| 71 |
in.shop2020.logistics.LogisticsService.Client logisticsClient = logisticsServiceClient.getClient();
|
71 |
in.shop2020.logistics.LogisticsService.Client logisticsClient = logisticsServiceClient.getClient();
|
| 72 |
List<Provider> providers = logisticsClient.getAllProviders();
|
72 |
List<Provider> providers = logisticsClient.getAllProviders();
|
| 73 |
for(Provider provider: providers)
|
73 |
for(Provider provider: providers)
|
| 74 |
providerNames.put(provider.getId(), provider.getName());
|
74 |
providerNames.put(provider.getId(), provider.getName());
|
| 75 |
|
75 |
|