| 7410 |
amar.kumar |
1 |
/**
|
|
|
2 |
*
|
|
|
3 |
*/
|
|
|
4 |
package in.shop2020.warehouse.handler;
|
|
|
5 |
|
|
|
6 |
import java.util.Date;
|
|
|
7 |
import java.util.HashMap;
|
|
|
8 |
import java.util.List;
|
|
|
9 |
import java.util.Map;
|
|
|
10 |
|
|
|
11 |
import in.shop2020.warehouse.TransferLotStatus;
|
| 15045 |
manish.sha |
12 |
import in.shop2020.warehouse.domain.RemovalStockShipmentReference;
|
| 7410 |
amar.kumar |
13 |
import in.shop2020.warehouse.domain.TransferLot;
|
|
|
14 |
import in.shop2020.warehouse.persistence.TransferLotMapper;
|
|
|
15 |
|
|
|
16 |
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
17 |
import org.springframework.stereotype.Service;
|
|
|
18 |
|
|
|
19 |
|
|
|
20 |
/**
|
|
|
21 |
* @author amar
|
|
|
22 |
*
|
|
|
23 |
*/
|
|
|
24 |
@Service
|
|
|
25 |
public class TransferLotHandler {
|
|
|
26 |
@Autowired
|
|
|
27 |
private TransferLotMapper transferLotMapper;
|
|
|
28 |
|
|
|
29 |
public long createTransferLot(TransferLot transferLot) {
|
|
|
30 |
transferLotMapper.createTransferLot(transferLot);
|
|
|
31 |
return transferLot.getId();
|
|
|
32 |
}
|
|
|
33 |
|
|
|
34 |
public TransferLot getTransferLot(long transferLotId) {
|
|
|
35 |
return transferLotMapper.getTransferLot(transferLotId);
|
|
|
36 |
}
|
|
|
37 |
|
|
|
38 |
public List<TransferLot> getTransferLotsByDate(Date fromDate, Date toDate) {
|
|
|
39 |
return transferLotMapper.getTransferLotsByDate(fromDate, toDate);
|
|
|
40 |
}
|
|
|
41 |
|
|
|
42 |
|
|
|
43 |
public Map<Long, Long> getItemsInTransferLot(long transferLotId) {
|
|
|
44 |
Map<Integer, Integer> result = transferLotMapper.getItemsInTransferLot(transferLotId);
|
|
|
45 |
Map<Long, Long> lotItems = new HashMap<Long, Long>();
|
|
|
46 |
|
|
|
47 |
for(Integer itemId : result.keySet()){
|
|
|
48 |
Long count = Long.parseLong(((Object)((Map<String,Long>)(Object)result.get(itemId)).get("count")).toString());
|
|
|
49 |
lotItems.put(new Long(itemId), count);
|
|
|
50 |
}
|
|
|
51 |
return lotItems;
|
|
|
52 |
}
|
|
|
53 |
|
|
|
54 |
public void markTransferLotAsReceived(long id, String remoteTransferRefNumber) {
|
|
|
55 |
transferLotMapper.markTransferLotAsReceived(id, remoteTransferRefNumber);
|
|
|
56 |
|
|
|
57 |
}
|
|
|
58 |
|
|
|
59 |
public List<Long> getAllowedDestinationWarehousesForTransfer(
|
|
|
60 |
long originWarehouseId) {
|
|
|
61 |
return transferLotMapper.getAllowedDestinationWarehousesForTransfer(originWarehouseId);
|
|
|
62 |
}
|
|
|
63 |
|
|
|
64 |
public void updateTransferLotStatus(long id,
|
|
|
65 |
TransferLotStatus status) {
|
|
|
66 |
transferLotMapper.updateTransferLotStatus(id, status);
|
|
|
67 |
}
|
|
|
68 |
|
| 10120 |
manish.sha |
69 |
public void markTransferLotAsReceivedPartial(long id, String remoteTransferRefNumber){
|
|
|
70 |
transferLotMapper.markTransferLotAsReceivedPartial(id, remoteTransferRefNumber);
|
|
|
71 |
}
|
| 15045 |
manish.sha |
72 |
|
|
|
73 |
public RemovalStockShipmentReference getRemovalStockShipmentReferenceById(long id) {
|
|
|
74 |
return transferLotMapper.getRemovalStockShipmentReferenceById(id);
|
|
|
75 |
}
|
| 7410 |
amar.kumar |
76 |
|
| 15045 |
manish.sha |
77 |
public List<RemovalStockShipmentReference> getAllUnCompletedStockShipments(String source){
|
|
|
78 |
return transferLotMapper.getAllUnCompletedStockShipments(source);
|
|
|
79 |
}
|
|
|
80 |
|
|
|
81 |
public void updateShipmentReferenceTransferLot(long id, long shipmentReference){
|
|
|
82 |
transferLotMapper.updateShipmentReferenceTransferLot(id, shipmentReference);
|
|
|
83 |
}
|
|
|
84 |
|
|
|
85 |
public long createRemovalStockShipmentReference(RemovalStockShipmentReference removalStockShipmentReference){
|
|
|
86 |
transferLotMapper.createRemovalStockShipmentReference(removalStockShipmentReference);
|
|
|
87 |
return removalStockShipmentReference.getId();
|
|
|
88 |
}
|
|
|
89 |
|
|
|
90 |
public void updateStockShipment(long lineItemQuantity, long id){
|
|
|
91 |
transferLotMapper.updateStockShipment(lineItemQuantity, id);
|
|
|
92 |
}
|
|
|
93 |
|
|
|
94 |
public void markStockShipmentComplete(long id){
|
|
|
95 |
transferLotMapper.markStockShipmentComplete(id);
|
|
|
96 |
}
|
|
|
97 |
|
| 7410 |
amar.kumar |
98 |
}
|