Subversion Repositories SmartDukaan

Rev

Rev 33399 | Rev 34186 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 33399 Rev 33436
Line 4... Line 4...
4
import com.spice.profitmandi.dao.enumuration.transaction.OrderStatus;
4
import com.spice.profitmandi.dao.enumuration.transaction.OrderStatus;
5
 
5
 
6
import javax.persistence.*;
6
import javax.persistence.*;
7
import java.io.Serializable;
7
import java.io.Serializable;
8
import java.time.LocalDateTime;
8
import java.time.LocalDateTime;
-
 
9
import java.util.Objects;
9
 
10
 
10
@Entity
11
@Entity
11
@Table(name = "fofo.pending_order_item", uniqueConstraints = {
12
@Table(name = "fofo.pending_order_item", uniqueConstraints = {
12
		@UniqueConstraint(name = "UK_ORDER_ID_AND_ITEM_ID", columnNames = { "order_id", "item_id" }), })
13
		@UniqueConstraint(name = "UK_ORDER_ID_AND_ITEM_ID", columnNames = { "order_id", "item_id" }), })
13
 
14
 
Line 78... Line 79...
78
	private int quantity;
79
	private int quantity;
79
 
80
 
80
	@Column(name = "selling_price")
81
	@Column(name = "selling_price")
81
	private float sellingPrice;
82
	private float sellingPrice;
82
 
83
 
83
	@Column(name = "extended_warranty_price")
-
 
84
	private float extendedWarrantyPrice;
-
 
85
 
-
 
86
	@Transient
84
	@Transient
87
	private PendingOrder pendingOrder;
85
	private PendingOrder pendingOrder;
88
 
86
 
