| Line 137... |
Line 137... |
| 137 |
ZipOutputStream zipOut = new ZipOutputStream(fos);
|
137 |
ZipOutputStream zipOut = new ZipOutputStream(fos);
|
| 138 |
|
138 |
|
| 139 |
for (String invoice : invoiceNumbers) {
|
139 |
for (String invoice : invoiceNumbers) {
|
| 140 |
List<Order> orders = invoiceOrdersMap.get(invoice);
|
140 |
List<Order> orders = invoiceOrdersMap.get(invoice);
|
| 141 |
String invoicePath = this.getInvoicePath(orders.get(0));
|
141 |
String invoicePath = this.getInvoicePath(orders.get(0));
|
| 142 |
HttpResponse response = restClient.getResponse("http://50.116.3.101/" + invoicePath, null, headersMap);
|
142 |
HttpResponse response = restClient.getResponse("http://192.168.202.177/" + invoicePath, null, headersMap);
|
| 143 |
this.addFileToZip(zipOut, response.getEntity().getContent(), invoice + ".pdf");
|
143 |
this.addFileToZip(zipOut, response.getEntity().getContent(), invoice + ".pdf");
|
| 144 |
}
|
144 |
}
|
| 145 |
zipOut.close();
|
145 |
zipOut.close();
|
| 146 |
byte[] byteArray = fos.toByteArray();
|
146 |
byte[] byteArray = fos.toByteArray();
|
| 147 |
headers.set("Content-Type", ContentType.APPLICATION_OCTET_STREAM.getMimeType());
|
147 |
headers.set("Content-Type", ContentType.APPLICATION_OCTET_STREAM.getMimeType());
|