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