| Line 12... |
Line 12... |
| 12 |
import in.shop2020.warehouse.ScanType;
|
12 |
import in.shop2020.warehouse.ScanType;
|
| 13 |
import in.shop2020.warehouse.domain.InventoryItem;
|
13 |
import in.shop2020.warehouse.domain.InventoryItem;
|
| 14 |
import in.shop2020.warehouse.persistence.InventoryItemMapper;
|
14 |
import in.shop2020.warehouse.persistence.InventoryItemMapper;
|
| 15 |
|
15 |
|
| 16 |
import java.util.ArrayList;
|
16 |
import java.util.ArrayList;
|
| - |
|
17 |
import java.util.Collections;
|
| 17 |
import java.util.Date;
|
18 |
import java.util.Date;
|
| 18 |
import java.util.HashMap;
|
19 |
import java.util.HashMap;
|
| 19 |
import java.util.HashSet;
|
20 |
import java.util.HashSet;
|
| 20 |
import java.util.List;
|
21 |
import java.util.List;
|
| 21 |
import java.util.Map;
|
22 |
import java.util.Map;
|
| 22 |
import java.util.Set;
|
23 |
import java.util.Set;
|
| 23 |
|
24 |
|
| - |
|
25 |
import org.apache.commons.collections.CollectionUtils;
|
| 24 |
import org.apache.ibatis.annotations.Param;
|
26 |
import org.apache.commons.collections.ListUtils;
|
| 25 |
import org.apache.thrift.TException;
|
27 |
import org.apache.thrift.TException;
|
| 26 |
import org.apache.thrift.transport.TTransportException;
|
- |
|
| 27 |
import org.springframework.beans.factory.annotation.Autowired;
|
28 |
import org.springframework.beans.factory.annotation.Autowired;
|
| 28 |
import org.springframework.stereotype.Service;
|
29 |
import org.springframework.stereotype.Service;
|
| 29 |
|
30 |
|
| 30 |
import com.mysql.jdbc.StringUtils;
|
31 |
import com.mysql.jdbc.StringUtils;
|
| 31 |
|
32 |
|
| Line 208... |
Line 209... |
| 208 |
|
209 |
|
| 209 |
public List<InventoryItem> getInventoryItemScannedInForPO(long itemId, List<Long> purchaseIds) {
|
210 |
public List<InventoryItem> getInventoryItemScannedInForPO(long itemId, List<Long> purchaseIds) {
|
| 210 |
return inventoryItemMapper.getInventoryItemScannedInForPO(itemId, purchaseIds);
|
211 |
return inventoryItemMapper.getInventoryItemScannedInForPO(itemId, purchaseIds);
|
| 211 |
}
|
212 |
}
|
| 212 |
|
213 |
|
| - |
|
214 |
public List<InventoryItem> getInventoryItemsBySerailNumbers(List<String> serialNumbers) {
|
| - |
|
215 |
List<InventoryItem> inventoryItems = inventoryItemMapper.getInventoryItemsBySerailNumbers(serialNumbers);
|
| - |
|
216 |
Map<String, InventoryItem> map = new HashMap<String, InventoryItem>();
|
| - |
|
217 |
for(InventoryItem inventoryItem : inventoryItems){
|
| - |
|
218 |
String serialNumber = inventoryItem.getSerialNumber();
|
| - |
|
219 |
if(map.containsKey(serialNumber)){
|
| - |
|
220 |
InventoryItem savedInventoryItem = map.get(serialNumber);
|
| - |
|
221 |
if(savedInventoryItem.getCreated().before(savedInventoryItem.getCreated())) {
|
| - |
|
222 |
map.put(serialNumber, inventoryItem);
|
| - |
|
223 |
}
|
| - |
|
224 |
} else {
|
| - |
|
225 |
map.put(serialNumber, inventoryItem);
|
| - |
|
226 |
}
|
| - |
|
227 |
}
|
| - |
|
228 |
return new ArrayList<InventoryItem>(map.values());
|
| - |
|
229 |
}
|
| - |
|
230 |
|
| 213 |
public Long getCurrentBadQuantityForItem( long itemId, long currentWarehouseId, long physicalWarehouseId){
|
231 |
public Long getCurrentBadQuantityForItem( long itemId, long currentWarehouseId, long physicalWarehouseId){
|
| 214 |
return inventoryItemMapper.getCurrentBadQuantityForItem(itemId, currentWarehouseId, physicalWarehouseId);
|
232 |
return inventoryItemMapper.getCurrentBadQuantityForItem(itemId, currentWarehouseId, physicalWarehouseId);
|
| 215 |
}
|
233 |
}
|
| 216 |
|
234 |
|
| 217 |
public Map<Long, Long> getItemsInPurchaseReturn(long purchaseReturnId, ScanType type, String returnTime){
|
235 |
public Map<Long, Long> getItemsInPurchaseReturn(long purchaseReturnId, ScanType type, String returnTime){
|