| Line 11... |
Line 11... |
| 11 |
import in.shop2020.thrift.clients.TransactionServiceClient;
|
11 |
import in.shop2020.thrift.clients.TransactionServiceClient;
|
| 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.Collections;
|
17 |
import java.util.Collections;
|
| 17 |
import java.util.Date;
|
18 |
import java.util.Date;
|
| 18 |
import java.util.HashMap;
|
19 |
import java.util.HashMap;
|
| 19 |
import java.util.List;
|
20 |
import java.util.List;
|
| 20 |
import java.util.Map;
|
21 |
import java.util.Map;
|
| Line 28... |
Line 29... |
| 28 |
/**
|
29 |
/**
|
| 29 |
* @author rajveer
|
30 |
* @author rajveer
|
| 30 |
*
|
31 |
*
|
| 31 |
*/
|
32 |
*/
|
| 32 |
|
33 |
|
| - |
|
34 |
@SuppressWarnings("serial")
|
| 33 |
@InterceptorRefs({
|
35 |
@InterceptorRefs({
|
| 34 |
@InterceptorRef("myDefault"),
|
36 |
@InterceptorRef("myDefault"),
|
| 35 |
@InterceptorRef("login")
|
37 |
@InterceptorRef("login")
|
| 36 |
})
|
38 |
})
|
| 37 |
|
39 |
|
| Line 39... |
Line 41... |
| 39 |
@Result(name="redirect", type="redirectAction",
|
41 |
@Result(name="redirect", type="redirectAction",
|
| 40 |
params = {"actionName" , "login"})
|
42 |
params = {"actionName" , "login"})
|
| 41 |
})
|
43 |
})
|
| 42 |
public class CompletedOrdersController extends BaseController {
|
44 |
public class CompletedOrdersController extends BaseController {
|
| 43 |
|
45 |
|
| 44 |
private static final long serialVersionUID = 1L;
|
- |
|
| 45 |
private static Logger log = Logger.getLogger(Class.class);
|
46 |
private static Logger log = Logger.getLogger(Class.class);
|
| - |
|
47 |
private static final List<OrderStatus> statuses = Arrays.asList(new OrderStatus[] {OrderStatus.DELIVERY_SUCCESS});
|
| - |
|
48 |
|
| 46 |
private FormattingUtils formattingUtils = new FormattingUtils();
|
49 |
private FormattingUtils formattingUtils = new FormattingUtils();
|
| 47 |
|
- |
|
| 48 |
private List<Order> orders = null;
|
50 |
private List<Order> orders = null;
|
| 49 |
private List<String> orderDate = new ArrayList<String>();
|
51 |
private List<String> orderDate = new ArrayList<String>();
|
| 50 |
private Map<Long, String> providerNames = new HashMap<Long, String>();
|
52 |
private Map<Long, String> providerNames = new HashMap<Long, String>();
|
| 51 |
|
53 |
|
| 52 |
public CompletedOrdersController() {
|
54 |
public CompletedOrdersController() {
|
| Line 61... |
Line 63... |
| 61 |
in.shop2020.model.v1.order.TransactionService.Client orderClient = null;
|
63 |
in.shop2020.model.v1.order.TransactionService.Client orderClient = null;
|
| 62 |
|
64 |
|
| 63 |
try{
|
65 |
try{
|
| 64 |
transactionServiceClient = new TransactionServiceClient();
|
66 |
transactionServiceClient = new TransactionServiceClient();
|
| 65 |
orderClient = transactionServiceClient.getClient();
|
67 |
orderClient = transactionServiceClient.getClient();
|
| 66 |
orders = orderClient.getOrdersForCustomer(userinfo.getUserId(), 0, (new Date()).getTime(), OrderStatus.DELIVERY_SUCCESS);
|
68 |
orders = orderClient.getOrdersForCustomer(userinfo.getUserId(), 0, (new Date()).getTime(), statuses);
|
| 67 |
Collections.reverse(orders);
|
69 |
Collections.reverse(orders);
|
| 68 |
LogisticsServiceClient logisticsServiceClient = new LogisticsServiceClient();
|
70 |
LogisticsServiceClient logisticsServiceClient = new LogisticsServiceClient();
|
| 69 |
in.shop2020.logistics.LogisticsService.Client logisticsClient = logisticsServiceClient.getClient();
|
71 |
in.shop2020.logistics.LogisticsService.Client logisticsClient = logisticsServiceClient.getClient();
|
| 70 |
List<Provider> providers = logisticsClient.getAllProviders();
|
72 |
List<Provider> providers = logisticsClient.getAllProviders();
|
| 71 |
for(Provider provider: providers)
|
73 |
for(Provider provider: providers)
|