| Line 3... |
Line 3... |
| 3 |
import in.shop2020.model.v1.catalog.InventoryServiceException;
|
3 |
import in.shop2020.model.v1.catalog.InventoryServiceException;
|
| 4 |
import in.shop2020.purchase.PurchaseServiceException;
|
4 |
import in.shop2020.purchase.PurchaseServiceException;
|
| 5 |
import in.shop2020.thrift.clients.CatalogClient;
|
5 |
import in.shop2020.thrift.clients.CatalogClient;
|
| 6 |
import in.shop2020.thrift.clients.PurchaseClient;
|
6 |
import in.shop2020.thrift.clients.PurchaseClient;
|
| 7 |
import in.shop2020.thrift.clients.WarehouseClient;
|
7 |
import in.shop2020.thrift.clients.WarehouseClient;
|
| - |
|
8 |
import in.shop2020.warehouse.InventoryItem;
|
| 8 |
import in.shop2020.warehouse.ScanType;
|
9 |
import in.shop2020.warehouse.ScanType;
|
| 9 |
import in.shop2020.warehouse.WarehouseService.Client;
|
10 |
import in.shop2020.warehouse.WarehouseService.Client;
|
| 10 |
import in.shop2020.warehouse.WarehouseServiceException;
|
11 |
import in.shop2020.warehouse.WarehouseServiceException;
|
| 11 |
|
12 |
|
| 12 |
import javax.servlet.ServletContext;
|
13 |
import javax.servlet.ServletContext;
|
| Line 88... |
Line 89... |
| 88 |
|
89 |
|
| 89 |
try {
|
90 |
try {
|
| 90 |
WarehouseClient warehouseClient = new WarehouseClient();
|
91 |
WarehouseClient warehouseClient = new WarehouseClient();
|
| 91 |
Client client = warehouseClient.getClient();
|
92 |
Client client = warehouseClient.getClient();
|
| 92 |
long warehouseId = 7;
|
93 |
long warehouseId = 7;
|
| 93 |
long inventoryItemId = client.createSerializedInventoryItemFromItemNumber(itemNumber, imeiNumber, id);
|
94 |
InventoryItem inventoryItem = client.createSerializedInventoryItemFromItemNumber(itemNumber, imeiNumber, id);
|
| 94 |
client.scanSerializedItem(inventoryItemId, ScanType.PURCHASE, warehouseId);
|
95 |
client.scanSerializedItem(inventoryItem.getId(), ScanType.PURCHASE, warehouseId);
|
| 95 |
in.shop2020.model.v1.catalog.InventoryService.Client catalaogClient = new CatalogClient().getClient();
|
96 |
in.shop2020.model.v1.catalog.InventoryService.Client catalaogClient = new CatalogClient().getClient();
|
| 96 |
catalaogClient.addInventory(client.getInventoryItem(imeiNumber).getItemId(), warehouseId, 1);
|
97 |
catalaogClient.addInventory(inventoryItem.getItemId(), warehouseId, 1);
|
| 97 |
} catch (TTransportException e) {
|
98 |
} catch (TTransportException e) {
|
| 98 |
errorMsg = "Error while establishing connection to the warehouse server";
|
99 |
errorMsg = "Error while establishing connection to the warehouse server";
|
| 99 |
logger.error(errorMsg, e);
|
100 |
logger.error(errorMsg, e);
|
| 100 |
} catch (WarehouseServiceException e) {
|
101 |
} catch (WarehouseServiceException e) {
|
| 101 |
errorMsg = e.getMessage();
|
102 |
errorMsg = e.getMessage();
|