Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
26629 tejbeer 1
package com.spice.profitmandi.dao.entity.fofo;
2
 
3
import java.io.Serializable;
4
import java.time.LocalDateTime;
26924 amit.gupta 5
import java.util.List;
26629 tejbeer 6
 
7
import javax.persistence.Column;
8
import javax.persistence.Convert;
9
import javax.persistence.Entity;
27046 tejbeer 10
import javax.persistence.EnumType;
11
import javax.persistence.Enumerated;
26629 tejbeer 12
import javax.persistence.GeneratedValue;
13
import javax.persistence.GenerationType;
14
import javax.persistence.Id;
15
import javax.persistence.Table;
26817 amit.gupta 16
import javax.persistence.Transient;
26629 tejbeer 17
 
18
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
27046 tejbeer 19
import com.spice.profitmandi.dao.enumuration.transaction.OrderStatus;
26629 tejbeer 20
 
26817 amit.gupta 21
/**
22
 * @author amit
23
 *
24
 */
26629 tejbeer 25
@Entity
26
@Table(name = "fofo.pending_order", schema = "fofo")
27
public class PendingOrder implements Serializable {
28
 
29
	/**
30
	 * 
31
	 */
32
	private static final long serialVersionUID = 1L;
33
	@Id
34
	@Column(name = "id")
35
	@GeneratedValue(strategy = GenerationType.IDENTITY)
36
	private int id;
37
 
38
	@Column(name = "fofo_id")
39
	private int fofoId;
40
 
26817 amit.gupta 41
	@Column(name = "customer_id")
42
	private int customerId;
26629 tejbeer 43
 
26817 amit.gupta 44
	@Column(name = "pay_method")
45
	private String payMethod;
27046 tejbeer 46
 
26629 tejbeer 47
	@Column(name = "customer_gst_number")
48
	private String customerGstNumber;
49
 
26817 amit.gupta 50
	@Column(name = "customer_address_id")
51
	private int customerAddressId;
26629 tejbeer 52
 
53
	@Column(name = "status")
27046 tejbeer 54
	@Enumerated(EnumType.STRING)
55
	private OrderStatus status;
56
 
57
	public OrderStatus getStatus() {
58
		return status;
59
	}
60
 
61
	public void setStatus(OrderStatus status) {
62
		this.status = status;
63
	}
64
 
26817 amit.gupta 65
	@Transient
66
	private Customer customer;
26629 tejbeer 67
 
28344 tejbeer 68
	@Transient
69
	private String payMethodDescription;
70
 
26629 tejbeer 71
	@Convert(converter = LocalDateTimeAttributeConverter.class)
72
	@Column(name = "create_timestamp")
73
	private LocalDateTime createTimestamp = LocalDateTime.now();
27046 tejbeer 74
 
26817 amit.gupta 75
	@Column(name = "total_amount")
76
	private double totalAmount;
77
	@Column(name = "cancelled_amount")
78
	private double cancelledAmount;
79
	@Column(name = "refunded_amount")
80
	private double refundedAmount;
81
	@Column(name = "paid_amount")
82
	private double paidAmount;
83
	@Column(name = "billed_amount")
84
	private double billedAmount;
27046 tejbeer 85
 
26924 amit.gupta 86
	@Transient
87
	private List<PendingOrderItem> pendingOrderItems;
27046 tejbeer 88
 
26924 amit.gupta 89
	public List<PendingOrderItem> getPendingOrderItems() {
90
		return pendingOrderItems;
91
	}
27046 tejbeer 92
 
28344 tejbeer 93
	public String getPayMethodDescription() {
94
		return payMethodDescription;
95
	}
96
 
97
	public void setPayMethodDescription(String payMethodDescription) {
98
		this.payMethodDescription = payMethodDescription;
99
	}
100
 
26924 amit.gupta 101
	public void setPendingOrderItems(List<PendingOrderItem> pendingOrderItems) {
102
		this.pendingOrderItems = pendingOrderItems;
103
	}
27046 tejbeer 104
 
26817 amit.gupta 105
	@Override
106
	public String toString() {
107
		return "PendingOrder [id=" + id + ", fofoId=" + fofoId + ", customerId=" + customerId + ", payMethod="
108
				+ payMethod + ", customerGstNumber=" + customerGstNumber + ", customerAddressId=" + customerAddressId
28344 tejbeer 109
				+ ", status=" + status + ", customer=" + customer + ", payMethodDescription=" + payMethodDescription
110
				+ ", createTimestamp=" + createTimestamp + ", totalAmount=" + totalAmount + ", cancelledAmount="
111
				+ cancelledAmount + ", refundedAmount=" + refundedAmount + ", paidAmount=" + paidAmount
112
				+ ", billedAmount=" + billedAmount + ", pendingOrderItems=" + pendingOrderItems + "]";
26629 tejbeer 113
	}
27046 tejbeer 114
 
26629 tejbeer 115
	public int getId() {
116
		return id;
117
	}
27046 tejbeer 118
 
26817 amit.gupta 119
	public Customer getCustomer() {
120
		return customer;
121
	}
27046 tejbeer 122
 
26817 amit.gupta 123
	public void setCustomer(Customer customer) {
124
		this.customer = customer;
125
	}
27046 tejbeer 126
 
26629 tejbeer 127
	public void setId(int id) {
128
		this.id = id;
129
	}
27046 tejbeer 130
 
26629 tejbeer 131
	public int getFofoId() {
132
		return fofoId;
133
	}
27046 tejbeer 134
 
26817 amit.gupta 135
	public String getPayMethod() {
136
		return payMethod;
137
	}
27046 tejbeer 138
 
26817 amit.gupta 139
	public void setPayMethod(String payMethod) {
140
		this.payMethod = payMethod;
141
	}
27046 tejbeer 142
 
26629 tejbeer 143
	public void setFofoId(int fofoId) {
144
		this.fofoId = fofoId;
145
	}
27046 tejbeer 146
 
26817 amit.gupta 147
	public int getCustomerId() {
148
		return customerId;
26629 tejbeer 149
	}
27046 tejbeer 150
 
26817 amit.gupta 151
	public void setCustomerId(int customerId) {
152
		this.customerId = customerId;
26629 tejbeer 153
	}
27046 tejbeer 154
 
26817 amit.gupta 155
	public String getCustomerGstNumber() {
156
		return customerGstNumber;
26629 tejbeer 157
	}
27046 tejbeer 158
 
26817 amit.gupta 159
	public void setCustomerGstNumber(String customerGstNumber) {
160
		this.customerGstNumber = customerGstNumber;
26629 tejbeer 161
	}
27046 tejbeer 162
 
26817 amit.gupta 163
	public int getCustomerAddressId() {
164
		return customerAddressId;
26629 tejbeer 165
	}
27046 tejbeer 166
 
26817 amit.gupta 167
	public void setCustomerAddressId(int customerAddressId) {
168
		this.customerAddressId = customerAddressId;
26629 tejbeer 169
	}
27046 tejbeer 170
 
26629 tejbeer 171
	public LocalDateTime getCreateTimestamp() {
172
		return createTimestamp;
173
	}
27046 tejbeer 174
 
26629 tejbeer 175
	public void setCreateTimestamp(LocalDateTime createTimestamp) {
176
		this.createTimestamp = createTimestamp;
177
	}
27046 tejbeer 178
 
26817 amit.gupta 179
	public double getTotalAmount() {
180
		return totalAmount;
26629 tejbeer 181
	}
27046 tejbeer 182
 
26817 amit.gupta 183
	public void setTotalAmount(double totalAmount) {
184
		this.totalAmount = totalAmount;
26629 tejbeer 185
	}
27046 tejbeer 186
 
26817 amit.gupta 187
	public double getCancelledAmount() {
188
		return cancelledAmount;
26629 tejbeer 189
	}
27046 tejbeer 190
 
26817 amit.gupta 191
	public void setCancelledAmount(double cancelledAmount) {
192
		this.cancelledAmount = cancelledAmount;
26629 tejbeer 193
	}
27046 tejbeer 194
 
26817 amit.gupta 195
	public double getRefundedAmount() {
196
		return refundedAmount;
197
	}
27046 tejbeer 198
 
26817 amit.gupta 199
	public void setRefundedAmount(double refundedAmount) {
200
		this.refundedAmount = refundedAmount;
201
	}
27046 tejbeer 202
 
26817 amit.gupta 203
	public double getPaidAmount() {
204
		return paidAmount;
205
	}
27046 tejbeer 206
 
26817 amit.gupta 207
	public void setPaidAmount(double paidAmount) {
208
		this.paidAmount = paidAmount;
209
	}
27046 tejbeer 210
 
26817 amit.gupta 211
	public double getBilledAmount() {
212
		return billedAmount;
213
	}
27046 tejbeer 214
 
26817 amit.gupta 215
	public void setBilledAmount(double billedAmount) {
216
		this.billedAmount = billedAmount;
217
	}
27046 tejbeer 218
 
26817 amit.gupta 219
	public static long getSerialversionuid() {
220
		return serialVersionUID;
221
	}
27046 tejbeer 222
 
26629 tejbeer 223
	@Override
26817 amit.gupta 224
	public int hashCode() {
225
		final int prime = 31;
226
		int result = 1;
227
		long temp;
228
		temp = Double.doubleToLongBits(billedAmount);
229
		result = prime * result + (int) (temp ^ (temp >>> 32));
230
		temp = Double.doubleToLongBits(cancelledAmount);
231
		result = prime * result + (int) (temp ^ (temp >>> 32));
232
		result = prime * result + ((createTimestamp == null) ? 0 : createTimestamp.hashCode());
27046 tejbeer 233
		result = prime * result + ((customer == null) ? 0 : customer.hashCode());
26817 amit.gupta 234
		result = prime * result + customerAddressId;
235
		result = prime * result + ((customerGstNumber == null) ? 0 : customerGstNumber.hashCode());
236
		result = prime * result + customerId;
237
		result = prime * result + fofoId;
238
		result = prime * result + id;
239
		temp = Double.doubleToLongBits(paidAmount);
240
		result = prime * result + (int) (temp ^ (temp >>> 32));
241
		result = prime * result + ((payMethod == null) ? 0 : payMethod.hashCode());
28344 tejbeer 242
		result = prime * result + ((payMethodDescription == null) ? 0 : payMethodDescription.hashCode());
27046 tejbeer 243
		result = prime * result + ((pendingOrderItems == null) ? 0 : pendingOrderItems.hashCode());
26817 amit.gupta 244
		temp = Double.doubleToLongBits(refundedAmount);
245
		result = prime * result + (int) (temp ^ (temp >>> 32));
246
		result = prime * result + ((status == null) ? 0 : status.hashCode());
247
		temp = Double.doubleToLongBits(totalAmount);
248
		result = prime * result + (int) (temp ^ (temp >>> 32));
249
		return result;
26629 tejbeer 250
	}
27046 tejbeer 251
 
26817 amit.gupta 252
	@Override
253
	public boolean equals(Object obj) {
254
		if (this == obj)
255
			return true;
256
		if (obj == null)
257
			return false;
258
		if (getClass() != obj.getClass())
259
			return false;
260
		PendingOrder other = (PendingOrder) obj;
261
		if (Double.doubleToLongBits(billedAmount) != Double.doubleToLongBits(other.billedAmount))
262
			return false;
263
		if (Double.doubleToLongBits(cancelledAmount) != Double.doubleToLongBits(other.cancelledAmount))
264
			return false;
265
		if (createTimestamp == null) {
266
			if (other.createTimestamp != null)
267
				return false;
268
		} else if (!createTimestamp.equals(other.createTimestamp))
269
			return false;
27046 tejbeer 270
		if (customer == null) {
271
			if (other.customer != null)
272
				return false;
273
		} else if (!customer.equals(other.customer))
274
			return false;
26817 amit.gupta 275
		if (customerAddressId != other.customerAddressId)
276
			return false;
277
		if (customerGstNumber == null) {
278
			if (other.customerGstNumber != null)
279
				return false;
280
		} else if (!customerGstNumber.equals(other.customerGstNumber))
281
			return false;
282
		if (customerId != other.customerId)
283
			return false;
284
		if (fofoId != other.fofoId)
285
			return false;
286
		if (id != other.id)
287
			return false;
288
		if (Double.doubleToLongBits(paidAmount) != Double.doubleToLongBits(other.paidAmount))
289
			return false;
290
		if (payMethod == null) {
291
			if (other.payMethod != null)
292
				return false;
293
		} else if (!payMethod.equals(other.payMethod))
294
			return false;
28344 tejbeer 295
		if (payMethodDescription == null) {
296
			if (other.payMethodDescription != null)
297
				return false;
298
		} else if (!payMethodDescription.equals(other.payMethodDescription))
299
			return false;
27046 tejbeer 300
		if (pendingOrderItems == null) {
301
			if (other.pendingOrderItems != null)
302
				return false;
303
		} else if (!pendingOrderItems.equals(other.pendingOrderItems))
304
			return false;
26817 amit.gupta 305
		if (Double.doubleToLongBits(refundedAmount) != Double.doubleToLongBits(other.refundedAmount))
306
			return false;
27046 tejbeer 307
		if (status != other.status)
26817 amit.gupta 308
			return false;
309
		if (Double.doubleToLongBits(totalAmount) != Double.doubleToLongBits(other.totalAmount))
310
			return false;
311
		return true;
312
	}
26629 tejbeer 313
 
314
}