Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
23418 ashik.ali 1
package com.spice.profitmandi.dao.entity.fofo;
2
 
3
import java.io.Serializable;
4
import java.time.LocalDateTime;
5
import java.time.format.DateTimeFormatter;
6
 
7
import javax.persistence.Column;
8
import javax.persistence.Convert;
9
import javax.persistence.Entity;
10
import javax.persistence.GeneratedValue;
11
import javax.persistence.GenerationType;
12
import javax.persistence.Id;
13
import javax.persistence.Table;
23880 ashik.ali 14
import javax.persistence.Transient;
23418 ashik.ali 15
import javax.persistence.UniqueConstraint;
16
 
17
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
18
 
19
@Entity
31860 tejbeer 20
@Table(name="fofo.prebooking_order", uniqueConstraints = {@UniqueConstraint(columnNames = {"catalog_id", "customer_mobile_number"})})
23418 ashik.ali 21
public class PrebookingOrder implements Serializable{
22
 
23
	private static final long serialVersionUID = 1L;
24
 
25
	@Id
26
	@Column(name = "id")
27
	@GeneratedValue(strategy = GenerationType.IDENTITY)
28
	private int id;
29
 
30
	@Column(name = "fofo_id")
31
	private int fofoId;
32
 
33
	@Column(name = "customer_name")
34
	private String customerName;
35
 
36
	@Column(name = "customer_mobile_number")
37
	private String customerMobileNumber;
38
 
39
	@Column(name = "customer_email_id")
40
	private String customerEmailId;
41
 
24085 amit.gupta 42
	@Column(name = "catalog_id")
43
	private int catalogId;
44
 
23418 ashik.ali 45
	@Column(name = "quantity")
46
	private int quantity;
47
 
24085 amit.gupta 48
	public int getCatalogId() {
49
		return catalogId;
50
	}
51
 
52
	public void setCatalogId(int catalogId) {
53
		this.catalogId = catalogId;
54
	}
55
 
23418 ashik.ali 56
	@Column(name = "available_quantity")
57
	private int availableQuantity;
58
 
59
	@Convert(converter = LocalDateTimeAttributeConverter.class)
60
	@Column(name = "complete_timestamp")
61
	private LocalDateTime completeTimestamp = null;
62
 
63
	@Convert(converter = LocalDateTimeAttributeConverter.class)
64
	@Column(name = "create_timestamp")
65
	private LocalDateTime createTimestamp = LocalDateTime.now();
66
 
23580 govind 67
	@Convert(converter = LocalDateTimeAttributeConverter.class)
68
	@Column(name = "notify_timestamp")
69
	private LocalDateTime notifyTimeStamp = null;
70
 
23880 ashik.ali 71
	@Transient
72
	private String description;
73
 
26042 amit.gupta 74
	@Column(name = "advance_paid")
23880 ashik.ali 75
	private float advanceAmount;
76
 
77
	@Transient
78
	private float tentativeAmount;
79
 
23580 govind 80
	public LocalDateTime getNotifyTimeStamp() {
81
		return notifyTimeStamp;
82
	}
83
 
84
	public void setNotifyTimeStamp(LocalDateTime notifyTimeStamp) {
85
		this.notifyTimeStamp = notifyTimeStamp;
86
	}
87
 
23418 ashik.ali 88
	public int getId() {
89
		return id;
90
	}
91
 
92
	public void setId(int id) {
93
		this.id = id;
94
	}
95
 
96
	public int getFofoId() {
97
		return fofoId;
98
	}
99
 
100
	public void setFofoId(int fofoId) {
101
		this.fofoId = fofoId;
102
	}
103
 
104
	public String getCustomerName() {
105
		return customerName;
106
	}
107
 
108
	public void setCustomerName(String customerName) {
109
		this.customerName = customerName;
110
	}
111
 
112
	public String getCustomerMobileNumber() {
113
		return customerMobileNumber;
114
	}
115
 
116
	public void setCustomerMobileNumber(String customerMobileNumber) {
117
		this.customerMobileNumber = customerMobileNumber;
118
	}
119
 
120
	public String getCustomerEmailId() {
121
		return customerEmailId;
122
	}
123
 
124
	public void setCustomerEmailId(String customerEmailId) {
125
		this.customerEmailId = customerEmailId;
126
	}
127
 
128
	public int getQuantity() {
129
		return quantity;
130
	}
131
 
132
	public void setQuantity(int quantity) {
133
		this.quantity = quantity;
134
	}
135
 
136
	public int getAvailableQuantity() {
137
		return availableQuantity;
138
	}
139
 
140
	public void setAvailableQuantity(int availableQuantity) {
141
		this.availableQuantity = availableQuantity;
142
	}
143
 
144
	public LocalDateTime getCompleteTimestamp() {
145
		return completeTimestamp;
146
	}
147
 
148
	public void setCompleteTimestamp(LocalDateTime completeTimestamp) {
149
		this.completeTimestamp = completeTimestamp;
150
	}
151
 
152
	public LocalDateTime getCreateTimestamp() {
153
		return createTimestamp;
154
	}
155
 
156
	public void setCreateTimestamp(LocalDateTime createTimestamp) {
157
		this.createTimestamp = createTimestamp;
158
	}
159
 
160
	public String getFormattedCreateTimestamp(){
161
		if(createTimestamp == null){
162
			return null;
163
		}
24402 amit.gupta 164
		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm");
23418 ashik.ali 165
		return createTimestamp.format(formatter);
166
    }
23880 ashik.ali 167
 
168
	public String getDescription() {
169
		return description;
170
	}
171
	public void setDescription(String description) {
172
		this.description = description;
173
	}
174
 
175
	public float getAdvanceAmount() {
176
		return advanceAmount;
177
	}
178
	public void setAdvanceAmount(float advanceAmount) {
179
		this.advanceAmount = advanceAmount;
180
	}
181
	public float getTentativeAmount() {
182
		return tentativeAmount;
183
	}
184
	public void setTentativeAmount(float tentativeAmount) {
185
		this.tentativeAmount = tentativeAmount;
186
	}
23418 ashik.ali 187
 
188
	@Override
189
	public int hashCode() {
190
		final int prime = 31;
191
		int result = 1;
192
		result = prime * result + id;
193
		return result;
194
	}
195
 
196
	@Override
197
	public boolean equals(Object obj) {
198
		if (this == obj)
199
			return true;
200
		if (obj == null)
201
			return false;
202
		if (getClass() != obj.getClass())
203
			return false;
204
		PrebookingOrder other = (PrebookingOrder) obj;
205
		if (id != other.id)
206
			return false;
207
		return true;
208
	}
209
 
210
	@Override
211
	public String toString() {
212
		return "PrebookingOrder [id=" + id + ", fofoId=" + fofoId + ", customerName=" + customerName
213
				+ ", customerMobileNumber=" + customerMobileNumber + ", customerEmailId=" + customerEmailId
24087 amit.gupta 214
				+ ", catalogId=" + catalogId + ", quantity=" + quantity + ", availableQuantity=" + availableQuantity
215
				+ ", completeTimestamp=" + completeTimestamp + ", createTimestamp=" + createTimestamp
216
				+ ", notifyTimeStamp=" + notifyTimeStamp + ", description=" + description + ", advanceAmount="
217
				+ advanceAmount + ", tentativeAmount=" + tentativeAmount + "]";
23418 ashik.ali 218
	}
219
 
220
}