Subversion Repositories SmartDukaan

Rev

Rev 23880 | Rev 24087 | 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
24085 amit.gupta 20
@Table(name="fofo.prebooking_order", schema = "fofo", 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
 
42
	@Column(name = "item_id")
43
	private int itemId;
44
 
24085 amit.gupta 45
	@Column(name = "catalog_id")
46
	private int catalogId;
47
 
23418 ashik.ali 48
	@Column(name = "quantity")
49
	private int quantity;
50
 
24085 amit.gupta 51
	public int getCatalogId() {
52
		return catalogId;
53
	}
54
 
55
	public void setCatalogId(int catalogId) {
56
		this.catalogId = catalogId;
57
	}
58
 
23418 ashik.ali 59
	@Column(name = "available_quantity")
60
	private int availableQuantity;
61
 
62
	@Convert(converter = LocalDateTimeAttributeConverter.class)
63
	@Column(name = "complete_timestamp")
64
	private LocalDateTime completeTimestamp = null;
65
 
66
	@Convert(converter = LocalDateTimeAttributeConverter.class)
67
	@Column(name = "create_timestamp")
68
	private LocalDateTime createTimestamp = LocalDateTime.now();
69
 
23580 govind 70
	@Convert(converter = LocalDateTimeAttributeConverter.class)
71
	@Column(name = "notify_timestamp")
72
	private LocalDateTime notifyTimeStamp = null;
73
 
23880 ashik.ali 74
	@Transient
75
	private String description;
76
 
77
	@Transient
78
	private float advanceAmount;
79
 
80
	@Transient
81
	private float tentativeAmount;
82
 
23580 govind 83
	public LocalDateTime getNotifyTimeStamp() {
84
		return notifyTimeStamp;
85
	}
86
 
87
	public void setNotifyTimeStamp(LocalDateTime notifyTimeStamp) {
88
		this.notifyTimeStamp = notifyTimeStamp;
89
	}
90
 
23418 ashik.ali 91
	public int getId() {
92
		return id;
93
	}
94
 
95
	public void setId(int id) {
96
		this.id = id;
97
	}
98
 
99
	public int getFofoId() {
100
		return fofoId;
101
	}
102
 
103
	public void setFofoId(int fofoId) {
104
		this.fofoId = fofoId;
105
	}
106
 
107
	public String getCustomerName() {
108
		return customerName;
109
	}
110
 
111
	public void setCustomerName(String customerName) {
112
		this.customerName = customerName;
113
	}
114
 
115
	public String getCustomerMobileNumber() {
116
		return customerMobileNumber;
117
	}
118
 
119
	public void setCustomerMobileNumber(String customerMobileNumber) {
120
		this.customerMobileNumber = customerMobileNumber;
121
	}
122
 
123
	public String getCustomerEmailId() {
124
		return customerEmailId;
125
	}
126
 
127
	public void setCustomerEmailId(String customerEmailId) {
128
		this.customerEmailId = customerEmailId;
129
	}
130
 
131
	public int getItemId() {
132
		return itemId;
133
	}
134
 
135
	public void setItemId(int itemId) {
136
		this.itemId = itemId;
137
	}
138
 
139
	public int getQuantity() {
140
		return quantity;
141
	}
142
 
143
	public void setQuantity(int quantity) {
144
		this.quantity = quantity;
145
	}
146
 
147
	public int getAvailableQuantity() {
148
		return availableQuantity;
149
	}
150
 
151
	public void setAvailableQuantity(int availableQuantity) {
152
		this.availableQuantity = availableQuantity;
153
	}
154
 
155
	public LocalDateTime getCompleteTimestamp() {
156
		return completeTimestamp;
157
	}
158
 
159
	public void setCompleteTimestamp(LocalDateTime completeTimestamp) {
160
		this.completeTimestamp = completeTimestamp;
161
	}
162
 
163
	public LocalDateTime getCreateTimestamp() {
164
		return createTimestamp;
165
	}
166
 
167
	public void setCreateTimestamp(LocalDateTime createTimestamp) {
168
		this.createTimestamp = createTimestamp;
169
	}
170
 
171
	public String getFormattedCreateTimestamp(){
172
		if(createTimestamp == null){
173
			return null;
174
		}
175
		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-YYYY HH:mm");
176
		return createTimestamp.format(formatter);
177
    }
23880 ashik.ali 178
 
179
	public String getDescription() {
180
		return description;
181
	}
182
	public void setDescription(String description) {
183
		this.description = description;
184
	}
185
 
186
	public float getAdvanceAmount() {
187
		return advanceAmount;
188
	}
189
	public void setAdvanceAmount(float advanceAmount) {
190
		this.advanceAmount = advanceAmount;
191
	}
192
	public float getTentativeAmount() {
193
		return tentativeAmount;
194
	}
195
	public void setTentativeAmount(float tentativeAmount) {
196
		this.tentativeAmount = tentativeAmount;
197
	}
23418 ashik.ali 198
 
199
	@Override
200
	public int hashCode() {
201
		final int prime = 31;
202
		int result = 1;
203
		result = prime * result + id;
204
		return result;
205
	}
206
 
207
	@Override
208
	public boolean equals(Object obj) {
209
		if (this == obj)
210
			return true;
211
		if (obj == null)
212
			return false;
213
		if (getClass() != obj.getClass())
214
			return false;
215
		PrebookingOrder other = (PrebookingOrder) obj;
216
		if (id != other.id)
217
			return false;
218
		return true;
219
	}
220
 
221
	@Override
222
	public String toString() {
223
		return "PrebookingOrder [id=" + id + ", fofoId=" + fofoId + ", customerName=" + customerName
224
				+ ", customerMobileNumber=" + customerMobileNumber + ", customerEmailId=" + customerEmailId
24085 amit.gupta 225
				+ ", itemId=" + itemId + ", catalogId=" + catalogId + ", quantity=" + quantity + ", availableQuantity="
226
				+ availableQuantity + ", completeTimestamp=" + completeTimestamp + ", createTimestamp="
227
				+ createTimestamp + ", notifyTimeStamp=" + notifyTimeStamp + ", description=" + description
228
				+ ", advanceAmount=" + advanceAmount + ", tentativeAmount=" + tentativeAmount + "]";
23418 ashik.ali 229
	}
230
 
231
}