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