| Line 1... |
Line 1... |
| 1 |
/**
|
1 |
/**
|
| 2 |
*
|
2 |
*
|
| 3 |
*/
|
3 |
*/
|
| 4 |
package in.shop2020.warehouse.handler;
|
4 |
package in.shop2020.warehouse.handler;
|
| 5 |
|
5 |
|
| - |
|
6 |
import in.shop2020.model.v1.inventory.InventoryService;
|
| - |
|
7 |
import in.shop2020.model.v1.inventory.InventoryServiceException;
|
| - |
|
8 |
import in.shop2020.model.v1.inventory.Warehouse;
|
| - |
|
9 |
import in.shop2020.thrift.clients.InventoryClient;
|
| 6 |
import in.shop2020.warehouse.InTransitInventory;
|
10 |
import in.shop2020.warehouse.InTransitInventory;
|
| 7 |
import in.shop2020.warehouse.ScanType;
|
11 |
import in.shop2020.warehouse.ScanType;
|
| 8 |
import in.shop2020.warehouse.domain.InventoryItem;
|
12 |
import in.shop2020.warehouse.domain.InventoryItem;
|
| 9 |
import in.shop2020.warehouse.persistence.InventoryItemMapper;
|
13 |
import in.shop2020.warehouse.persistence.InventoryItemMapper;
|
| 10 |
|
14 |
|
| 11 |
import java.util.ArrayList;
|
15 |
import java.util.ArrayList;
|
| 12 |
import java.util.List;
|
16 |
import java.util.List;
|
| 13 |
import java.util.Map;
|
17 |
import java.util.Map;
|
| 14 |
|
18 |
|
| - |
|
19 |
import org.apache.thrift.TException;
|
| - |
|
20 |
import org.apache.thrift.transport.TTransportException;
|
| 15 |
import org.springframework.beans.factory.annotation.Autowired;
|
21 |
import org.springframework.beans.factory.annotation.Autowired;
|
| 16 |
import org.springframework.stereotype.Service;
|
22 |
import org.springframework.stereotype.Service;
|
| 17 |
|
23 |
|
| 18 |
import com.mysql.jdbc.StringUtils;
|
24 |
import com.mysql.jdbc.StringUtils;
|
| 19 |
|
25 |
|
| Line 89... |
Line 95... |
| 89 |
public void markPurchaseReturnIdForItem(long id, long currentQuantity, long purchaseReturnId) {
|
95 |
public void markPurchaseReturnIdForItem(long id, long currentQuantity, long purchaseReturnId) {
|
| 90 |
inventoryItemMapper.markPurchaseReturnIdForItem(id, currentQuantity, purchaseReturnId);
|
96 |
inventoryItemMapper.markPurchaseReturnIdForItem(id, currentQuantity, purchaseReturnId);
|
| 91 |
|
97 |
|
| 92 |
}
|
98 |
}
|
| 93 |
|
99 |
|
| 94 |
public List<InventoryItem> getCurrentNonSerializedItemsByItemId(long itemId, long warehouseId) {
|
100 |
public List<InventoryItem> getCurrentNonSerializedItemsByItemId(long itemId, long warehouseId) throws InventoryServiceException, TException {
|
| - |
|
101 |
InventoryService.Client inventoryClient = new InventoryClient().getClient();
|
| - |
|
102 |
Warehouse warehouse = inventoryClient.getWarehouse(warehouseId);
|
| 95 |
return inventoryItemMapper.getCurrentNonSerializedItemsByItemId(itemId, warehouseId);
|
103 |
return inventoryItemMapper.getCurrentNonSerializedItemsByItemId(itemId, warehouseId, warehouse.getBillingWarehouseId());
|
| 96 |
}
|
104 |
}
|
| 97 |
|
105 |
|
| 98 |
public List<Map<String, Integer>> getCurrentSerializedInventory() {
|
106 |
public List<Map<String, Integer>> getCurrentSerializedInventory() {
|
| 99 |
return inventoryItemMapper.getCurrentSerializedInventory();
|
107 |
return inventoryItemMapper.getCurrentSerializedInventory();
|
| 100 |
}
|
108 |
}
|