89
	public PendingOrder getPendingOrder() {
87
	public PendingOrder getPendingOrder() {
90
		return pendingOrder;
88
		return pendingOrder;
Line 122... Line 120...
122
	private LocalDateTime deliveredTimestamp;
120
	private LocalDateTime deliveredTimestamp;
123
 
121
 
124
	@Column(name = "claimed_timestamp")
122
	@Column(name = "claimed_timestamp")
125
	private LocalDateTime claimedTimestamp;
123
	private LocalDateTime claimedTimestamp;
126
 
124
 
-
 
125
	@Column(name = "originalOrderId")
-
 
126
	private int originalOrderId;
-
 
127
 
127
	public LocalDateTime getClaimedTimestamp() {
128
	public LocalDateTime getClaimedTimestamp() {
128
		return claimedTimestamp;
129
		return claimedTimestamp;
129
	}
130
	}
130
 
131
 
131
	public void setClaimedTimestamp(LocalDateTime claimedTimestamp) {
132
	public void setClaimedTimestamp(LocalDateTime claimedTimestamp) {
Line 174... Line 175...
174
 
175
 
175
	public void setSettled(boolean isSettled) {
176
	public void setSettled(boolean isSettled) {
176
		isSettled = isSettled;
177
		isSettled = isSettled;
177
	}
178
	}
178
 
179
 
-
 
180
	public int getOriginalOrderId() {
-
 
181
		return originalOrderId;
-
 
182
	}
-
 
183
 
-
 
184
	public void setOriginalOrderId(int originalOrderId) {
-
 
185
		this.originalOrderId = originalOrderId;
-
 
186
	}
-
 
187
 
179
	@Column(name = "scheduled_delivery_time")
188
	@Column(name = "scheduled_delivery_time")
180
	private LocalDateTime scheduledDeliveryTime;
189
	private LocalDateTime scheduledDeliveryTime;
181
 
190
 
182
	@Convert(converter = LocalDateTimeAttributeConverter.class)
191
	@Convert(converter = LocalDateTimeAttributeConverter.class)
183
	@Column(name = "create_timestamp")
192
	@Column(name = "create_timestamp")
184
	private LocalDateTime createTimestamp = LocalDateTime.now();
193
	private LocalDateTime createTimestamp = LocalDateTime.now();
185
 
194
 
186
	@Override
195
	@Override
187
	public int hashCode() {
196
	public boolean equals(Object o) {
188
		final int prime = 31;
-
 
189
		int result = 1;
-
 
190
		result = prime * result + ((billedTimestamp == null) ? 0 : billedTimestamp.hashCode());
-
 
191
		result = prime * result + ((cancelledTimestamp == null) ? 0 : cancelledTimestamp.hashCode());
-
 
192
		result = prime * result + ((claimedTimestamp == null) ? 0 : claimedTimestamp.hashCode());
-
 
193
		result = prime * result + ((createTimestamp == null) ? 0 : createTimestamp.hashCode());
-
 
194
		result = prime * result + ((deliveredTimestamp == null) ? 0 : deliveredTimestamp.hashCode());
-
 
195
		result = prime * result + id;
197
		if (this == o) return true;
196
		result = prime * result + ((imgUrl == null) ? 0 : imgUrl.hashCode());
198
		if (o == null || getClass() != o.getClass()) return false;
197
		result = prime * result + itemId;
-
 
198
		result = prime * result + ((itemName == null) ? 0 : itemName.hashCode());
-
 
199
		result = prime * result + orderId;
199
		PendingOrderItem that = (PendingOrderItem) o;
200
		result = prime * result + ((pendingOrder == null) ? 0 : pendingOrder.hashCode());
-
 
201
		result = prime * result + quantity;
-
 
202
		result = prime * result + ((remark == null) ? 0 : remark.hashCode());
-
 
203
		result = prime * result + ((scheduledDeliveryTime == null) ? 0 : scheduledDeliveryTime.hashCode());
-
 
204
		result = prime * result + Float.floatToIntBits(sellingPrice);
-
 
205
		result = prime * result + Float.floatToIntBits(extendedWarrantyPrice);
-
 
206
		result = prime * result + ((status == null) ? 0 : status.hashCode());
-
 
207
		result = prime * result + ((statusDescription == null) ? 0 : statusDescription.hashCode());
-
 
208
		result = prime * result + ((verifiedTimestamp == null) ? 0 : verifiedTimestamp.hashCode());
-
 
209
		return result;
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);
210
	}
201
	}
211
 
202
 
212
	@Override
203
	@Override
213
	public boolean equals(Object obj) {
204
	public int hashCode() {
214
		if (this == obj)
-
 
215
			return true;
-
 
216
		if (obj == null)
-
 
217
			return false;
-
 
218
		if (getClass() != obj.getClass())
-
 
219
			return false;
-
 
220
		PendingOrderItem other = (PendingOrderItem) obj;
-
 
221
		if (billedTimestamp == null) {
-
 
222
			if (other.billedTimestamp != null)
-
 
223
				return false;
-
 
224
		} else if (!billedTimestamp.equals(other.billedTimestamp))
-
 
225
			return false;
-
 
226
		if (cancelledTimestamp == null) {
-
 
227
			if (other.cancelledTimestamp != null)
-
 
228
				return false;
-
 
229
		} else if (!cancelledTimestamp.equals(other.cancelledTimestamp))
-
 
230
			return false;
-
 
231
		if (claimedTimestamp == null) {
-
 
232
			if (other.claimedTimestamp != null)
-
 
233
				return false;
-
 
234
		} else if (!claimedTimestamp.equals(other.claimedTimestamp))
-
 
235
			return false;
-
 
236
		if (createTimestamp == null) {
-
 
237
			if (other.createTimestamp != null)
-
 
238
				return false;
-
 
239
		} else if (!createTimestamp.equals(other.createTimestamp))
-
 
240
			return false;
-
 
241
		if (deliveredTimestamp == null) {
-
 
242
			if (other.deliveredTimestamp != null)
-
 
243
				return false;
-
 
244
		} else if (!deliveredTimestamp.equals(other.deliveredTimestamp))
-
 
245
			return false;
-
 
246
		if (id != other.id)
-
 
247
			return false;
-
 
248
		if (imgUrl == null) {
-
 
249
			if (other.imgUrl != null)
-
 
250
				return false;
-
 
251
		} else if (!imgUrl.equals(other.imgUrl))
-
 
252
			return false;
-
 
253
		if (itemId != other.itemId)
-
 
254
			return false;
-
 
255
		if (itemName == null) {
-
 
256
			if (other.itemName != null)
-
 
257
				return false;
-
 
258
		} else if (!itemName.equals(other.itemName))
-
 
259
			return false;
-
 
260
		if (orderId != other.orderId)
-
 
261
			return false;
-
 
262
		if (pendingOrder == null) {
-
 
263
			if (other.pendingOrder != null)
-
 
264
				return false;
-
 
265
		} else if (!pendingOrder.equals(other.pendingOrder))
-
 
266
			return false;
-
 
267
		if (quantity != other.quantity)
-
 
268
			return false;
-
 
269
		if (remark == null) {
-
 
270
			if (other.remark != null)
-
 
271
				return false;
-
 
272
		} else if (!remark.equals(other.remark))
-
 
273
			return false;
-
 
274
		if (scheduledDeliveryTime == null) {
-
 
275
			if (other.scheduledDeliveryTime != null)
-
 
276
				return false;
-
 
277
		} else if (!scheduledDeliveryTime.equals(other.scheduledDeliveryTime))
-
 
278
			return false;
-
 
279
		if (Float.floatToIntBits(sellingPrice) != Float.floatToIntBits(other.sellingPrice))
-
 
280
			return false;
-
 
281
		if (Float.floatToIntBits(extendedWarrantyPrice) != Float.floatToIntBits(other.extendedWarrantyPrice))
205
		return Objects.hash(id, orderId, itemId, remark, isSettled, itemName, imgUrl, quantity, sellingPrice, pendingOrder, status, statusDescription, cancelledTimestamp, billedTimestamp, verifiedTimestamp, deliveredTimestamp, claimedTimestamp, originalOrderId, scheduledDeliveryTime, createTimestamp);
282
			return false;
-
 
283
		if (status != other.status)
-
 
284
			return false;
-
 
285
		if (statusDescription == null) {
-
 
286
			if (other.statusDescription != null)
-
 
287
				return false;
-
 
288
		} else if (!statusDescription.equals(other.statusDescription))
-
 
289
			return false;
-
 
290
		if (verifiedTimestamp == null) {
-
 
291
			if (other.verifiedTimestamp != null)
-
 
292
				return false;
-
 
293
		} else if (!verifiedTimestamp.equals(other.verifiedTimestamp))
-
 
294
			return false;
-
 
295
		return true;
-
 
296
	}
206
	}
297
 
207
 
298
	public LocalDateTime getScheduledDeliveryTime() {
208
	public LocalDateTime getScheduledDeliveryTime() {
299
		return scheduledDeliveryTime;
209
		return scheduledDeliveryTime;
300
	}
210
	}
Line 341... Line 251...
341
 
251
 
342
	public void setSellingPrice(float sellingPrice) {
252
	public void setSellingPrice(float sellingPrice) {
343
		this.sellingPrice = sellingPrice;
253
		this.sellingPrice = sellingPrice;
344
	}
254
	}
345
 
255
 
346
	public float getExtendedWarrantyPrice() {
-
 
347
		return extendedWarrantyPrice;
-
 
348
	}
-
 
349
 
-
 
350
	public void setExtendedWarrantyPrice(float extendedWarrantyPrice) {
-
 
351
		this.extendedWarrantyPrice = extendedWarrantyPrice;
-
 
352
	}
-
 
353
 
-
 
354
	public LocalDateTime getCreateTimestamp() {
256
	public LocalDateTime getCreateTimestamp() {
355
		return createTimestamp;
257
		return createTimestamp;
356
	}
258
	}
357
 
259
 
358
	public void setCreateTimestamp(LocalDateTime createTimestamp) {
260
	public void setCreateTimestamp(LocalDateTime createTimestamp) {
Line 363... Line 265...
363
		return serialVersionUID;
265
		return serialVersionUID;
364
	}
266
	}
365
 
267
 
366
	@Override
268
	@Override
367
	public String toString() {
269
	public String toString() {
368
		return "PendingOrderItem [id=" + id + ", orderId=" + orderId + ", itemId=" + itemId + ", remark=" + remark
270
		return "PendingOrderItem{" +
-
 
271
				"id=" + id +
-
 
272
				", orderId=" + orderId +
-
 
273
				", itemId=" + itemId +
-
 
274
				", remark='" + remark + '\'' +
-
 
275
				", isSettled=" + isSettled +
369
				+ ", itemName=" + itemName + ", imgUrl=" + imgUrl + ", quantity=" + quantity + ", sellingPrice="
276
				", itemName='" + itemName + '\'' +
-
 
277
				", imgUrl='" + imgUrl + '\'' +
-
 
278
				", quantity=" + quantity +
-
 
279
				", sellingPrice=" + sellingPrice +
370
				+ sellingPrice + ", extendedWarrantyPrice="	+ extendedWarrantyPrice + ", pendingOrder="
280
				", pendingOrder=" + pendingOrder +
-
 
281
				", status=" + status +
371
				+ pendingOrder + ", status=" + status + ", statusDescription="
282
				", statusDescription='" + statusDescription + '\'' +
372
				+ statusDescription + ", cancelledTimestamp=" + cancelledTimestamp + ", billedTimestamp="
283
				", cancelledTimestamp=" + cancelledTimestamp +
-
 
284
				", billedTimestamp=" + billedTimestamp +
373
				+ billedTimestamp + ", verifiedTimestamp=" + verifiedTimestamp + ", deliveredTimestamp="
285
				", verifiedTimestamp=" + verifiedTimestamp +
-
 
286
				", deliveredTimestamp=" + deliveredTimestamp +
374
				+ deliveredTimestamp + ", claimedTimestamp=" + claimedTimestamp + ", scheduledDeliveryTime="
287
				", claimedTimestamp=" + claimedTimestamp +
-
 
288
				", originalOrderId=" + originalOrderId +
-
 
289
				", scheduledDeliveryTime=" + scheduledDeliveryTime +
375
				+ scheduledDeliveryTime + ", createTimestamp=" + createTimestamp + "]";
290
				", createTimestamp=" + createTimestamp +
-
 
291
				'}';
376
	}
292
	}
377
 
293
 
378
}
294
}