Subversion Repositories SmartDukaan

Rev

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

Rev 26817 Rev 27579
Line 9... Line 9...
9
import javax.persistence.Convert;
9
import javax.persistence.Convert;
10
import javax.persistence.Entity;
10
import javax.persistence.Entity;
11
import javax.persistence.GeneratedValue;
11
import javax.persistence.GeneratedValue;
12
import javax.persistence.GenerationType;
12
import javax.persistence.GenerationType;
13
import javax.persistence.Id;
13
import javax.persistence.Id;
-
 
14
import javax.persistence.NamedQueries;
-
 
15
import javax.persistence.NamedQuery;
14
import javax.persistence.Table;
16
import javax.persistence.Table;
15
import javax.persistence.Transient;
17
import javax.persistence.Transient;
16
 
18
 
17
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
19
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
18
 
20
 
19
@Entity
21
@Entity
20
@Table(name="fofo.fofo_order", schema = "fofo")
22
@Table(name = "fofo.fofo_order", schema = "fofo")
-
 
23
 
-
 
24
@NamedQueries({
-
 
25
 
-
 
26
		@NamedQuery(name = "FofoOrder.SelectItemWiseTertiary", query = "select new com.spice.profitmandi.dao.model.ItemWiseTertiaryModel(foi.brand,"
-
 
27
				+ "foi.modelName, foi.modelNumber, foi.quantity, foi.mop)"
-
 
28
				+ " from FofoOrder fo join FofoOrderItem foi on fo.id = foi.orderId where fo.cancelledTimestamp is null and fo.fofoId = :fofoId"
-
 
29
				+ " and fo.createTimestamp between :startDate and :endDate"),
-
 
30
 
-
 
31
})
21
public class FofoOrder implements Serializable{
32
public class FofoOrder implements Serializable {
22
 
33
 
23
	private static final long serialVersionUID = 1L;
34
	private static final long serialVersionUID = 1L;
24
 
35
 
25
	@Id
36
	@Id
26
	@Column(name = "id")
37
	@Column(name = "id")
27
	@GeneratedValue(strategy = GenerationType.IDENTITY)
38
	@GeneratedValue(strategy = GenerationType.IDENTITY)
28
	private int id;
39
	private int id;
29
	
40
 
30
	@Column(name = "fofo_id")
41
	@Column(name = "fofo_id")
31
	private int fofoId;
42
	private int fofoId;
32
	
43
 
33
	@Column(name = "customer_id")
44
	@Column(name = "customer_id")
34
	private int customerId;
45
	private int customerId;
35
	
46
 
36
	@Column(name = "customer_address_id")
47
	@Column(name = "customer_address_id")
37
	private int customerAddressId;
48
	private int customerAddressId;
38
	
49
 
39
	@Column(name = "customer_gst_number")
50
	@Column(name = "customer_gst_number")
40
	private String customerGstNumber;
51
	private String customerGstNumber;
41
	
52
 
42
	@Column(name = "total_amount")
53
	@Column(name = "total_amount")
43
	private float totalAmount;
54
	private float totalAmount;
44
	
55
 
45
	@Column(name = "invoice_number", length = 50)
56
	@Column(name = "invoice_number", length = 50)
46
	private String invoiceNumber;
57
	private String invoiceNumber;
47
	
58
 
48
	@Column(name = "cashback")
59
	@Column(name = "cashback")
49
	private float cashback;
60
	private float cashback;
50
	
61
 
51
	@Convert(converter = LocalDateTimeAttributeConverter.class)
62
	@Convert(converter = LocalDateTimeAttributeConverter.class)
52
	@Column(name = "create_timestamp")
63
	@Column(name = "create_timestamp")
53
	private LocalDateTime createTimestamp = LocalDateTime.now();	
64
	private LocalDateTime createTimestamp = LocalDateTime.now();
54
	
65
 
55
	@Convert(converter = LocalDateTimeAttributeConverter.class)
66
	@Convert(converter = LocalDateTimeAttributeConverter.class)
56
	@Column(name = "cancelled_timestamp")
67
	@Column(name = "cancelled_timestamp")
57
	private LocalDateTime cancelledTimestamp;	
68
	private LocalDateTime cancelledTimestamp;
58
	
-
 
59
	
69
 
60
	//@Convert(converter = LocalDateTimeAttributeConverter.class)
70
	// @Convert(converter = LocalDateTimeAttributeConverter.class)
61
	//@Column(name = "billing_timestamp")
71
	// @Column(name = "billing_timestamp")
62
	@Transient
72
	@Transient
63
	private LocalDateTime billingTimestamp;	
73
	private LocalDateTime billingTimestamp;
64
	
-
 
65
	
74
 
66
	@Transient
75
	@Transient
67
	private FofoOrderItem orderItem;
76
	private FofoOrderItem orderItem;
68
	
-
 
69
	
77
 
70
	@Transient
78
	@Transient
71
	private LocalDate dateOfBirth;
79
	private LocalDate dateOfBirth;
72
	
80
 
73
	public LocalDate getDateOfBirth() {
81
	public LocalDate getDateOfBirth() {
74
		return dateOfBirth;
82
		return dateOfBirth;
75
	}
83
	}
-
 
84
 
76
	public void setDateOfBirth(LocalDate dateOfBirth) {
85
	public void setDateOfBirth(LocalDate dateOfBirth) {
77
		this.dateOfBirth = dateOfBirth;
86
		this.dateOfBirth = dateOfBirth;
78
	}
87
	}
-
 
88
 
79
	public FofoOrderItem getOrderItem() {
89
	public FofoOrderItem getOrderItem() {
80
		return orderItem;
90
		return orderItem;
81
	}
91
	}
-
 
92
 
82
	public void setOrderItem(FofoOrderItem orderItem) {
93
	public void setOrderItem(FofoOrderItem orderItem) {
83
		this.orderItem = orderItem;
94
		this.orderItem = orderItem;
84
	}
95
	}
-
 
96
 
85
	public LocalDateTime getCancelledTimestamp() {
97
	public LocalDateTime getCancelledTimestamp() {
86
		return cancelledTimestamp;
98
		return cancelledTimestamp;
87
	}
99
	}
-
 
100
 
88
	public void setCancelledTimestamp(LocalDateTime cancelledTimestamp) {
101
	public void setCancelledTimestamp(LocalDateTime cancelledTimestamp) {
89
		this.cancelledTimestamp = cancelledTimestamp;
102
		this.cancelledTimestamp = cancelledTimestamp;
90
	}
103
	}
-
 
104
 
91
	public int getId() {
105
	public int getId() {
92
		return id;
106
		return id;
93
	}
107
	}
-
 
108
 
94
	public void setId(int id) {
109
	public void setId(int id) {
95
		this.id = id;
110
		this.id = id;
96
	}
111
	}
-
 
112
 
97
	public int getFofoId() {
113
	public int getFofoId() {
98
		return fofoId;
114
		return fofoId;
99
	}
115
	}
-
 
116
 
100
	public void setFofoId(int fofoId) {
117
	public void setFofoId(int fofoId) {
101
		this.fofoId = fofoId;
118
		this.fofoId = fofoId;
102
	}
119
	}
-
 
120
 
103
	public int getCustomerId() {
121
	public int getCustomerId() {
104
		return customerId;
122
		return customerId;
105
	}
123
	}
-
 
124
 
106
	public void setCustomerId(int customerId) {
125
	public void setCustomerId(int customerId) {
107
		this.customerId = customerId;
126
		this.customerId = customerId;
108
	}
127
	}
-
 
128
 
109
	public int getCustomerAddressId() {
129
	public int getCustomerAddressId() {
110
		return customerAddressId;
130
		return customerAddressId;
111
	}
131
	}
-
 
132
 
112
	public void setCustomerAddressId(int customerAddressId) {
133
	public void setCustomerAddressId(int customerAddressId) {
113
		this.customerAddressId = customerAddressId;
134
		this.customerAddressId = customerAddressId;
114
	}
135
	}
-
 
136
 
115
	public String getCustomerGstNumber() {
137
	public String getCustomerGstNumber() {
116
		return customerGstNumber;
138
		return customerGstNumber;
117
	}
139
	}
-
 
140
 
118
	public void setCustomerGstNumber(String customerGstNumber) {
141
	public void setCustomerGstNumber(String customerGstNumber) {
119
		this.customerGstNumber = customerGstNumber;
142
		this.customerGstNumber = customerGstNumber;
120
	}
143
	}
-
 
144
 
121
	public float getTotalAmount() {
145
	public float getTotalAmount() {
122
		return totalAmount;
146
		return totalAmount;
123
	}
147
	}
-
 
148
 
124
	public void setTotalAmount(float totalAmount) {
149
	public void setTotalAmount(float totalAmount) {
125
		this.totalAmount = totalAmount;
150
		this.totalAmount = totalAmount;
126
	}
151
	}
-
 
152
 
127
	public String getInvoiceNumber() {
153
	public String getInvoiceNumber() {
128
		return invoiceNumber;
154
		return invoiceNumber;
129
	}
155
	}
-
 
156
 
130
	public void setInvoiceNumber(String invoiceNumber) {
157
	public void setInvoiceNumber(String invoiceNumber) {
131
		this.invoiceNumber = invoiceNumber;
158
		this.invoiceNumber = invoiceNumber;
132
	}
159
	}
-
 
160
 
133
	public float getCashback() {
161
	public float getCashback() {
134
		return cashback;
162
		return cashback;
135
	}
163
	}
-
 
164
 
136
	public void setCashback(float cashback) {
165
	public void setCashback(float cashback) {
137
		this.cashback = cashback;
166
		this.cashback = cashback;
138
	}
167
	}
-
 
168
 
139
	public LocalDateTime getCreateTimestamp() {
169
	public LocalDateTime getCreateTimestamp() {
140
		return createTimestamp;
170
		return createTimestamp;
141
	}
171
	}
-
 
172
 
142
	public void setCreateTimestamp(LocalDateTime createTimestamp) {
173
	public void setCreateTimestamp(LocalDateTime createTimestamp) {
143
		this.createTimestamp = createTimestamp;
174
		this.createTimestamp = createTimestamp;
144
	}
175
	}
145
	
176
 
146
	public String getFormattedDate(){
177
	public String getFormattedDate() {
147
    	DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm");
178
		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm");
148
		return this.createTimestamp.format(formatter);
179
		return this.createTimestamp.format(formatter);
149
    }
-
 
150
	
-
 
151
	
180
	}
152
	
181
 
153
	@Override
182
	@Override
154
	public int hashCode() {
183
	public int hashCode() {
155
		final int prime = 31;
184
		final int prime = 31;
156
		int result = 1;
185
		int result = 1;
157
		result = prime * result + ((billingTimestamp == null) ? 0 : billingTimestamp.hashCode());
186
		result = prime * result + ((billingTimestamp == null) ? 0 : billingTimestamp.hashCode());
Line 167... Line 196...
167
		result = prime * result + ((invoiceNumber == null) ? 0 : invoiceNumber.hashCode());
196
		result = prime * result + ((invoiceNumber == null) ? 0 : invoiceNumber.hashCode());
168
		result = prime * result + ((orderItem == null) ? 0 : orderItem.hashCode());
197
		result = prime * result + ((orderItem == null) ? 0 : orderItem.hashCode());
169
		result = prime * result + Float.floatToIntBits(totalAmount);
198
		result = prime * result + Float.floatToIntBits(totalAmount);
170
		return result;
199
		return result;
171
	}
200
	}
172
	
201
 
173
	@Override
202
	@Override
174
	public boolean equals(Object obj) {
203
	public boolean equals(Object obj) {
175
		if (this == obj)
204
		if (this == obj)
176
			return true;
205
			return true;
177
		if (obj == null)
206
		if (obj == null)