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