Rev 34474 | View as "text/plain" | Blame | Compare with Previous | Last modification | View Log | RSS feed
package com.spice.profitmandi.dao.entity.fofo;import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;import com.spice.profitmandi.dao.enumuration.transaction.OrderStatus;import javax.persistence.*;import java.io.Serializable;import java.time.LocalDateTime;import java.util.List;import java.util.Objects;@Entity@Table(name = "fofo.pending_order_item", uniqueConstraints = {@UniqueConstraint(name = "UK_ORDER_ID_AND_ITEM_ID", columnNames = { "order_id", "item_id" }), })@NamedQueries({@NamedQuery(name = "PendingOrderItem.selectSumSellingPriceOnlineOrder", query = "select new com.spice.profitmandi.common.model.OnlineDeliveredOrderSum("+ "SUM(CAST(poi.sellingPrice AS int)))"+ " from PendingOrder po join PendingOrderItem poi on po.id = poi.orderId"+ " where po.fofoId = :fofoId and po.createTimestamp between :startDate and :endDate and poi.deliveredTimestamp is not null and poi.cancelledTimestamp is null"),})public class PendingOrderItem implements Serializable {private static final long serialVersionUID = 1L;@Id@Column(name = "id")@GeneratedValue(strategy = GenerationType.IDENTITY)private int id;@Column(name = "order_id")private int orderId;@Column(name = "item_id")private int itemId;@Column(name = "remark")private String remark;@Column(name = "is_settled")private boolean isSettled;@Column(name = "quantity")private int quantity;@Column(name = "selling_price")private float sellingPrice;@Column(name = "status")@Enumerated(EnumType.STRING)private OrderStatus status;@Column(name = "status_description")private String statusDescription;@Column(name = "cancelled_timestamp")private LocalDateTime cancelledTimestamp;@Column(name = "billed_timestamp")private LocalDateTime billedTimestamp;@Column(name = "verified_timestamp")private LocalDateTime verifiedTimestamp;@Column(name = "delivered_timestamp")private LocalDateTime deliveredTimestamp;@Column(name = "claimed_timestamp")private LocalDateTime claimedTimestamp;@Column(name = "originalOrderId")private int originalOrderId;@Column(name = "smart_seller_id")private String smartSellerId;@Column(name = "scheduled_delivery_time")private LocalDateTime scheduledDeliveryTime;@Convert(converter = LocalDateTimeAttributeConverter.class)@Column(name = "create_timestamp")private LocalDateTime createTimestamp = LocalDateTime.now();@Transientprivate List<PendingOrderPlan> pendingOrderItemPolicyPlan;@Transientprivate String itemName;@Transientprivate int catalogId;@Transientprivate String imgUrl;@Transientprivate PendingOrder pendingOrder;@Transientprivate FofoOrderItem fofoOrderItem;public int getId() {return id;}public void setId(int id) {this.id = id;}public int getOrderId() {return orderId;}public void setOrderId(int orderId) {this.orderId = orderId;}public int getItemId() {return itemId;}public void setItemId(int itemId) {this.itemId = itemId;}public String getRemark() {return remark;}public void setRemark(String remark) {this.remark = remark;}public boolean isSettled() {return isSettled;}public void setSettled(boolean settled) {isSettled = settled;}public int getQuantity() {return quantity;}public void setQuantity(int quantity) {this.quantity = quantity;}public float getSellingPrice() {return sellingPrice;}public void setSellingPrice(float sellingPrice) {this.sellingPrice = sellingPrice;}public OrderStatus getStatus() {return status;}public void setStatus(OrderStatus status) {this.status = status;}public String getStatusDescription() {return statusDescription;}public void setStatusDescription(String statusDescription) {this.statusDescription = statusDescription;}public LocalDateTime getCancelledTimestamp() {return cancelledTimestamp;}public void setCancelledTimestamp(LocalDateTime cancelledTimestamp) {this.cancelledTimestamp = cancelledTimestamp;}public LocalDateTime getBilledTimestamp() {return billedTimestamp;}public void setBilledTimestamp(LocalDateTime billedTimestamp) {this.billedTimestamp = billedTimestamp;}public LocalDateTime getVerifiedTimestamp() {return verifiedTimestamp;}public void setVerifiedTimestamp(LocalDateTime verifiedTimestamp) {this.verifiedTimestamp = verifiedTimestamp;}public LocalDateTime getDeliveredTimestamp() {return deliveredTimestamp;}public void setDeliveredTimestamp(LocalDateTime deliveredTimestamp) {this.deliveredTimestamp = deliveredTimestamp;}public LocalDateTime getClaimedTimestamp() {return claimedTimestamp;}public void setClaimedTimestamp(LocalDateTime claimedTimestamp) {this.claimedTimestamp = claimedTimestamp;}public int getOriginalOrderId() {return originalOrderId;}public void setOriginalOrderId(int originalOrderId) {this.originalOrderId = originalOrderId;}public LocalDateTime getScheduledDeliveryTime() {return scheduledDeliveryTime;}public void setScheduledDeliveryTime(LocalDateTime scheduledDeliveryTime) {this.scheduledDeliveryTime = scheduledDeliveryTime;}public LocalDateTime getCreateTimestamp() {return createTimestamp;}public void setCreateTimestamp(LocalDateTime createTimestamp) {this.createTimestamp = createTimestamp;}public List<PendingOrderPlan> getPendingOrderItemPolicyPlan() {return pendingOrderItemPolicyPlan;}public void setPendingOrderItemPolicyPlan(List<PendingOrderPlan> pendingOrderItemPolicyPlan) {this.pendingOrderItemPolicyPlan = pendingOrderItemPolicyPlan;}public String getItemName() {return itemName;}public void setItemName(String itemName) {this.itemName = itemName;}public int getCatalogId() {return catalogId;}public void setCatalogId(int catalogId) {this.catalogId = catalogId;}public String getImgUrl() {return imgUrl;}public void setImgUrl(String imgUrl) {this.imgUrl = imgUrl;}public PendingOrder getPendingOrder() {return pendingOrder;}public void setPendingOrder(PendingOrder pendingOrder) {this.pendingOrder = pendingOrder;}public FofoOrderItem getFofoOrderItem() {return fofoOrderItem;}public void setFofoOrderItem(FofoOrderItem fofoOrderItem) {this.fofoOrderItem = fofoOrderItem;}public String getSmartSellerId() {return smartSellerId;}public void setSmartSellerId(String smartSellerId) {this.smartSellerId = smartSellerId;}@Overridepublic boolean equals(Object o) {if (this == o) return true;if (o == null || getClass() != o.getClass()) return false;PendingOrderItem that = (PendingOrderItem) o;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);}@Overridepublic int hashCode() {return Objects.hash(id, orderId, itemId, remark, isSettled, itemName, imgUrl, quantity, sellingPrice, pendingOrder, status, statusDescription, cancelledTimestamp, billedTimestamp, verifiedTimestamp, deliveredTimestamp, claimedTimestamp, originalOrderId, scheduledDeliveryTime, createTimestamp);}@Overridepublic String toString() {return "PendingOrderItem{" +"id=" + id +", orderId=" + orderId +", itemId=" + itemId +", remark='" + remark + '\'' +", isSettled=" + isSettled +", itemName='" + itemName + '\'' +", imgUrl='" + imgUrl + '\'' +", quantity=" + quantity +", sellingPrice=" + sellingPrice +", pendingOrder=" + pendingOrder +", status=" + status +", statusDescription='" + statusDescription + '\'' +", cancelledTimestamp=" + cancelledTimestamp +", billedTimestamp=" + billedTimestamp +", verifiedTimestamp=" + verifiedTimestamp +", deliveredTimestamp=" + deliveredTimestamp +", claimedTimestamp=" + claimedTimestamp +", originalOrderId=" + originalOrderId +", smartSellerId=" + smartSellerId +", scheduledDeliveryTime=" + scheduledDeliveryTime +", createTimestamp=" + createTimestamp +", pendingOrderItemPolicyPlan=" + pendingOrderItemPolicyPlan +'}';}}