Subversion Repositories SmartDukaan

Rev

Rev 33399 | Rev 34186 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

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