| Line 1... |
Line 1... |
| 1 |
package in.shop2020.inventory.controllers;
|
1 |
package in.shop2020.inventory.controllers;
|
| 2 |
|
2 |
|
| 3 |
import in.shop2020.model.v1.catalog.InventoryType;
|
- |
|
| 4 |
import in.shop2020.model.v1.catalog.Item;
|
3 |
import in.shop2020.model.v1.catalog.Item;
|
| - |
|
4 |
import in.shop2020.model.v1.inventory.InventoryType;
|
| 5 |
import in.shop2020.model.v1.catalog.Warehouse;
|
5 |
import in.shop2020.model.v1.inventory.Warehouse;
|
| 6 |
import in.shop2020.model.v1.catalog.WarehouseType;
|
6 |
import in.shop2020.model.v1.inventory.WarehouseType;
|
| 7 |
import in.shop2020.model.v1.order.LineItem;
|
7 |
import in.shop2020.model.v1.order.LineItem;
|
| 8 |
import in.shop2020.purchase.Invoice;
|
8 |
import in.shop2020.purchase.Invoice;
|
| 9 |
import in.shop2020.purchase.PurchaseOrder;
|
9 |
import in.shop2020.purchase.PurchaseOrder;
|
| 10 |
import in.shop2020.purchase.PurchaseServiceException;
|
10 |
import in.shop2020.purchase.PurchaseServiceException;
|
| 11 |
import in.shop2020.thrift.clients.CatalogClient;
|
11 |
import in.shop2020.thrift.clients.CatalogClient;
|
| - |
|
12 |
import in.shop2020.thrift.clients.InventoryClient;
|
| 12 |
import in.shop2020.thrift.clients.PurchaseClient;
|
13 |
import in.shop2020.thrift.clients.PurchaseClient;
|
| 13 |
import in.shop2020.thrift.clients.WarehouseClient;
|
14 |
import in.shop2020.thrift.clients.WarehouseClient;
|
| 14 |
import in.shop2020.utils.ModelUtils;
|
15 |
import in.shop2020.utils.ModelUtils;
|
| 15 |
import in.shop2020.warehouse.InventoryItem;
|
16 |
import in.shop2020.warehouse.InventoryItem;
|
| 16 |
import in.shop2020.warehouse.ScanType;
|
17 |
import in.shop2020.warehouse.ScanType;
|
| Line 265... |
Line 266... |
| 265 |
private void setItemsFromPO(long id) {
|
266 |
private void setItemsFromPO(long id) {
|
| 266 |
try {
|
267 |
try {
|
| 267 |
items = new ArrayList<Item>();
|
268 |
items = new ArrayList<Item>();
|
| 268 |
in.shop2020.purchase.PurchaseService.Client purchaseClient = new PurchaseClient().getClient();
|
269 |
in.shop2020.purchase.PurchaseService.Client purchaseClient = new PurchaseClient().getClient();
|
| 269 |
PurchaseOrder purchaseOrder = purchaseClient.getPurchaseOrderForPurchase(id);
|
270 |
PurchaseOrder purchaseOrder = purchaseClient.getPurchaseOrderForPurchase(id);
|
| 270 |
in.shop2020.model.v1.catalog.InventoryService.Client catalogClient = new CatalogClient().getClient();
|
271 |
in.shop2020.model.v1.catalog.CatalogService.Client catalogClient = new CatalogClient().getClient();
|
| 271 |
|
272 |
|
| 272 |
for (in.shop2020.purchase.LineItem lineItem : purchaseOrder.getLineitems()) {
|
273 |
for (in.shop2020.purchase.LineItem lineItem : purchaseOrder.getLineitems()) {
|
| 273 |
items.add(catalogClient.getItem(lineItem.getItemId()));
|
274 |
items.add(catalogClient.getItem(lineItem.getItemId()));
|
| 274 |
}
|
275 |
}
|
| 275 |
|
276 |
|
| - |
|
277 |
in.shop2020.model.v1.inventory.InventoryService.Client inventoryClient = new InventoryClient().getClient();
|
| 276 |
warehouse = catalogClient.getWarehouses(WarehouseType.OURS, InventoryType.GOOD, purchaseOrder.getSupplierId(), PurchaseOrderController.WAREHOUSE_ID, PurchaseOrderController.WAREHOUSE_ID).get(0);
|
278 |
warehouse = inventoryClient.getWarehouses(WarehouseType.OURS, InventoryType.GOOD, purchaseOrder.getSupplierId(), PurchaseOrderController.WAREHOUSE_ID, PurchaseOrderController.WAREHOUSE_ID).get(0);
|
| 277 |
} catch (Exception e) {
|
279 |
} catch (Exception e) {
|
| 278 |
logger.error("Could not find items in PO with purchase: " + id, e);
|
280 |
logger.error("Could not find items in PO with purchase: " + id, e);
|
| 279 |
}
|
281 |
}
|
| 280 |
}
|
282 |
}
|
| 281 |
|
283 |
|