Subversion Repositories SmartDukaan

Rev

Rev 27723 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
24081 govind 1
package com.spice.profitmandi.dao.entity.warehouse;
2
 
3
import java.time.LocalDateTime;
4
 
5
import javax.persistence.Column;
6
import javax.persistence.Convert;
7
import javax.persistence.Entity;
8
import javax.persistence.EnumType;
9
import javax.persistence.Enumerated;
10
import javax.persistence.GeneratedValue;
11
import javax.persistence.GenerationType;
12
import javax.persistence.Id;
13
import javax.persistence.Table;
14
 
15
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
16
 
17
import in.shop2020.warehouse.ScanType;
18
/**
19
 * This class basically contains scheme details
20
 * 
21
 * @author Govind Kumar
22
 *
23
 */
24
@Entity
25
@Table(name = "warehouse.scanNew", schema = "warehouse")
26
public class WarehouseScan {
27
 
28
	@Id
29
	@Column(name = "id", unique = true, updatable = false)
30
	@GeneratedValue(strategy = GenerationType.IDENTITY)
31
	private int id;
32
 
33
	@Column(name = "inventoryItemId")
34
	private int inventoryItemId;
35
 
36
	@Column(name = "quantity")
37
	private Integer quantity;
38
 
39
	@Column(name = "orderId")
40
	private Integer orderId; // The order that was fulfilled with thin scan!
41
 
42
	@Column(name = "warehouseId")
43
	private int warehouseId;
44
 
45
	@Column(name = "transferLotId")
46
	private Integer transferLotId;
47
 
48
	@Column(name = "type")
49
	@Enumerated(EnumType.STRING)
50
	private ScanType type;
51
 
52
	@Convert(converter = LocalDateTimeAttributeConverter.class)
53
	@Column(name = "scannedAt")
54
	private LocalDateTime scannedAt;
55
 
56
	@Column(name = "remarks")
57
	private String remarks;
58
 
59
	public int getId() {
60
		return id;
61
	}
62
 
63
	public void setId(int id) {
64
		this.id = id;
65
	}
66
 
67
	public int getInventoryItemId() {
68
		return inventoryItemId;
69
	}
70
 
71
	public void setInventoryItemId(int inventoryItemId) {
72
		this.inventoryItemId = inventoryItemId;
73
	}
74
 
75
	public Integer getQuantity() {
76
		return quantity;
77
	}
78
 
79
	public void setQuantity(Integer quantity) {
80
		this.quantity = quantity;
81
	}
82
 
83
	public Integer getOrderId() {
84
		return orderId;
85
	}
86
 
87
	public void setOrderId(Integer orderId) {
88
		this.orderId = orderId;
89
	}
90
 
91
	public int getWarehouseId() {
92
		return warehouseId;
93
	}
94
 
95
	public void setWarehouseId(int warehouseId) {
96
		this.warehouseId = warehouseId;
97
	}
98
 
99
	public Integer getTransferLotId() {
100
		return transferLotId;
101
	}
102
 
103
	public void setTransferLotId(Integer transferLotId) {
104
		this.transferLotId = transferLotId;
105
	}
106
 
107
	public ScanType getType() {
108
		return type;
109
	}
110
 
111
	public void setType(ScanType type) {
112
		this.type = type;
113
	}
114
 
115
	public LocalDateTime getScannedAt() {
116
		return scannedAt;
117
	}
118
 
119
	public void setScannedAt(LocalDateTime scannedAt) {
120
		this.scannedAt = scannedAt;
121
	}
122
 
123
	public String getRemarks() {
124
		return remarks;
125
	}
126
 
127
	public void setRemarks(String remarks) {
128
		this.remarks = remarks;
129
	}
130
 
131
	@Override
132
	public int hashCode() {
133
		final int prime = 31;
134
		int result = 1;
135
		result = prime * result + id;
136
		result = prime * result + inventoryItemId;
137
		result = prime * result + ((orderId == null) ? 0 : orderId.hashCode());
138
		result = prime * result + ((quantity == null) ? 0 : quantity.hashCode());
139
		result = prime * result + ((remarks == null) ? 0 : remarks.hashCode());
140
		result = prime * result + ((scannedAt == null) ? 0 : scannedAt.hashCode());
141
		result = prime * result + ((transferLotId == null) ? 0 : transferLotId.hashCode());
142
		result = prime * result + ((type == null) ? 0 : type.hashCode());
143
		result = prime * result + warehouseId;
144
		return result;
145
	}
146
 
147
	@Override
148
	public boolean equals(Object obj) {
149
		if (this == obj)
150
			return true;
151
		if (obj == null)
152
			return false;
153
		if (getClass() != obj.getClass())
154
			return false;
155
		WarehouseScan other = (WarehouseScan) obj;
156
		if (id != other.id)
157
			return false;
158
		if (inventoryItemId != other.inventoryItemId)
159
			return false;
160
		if (orderId == null) {
161
			if (other.orderId != null)
162
				return false;
163
		} else if (!orderId.equals(other.orderId))
164
			return false;
165
		if (quantity == null) {
166
			if (other.quantity != null)
167
				return false;
168
		} else if (!quantity.equals(other.quantity))
169
			return false;
170
		if (remarks == null) {
171
			if (other.remarks != null)
172
				return false;
173
		} else if (!remarks.equals(other.remarks))
174
			return false;
175
		if (scannedAt == null) {
176
			if (other.scannedAt != null)
177
				return false;
178
		} else if (!scannedAt.equals(other.scannedAt))
179
			return false;
180
		if (transferLotId == null) {
181
			if (other.transferLotId != null)
182
				return false;
183
		} else if (!transferLotId.equals(other.transferLotId))
184
			return false;
185
		if (type != other.type)
186
			return false;
187
		if (warehouseId != other.warehouseId)
188
			return false;
189
		return true;
190
	}
191
 
192
	@Override
193
	public String toString() {
194
		return "WarehouseScan [id=" + id + ", inventoryItemId=" + inventoryItemId + ", quantity=" + quantity
195
				+ ", orderId=" + orderId + ", warehouseId=" + warehouseId + ", transferLotId=" + transferLotId
196
				+ ", type=" + type + ", scannedAt=" + scannedAt + ", remarks=" + remarks + "]";
197
	}
198
 
199
 
200
 
201
}