| Line 1... |
Line 1... |
| 1 |
package in.shop2020.support.controllers;
|
1 |
package in.shop2020.support.controllers;
|
| 2 |
|
2 |
|
| 3 |
import in.shop2020.logistics.DeliveryType;
|
3 |
import in.shop2020.logistics.DeliveryType;
|
| 4 |
import in.shop2020.logistics.LogisticsServiceException;
|
4 |
import in.shop2020.logistics.LogisticsServiceException;
|
| 5 |
import in.shop2020.logistics.Provider;
|
5 |
import in.shop2020.logistics.Provider;
|
| 6 |
import in.shop2020.model.v1.catalog.InventoryServiceException;
|
6 |
import in.shop2020.model.v1.inventory.InventoryServiceException;
|
| 7 |
import in.shop2020.model.v1.catalog.Warehouse;
|
7 |
import in.shop2020.model.v1.inventory.Warehouse;
|
| 8 |
import in.shop2020.model.v1.order.LineItem;
|
8 |
import in.shop2020.model.v1.order.LineItem;
|
| 9 |
import in.shop2020.model.v1.order.Order;
|
9 |
import in.shop2020.model.v1.order.Order;
|
| 10 |
import in.shop2020.model.v1.order.TransactionServiceException;
|
10 |
import in.shop2020.model.v1.order.TransactionServiceException;
|
| - |
|
11 |
import in.shop2020.support.models.AwbDetails;
|
| 11 |
import in.shop2020.support.utils.FileUtils;
|
12 |
import in.shop2020.support.utils.FileUtils;
|
| 12 |
import in.shop2020.thrift.clients.CatalogClient;
|
13 |
import in.shop2020.thrift.clients.CatalogClient;
|
| 13 |
import in.shop2020.thrift.clients.HelperClient;
|
14 |
import in.shop2020.thrift.clients.HelperClient;
|
| - |
|
15 |
import in.shop2020.thrift.clients.InventoryClient;
|
| 14 |
import in.shop2020.thrift.clients.LogisticsClient;
|
16 |
import in.shop2020.thrift.clients.LogisticsClient;
|
| 15 |
import in.shop2020.thrift.clients.TransactionClient;
|
17 |
import in.shop2020.thrift.clients.TransactionClient;
|
| 16 |
import in.shop2020.utils.LogisticsUser;
|
18 |
import in.shop2020.utils.LogisticsUser;
|
| 17 |
import in.shop2020.support.models.AwbDetails;
|
- |
|
| 18 |
|
19 |
|
| 19 |
import java.io.ByteArrayOutputStream;
|
20 |
import java.io.ByteArrayOutputStream;
|
| 20 |
import java.io.File;
|
21 |
import java.io.File;
|
| 21 |
import java.io.IOException;
|
22 |
import java.io.IOException;
|
| 22 |
import java.util.ArrayList;
|
23 |
import java.util.ArrayList;
|
| Line 162... |
Line 163... |
| 162 |
String [] awbArray = awbNumbers.split(",");
|
163 |
String [] awbArray = awbNumbers.split(",");
|
| 163 |
for(String awbNumber : awbArray) {
|
164 |
for(String awbNumber : awbArray) {
|
| 164 |
try {
|
165 |
try {
|
| 165 |
LogisticsClient lsc = new LogisticsClient();
|
166 |
LogisticsClient lsc = new LogisticsClient();
|
| 166 |
TransactionClient tsc = new TransactionClient();
|
167 |
TransactionClient tsc = new TransactionClient();
|
| 167 |
CatalogClient csc = new CatalogClient();
|
168 |
InventoryClient isc = new InventoryClient();
|
| 168 |
in.shop2020.model.v1.catalog.InventoryService.Client inventoryClient = csc.getClient();
|
169 |
in.shop2020.model.v1.inventory.InventoryService.Client inventoryClient = isc.getClient();
|
| 169 |
in.shop2020.model.v1.order.TransactionService.Client txnClient = tsc.getClient();
|
170 |
in.shop2020.model.v1.order.TransactionService.Client txnClient = tsc.getClient();
|
| 170 |
in.shop2020.logistics.LogisticsService.Client logisticsClient = lsc.getClient();
|
171 |
in.shop2020.logistics.LogisticsService.Client logisticsClient = lsc.getClient();
|
| 171 |
|
172 |
|
| 172 |
/*
|
173 |
/*
|
| 173 |
* Get required stuff
|
174 |
* Get required stuff
|
| Line 302... |
Line 303... |
| 302 |
* @return the mapping of warehouse if to its display namee
|
303 |
* @return the mapping of warehouse if to its display namee
|
| 303 |
*/
|
304 |
*/
|
| 304 |
public Map<Long, String> getWarehouses(){
|
305 |
public Map<Long, String> getWarehouses(){
|
| 305 |
Map<Long, String> warehouseMap = new HashMap<Long, String>();
|
306 |
Map<Long, String> warehouseMap = new HashMap<Long, String>();
|
| 306 |
try{
|
307 |
try{
|
| 307 |
CatalogClient csc = new CatalogClient();
|
308 |
InventoryClient isc = new InventoryClient();
|
| 308 |
in.shop2020.model.v1.catalog.InventoryService.Client catalogClient= csc.getClient();
|
309 |
in.shop2020.model.v1.inventory.InventoryService.Client inventoryClient= isc.getClient();
|
| 309 |
List<Warehouse> warehouses = catalogClient.getShippingLocations();
|
310 |
List<Warehouse> warehouses = inventoryClient.getShippingLocations();
|
| 310 |
for(Warehouse warehouse : warehouses){
|
311 |
for(Warehouse warehouse : warehouses){
|
| 311 |
warehouseMap.put(warehouse.getId(), warehouse.getDisplayName());
|
312 |
warehouseMap.put(warehouse.getId(), warehouse.getDisplayName());
|
| 312 |
}
|
313 |
}
|
| 313 |
}catch(Exception e){
|
314 |
}catch(Exception e){
|
| 314 |
logger.error("Error getting the list of warehouses", e);
|
315 |
logger.error("Error getting the list of warehouses", e);
|