| 21716 |
ashik.ali |
1 |
package com.spice.profitmandi.dao.entity.transaction;
|
| 21545 |
ashik.ali |
2 |
|
|
|
3 |
import java.io.Serializable;
|
|
|
4 |
import java.time.LocalDateTime;
|
|
|
5 |
|
|
|
6 |
import javax.persistence.Column;
|
|
|
7 |
import javax.persistence.Entity;
|
|
|
8 |
import javax.persistence.GeneratedValue;
|
|
|
9 |
import javax.persistence.GenerationType;
|
|
|
10 |
import javax.persistence.Id;
|
|
|
11 |
import javax.persistence.NamedQueries;
|
|
|
12 |
import javax.persistence.NamedQuery;
|
|
|
13 |
import javax.persistence.Table;
|
|
|
14 |
|
| 21716 |
ashik.ali |
15 |
import in.shop2020.model.v1.order.TransactionStatus;
|
| 21545 |
ashik.ali |
16 |
|
|
|
17 |
/**
|
|
|
18 |
* This class basically contains transaction details
|
|
|
19 |
*
|
|
|
20 |
* @author ashikali
|
|
|
21 |
*
|
|
|
22 |
*/
|
|
|
23 |
@Entity
|
|
|
24 |
@Table(name="transaction.transaction", schema = "transaction")
|
|
|
25 |
@NamedQueries({
|
|
|
26 |
@NamedQuery(name = "Transaction.selectCount", query = "select count(t) from Transaction t"),
|
|
|
27 |
@NamedQuery(name = "Transaction.selectCountByRetailerId", query = "select count(t) from Transaction t where t.retailerId = :retailerId"),
|
|
|
28 |
@NamedQuery(name="Transaction.selectAll", query="select t from Transaction t"),
|
| 21733 |
amit.gupta |
29 |
@NamedQuery(name="Transaction.selectById", query="select t from Transaction t where t.id= :id and t.status in (1,2,4,5,6)"),
|
| 21805 |
amit.gupta |
30 |
@NamedQuery(name = "Transaction.selectIdsByRetailerId", query = "select t.id from Transaction t where t.retailerId = :retailerId order by id desc"),
|
| 21545 |
ashik.ali |
31 |
@NamedQuery(
|
|
|
32 |
name = "Transaction.selectByIds",
|
|
|
33 |
query = "select t.id, t.createTimestamp, o.retailerAddress1, o.retailerAddress2, o.retailerCity, "
|
|
|
34 |
+ "o.retailerPinCode, o.retailerState, o.shippingCost, o.statusDescription, o.invoiceNumber, o.airwayBillNumber, o.totalAmount, li.brand, li.modelName, "
|
| 21806 |
amit.gupta |
35 |
+ "li.modelNumber, li.color, li.quantity, li.unitPrice, p.id, p.name, o.shippingTimestamp, o.status, o.promisedDeliveryTime, o.retailerName from Transaction t join Order o on o.transactionId = t.id "
|
| 21808 |
amit.gupta |
36 |
+ "join LineItem li on li.orderId = o.id left join Provider p on p.id = o.logisticsProviderId where t.id in :ids order by t.id desc")
|
| 21545 |
ashik.ali |
37 |
})
|
|
|
38 |
|
|
|
39 |
public class Transaction implements Serializable{
|
|
|
40 |
|
|
|
41 |
private static final long serialVersionUID = 1L;
|
|
|
42 |
|
|
|
43 |
public Transaction() {
|
|
|
44 |
}
|
|
|
45 |
|
|
|
46 |
@Id
|
|
|
47 |
@Column(name="id", unique=true, updatable=false)
|
|
|
48 |
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
|
|
49 |
private int id;
|
|
|
50 |
|
|
|
51 |
@Column(name = "createdOn")
|
|
|
52 |
private LocalDateTime createTimestamp;
|
|
|
53 |
|
|
|
54 |
@Column(name = "status")
|
|
|
55 |
private TransactionStatus status;
|
|
|
56 |
|
|
|
57 |
@Column(name = "status_message", length = 100)
|
|
|
58 |
private String statusMessage;
|
|
|
59 |
|
|
|
60 |
@Column(name = "customer_id")
|
|
|
61 |
private int retailerId;
|
|
|
62 |
|
|
|
63 |
@Column(name = "shopping_cart_id")
|
|
|
64 |
private int shoppingCartId;
|
|
|
65 |
|
|
|
66 |
@Column(name = "coupon_code", length = 20)
|
|
|
67 |
private String couponCode;
|
|
|
68 |
|
|
|
69 |
@Column(name = "session_source", length = 100)
|
|
|
70 |
private String sessionSource;
|
|
|
71 |
|
|
|
72 |
@Column(name = "session_start_time")
|
|
|
73 |
private LocalDateTime sessionStateTime;
|
|
|
74 |
|
|
|
75 |
@Column(name = "first_source")
|
|
|
76 |
private String firstSource;
|
|
|
77 |
|
|
|
78 |
@Column(name = "first_source_start_time")
|
|
|
79 |
private LocalDateTime firstSourceStateTime;
|
|
|
80 |
|
|
|
81 |
@Column(name = "totalShippingCost")
|
|
|
82 |
private float totalShippingCost;
|
|
|
83 |
|
|
|
84 |
@Column(name = "totalCodCharges")
|
|
|
85 |
private float totalCodCharges;
|
|
|
86 |
|
|
|
87 |
@Column(name = "payment_option")
|
|
|
88 |
private int paymentOption;
|
|
|
89 |
|
|
|
90 |
public int getId() {
|
|
|
91 |
return id;
|
|
|
92 |
}
|
|
|
93 |
public void setId(int id) {
|
|
|
94 |
this.id = id;
|
|
|
95 |
}
|
|
|
96 |
|
|
|
97 |
|
|
|
98 |
public LocalDateTime getCreateTimestamp() {
|
|
|
99 |
return createTimestamp;
|
|
|
100 |
}
|
|
|
101 |
public void setCreateTimestamp(LocalDateTime createTimestamp) {
|
|
|
102 |
this.createTimestamp = createTimestamp;
|
|
|
103 |
}
|
|
|
104 |
public TransactionStatus getStatus() {
|
|
|
105 |
return status;
|
|
|
106 |
}
|
|
|
107 |
public void setStatus(TransactionStatus status) {
|
|
|
108 |
this.status = status;
|
|
|
109 |
}
|
|
|
110 |
public String getStatusMessage() {
|
|
|
111 |
return statusMessage;
|
|
|
112 |
}
|
|
|
113 |
public void setStatusMessage(String statusMessage) {
|
|
|
114 |
this.statusMessage = statusMessage;
|
|
|
115 |
}
|
|
|
116 |
public int getRetailerId() {
|
|
|
117 |
return retailerId;
|
|
|
118 |
}
|
|
|
119 |
public void setRetailerId(int retailerId) {
|
|
|
120 |
this.retailerId = retailerId;
|
|
|
121 |
}
|
|
|
122 |
public int getShoppingCartId() {
|
|
|
123 |
return shoppingCartId;
|
|
|
124 |
}
|
|
|
125 |
public void setShoppingCartId(int shoppingCartId) {
|
|
|
126 |
this.shoppingCartId = shoppingCartId;
|
|
|
127 |
}
|
|
|
128 |
public String getCouponCode() {
|
|
|
129 |
return couponCode;
|
|
|
130 |
}
|
|
|
131 |
public void setCouponCode(String couponCode) {
|
|
|
132 |
this.couponCode = couponCode;
|
|
|
133 |
}
|
|
|
134 |
public String getSessionSource() {
|
|
|
135 |
return sessionSource;
|
|
|
136 |
}
|
|
|
137 |
public void setSessionSource(String sessionSource) {
|
|
|
138 |
this.sessionSource = sessionSource;
|
|
|
139 |
}
|
|
|
140 |
public LocalDateTime getSessionStateTime() {
|
|
|
141 |
return sessionStateTime;
|
|
|
142 |
}
|
|
|
143 |
public void setSessionStateTime(LocalDateTime sessionStateTime) {
|
|
|
144 |
this.sessionStateTime = sessionStateTime;
|
|
|
145 |
}
|
|
|
146 |
public String getFirstSource() {
|
|
|
147 |
return firstSource;
|
|
|
148 |
}
|
|
|
149 |
public void setFirstSource(String firstSource) {
|
|
|
150 |
this.firstSource = firstSource;
|
|
|
151 |
}
|
|
|
152 |
public LocalDateTime getFirstSourceStateTime() {
|
|
|
153 |
return firstSourceStateTime;
|
|
|
154 |
}
|
|
|
155 |
public void setFirstSourceStateTime(LocalDateTime firstSourceStateTime) {
|
|
|
156 |
this.firstSourceStateTime = firstSourceStateTime;
|
|
|
157 |
}
|
|
|
158 |
public float getTotalShippingCost() {
|
|
|
159 |
return totalShippingCost;
|
|
|
160 |
}
|
|
|
161 |
public void setTotalShippingCost(float totalShippingCost) {
|
|
|
162 |
this.totalShippingCost = totalShippingCost;
|
|
|
163 |
}
|
|
|
164 |
public float getTotalCodCharges() {
|
|
|
165 |
return totalCodCharges;
|
|
|
166 |
}
|
|
|
167 |
public void setTotalCodCharges(float totalCodCharges) {
|
|
|
168 |
this.totalCodCharges = totalCodCharges;
|
|
|
169 |
}
|
|
|
170 |
public int getPaymentOption() {
|
|
|
171 |
return paymentOption;
|
|
|
172 |
}
|
|
|
173 |
public void setPaymentOption(int paymentOption) {
|
|
|
174 |
this.paymentOption = paymentOption;
|
|
|
175 |
}
|
|
|
176 |
|
|
|
177 |
@Override
|
|
|
178 |
public String toString() {
|
|
|
179 |
return "Transaction [createTimestamp=" + createTimestamp + ", status=" + status + ", statusMessage="
|
|
|
180 |
+ statusMessage + ", retailerId=" + retailerId + ", shoppingCartId=" + shoppingCartId + ", couponCode="
|
|
|
181 |
+ couponCode + ", sessionSource=" + sessionSource + ", sessionStateTime=" + sessionStateTime
|
|
|
182 |
+ ", firstSource=" + firstSource + ", firstSourceStateTime=" + firstSourceStateTime
|
|
|
183 |
+ ", totalShippingCost=" + totalShippingCost + ", totalCodCharges=" + totalCodCharges
|
|
|
184 |
+ ", paymentOption=" + paymentOption + "]";
|
|
|
185 |
}
|
|
|
186 |
|
|
|
187 |
|
|
|
188 |
}
|