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