| 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
|
| 31860 |
tejbeer |
26 |
@Table(name = "fofo.pending_order")
|
| 26629 |
tejbeer |
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
|
| 28377 |
tejbeer |
69 |
private CustomerAddress customerAddress;
|
|
|
70 |
|
|
|
71 |
public CustomerAddress getCustomerAddress() {
|
|
|
72 |
return customerAddress;
|
|
|
73 |
}
|
|
|
74 |
|
|
|
75 |
public void setCustomerAddress(CustomerAddress customerAddress) {
|
|
|
76 |
this.customerAddress = customerAddress;
|
|
|
77 |
}
|
|
|
78 |
|
|
|
79 |
@Transient
|
| 28344 |
tejbeer |
80 |
private String payMethodDescription;
|
|
|
81 |
|
| 26629 |
tejbeer |
82 |
@Convert(converter = LocalDateTimeAttributeConverter.class)
|
|
|
83 |
@Column(name = "create_timestamp")
|
|
|
84 |
private LocalDateTime createTimestamp = LocalDateTime.now();
|
| 27046 |
tejbeer |
85 |
|
| 26817 |
amit.gupta |
86 |
@Column(name = "total_amount")
|
|
|
87 |
private double totalAmount;
|
|
|
88 |
@Column(name = "cancelled_amount")
|
|
|
89 |
private double cancelledAmount;
|
|
|
90 |
@Column(name = "refunded_amount")
|
|
|
91 |
private double refundedAmount;
|
|
|
92 |
@Column(name = "paid_amount")
|
|
|
93 |
private double paidAmount;
|
|
|
94 |
@Column(name = "billed_amount")
|
|
|
95 |
private double billedAmount;
|
| 27046 |
tejbeer |
96 |
|
| 26924 |
amit.gupta |
97 |
@Transient
|
|
|
98 |
private List<PendingOrderItem> pendingOrderItems;
|
| 27046 |
tejbeer |
99 |
|
| 26924 |
amit.gupta |
100 |
public List<PendingOrderItem> getPendingOrderItems() {
|
|
|
101 |
return pendingOrderItems;
|
|
|
102 |
}
|
| 27046 |
tejbeer |
103 |
|
| 28344 |
tejbeer |
104 |
public String getPayMethodDescription() {
|
|
|
105 |
return payMethodDescription;
|
|
|
106 |
}
|
|
|
107 |
|
|
|
108 |
public void setPayMethodDescription(String payMethodDescription) {
|
|
|
109 |
this.payMethodDescription = payMethodDescription;
|
|
|
110 |
}
|
|
|
111 |
|
| 26924 |
amit.gupta |
112 |
public void setPendingOrderItems(List<PendingOrderItem> pendingOrderItems) {
|
|
|
113 |
this.pendingOrderItems = pendingOrderItems;
|
|
|
114 |
}
|
| 27046 |
tejbeer |
115 |
|
| 26817 |
amit.gupta |
116 |
@Override
|
|
|
117 |
public String toString() {
|
|
|
118 |
return "PendingOrder [id=" + id + ", fofoId=" + fofoId + ", customerId=" + customerId + ", payMethod="
|
|
|
119 |
+ payMethod + ", customerGstNumber=" + customerGstNumber + ", customerAddressId=" + customerAddressId
|
| 28377 |
tejbeer |
120 |
+ ", status=" + status + ", customer=" + customer + ", customerAddress=" + customerAddress
|
|
|
121 |
+ ", payMethodDescription=" + payMethodDescription + ", createTimestamp=" + createTimestamp
|
|
|
122 |
+ ", totalAmount=" + totalAmount + ", cancelledAmount=" + cancelledAmount + ", refundedAmount="
|
|
|
123 |
+ refundedAmount + ", paidAmount=" + paidAmount + ", billedAmount=" + billedAmount
|
|
|
124 |
+ ", pendingOrderItems=" + pendingOrderItems + ", getStatus()=" + getStatus()
|
|
|
125 |
+ ", getCustomerAddress()=" + getCustomerAddress() + ", getPendingOrderItems()="
|
|
|
126 |
+ getPendingOrderItems() + ", getPayMethodDescription()=" + getPayMethodDescription() + ", getId()="
|
|
|
127 |
+ getId() + ", getCustomer()=" + getCustomer() + ", getFofoId()=" + getFofoId() + ", getPayMethod()="
|
|
|
128 |
+ getPayMethod() + ", getCustomerId()=" + getCustomerId() + ", getCustomerGstNumber()="
|
|
|
129 |
+ getCustomerGstNumber() + ", getCustomerAddressId()=" + getCustomerAddressId()
|
|
|
130 |
+ ", getCreateTimestamp()=" + getCreateTimestamp() + ", getTotalAmount()=" + getTotalAmount()
|
|
|
131 |
+ ", getCancelledAmount()=" + getCancelledAmount() + ", getRefundedAmount()=" + getRefundedAmount()
|
|
|
132 |
+ ", getPaidAmount()=" + getPaidAmount() + ", getBilledAmount()=" + getBilledAmount() + ", hashCode()="
|
|
|
133 |
+ hashCode() + ", getClass()=" + getClass() + ", toString()=" + super.toString() + "]";
|
| 26629 |
tejbeer |
134 |
}
|
| 27046 |
tejbeer |
135 |
|
| 26629 |
tejbeer |
136 |
public int getId() {
|
|
|
137 |
return id;
|
|
|
138 |
}
|
| 27046 |
tejbeer |
139 |
|
| 26817 |
amit.gupta |
140 |
public Customer getCustomer() {
|
|
|
141 |
return customer;
|
|
|
142 |
}
|
| 27046 |
tejbeer |
143 |
|
| 26817 |
amit.gupta |
144 |
public void setCustomer(Customer customer) {
|
|
|
145 |
this.customer = customer;
|
|
|
146 |
}
|
| 27046 |
tejbeer |
147 |
|
| 26629 |
tejbeer |
148 |
public void setId(int id) {
|
|
|
149 |
this.id = id;
|
|
|
150 |
}
|
| 27046 |
tejbeer |
151 |
|
| 26629 |
tejbeer |
152 |
public int getFofoId() {
|
|
|
153 |
return fofoId;
|
|
|
154 |
}
|
| 27046 |
tejbeer |
155 |
|
| 26817 |
amit.gupta |
156 |
public String getPayMethod() {
|
|
|
157 |
return payMethod;
|
|
|
158 |
}
|
| 27046 |
tejbeer |
159 |
|
| 26817 |
amit.gupta |
160 |
public void setPayMethod(String payMethod) {
|
|
|
161 |
this.payMethod = payMethod;
|
|
|
162 |
}
|
| 27046 |
tejbeer |
163 |
|
| 26629 |
tejbeer |
164 |
public void setFofoId(int fofoId) {
|
|
|
165 |
this.fofoId = fofoId;
|
|
|
166 |
}
|
| 27046 |
tejbeer |
167 |
|
| 26817 |
amit.gupta |
168 |
public int getCustomerId() {
|
|
|
169 |
return customerId;
|
| 26629 |
tejbeer |
170 |
}
|
| 27046 |
tejbeer |
171 |
|
| 26817 |
amit.gupta |
172 |
public void setCustomerId(int customerId) {
|
|
|
173 |
this.customerId = customerId;
|
| 26629 |
tejbeer |
174 |
}
|
| 27046 |
tejbeer |
175 |
|
| 26817 |
amit.gupta |
176 |
public String getCustomerGstNumber() {
|
|
|
177 |
return customerGstNumber;
|
| 26629 |
tejbeer |
178 |
}
|
| 27046 |
tejbeer |
179 |
|
| 26817 |
amit.gupta |
180 |
public void setCustomerGstNumber(String customerGstNumber) {
|
|
|
181 |
this.customerGstNumber = customerGstNumber;
|
| 26629 |
tejbeer |
182 |
}
|
| 27046 |
tejbeer |
183 |
|
| 26817 |
amit.gupta |
184 |
public int getCustomerAddressId() {
|
|
|
185 |
return customerAddressId;
|
| 26629 |
tejbeer |
186 |
}
|
| 27046 |
tejbeer |
187 |
|
| 26817 |
amit.gupta |
188 |
public void setCustomerAddressId(int customerAddressId) {
|
|
|
189 |
this.customerAddressId = customerAddressId;
|
| 26629 |
tejbeer |
190 |
}
|
| 27046 |
tejbeer |
191 |
|
| 26629 |
tejbeer |
192 |
public LocalDateTime getCreateTimestamp() {
|
|
|
193 |
return createTimestamp;
|
|
|
194 |
}
|
| 27046 |
tejbeer |
195 |
|
| 26629 |
tejbeer |
196 |
public void setCreateTimestamp(LocalDateTime createTimestamp) {
|
|
|
197 |
this.createTimestamp = createTimestamp;
|
|
|
198 |
}
|
| 27046 |
tejbeer |
199 |
|
| 26817 |
amit.gupta |
200 |
public double getTotalAmount() {
|
|
|
201 |
return totalAmount;
|
| 26629 |
tejbeer |
202 |
}
|
| 27046 |
tejbeer |
203 |
|
| 26817 |
amit.gupta |
204 |
public void setTotalAmount(double totalAmount) {
|
|
|
205 |
this.totalAmount = totalAmount;
|
| 26629 |
tejbeer |
206 |
}
|
| 27046 |
tejbeer |
207 |
|
| 26817 |
amit.gupta |
208 |
public double getCancelledAmount() {
|
|
|
209 |
return cancelledAmount;
|
| 26629 |
tejbeer |
210 |
}
|
| 27046 |
tejbeer |
211 |
|
| 26817 |
amit.gupta |
212 |
public void setCancelledAmount(double cancelledAmount) {
|
|
|
213 |
this.cancelledAmount = cancelledAmount;
|
| 26629 |
tejbeer |
214 |
}
|
| 27046 |
tejbeer |
215 |
|
| 26817 |
amit.gupta |
216 |
public double getRefundedAmount() {
|
|
|
217 |
return refundedAmount;
|
|
|
218 |
}
|
| 27046 |
tejbeer |
219 |
|
| 26817 |
amit.gupta |
220 |
public void setRefundedAmount(double refundedAmount) {
|
|
|
221 |
this.refundedAmount = refundedAmount;
|
|
|
222 |
}
|
| 27046 |
tejbeer |
223 |
|
| 26817 |
amit.gupta |
224 |
public double getPaidAmount() {
|
|
|
225 |
return paidAmount;
|
|
|
226 |
}
|
| 27046 |
tejbeer |
227 |
|
| 26817 |
amit.gupta |
228 |
public void setPaidAmount(double paidAmount) {
|
|
|
229 |
this.paidAmount = paidAmount;
|
|
|
230 |
}
|
| 27046 |
tejbeer |
231 |
|
| 26817 |
amit.gupta |
232 |
public double getBilledAmount() {
|
|
|
233 |
return billedAmount;
|
|
|
234 |
}
|
| 27046 |
tejbeer |
235 |
|
| 26817 |
amit.gupta |
236 |
public void setBilledAmount(double billedAmount) {
|
|
|
237 |
this.billedAmount = billedAmount;
|
|
|
238 |
}
|
| 27046 |
tejbeer |
239 |
|
| 26817 |
amit.gupta |
240 |
public static long getSerialversionuid() {
|
|
|
241 |
return serialVersionUID;
|
|
|
242 |
}
|
| 27046 |
tejbeer |
243 |
|
| 26629 |
tejbeer |
244 |
@Override
|
| 26817 |
amit.gupta |
245 |
public int hashCode() {
|
|
|
246 |
final int prime = 31;
|
|
|
247 |
int result = 1;
|
|
|
248 |
long temp;
|
|
|
249 |
temp = Double.doubleToLongBits(billedAmount);
|
|
|
250 |
result = prime * result + (int) (temp ^ (temp >>> 32));
|
|
|
251 |
temp = Double.doubleToLongBits(cancelledAmount);
|
|
|
252 |
result = prime * result + (int) (temp ^ (temp >>> 32));
|
|
|
253 |
result = prime * result + ((createTimestamp == null) ? 0 : createTimestamp.hashCode());
|
| 27046 |
tejbeer |
254 |
result = prime * result + ((customer == null) ? 0 : customer.hashCode());
|
| 26817 |
amit.gupta |
255 |
result = prime * result + customerAddressId;
|
| 28377 |
tejbeer |
256 |
result = prime * result + ((customerAddress == null) ? 0 : customerAddress.hashCode());
|
| 26817 |
amit.gupta |
257 |
result = prime * result + ((customerGstNumber == null) ? 0 : customerGstNumber.hashCode());
|
|
|
258 |
result = prime * result + customerId;
|
|
|
259 |
result = prime * result + fofoId;
|
|
|
260 |
result = prime * result + id;
|
|
|
261 |
temp = Double.doubleToLongBits(paidAmount);
|
|
|
262 |
result = prime * result + (int) (temp ^ (temp >>> 32));
|
|
|
263 |
result = prime * result + ((payMethod == null) ? 0 : payMethod.hashCode());
|
| 28344 |
tejbeer |
264 |
result = prime * result + ((payMethodDescription == null) ? 0 : payMethodDescription.hashCode());
|
| 27046 |
tejbeer |
265 |
result = prime * result + ((pendingOrderItems == null) ? 0 : pendingOrderItems.hashCode());
|
| 26817 |
amit.gupta |
266 |
temp = Double.doubleToLongBits(refundedAmount);
|
|
|
267 |
result = prime * result + (int) (temp ^ (temp >>> 32));
|
|
|
268 |
result = prime * result + ((status == null) ? 0 : status.hashCode());
|
|
|
269 |
temp = Double.doubleToLongBits(totalAmount);
|
|
|
270 |
result = prime * result + (int) (temp ^ (temp >>> 32));
|
|
|
271 |
return result;
|
| 26629 |
tejbeer |
272 |
}
|
| 27046 |
tejbeer |
273 |
|
| 26817 |
amit.gupta |
274 |
@Override
|
|
|
275 |
public boolean equals(Object obj) {
|
|
|
276 |
if (this == obj)
|
|
|
277 |
return true;
|
|
|
278 |
if (obj == null)
|
|
|
279 |
return false;
|
|
|
280 |
if (getClass() != obj.getClass())
|
|
|
281 |
return false;
|
|
|
282 |
PendingOrder other = (PendingOrder) obj;
|
|
|
283 |
if (Double.doubleToLongBits(billedAmount) != Double.doubleToLongBits(other.billedAmount))
|
|
|
284 |
return false;
|
|
|
285 |
if (Double.doubleToLongBits(cancelledAmount) != Double.doubleToLongBits(other.cancelledAmount))
|
|
|
286 |
return false;
|
|
|
287 |
if (createTimestamp == null) {
|
|
|
288 |
if (other.createTimestamp != null)
|
|
|
289 |
return false;
|
|
|
290 |
} else if (!createTimestamp.equals(other.createTimestamp))
|
|
|
291 |
return false;
|
| 27046 |
tejbeer |
292 |
if (customer == null) {
|
|
|
293 |
if (other.customer != null)
|
|
|
294 |
return false;
|
|
|
295 |
} else if (!customer.equals(other.customer))
|
|
|
296 |
return false;
|
| 26817 |
amit.gupta |
297 |
if (customerAddressId != other.customerAddressId)
|
|
|
298 |
return false;
|
| 28377 |
tejbeer |
299 |
if (customerAddress == null) {
|
|
|
300 |
if (other.customerAddress != null)
|
|
|
301 |
return false;
|
|
|
302 |
} else if (!customerAddress.equals(other.customerAddress))
|
|
|
303 |
return false;
|
| 26817 |
amit.gupta |
304 |
if (customerGstNumber == null) {
|
|
|
305 |
if (other.customerGstNumber != null)
|
|
|
306 |
return false;
|
|
|
307 |
} else if (!customerGstNumber.equals(other.customerGstNumber))
|
|
|
308 |
return false;
|
|
|
309 |
if (customerId != other.customerId)
|
|
|
310 |
return false;
|
|
|
311 |
if (fofoId != other.fofoId)
|
|
|
312 |
return false;
|
|
|
313 |
if (id != other.id)
|
|
|
314 |
return false;
|
|
|
315 |
if (Double.doubleToLongBits(paidAmount) != Double.doubleToLongBits(other.paidAmount))
|
|
|
316 |
return false;
|
|
|
317 |
if (payMethod == null) {
|
|
|
318 |
if (other.payMethod != null)
|
|
|
319 |
return false;
|
|
|
320 |
} else if (!payMethod.equals(other.payMethod))
|
|
|
321 |
return false;
|
| 28344 |
tejbeer |
322 |
if (payMethodDescription == null) {
|
|
|
323 |
if (other.payMethodDescription != null)
|
|
|
324 |
return false;
|
|
|
325 |
} else if (!payMethodDescription.equals(other.payMethodDescription))
|
|
|
326 |
return false;
|
| 27046 |
tejbeer |
327 |
if (pendingOrderItems == null) {
|
|
|
328 |
if (other.pendingOrderItems != null)
|
|
|
329 |
return false;
|
|
|
330 |
} else if (!pendingOrderItems.equals(other.pendingOrderItems))
|
|
|
331 |
return false;
|
| 26817 |
amit.gupta |
332 |
if (Double.doubleToLongBits(refundedAmount) != Double.doubleToLongBits(other.refundedAmount))
|
|
|
333 |
return false;
|
| 27046 |
tejbeer |
334 |
if (status != other.status)
|
| 26817 |
amit.gupta |
335 |
return false;
|
|
|
336 |
if (Double.doubleToLongBits(totalAmount) != Double.doubleToLongBits(other.totalAmount))
|
|
|
337 |
return false;
|
|
|
338 |
return true;
|
|
|
339 |
}
|
| 26629 |
tejbeer |
340 |
|
|
|
341 |
}
|