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