Subversion Repositories SmartDukaan

Rev

Rev 7410 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
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;
12
import in.shop2020.warehouse.domain.TransferLot;
13
import in.shop2020.warehouse.persistence.TransferLotMapper;
14
 
15
import org.springframework.beans.factory.annotation.Autowired;
16
import org.springframework.stereotype.Service;
17
 
18
 
19
/**
20
 * @author amar
21
 *
22
 */
23
@Service
24
public class TransferLotHandler {
25
    @Autowired
26
    private TransferLotMapper transferLotMapper;
27
 
28
	public long createTransferLot(TransferLot transferLot) {
29
		transferLotMapper.createTransferLot(transferLot);
30
		return transferLot.getId();
31
	}
32
 
33
	public TransferLot getTransferLot(long transferLotId) {
34
		return transferLotMapper.getTransferLot(transferLotId);
35
	}
36
 
37
	public List<TransferLot> getTransferLotsByDate(Date fromDate, Date toDate) {
38
		return transferLotMapper.getTransferLotsByDate(fromDate, toDate);
39
	}
40
 
41
 
42
	public Map<Long, Long> getItemsInTransferLot(long transferLotId) {
43
		Map<Integer, Integer> result = transferLotMapper.getItemsInTransferLot(transferLotId);
44
		Map<Long, Long> lotItems = new HashMap<Long, Long>();
45
 
46
		for(Integer itemId : result.keySet()){
47
			Long count = Long.parseLong(((Object)((Map<String,Long>)(Object)result.get(itemId)).get("count")).toString());
48
			lotItems.put(new Long(itemId), count);
49
		}
50
		return lotItems;
51
	}
52
 
53
	public void markTransferLotAsReceived(long id, String remoteTransferRefNumber) {
54
		transferLotMapper.markTransferLotAsReceived(id, remoteTransferRefNumber);
55
 
56
	}
57
 
58
	public List<Long> getAllowedDestinationWarehousesForTransfer(
59
			long originWarehouseId) {
60
		return transferLotMapper.getAllowedDestinationWarehousesForTransfer(originWarehouseId);
61
	}
62
 
63
	public void updateTransferLotStatus(long id,
64
			TransferLotStatus status) {
65
		transferLotMapper.updateTransferLotStatus(id, status);
66
	}
67
 
10120 manish.sha 68
	public void markTransferLotAsReceivedPartial(long id, String remoteTransferRefNumber){
69
		transferLotMapper.markTransferLotAsReceivedPartial(id, remoteTransferRefNumber);
70
	}
7410 amar.kumar 71
 
72
}