Subversion Repositories SmartDukaan

Rev

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

Rev 26629 Rev 26817
Line 8... Line 8...
8
import javax.persistence.Entity;
8
import javax.persistence.Entity;
9
import javax.persistence.GeneratedValue;
9
import javax.persistence.GeneratedValue;
10
import javax.persistence.GenerationType;
10
import javax.persistence.GenerationType;
11
import javax.persistence.Id;
11
import javax.persistence.Id;
12
import javax.persistence.Table;
12
import javax.persistence.Table;
-
 
13
import javax.persistence.Transient;
13
 
14
 
14
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
15
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
15
 
16
 
-
 
17
/**
-
 
18
 * @author amit
-
 
19
 *
-
 
20
 */
16
@Entity
21
@Entity
17
@Table(name = "fofo.pending_order", schema = "fofo")
22
@Table(name = "fofo.pending_order", schema = "fofo")
18
public class PendingOrder implements Serializable {
23
public class PendingOrder implements Serializable {
19
 
24
 
20
	/**
25
	/**
Line 27... Line 32...
27
	private int id;
32
	private int id;
28
 
33
 
29
	@Column(name = "fofo_id")
34
	@Column(name = "fofo_id")
30
	private int fofoId;
35
	private int fofoId;
31
 
36
 
32
	@Column(name = "customer_first_name")
37
	@Column(name = "customer_id")
33
	private String customerFirstName;
-
 
34
 
-
 
35
	@Column(name = "customer_last_name")
-
 
36
	private String customerLastName;
38
	private int customerId;
37
 
-
 
38
	@Column(name = "mobile_number", length = 20)
-
 
39
	private String mobileNumber;
-
 
40
 
-
 
41
	@Column(name = "address_line1")
-
 
42
	private String line1;
-
 
43
 
-
 
44
	@Column(name = "address_line2")
-
 
45
	private String line2;
-
 
46
 
-
 
47
	@Column(name = "email_id")
-
 
48
	private String emailId;
-
 
49
 
39
 
-
 
40
	@Column(name = "pay_method")
-
 
41
	private String payMethod;
-
 
42
	
50
	@Column(name = "customer_gst_number")
43
	@Column(name = "customer_gst_number")
51
	private String customerGstNumber;
44
	private String customerGstNumber;
52
 
45
 
53
	@Column(name = "city")
-
 
54
	private String city;
-
 
55
 
-
 
56
	@Column(name = "state")
46
	@Column(name = "customer_address_id")
57
	private String state;
-
 
58
 
-
 
59
	@Column(name = "pin_code", length = 10)
-
 
60
	private String pinCode;
47
	private int customerAddressId;
61
 
48
 
62
	@Column(name = "status")
49
	@Column(name = "status")
63
	private String status;
50
	private String status;
-
 
51
	
-
 
52
	@Transient
-
 
53
	private Customer customer;
64
 
54
 
65
	@Convert(converter = LocalDateTimeAttributeConverter.class)
55
	@Convert(converter = LocalDateTimeAttributeConverter.class)
66
	@Column(name = "create_timestamp")
56
	@Column(name = "create_timestamp")
67
	private LocalDateTime createTimestamp = LocalDateTime.now();
57
	private LocalDateTime createTimestamp = LocalDateTime.now();
68
 
58
	
69
	public String getCustomerGstNumber() {
59
	@Column(name = "total_amount")
70
		return customerGstNumber;
60
	private double totalAmount;
-
 
61
	@Column(name = "cancelled_amount")
-
 
62
	private double cancelledAmount;
-
 
63
	@Column(name = "refunded_amount")
-
 
64
	private double refundedAmount;
-
 
65
	@Column(name = "paid_amount")
-
 
66
	private double paidAmount;
-
 
67
	@Column(name = "billed_amount")
-
 
68
	private double billedAmount;
71
	}
69
	@Override
72
 
-
 
-
 
70
	public String toString() {
-
 
71
		return "PendingOrder [id=" + id + ", fofoId=" + fofoId + ", customerId=" + customerId + ", payMethod="
73
	public void setCustomerGstNumber(String customerGstNumber) {
72
				+ payMethod + ", customerGstNumber=" + customerGstNumber + ", customerAddressId=" + customerAddressId
-
 
73
				+ ", status=" + status + ", createTimestamp=" + createTimestamp + ", totalAmount=" + totalAmount
-
 
74
				+ ", cancelledAmount=" + cancelledAmount + ", refundedAmount=" + refundedAmount + ", paidAmount="
74
		this.customerGstNumber = customerGstNumber;
75
				+ paidAmount + ", billedAmount=" + billedAmount + "]";
75
	}
76
	}
76
 
-
 
77
	public int getId() {
77
	public int getId() {
78
		return id;
78
		return id;
79
	}
79
	}
-
 
80
	
80
 
81
	
-
 
82
	public Customer getCustomer() {
-
 
83
		return customer;
-
 
84
	}
-
 
85
	public void setCustomer(Customer customer) {
-
 
86
		this.customer = customer;
-
 
87
	}
81
	public void setId(int id) {
88
	public void setId(int id) {
82
		this.id = id;
89
		this.id = id;
83
	}
90
	}
84
 
-
 
85
	public int getFofoId() {
91
	public int getFofoId() {
86
		return fofoId;
92
		return fofoId;
87
	}
93
	}
88
 
-
 
89
	public void setFofoId(int fofoId) {
-
 
90
		this.fofoId = fofoId;
-
 
91
	}
94
	
92
 
-
 
93
	public String getMobileNumber() {
95
	public String getPayMethod() {
94
		return mobileNumber;
96
		return payMethod;
95
	}
97
	}
96
 
-
 
97
	public void setMobileNumber(String mobileNumber) {
-
 
98
		this.mobileNumber = mobileNumber;
-
 
99
	}
-
 
100
 
-
 
101
	public String getCity() {
-
 
102
		return city;
-
 
103
	}
-
 
104
 
-
 
105
	public void setCity(String city) {
98
	public void setPayMethod(String payMethod) {
106
		this.city = city;
99
		this.payMethod = payMethod;
107
	}
-
 
108
 
-
 
109
	public String getCustomerFirstName() {
-
 
110
		return customerFirstName;
-
 
111
	}
-
 
112
 
-
 
113
	public void setCustomerFirstName(String customerFirstName) {
-
 
114
		this.customerFirstName = customerFirstName;
-
 
115
	}
100
	}
116
 
-
 
117
	public String getCustomerLastName() {
101
	public void setFofoId(int fofoId) {
118
		return customerLastName;
102
		this.fofoId = fofoId;
119
	}
103
	}
120
 
-
 
121
	public void setCustomerLastName(String customerLastName) {
104
	public int getCustomerId() {
122
		this.customerLastName = customerLastName;
105
		return customerId;
123
	}
106
	}
124
 
-
 
125
	public String getEmailId() {
107
	public void setCustomerId(int customerId) {
126
		return emailId;
108
		this.customerId = customerId;
127
	}
109
	}
128
 
-
 
129
	public void setEmailId(String emailId) {
-
 
130
		this.emailId = emailId;
-
 
131
	}
-
 
132
 
-
 
133
	public String getState() {
110
	public String getCustomerGstNumber() {
134
		return state;
111
		return customerGstNumber;
135
	}
112
	}
136
 
-
 
137
	public void setState(String state) {
113
	public void setCustomerGstNumber(String customerGstNumber) {
138
		this.state = state;
114
		this.customerGstNumber = customerGstNumber;
139
	}
115
	}
140
 
-
 
141
	public String getPinCode() {
116
	public int getCustomerAddressId() {
142
		return pinCode;
117
		return customerAddressId;
143
	}
118
	}
144
 
-
 
145
	public void setPinCode(String pinCode) {
119
	public void setCustomerAddressId(int customerAddressId) {
146
		this.pinCode = pinCode;
120
		this.customerAddressId = customerAddressId;
147
	}
121
	}
148
 
-
 
149
	public String getStatus() {
122
	public String getStatus() {
150
		return status;
123
		return status;
151
	}
124
	}
152
 
-
 
153
	public void setStatus(String status) {
125
	public void setStatus(String status) {
154
		this.status = status;
126
		this.status = status;
155
	}
127
	}
156
 
-
 
157
	public LocalDateTime getCreateTimestamp() {
128
	public LocalDateTime getCreateTimestamp() {
158
		return createTimestamp;
129
		return createTimestamp;
159
	}
130
	}
160
 
-
 
161
	public void setCreateTimestamp(LocalDateTime createTimestamp) {
131
	public void setCreateTimestamp(LocalDateTime createTimestamp) {
162
		this.createTimestamp = createTimestamp;
132
		this.createTimestamp = createTimestamp;
163
	}
133
	}
164
 
-
 
165
	public String getLine1() {
134
	public double getTotalAmount() {
166
		return line1;
135
		return totalAmount;
167
	}
136
	}
168
 
-
 
169
	public void setLine1(String line1) {
137
	public void setTotalAmount(double totalAmount) {
170
		this.line1 = line1;
138
		this.totalAmount = totalAmount;
171
	}
139
	}
172
 
-
 
173
	public String getLine2() {
140
	public double getCancelledAmount() {
174
		return line2;
141
		return cancelledAmount;
175
	}
142
	}
-
 
143
	public void setCancelledAmount(double cancelledAmount) {
-
 
144
		this.cancelledAmount = cancelledAmount;
-
 
145
	}
-
 
146
	public double getRefundedAmount() {
-
 
147
		return refundedAmount;
176
 
148
	}
-
 
149
	public void setRefundedAmount(double refundedAmount) {
-
 
150
		this.refundedAmount = refundedAmount;
-
 
151
	}
-
 
152
	public double getPaidAmount() {
-
 
153
		return paidAmount;
-
 
154
	}
177
	public void setLine2(String line2) {
155
	public void setPaidAmount(double paidAmount) {
178
		this.line2 = line2;
156
		this.paidAmount = paidAmount;
-
 
157
	}
-
 
158
	public double getBilledAmount() {
-
 
159
		return billedAmount;
-
 
160
	}
-
 
161
	public void setBilledAmount(double billedAmount) {
-
 
162
		this.billedAmount = billedAmount;
-
 
163
	}
-
 
164
	public static long getSerialversionuid() {
-
 
165
		return serialVersionUID;
179
	}
166
	}
180
 
-
 
181
	@Override
167
	@Override
182
	public String toString() {
168
	public int hashCode() {
-
 
169
		final int prime = 31;
-
 
170
		int result = 1;
-
 
171
		long temp;
-
 
172
		temp = Double.doubleToLongBits(billedAmount);
-
 
173
		result = prime * result + (int) (temp ^ (temp >>> 32));
-
 
174
		temp = Double.doubleToLongBits(cancelledAmount);
183
		return "PendingOrder [id=" + id + ", fofoId=" + fofoId + ", customerFirstName=" + customerFirstName
175
		result = prime * result + (int) (temp ^ (temp >>> 32));
184
				+ ", customerLastName=" + customerLastName + ", mobileNumber=" + mobileNumber + ", line1=" + line1
176
		result = prime * result + ((createTimestamp == null) ? 0 : createTimestamp.hashCode());
-
 
177
		result = prime * result + customerAddressId;
185
				+ ", line2=" + line2 + ", emailId=" + emailId + ", customerGstNumber=" + customerGstNumber + ", city="
178
		result = prime * result + ((customerGstNumber == null) ? 0 : customerGstNumber.hashCode());
-
 
179
		result = prime * result + customerId;
-
 
180
		result = prime * result + fofoId;
-
 
181
		result = prime * result + id;
-
 
182
		temp = Double.doubleToLongBits(paidAmount);
-
 
183
		result = prime * result + (int) (temp ^ (temp >>> 32));
-
 
184
		result = prime * result + ((payMethod == null) ? 0 : payMethod.hashCode());
-
 
185
		temp = Double.doubleToLongBits(refundedAmount);
-
 
186
		result = prime * result + (int) (temp ^ (temp >>> 32));
186
				+ city + ", state=" + state + ", pinCode=" + pinCode + ", status=" + status + ", createTimestamp="
187
		result = prime * result + ((status == null) ? 0 : status.hashCode());
-
 
188
		temp = Double.doubleToLongBits(totalAmount);
-
 
189
		result = prime * result + (int) (temp ^ (temp >>> 32));
-
 
190
		return result;
-
 
191
	}
-
 
192
	@Override
-
 
193
	public boolean equals(Object obj) {
-
 
194
		if (this == obj)
-
 
195
			return true;
-
 
196
		if (obj == null)
-
 
197
			return false;
-
 
198
		if (getClass() != obj.getClass())
-
 
199
			return false;
-
 
200
		PendingOrder other = (PendingOrder) obj;
-
 
201
		if (Double.doubleToLongBits(billedAmount) != Double.doubleToLongBits(other.billedAmount))
-
 
202
			return false;
-
 
203
		if (Double.doubleToLongBits(cancelledAmount) != Double.doubleToLongBits(other.cancelledAmount))
-
 
204
			return false;
187
				+ createTimestamp + "]";
205
		if (createTimestamp == null) {
-
 
206
			if (other.createTimestamp != null)
-
 
207
				return false;
-
 
208
		} else if (!createTimestamp.equals(other.createTimestamp))
-
 
209
			return false;
-
 
210
		if (customerAddressId != other.customerAddressId)
-
 
211
			return false;
-
 
212
		if (customerGstNumber == null) {
-
 
213
			if (other.customerGstNumber != null)
-
 
214
				return false;
-
 
215
		} else if (!customerGstNumber.equals(other.customerGstNumber))
-
 
216
			return false;
-
 
217
		if (customerId != other.customerId)
-
 
218
			return false;
-
 
219
		if (fofoId != other.fofoId)
-
 
220
			return false;
-
 
221
		if (id != other.id)
-
 
222
			return false;
-
 
223
		if (Double.doubleToLongBits(paidAmount) != Double.doubleToLongBits(other.paidAmount))
-
 
224
			return false;
-
 
225
		if (payMethod == null) {
-
 
226
			if (other.payMethod != null)
-
 
227
				return false;
-
 
228
		} else if (!payMethod.equals(other.payMethod))
-
 
229
			return false;
-
 
230
		if (Double.doubleToLongBits(refundedAmount) != Double.doubleToLongBits(other.refundedAmount))
-
 
231
			return false;
-
 
232
		if (status == null) {
-
 
233
			if (other.status != null)
-
 
234
				return false;
-
 
235
		} else if (!status.equals(other.status))
-
 
236
			return false;
-
 
237
		if (Double.doubleToLongBits(totalAmount) != Double.doubleToLongBits(other.totalAmount))
-
 
238
			return false;
-
 
239
		return true;
188
	}
240
	}
189
 
241
 
190
}
242
}