| 26629 |
tejbeer |
1 |
package com.spice.profitmandi.dao.entity.fofo;
|
|
|
2 |
|
|
|
3 |
import java.io.Serializable;
|
|
|
4 |
import java.time.LocalDateTime;
|
| 28339 |
tejbeer |
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 |
import javax.persistence.UniqueConstraint;
|
|
|
18 |
|
|
|
19 |
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
|
| 27046 |
tejbeer |
20 |
import com.spice.profitmandi.dao.enumuration.transaction.OrderStatus;
|
| 26629 |
tejbeer |
21 |
|
|
|
22 |
@Entity
|
|
|
23 |
@Table(name = "fofo.pending_order_item", schema = "fofo", uniqueConstraints = {
|
|
|
24 |
@UniqueConstraint(name = "UK_ORDER_ID_AND_ITEM_ID", columnNames = { "order_id", "item_id" }) })
|
|
|
25 |
public class PendingOrderItem implements Serializable {
|
|
|
26 |
|
| 27046 |
tejbeer |
27 |
public OrderStatus getStatus() {
|
|
|
28 |
return status;
|
|
|
29 |
}
|
|
|
30 |
|
| 26817 |
amit.gupta |
31 |
public String getItemName() {
|
|
|
32 |
return itemName;
|
|
|
33 |
}
|
|
|
34 |
|
|
|
35 |
public void setItemName(String itemName) {
|
|
|
36 |
this.itemName = itemName;
|
|
|
37 |
}
|
|
|
38 |
|
| 26629 |
tejbeer |
39 |
private static final long serialVersionUID = 1L;
|
|
|
40 |
|
|
|
41 |
@Id
|
|
|
42 |
@Column(name = "id")
|
|
|
43 |
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
|
|
44 |
private int id;
|
|
|
45 |
|
|
|
46 |
@Column(name = "order_id")
|
|
|
47 |
private int orderId;
|
|
|
48 |
|
|
|
49 |
@Column(name = "item_id")
|
|
|
50 |
private int itemId;
|
| 27046 |
tejbeer |
51 |
|
| 26817 |
amit.gupta |
52 |
@Transient
|
|
|
53 |
private String itemName;
|
| 27046 |
tejbeer |
54 |
|
| 26924 |
amit.gupta |
55 |
@Transient
|
|
|
56 |
private String imgUrl;
|
| 26629 |
tejbeer |
57 |
|
| 26924 |
amit.gupta |
58 |
public String getImgUrl() {
|
|
|
59 |
return imgUrl;
|
|
|
60 |
}
|
|
|
61 |
|
|
|
62 |
public void setImgUrl(String imgUrl) {
|
|
|
63 |
this.imgUrl = imgUrl;
|
|
|
64 |
}
|
|
|
65 |
|
| 26629 |
tejbeer |
66 |
@Column(name = "quantity")
|
|
|
67 |
private int quantity;
|
|
|
68 |
|
|
|
69 |
@Column(name = "selling_price")
|
|
|
70 |
private float sellingPrice;
|
|
|
71 |
|
| 28339 |
tejbeer |
72 |
@Transient
|
|
|
73 |
private PendingOrder pendingOrder;
|
|
|
74 |
|
|
|
75 |
public PendingOrder getPendingOrder() {
|
|
|
76 |
return pendingOrder;
|
|
|
77 |
}
|
|
|
78 |
|
|
|
79 |
public void setPendingOrder(PendingOrder pendingOrder) {
|
|
|
80 |
this.pendingOrder = pendingOrder;
|
|
|
81 |
}
|
|
|
82 |
|
| 26721 |
tejbeer |
83 |
@Column(name = "status")
|
| 27046 |
tejbeer |
84 |
@Enumerated(EnumType.STRING)
|
|
|
85 |
private OrderStatus status;
|
|
|
86 |
|
|
|
87 |
@Column(name = "status_description")
|
|
|
88 |
private String statusDescription;
|
| 28339 |
tejbeer |
89 |
|
| 28311 |
amit.gupta |
90 |
@Column(name = "cancelled_timestamp")
|
|
|
91 |
private LocalDateTime cancelledTimestamp;
|
| 27046 |
tejbeer |
92 |
|
|
|
93 |
@Column(name = "billed_timestamp")
|
|
|
94 |
private LocalDateTime billedTimestamp;
|
|
|
95 |
|
| 28339 |
tejbeer |
96 |
@Column(name = "delivered_timestamp")
|
|
|
97 |
private LocalDateTime deliveredTimestamp;
|
|
|
98 |
|
|
|
99 |
@Column(name = "claimed_timestamp")
|
|
|
100 |
private LocalDateTime claimedTimestamp;
|
|
|
101 |
|
|
|
102 |
public LocalDateTime getClaimedTimestamp() {
|
|
|
103 |
return claimedTimestamp;
|
|
|
104 |
}
|
|
|
105 |
|
|
|
106 |
public void setClaimedTimestamp(LocalDateTime claimedTimestamp) {
|
|
|
107 |
this.claimedTimestamp = claimedTimestamp;
|
|
|
108 |
}
|
|
|
109 |
|
|
|
110 |
public LocalDateTime getDeliveredTimestamp() {
|
|
|
111 |
return deliveredTimestamp;
|
|
|
112 |
}
|
|
|
113 |
|
|
|
114 |
public void setDeliveredTimestamp(LocalDateTime deliveredTimestamp) {
|
|
|
115 |
this.deliveredTimestamp = deliveredTimestamp;
|
|
|
116 |
}
|
|
|
117 |
|
| 27046 |
tejbeer |
118 |
public String getStatusDescription() {
|
|
|
119 |
return statusDescription;
|
|
|
120 |
}
|
|
|
121 |
|
|
|
122 |
public LocalDateTime getBilledTimestamp() {
|
|
|
123 |
return billedTimestamp;
|
|
|
124 |
}
|
|
|
125 |
|
|
|
126 |
public void setBilledTimestamp(LocalDateTime billedTimestamp) {
|
|
|
127 |
this.billedTimestamp = billedTimestamp;
|
|
|
128 |
}
|
|
|
129 |
|
|
|
130 |
public void setStatusDescription(String statusDescription) {
|
|
|
131 |
this.statusDescription = statusDescription;
|
|
|
132 |
}
|
|
|
133 |
|
|
|
134 |
public void setStatus(OrderStatus status) {
|
|
|
135 |
this.status = status;
|
|
|
136 |
}
|
|
|
137 |
|
| 28311 |
amit.gupta |
138 |
public LocalDateTime getCancelledTimestamp() {
|
|
|
139 |
return cancelledTimestamp;
|
|
|
140 |
}
|
|
|
141 |
|
|
|
142 |
public void setCancelledTimestamp(LocalDateTime cancelledTimestamp) {
|
|
|
143 |
this.cancelledTimestamp = cancelledTimestamp;
|
|
|
144 |
}
|
|
|
145 |
|
| 26924 |
amit.gupta |
146 |
@Column(name = "scheduled_delivery_time")
|
|
|
147 |
private LocalDateTime scheduledDeliveryTime;
|
| 26721 |
tejbeer |
148 |
|
| 26629 |
tejbeer |
149 |
@Convert(converter = LocalDateTimeAttributeConverter.class)
|
|
|
150 |
@Column(name = "create_timestamp")
|
|
|
151 |
private LocalDateTime createTimestamp = LocalDateTime.now();
|
|
|
152 |
|
| 26924 |
amit.gupta |
153 |
@Override
|
|
|
154 |
public int hashCode() {
|
|
|
155 |
final int prime = 31;
|
|
|
156 |
int result = 1;
|
| 28311 |
amit.gupta |
157 |
result = prime * result + ((billedTimestamp == null) ? 0 : billedTimestamp.hashCode());
|
|
|
158 |
result = prime * result + ((cancelledTimestamp == null) ? 0 : cancelledTimestamp.hashCode());
|
| 28339 |
tejbeer |
159 |
result = prime * result + ((claimedTimestamp == null) ? 0 : claimedTimestamp.hashCode());
|
| 26924 |
amit.gupta |
160 |
result = prime * result + ((createTimestamp == null) ? 0 : createTimestamp.hashCode());
|
| 28339 |
tejbeer |
161 |
result = prime * result + ((deliveredTimestamp == null) ? 0 : deliveredTimestamp.hashCode());
|
| 26924 |
amit.gupta |
162 |
result = prime * result + id;
|
|
|
163 |
result = prime * result + ((imgUrl == null) ? 0 : imgUrl.hashCode());
|
|
|
164 |
result = prime * result + itemId;
|
|
|
165 |
result = prime * result + ((itemName == null) ? 0 : itemName.hashCode());
|
|
|
166 |
result = prime * result + orderId;
|
| 28339 |
tejbeer |
167 |
result = prime * result + ((pendingOrder == null) ? 0 : pendingOrder.hashCode());
|
| 26924 |
amit.gupta |
168 |
result = prime * result + quantity;
|
|
|
169 |
result = prime * result + ((scheduledDeliveryTime == null) ? 0 : scheduledDeliveryTime.hashCode());
|
|
|
170 |
result = prime * result + Float.floatToIntBits(sellingPrice);
|
|
|
171 |
result = prime * result + ((status == null) ? 0 : status.hashCode());
|
| 28311 |
amit.gupta |
172 |
result = prime * result + ((statusDescription == null) ? 0 : statusDescription.hashCode());
|
| 26924 |
amit.gupta |
173 |
return result;
|
|
|
174 |
}
|
|
|
175 |
|
|
|
176 |
@Override
|
|
|
177 |
public boolean equals(Object obj) {
|
|
|
178 |
if (this == obj)
|
|
|
179 |
return true;
|
|
|
180 |
if (obj == null)
|
|
|
181 |
return false;
|
|
|
182 |
if (getClass() != obj.getClass())
|
|
|
183 |
return false;
|
|
|
184 |
PendingOrderItem other = (PendingOrderItem) obj;
|
| 28311 |
amit.gupta |
185 |
if (billedTimestamp == null) {
|
|
|
186 |
if (other.billedTimestamp != null)
|
|
|
187 |
return false;
|
|
|
188 |
} else if (!billedTimestamp.equals(other.billedTimestamp))
|
|
|
189 |
return false;
|
|
|
190 |
if (cancelledTimestamp == null) {
|
|
|
191 |
if (other.cancelledTimestamp != null)
|
|
|
192 |
return false;
|
|
|
193 |
} else if (!cancelledTimestamp.equals(other.cancelledTimestamp))
|
|
|
194 |
return false;
|
| 28339 |
tejbeer |
195 |
if (claimedTimestamp == null) {
|
|
|
196 |
if (other.claimedTimestamp != null)
|
|
|
197 |
return false;
|
|
|
198 |
} else if (!claimedTimestamp.equals(other.claimedTimestamp))
|
|
|
199 |
return false;
|
| 26924 |
amit.gupta |
200 |
if (createTimestamp == null) {
|
|
|
201 |
if (other.createTimestamp != null)
|
|
|
202 |
return false;
|
|
|
203 |
} else if (!createTimestamp.equals(other.createTimestamp))
|
|
|
204 |
return false;
|
| 28339 |
tejbeer |
205 |
if (deliveredTimestamp == null) {
|
|
|
206 |
if (other.deliveredTimestamp != null)
|
|
|
207 |
return false;
|
|
|
208 |
} else if (!deliveredTimestamp.equals(other.deliveredTimestamp))
|
|
|
209 |
return false;
|
| 26924 |
amit.gupta |
210 |
if (id != other.id)
|
|
|
211 |
return false;
|
|
|
212 |
if (imgUrl == null) {
|
|
|
213 |
if (other.imgUrl != null)
|
|
|
214 |
return false;
|
|
|
215 |
} else if (!imgUrl.equals(other.imgUrl))
|
|
|
216 |
return false;
|
|
|
217 |
if (itemId != other.itemId)
|
|
|
218 |
return false;
|
|
|
219 |
if (itemName == null) {
|
|
|
220 |
if (other.itemName != null)
|
|
|
221 |
return false;
|
|
|
222 |
} else if (!itemName.equals(other.itemName))
|
|
|
223 |
return false;
|
|
|
224 |
if (orderId != other.orderId)
|
|
|
225 |
return false;
|
| 28339 |
tejbeer |
226 |
if (pendingOrder == null) {
|
|
|
227 |
if (other.pendingOrder != null)
|
|
|
228 |
return false;
|
|
|
229 |
} else if (!pendingOrder.equals(other.pendingOrder))
|
|
|
230 |
return false;
|
| 26924 |
amit.gupta |
231 |
if (quantity != other.quantity)
|
|
|
232 |
return false;
|
|
|
233 |
if (scheduledDeliveryTime == null) {
|
|
|
234 |
if (other.scheduledDeliveryTime != null)
|
|
|
235 |
return false;
|
|
|
236 |
} else if (!scheduledDeliveryTime.equals(other.scheduledDeliveryTime))
|
|
|
237 |
return false;
|
|
|
238 |
if (Float.floatToIntBits(sellingPrice) != Float.floatToIntBits(other.sellingPrice))
|
|
|
239 |
return false;
|
| 28311 |
amit.gupta |
240 |
if (status != other.status)
|
|
|
241 |
return false;
|
|
|
242 |
if (statusDescription == null) {
|
|
|
243 |
if (other.statusDescription != null)
|
| 26924 |
amit.gupta |
244 |
return false;
|
| 28311 |
amit.gupta |
245 |
} else if (!statusDescription.equals(other.statusDescription))
|
| 26924 |
amit.gupta |
246 |
return false;
|
|
|
247 |
return true;
|
|
|
248 |
}
|
|
|
249 |
|
|
|
250 |
public LocalDateTime getScheduledDeliveryTime() {
|
|
|
251 |
return scheduledDeliveryTime;
|
|
|
252 |
}
|
|
|
253 |
|
|
|
254 |
public void setScheduledDeliveryTime(LocalDateTime scheduledDeliveryTime) {
|
|
|
255 |
this.scheduledDeliveryTime = scheduledDeliveryTime;
|
|
|
256 |
}
|
|
|
257 |
|
| 26629 |
tejbeer |
258 |
public int getId() {
|
|
|
259 |
return id;
|
|
|
260 |
}
|
|
|
261 |
|
|
|
262 |
public void setId(int id) {
|
|
|
263 |
this.id = id;
|
|
|
264 |
}
|
|
|
265 |
|
|
|
266 |
public int getOrderId() {
|
|
|
267 |
return orderId;
|
|
|
268 |
}
|
|
|
269 |
|
|
|
270 |
public void setOrderId(int orderId) {
|
|
|
271 |
this.orderId = orderId;
|
|
|
272 |
}
|
|
|
273 |
|
|
|
274 |
public int getItemId() {
|
|
|
275 |
return itemId;
|
|
|
276 |
}
|
|
|
277 |
|
|
|
278 |
public void setItemId(int itemId) {
|
|
|
279 |
this.itemId = itemId;
|
|
|
280 |
}
|
|
|
281 |
|
|
|
282 |
public int getQuantity() {
|
|
|
283 |
return quantity;
|
|
|
284 |
}
|
|
|
285 |
|
|
|
286 |
public void setQuantity(int quantity) {
|
|
|
287 |
this.quantity = quantity;
|
|
|
288 |
}
|
|
|
289 |
|
|
|
290 |
public float getSellingPrice() {
|
|
|
291 |
return sellingPrice;
|
|
|
292 |
}
|
|
|
293 |
|
|
|
294 |
public void setSellingPrice(float sellingPrice) {
|
|
|
295 |
this.sellingPrice = sellingPrice;
|
|
|
296 |
}
|
|
|
297 |
|
|
|
298 |
public LocalDateTime getCreateTimestamp() {
|
|
|
299 |
return createTimestamp;
|
|
|
300 |
}
|
|
|
301 |
|
|
|
302 |
public void setCreateTimestamp(LocalDateTime createTimestamp) {
|
|
|
303 |
this.createTimestamp = createTimestamp;
|
|
|
304 |
}
|
|
|
305 |
|
|
|
306 |
public static long getSerialversionuid() {
|
|
|
307 |
return serialVersionUID;
|
|
|
308 |
}
|
|
|
309 |
|
|
|
310 |
@Override
|
|
|
311 |
public String toString() {
|
| 26924 |
amit.gupta |
312 |
return "PendingOrderItem [id=" + id + ", orderId=" + orderId + ", itemId=" + itemId + ", itemName=" + itemName
|
| 28339 |
tejbeer |
313 |
+ ", imgUrl=" + imgUrl + ", quantity=" + quantity + ", sellingPrice=" + sellingPrice + ", pendingOrder="
|
|
|
314 |
+ pendingOrder + ", status=" + status + ", statusDescription=" + statusDescription
|
|
|
315 |
+ ", cancelledTimestamp=" + cancelledTimestamp + ", billedTimestamp=" + billedTimestamp
|
|
|
316 |
+ ", deliveredTimestamp=" + deliveredTimestamp + ", claimedTimestamp=" + claimedTimestamp
|
|
|
317 |
+ ", scheduledDeliveryTime=" + scheduledDeliveryTime + ", createTimestamp=" + createTimestamp + "]";
|
| 26629 |
tejbeer |
318 |
}
|
|
|
319 |
|
|
|
320 |
}
|