| Line 98... |
Line 98... |
| 98 |
|
98 |
|
| 99 |
public HttpHeaders getOrderIds() {
|
99 |
public HttpHeaders getOrderIds() {
|
| 100 |
long status = (long)OrderStatus.valueOf(request.getParameter("status")).getValue();
|
100 |
long status = (long)OrderStatus.valueOf(request.getParameter("status")).getValue();
|
| 101 |
String[] timestamps = request.getParameter("timestamps").split("-");
|
101 |
String[] timestamps = request.getParameter("timestamps").split("-");
|
| 102 |
|
102 |
|
| 103 |
logger.info(status + " - " + timestamps);
|
- |
|
| 104 |
|
- |
|
| 105 |
TransactionClient tsc;
|
103 |
TransactionClient tsc;
|
| 106 |
try {
|
104 |
try {
|
| 107 |
tsc = new TransactionClient();
|
105 |
tsc = new TransactionClient();
|
| 108 |
in.shop2020.model.v1.order.TransactionService.Client transactionClient = tsc.getClient();
|
106 |
in.shop2020.model.v1.order.TransactionService.Client transactionClient = tsc.getClient();
|
| 109 |
List<Long> orderIds = transactionClient.getOrderIdsForStatus(status, Long.parseLong(timestamps[0]), Long.parseLong(timestamps[1]));
|
107 |
List<Long> orderIds = transactionClient.getOrderIdsForStatus(status, Long.parseLong(timestamps[0]), Long.parseLong(timestamps[1]));
|
| 110 |
|
108 |
|
| 111 |
response.setContentType("text/tab-separated-values");
|
109 |
response.setContentType("text/comma-separated-values");
|
| 112 |
response.setHeader("Content-disposition", "inline; filename=OrderIds-" + request.getParameter("status") + ".txt");
|
110 |
response.setHeader("Content-disposition", "inline; filename=OrderIds-" + request.getParameter("status") + ".csv");
|
| 113 |
|
111 |
|
| 114 |
StringBuilder sb = new StringBuilder();
|
112 |
StringBuilder sb = new StringBuilder();
|
| 115 |
|
113 |
|
| 116 |
for (long orderId: orderIds) {
|
114 |
for (long orderId: orderIds) {
|
| 117 |
sb.append(Long.toString(orderId));
|
115 |
sb.append(Long.toString(orderId));
|