Subversion Repositories SmartDukaan

Rev

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

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