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