| 26629 |
tejbeer |
1 |
package com.spice.profitmandi.dao.entity.fofo;
|
|
|
2 |
|
| 33399 |
ranu |
3 |
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
|
|
|
4 |
import com.spice.profitmandi.dao.enumuration.transaction.OrderStatus;
|
|
|
5 |
|
|
|
6 |
import javax.persistence.*;
|
| 26629 |
tejbeer |
7 |
import java.io.Serializable;
|
|
|
8 |
import java.time.LocalDateTime;
|
|
|
9 |
|
|
|
10 |
@Entity
|
| 31860 |
tejbeer |
11 |
@Table(name = "fofo.pending_order_item", uniqueConstraints = {
|
| 28407 |
tejbeer |
12 |
@UniqueConstraint(name = "UK_ORDER_ID_AND_ITEM_ID", columnNames = { "order_id", "item_id" }), })
|
|
|
13 |
|
|
|
14 |
@NamedQueries({
|
|
|
15 |
@NamedQuery(name = "PendingOrderItem.selectSumSellingPriceOnlineOrder", query = "select new com.spice.profitmandi.common.model.OnlineDeliveredOrderSum("
|
|
|
16 |
+ "SUM(CAST(poi.sellingPrice AS int)))"
|
|
|
17 |
+ " from PendingOrder po join PendingOrderItem poi on po.id = poi.orderId"
|
|
|
18 |
+ " where po.fofoId = :fofoId and po.createTimestamp between :startDate and :endDate and poi.deliveredTimestamp is not null and poi.cancelledTimestamp is null"),
|
|
|
19 |
|
|
|
20 |
})
|
|
|
21 |
|
| 26629 |
tejbeer |
22 |
public class PendingOrderItem implements Serializable {
|
|
|
23 |
|
| 27046 |
tejbeer |
24 |
public OrderStatus getStatus() {
|
|
|
25 |
return status;
|
|
|
26 |
}
|
|
|
27 |
|
| 26817 |
amit.gupta |
28 |
public String getItemName() {
|
|
|
29 |
return itemName;
|
|
|
30 |
}
|
|
|
31 |
|
|
|
32 |
public void setItemName(String itemName) {
|
|
|
33 |
this.itemName = itemName;
|
|
|
34 |
}
|
|
|
35 |
|
| 26629 |
tejbeer |
36 |
private static final long serialVersionUID = 1L;
|
|
|
37 |
|
|
|
38 |
@Id
|
|
|
39 |
@Column(name = "id")
|
|
|
40 |
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
|
|
41 |
private int id;
|
|
|
42 |
|
|
|
43 |
@Column(name = "order_id")
|
|
|
44 |
private int orderId;
|
|
|
45 |
|
|
|
46 |
@Column(name = "item_id")
|
|
|
47 |
private int itemId;
|
| 27046 |
tejbeer |
48 |
|
| 28352 |
tejbeer |
49 |
@Column(name = "remark")
|
|
|
50 |
private String remark;
|
|
|
51 |
|
| 33399 |
ranu |
52 |
@Column(name = "is_settled")
|
|
|
53 |
private boolean isSettled;
|
|
|
54 |
|
| 28352 |
tejbeer |
55 |
public String getRemark() {
|
|
|
56 |
return remark;
|
|
|
57 |
}
|
|
|
58 |
|
|
|
59 |
public void setRemark(String remark) {
|
|
|
60 |
this.remark = remark;
|
|
|
61 |
}
|
|
|
62 |
|
| 26817 |
amit.gupta |
63 |
@Transient
|
|
|
64 |
private String itemName;
|
| 27046 |
tejbeer |
65 |
|
| 26924 |
amit.gupta |
66 |
@Transient
|
|
|
67 |
private String imgUrl;
|
| 26629 |
tejbeer |
68 |
|
| 26924 |
amit.gupta |
69 |
public String getImgUrl() {
|
|
|
70 |
return imgUrl;
|
|
|
71 |
}
|
|
|
72 |
|
|
|
73 |
public void setImgUrl(String imgUrl) {
|
|
|
74 |
this.imgUrl = imgUrl;
|
|
|
75 |
}
|
|
|
76 |
|
| 26629 |
tejbeer |
77 |
@Column(name = "quantity")
|
|
|
78 |
private int quantity;
|
|
|
79 |
|
|
|
80 |
@Column(name = "selling_price")
|
|
|
81 |
private float sellingPrice;
|
|
|
82 |
|
| 33399 |
ranu |
83 |
@Column(name = "extended_warranty_price")
|
|
|
84 |
private float extendedWarrantyPrice;
|
|
|
85 |
|
| 28339 |
tejbeer |
86 |
@Transient
|
|
|
87 |
private PendingOrder pendingOrder;
|
|
|
88 |
|
|
|
89 |
public PendingOrder getPendingOrder() {
|
|
|
90 |
return pendingOrder;
|
|
|
91 |
}
|
|
|
92 |
|
|
|
93 |
public void setPendingOrder(PendingOrder pendingOrder) {
|
|
|
94 |
this.pendingOrder = pendingOrder;
|
|
|
95 |
}
|
|
|
96 |
|
| 26721 |
tejbeer |
97 |
@Column(name = "status")
|
| 27046 |
tejbeer |
98 |
@Enumerated(EnumType.STRING)
|
|
|
99 |
private OrderStatus status;
|
|
|
100 |
|
|
|
101 |
@Column(name = "status_description")
|
|
|
102 |
private String statusDescription;
|
| 28339 |
tejbeer |
103 |
|
| 28311 |
amit.gupta |
104 |
@Column(name = "cancelled_timestamp")
|
|
|
105 |
private LocalDateTime cancelledTimestamp;
|
| 27046 |
tejbeer |
106 |
|
|
|
107 |
@Column(name = "billed_timestamp")
|
|
|
108 |
private LocalDateTime billedTimestamp;
|
|
|
109 |
|
| 28344 |
tejbeer |
110 |
@Column(name = "verified_timestamp")
|
|
|
111 |
private LocalDateTime verifiedTimestamp;
|
|
|
112 |
|
|
|
113 |
public LocalDateTime getVerifiedTimestamp() {
|
|
|
114 |
return verifiedTimestamp;
|
|
|
115 |
}
|
|
|
116 |
|
|
|
117 |
public void setVerifiedTimestamp(LocalDateTime verifiedTimestamp) {
|
|
|
118 |
this.verifiedTimestamp = verifiedTimestamp;
|
|
|
119 |
}
|
|
|
120 |
|
| 28339 |
tejbeer |
121 |
@Column(name = "delivered_timestamp")
|
|
|
122 |
private LocalDateTime deliveredTimestamp;
|
|
|
123 |
|
|
|
124 |
@Column(name = "claimed_timestamp")
|
|
|
125 |
private LocalDateTime claimedTimestamp;
|
|
|
126 |
|
|
|
127 |
public LocalDateTime getClaimedTimestamp() {
|
|
|
128 |
return claimedTimestamp;
|
|
|
129 |
}
|
|
|
130 |
|
|
|
131 |
public void setClaimedTimestamp(LocalDateTime claimedTimestamp) {
|
|
|
132 |
this.claimedTimestamp = claimedTimestamp;
|
|
|
133 |
}
|
|
|
134 |
|
|
|
135 |
public LocalDateTime getDeliveredTimestamp() {
|
|
|
136 |
return deliveredTimestamp;
|
|
|
137 |
}
|
|
|
138 |
|
|
|
139 |
public void setDeliveredTimestamp(LocalDateTime deliveredTimestamp) {
|
|
|
140 |
this.deliveredTimestamp = deliveredTimestamp;
|
|
|
141 |
}
|
|
|
142 |
|
| 27046 |
tejbeer |
143 |
public String getStatusDescription() {
|
|
|
144 |
return statusDescription;
|
|
|
145 |
}
|
|
|
146 |
|
|
|
147 |
public LocalDateTime getBilledTimestamp() {
|
|
|
148 |
return billedTimestamp;
|
|
|
149 |
}
|
|
|
150 |
|
|
|
151 |
public void setBilledTimestamp(LocalDateTime billedTimestamp) {
|
|
|
152 |
this.billedTimestamp = billedTimestamp;
|
|
|
153 |
}
|
|
|
154 |
|
|
|
155 |
public void setStatusDescription(String statusDescription) {
|
|
|
156 |
this.statusDescription = statusDescription;
|
|
|
157 |
}
|
|
|
158 |
|
|
|
159 |
public void setStatus(OrderStatus status) {
|
|
|
160 |
this.status = status;
|
|
|
161 |
}
|
|
|
162 |
|
| 28311 |
amit.gupta |
163 |
public LocalDateTime getCancelledTimestamp() {
|
|
|
164 |
return cancelledTimestamp;
|
|
|
165 |
}
|
|
|
166 |
|
|
|
167 |
public void setCancelledTimestamp(LocalDateTime cancelledTimestamp) {
|
|
|
168 |
this.cancelledTimestamp = cancelledTimestamp;
|
|
|
169 |
}
|
|
|
170 |
|
| 33399 |
ranu |
171 |
public boolean isSettled() {
|
|
|
172 |
return isSettled;
|
|
|
173 |
}
|
|
|
174 |
|
|
|
175 |
public void setSettled(boolean isSettled) {
|
|
|
176 |
isSettled = isSettled;
|
|
|
177 |
}
|
|
|
178 |
|
| 26924 |
amit.gupta |
179 |
@Column(name = "scheduled_delivery_time")
|
|
|
180 |
private LocalDateTime scheduledDeliveryTime;
|
| 26721 |
tejbeer |
181 |
|
| 26629 |
tejbeer |
182 |
@Convert(converter = LocalDateTimeAttributeConverter.class)
|
|
|
183 |
@Column(name = "create_timestamp")
|
|
|
184 |
private LocalDateTime createTimestamp = LocalDateTime.now();
|
|
|
185 |
|
| 26924 |
amit.gupta |
186 |
@Override
|
|
|
187 |
public int hashCode() {
|
|
|
188 |
final int prime = 31;
|
|
|
189 |
int result = 1;
|
| 28311 |
amit.gupta |
190 |
result = prime * result + ((billedTimestamp == null) ? 0 : billedTimestamp.hashCode());
|
|
|
191 |
result = prime * result + ((cancelledTimestamp == null) ? 0 : cancelledTimestamp.hashCode());
|
| 28339 |
tejbeer |
192 |
result = prime * result + ((claimedTimestamp == null) ? 0 : claimedTimestamp.hashCode());
|
| 26924 |
amit.gupta |
193 |
result = prime * result + ((createTimestamp == null) ? 0 : createTimestamp.hashCode());
|
| 28339 |
tejbeer |
194 |
result = prime * result + ((deliveredTimestamp == null) ? 0 : deliveredTimestamp.hashCode());
|
| 26924 |
amit.gupta |
195 |
result = prime * result + id;
|
|
|
196 |
result = prime * result + ((imgUrl == null) ? 0 : imgUrl.hashCode());
|
|
|
197 |
result = prime * result + itemId;
|
|
|
198 |
result = prime * result + ((itemName == null) ? 0 : itemName.hashCode());
|
|
|
199 |
result = prime * result + orderId;
|
| 28339 |
tejbeer |
200 |
result = prime * result + ((pendingOrder == null) ? 0 : pendingOrder.hashCode());
|
| 26924 |
amit.gupta |
201 |
result = prime * result + quantity;
|
| 28352 |
tejbeer |
202 |
result = prime * result + ((remark == null) ? 0 : remark.hashCode());
|
| 26924 |
amit.gupta |
203 |
result = prime * result + ((scheduledDeliveryTime == null) ? 0 : scheduledDeliveryTime.hashCode());
|
|
|
204 |
result = prime * result + Float.floatToIntBits(sellingPrice);
|
| 33399 |
ranu |
205 |
result = prime * result + Float.floatToIntBits(extendedWarrantyPrice);
|
| 26924 |
amit.gupta |
206 |
result = prime * result + ((status == null) ? 0 : status.hashCode());
|
| 28311 |
amit.gupta |
207 |
result = prime * result + ((statusDescription == null) ? 0 : statusDescription.hashCode());
|
| 28344 |
tejbeer |
208 |
result = prime * result + ((verifiedTimestamp == null) ? 0 : verifiedTimestamp.hashCode());
|
| 26924 |
amit.gupta |
209 |
return result;
|
|
|
210 |
}
|
|
|
211 |
|
|
|
212 |
@Override
|
|
|
213 |
public boolean equals(Object obj) {
|
|
|
214 |
if (this == obj)
|
|
|
215 |
return true;
|
|
|
216 |
if (obj == null)
|
|
|
217 |
return false;
|
|
|
218 |
if (getClass() != obj.getClass())
|
|
|
219 |
return false;
|
|
|
220 |
PendingOrderItem other = (PendingOrderItem) obj;
|
| 28311 |
amit.gupta |
221 |
if (billedTimestamp == null) {
|
|
|
222 |
if (other.billedTimestamp != null)
|
|
|
223 |
return false;
|
|
|
224 |
} else if (!billedTimestamp.equals(other.billedTimestamp))
|
|
|
225 |
return false;
|
|
|
226 |
if (cancelledTimestamp == null) {
|
|
|
227 |
if (other.cancelledTimestamp != null)
|
|
|
228 |
return false;
|
|
|
229 |
} else if (!cancelledTimestamp.equals(other.cancelledTimestamp))
|
|
|
230 |
return false;
|
| 28339 |
tejbeer |
231 |
if (claimedTimestamp == null) {
|
|
|
232 |
if (other.claimedTimestamp != null)
|
|
|
233 |
return false;
|
|
|
234 |
} else if (!claimedTimestamp.equals(other.claimedTimestamp))
|
|
|
235 |
return false;
|
| 26924 |
amit.gupta |
236 |
if (createTimestamp == null) {
|
|
|
237 |
if (other.createTimestamp != null)
|
|
|
238 |
return false;
|
|
|
239 |
} else if (!createTimestamp.equals(other.createTimestamp))
|
|
|
240 |
return false;
|
| 28339 |
tejbeer |
241 |
if (deliveredTimestamp == null) {
|
|
|
242 |
if (other.deliveredTimestamp != null)
|
|
|
243 |
return false;
|
|
|
244 |
} else if (!deliveredTimestamp.equals(other.deliveredTimestamp))
|
|
|
245 |
return false;
|
| 26924 |
amit.gupta |
246 |
if (id != other.id)
|
|
|
247 |
return false;
|
|
|
248 |
if (imgUrl == null) {
|
|
|
249 |
if (other.imgUrl != null)
|
|
|
250 |
return false;
|
|
|
251 |
} else if (!imgUrl.equals(other.imgUrl))
|
|
|
252 |
return false;
|
|
|
253 |
if (itemId != other.itemId)
|
|
|
254 |
return false;
|
|
|
255 |
if (itemName == null) {
|
|
|
256 |
if (other.itemName != null)
|
|
|
257 |
return false;
|
|
|
258 |
} else if (!itemName.equals(other.itemName))
|
|
|
259 |
return false;
|
|
|
260 |
if (orderId != other.orderId)
|
|
|
261 |
return false;
|
| 28339 |
tejbeer |
262 |
if (pendingOrder == null) {
|
|
|
263 |
if (other.pendingOrder != null)
|
|
|
264 |
return false;
|
|
|
265 |
} else if (!pendingOrder.equals(other.pendingOrder))
|
|
|
266 |
return false;
|
| 26924 |
amit.gupta |
267 |
if (quantity != other.quantity)
|
|
|
268 |
return false;
|
| 28352 |
tejbeer |
269 |
if (remark == null) {
|
|
|
270 |
if (other.remark != null)
|
|
|
271 |
return false;
|
|
|
272 |
} else if (!remark.equals(other.remark))
|
|
|
273 |
return false;
|
| 26924 |
amit.gupta |
274 |
if (scheduledDeliveryTime == null) {
|
|
|
275 |
if (other.scheduledDeliveryTime != null)
|
|
|
276 |
return false;
|
|
|
277 |
} else if (!scheduledDeliveryTime.equals(other.scheduledDeliveryTime))
|
|
|
278 |
return false;
|
|
|
279 |
if (Float.floatToIntBits(sellingPrice) != Float.floatToIntBits(other.sellingPrice))
|
|
|
280 |
return false;
|
| 33399 |
ranu |
281 |
if (Float.floatToIntBits(extendedWarrantyPrice) != Float.floatToIntBits(other.extendedWarrantyPrice))
|
|
|
282 |
return false;
|
| 28311 |
amit.gupta |
283 |
if (status != other.status)
|
|
|
284 |
return false;
|
|
|
285 |
if (statusDescription == null) {
|
|
|
286 |
if (other.statusDescription != null)
|
| 26924 |
amit.gupta |
287 |
return false;
|
| 28311 |
amit.gupta |
288 |
} else if (!statusDescription.equals(other.statusDescription))
|
| 26924 |
amit.gupta |
289 |
return false;
|
| 28344 |
tejbeer |
290 |
if (verifiedTimestamp == null) {
|
|
|
291 |
if (other.verifiedTimestamp != null)
|
|
|
292 |
return false;
|
|
|
293 |
} else if (!verifiedTimestamp.equals(other.verifiedTimestamp))
|
|
|
294 |
return false;
|
| 26924 |
amit.gupta |
295 |
return true;
|
|
|
296 |
}
|
|
|
297 |
|
|
|
298 |
public LocalDateTime getScheduledDeliveryTime() {
|
|
|
299 |
return scheduledDeliveryTime;
|
|
|
300 |
}
|
|
|
301 |
|
|
|
302 |
public void setScheduledDeliveryTime(LocalDateTime scheduledDeliveryTime) {
|
|
|
303 |
this.scheduledDeliveryTime = scheduledDeliveryTime;
|
|
|
304 |
}
|
|
|
305 |
|
| 26629 |
tejbeer |
306 |
public int getId() {
|
|
|
307 |
return id;
|
|
|
308 |
}
|
|
|
309 |
|
|
|
310 |
public void setId(int id) {
|
|
|
311 |
this.id = id;
|
|
|
312 |
}
|
|
|
313 |
|
|
|
314 |
public int getOrderId() {
|
|
|
315 |
return orderId;
|
|
|
316 |
}
|
|
|
317 |
|
|
|
318 |
public void setOrderId(int orderId) {
|
|
|
319 |
this.orderId = orderId;
|
|
|
320 |
}
|
|
|
321 |
|
|
|
322 |
public int getItemId() {
|
|
|
323 |
return itemId;
|
|
|
324 |
}
|
|
|
325 |
|
|
|
326 |
public void setItemId(int itemId) {
|
|
|
327 |
this.itemId = itemId;
|
|
|
328 |
}
|
|
|
329 |
|
|
|
330 |
public int getQuantity() {
|
|
|
331 |
return quantity;
|
|
|
332 |
}
|
|
|
333 |
|
|
|
334 |
public void setQuantity(int quantity) {
|
|
|
335 |
this.quantity = quantity;
|
|
|
336 |
}
|
|
|
337 |
|
|
|
338 |
public float getSellingPrice() {
|
|
|
339 |
return sellingPrice;
|
|
|
340 |
}
|
|
|
341 |
|
|
|
342 |
public void setSellingPrice(float sellingPrice) {
|
|
|
343 |
this.sellingPrice = sellingPrice;
|
|
|
344 |
}
|
|
|
345 |
|
| 33399 |
ranu |
346 |
public float getExtendedWarrantyPrice() {
|
|
|
347 |
return extendedWarrantyPrice;
|
|
|
348 |
}
|
|
|
349 |
|
|
|
350 |
public void setExtendedWarrantyPrice(float extendedWarrantyPrice) {
|
|
|
351 |
this.extendedWarrantyPrice = extendedWarrantyPrice;
|
|
|
352 |
}
|
|
|
353 |
|
| 26629 |
tejbeer |
354 |
public LocalDateTime getCreateTimestamp() {
|
|
|
355 |
return createTimestamp;
|
|
|
356 |
}
|
|
|
357 |
|
|
|
358 |
public void setCreateTimestamp(LocalDateTime createTimestamp) {
|
|
|
359 |
this.createTimestamp = createTimestamp;
|
|
|
360 |
}
|
|
|
361 |
|
|
|
362 |
public static long getSerialversionuid() {
|
|
|
363 |
return serialVersionUID;
|
|
|
364 |
}
|
|
|
365 |
|
|
|
366 |
@Override
|
|
|
367 |
public String toString() {
|
| 28352 |
tejbeer |
368 |
return "PendingOrderItem [id=" + id + ", orderId=" + orderId + ", itemId=" + itemId + ", remark=" + remark
|
|
|
369 |
+ ", itemName=" + itemName + ", imgUrl=" + imgUrl + ", quantity=" + quantity + ", sellingPrice="
|
| 33399 |
ranu |
370 |
+ sellingPrice + ", extendedWarrantyPrice=" + extendedWarrantyPrice + ", pendingOrder="
|
|
|
371 |
+ pendingOrder + ", status=" + status + ", statusDescription="
|
| 28352 |
tejbeer |
372 |
+ statusDescription + ", cancelledTimestamp=" + cancelledTimestamp + ", billedTimestamp="
|
|
|
373 |
+ billedTimestamp + ", verifiedTimestamp=" + verifiedTimestamp + ", deliveredTimestamp="
|
|
|
374 |
+ deliveredTimestamp + ", claimedTimestamp=" + claimedTimestamp + ", scheduledDeliveryTime="
|
|
|
375 |
+ scheduledDeliveryTime + ", createTimestamp=" + createTimestamp + "]";
|
| 26629 |
tejbeer |
376 |
}
|
|
|
377 |
|
|
|
378 |
}
|