Subversion Repositories SmartDukaan

Rev

Rev 6467 | Rev 7672 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6467 Rev 7410
Line 7... Line 7...
7
import in.shop2020.purchase.LineItem;
7
import in.shop2020.purchase.LineItem;
8
import in.shop2020.purchase.PurchaseOrder;
8
import in.shop2020.purchase.PurchaseOrder;
9
import in.shop2020.purchase.PurchaseService.Client;
9
import in.shop2020.purchase.PurchaseService.Client;
10
import in.shop2020.thrift.clients.PurchaseClient;
10
import in.shop2020.thrift.clients.PurchaseClient;
11
import in.shop2020.warehouse.ScanType;
11
import in.shop2020.warehouse.ScanType;
-
 
12
import in.shop2020.warehouse.TransferLotStatus;
12
import in.shop2020.warehouse.WarehouseServiceException;
13
import in.shop2020.warehouse.WarehouseServiceException;
13
 
14
 
14
import org.apache.commons.logging.Log;
15
import org.apache.commons.logging.Log;
15
import org.apache.commons.logging.LogFactory;
16
import org.apache.commons.logging.LogFactory;
16
 
17
 
Line 30... Line 31...
30
    private long currentQuantity;
31
    private long currentQuantity;
31
    private long purchaseId;
32
    private long purchaseId;
32
    private long purchaseReturnId;
33
    private long purchaseReturnId;
33
    private long currentWarehouseId;
34
    private long currentWarehouseId;
34
    private ScanType lastScanType;
35
    private ScanType lastScanType;
-
 
36
    private long physicalWarehouseId;
-
 
37
    private TransferLotStatus transferStatus;
35
 
38
 
36
    public static InventoryItem create(in.shop2020.warehouse.InventoryItem thriftInventoryItem) {
39
    public static InventoryItem create(in.shop2020.warehouse.InventoryItem thriftInventoryItem) {
37
        InventoryItem inventoryItem = new InventoryItem();
40
        InventoryItem inventoryItem = new InventoryItem();
38
        inventoryItem.id = thriftInventoryItem.getId();
41
        inventoryItem.id = thriftInventoryItem.getId();
39
        inventoryItem.itemId = thriftInventoryItem.getItemId();
42
        inventoryItem.itemId = thriftInventoryItem.getItemId();
Line 43... Line 46...
43
        inventoryItem.currentQuantity = thriftInventoryItem.getCurrentQuantity();
46
        inventoryItem.currentQuantity = thriftInventoryItem.getCurrentQuantity();
44
        inventoryItem.purchaseId = thriftInventoryItem.getPurchaseId();
47
        inventoryItem.purchaseId = thriftInventoryItem.getPurchaseId();
45
        inventoryItem.purchaseReturnId = thriftInventoryItem.getPurchaseReturnId();
48
        inventoryItem.purchaseReturnId = thriftInventoryItem.getPurchaseReturnId();
46
        inventoryItem.currentWarehouseId = thriftInventoryItem.getCurrentWarehouseId();
49
        inventoryItem.currentWarehouseId = thriftInventoryItem.getCurrentWarehouseId();
47
        inventoryItem.lastScanType = thriftInventoryItem.getLastScanType();
50
        inventoryItem.lastScanType = thriftInventoryItem.getLastScanType();
-
 
51
        inventoryItem.physicalWarehouseId = thriftInventoryItem.getPhysicalWarehouseId();
-
 
52
        inventoryItem.transferStatus = thriftInventoryItem.getTransferStatus();
48
 
53
 
49
        return inventoryItem;
54
        return inventoryItem;
50
    }
55
    }
51
 
56
 
52
    public in.shop2020.warehouse.InventoryItem convert() throws WarehouseServiceException {
57
    public in.shop2020.warehouse.InventoryItem convert() throws WarehouseServiceException {
Line 59... Line 64...
59
        inventoryItem.setPurchaseId(purchaseId);
64
        inventoryItem.setPurchaseId(purchaseId);
60
        inventoryItem.setPurchaseReturnId(purchaseReturnId);
65
        inventoryItem.setPurchaseReturnId(purchaseReturnId);
61
        inventoryItem.setSerialNumber(serialNumber);
66
        inventoryItem.setSerialNumber(serialNumber);
62
        inventoryItem.setCurrentWarehouseId(currentWarehouseId);
67
        inventoryItem.setCurrentWarehouseId(currentWarehouseId);
63
        inventoryItem.setLastScanType(lastScanType);        
68
        inventoryItem.setLastScanType(lastScanType);        
-
 
69
        inventoryItem.setTransferStatus(transferStatus);        
-
 
70
        inventoryItem.setPhysicalWarehouseId(physicalWarehouseId);        
64
 
71
 
65
        // Setting derived fields
72
        // Setting derived fields
66
        try {
73
        try {
67
            Client client = new PurchaseClient().getClient();
74
            Client client = new PurchaseClient().getClient();
68
            PurchaseOrder purchaseOrder = client.getPurchaseOrderForPurchase(purchaseId);
75
            PurchaseOrder purchaseOrder = client.getPurchaseOrderForPurchase(purchaseId);
Line 145... Line 152...
145
    }
152
    }
146
 
153
 
147
    public void setLastScanType(ScanType lastScanType) {
154
    public void setLastScanType(ScanType lastScanType) {
148
        this.lastScanType = lastScanType;
155
        this.lastScanType = lastScanType;
149
    }
156
    }
-
 
157
 
-
 
158
	public TransferLotStatus getTransferStatus() {
-
 
159
		return transferStatus;
-
 
160
	}
-
 
161
 
-
 
162
	public void setTransferStatus(TransferLotStatus transferStatus) {
-
 
163
		this.transferStatus = transferStatus;
-
 
164
	}
-
 
165
 
-
 
166
	public long getPhysicalWarehouseId() {
-
 
167
		return physicalWarehouseId;
-
 
168
	}
-
 
169
 
-
 
170
	public void setPhysicalWarehouseId(long physicalWarehouseId) {
-
 
171
		this.physicalWarehouseId = physicalWarehouseId;
-
 
172
	}
-
 
173
	
150
}
174
}