Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
21714 ashik.ali 1
package com.spice.profitmandi.dao.entity.fofo;
21596 ashik.ali 2
 
30641 amit.gupta 3
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
4
 
5
import javax.persistence.*;
21596 ashik.ali 6
import java.io.Serializable;
25726 amit.gupta 7
import java.time.LocalDate;
21596 ashik.ali 8
import java.time.LocalDateTime;
22243 ashik.ali 9
import java.time.format.DateTimeFormatter;
21596 ashik.ali 10
 
11
@Entity
27579 tejbeer 12
@Table(name = "fofo.fofo_order", schema = "fofo")
21596 ashik.ali 13
 
27579 tejbeer 14
@NamedQueries({
15
 
16
		@NamedQuery(name = "FofoOrder.SelectItemWiseTertiary", query = "select new com.spice.profitmandi.dao.model.ItemWiseTertiaryModel(foi.brand,"
27586 tejbeer 17
				+ "foi.modelName, foi.modelNumber, foi.color, foi.quantity, foi.mop)"
27579 tejbeer 18
				+ " from FofoOrder fo join FofoOrderItem foi on fo.id = foi.orderId where fo.cancelledTimestamp is null and fo.fofoId = :fofoId"
19
				+ " and fo.createTimestamp between :startDate and :endDate"),
20
 
30641 amit.gupta 21
		@NamedQuery(name = "FofoOrder.selectOrderByModelsAndSaleBetween", query = "select fo from FofoOrder fo join FofoOrderItem foi on fo.id = foi.orderId"
22
				+ " join Item i on i.id=foi.itemId where fo.cancelledTimestamp is null and i.catalogItemId in :catalogItemIds"
23
				+ " and fo.createTimestamp between :startDate and :endDate"),
24
 
27723 tejbeer 25
		@NamedQuery(name = "FofoOrder.selectGroupByBrandPartnerTertiary", query = "select new com.spice.profitmandi.dao.model.BrandWiseTertiaryModel(foi.brand, "
26
				+ "sum(case when foi.createTimestamp >= :today then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
27728 tejbeer 27
				+ "sum(case when foi.createTimestamp >= :threedays  and foi.createTimestamp < :endDate  then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
27723 tejbeer 28
				+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :mtd  then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
29
				+ "sum(case when foi.createTimestamp between  :lmtdStartDate and :lmtdEndDate  then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
27748 tejbeer 30
				+ "sum(case when foi.createTimestamp between  :lmtdStartDate and :lmsEndDate  then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
27723 tejbeer 31
				+ "sum(case when foi.createTimestamp >= :today then foi.quantity else 0 end),"
27728 tejbeer 32
				+ "sum(case when foi.createTimestamp >= :threedays and foi.createTimestamp < :endDate then foi.quantity else 0 end),"
27723 tejbeer 33
				+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :mtd  then foi.quantity else 0 end), "
27748 tejbeer 34
				+ "sum(case when foi.createTimestamp between  :lmtdStartDate and :lmtdEndDate then foi.quantity else 0 end),"
35
				+ "sum(case when foi.createTimestamp between  :lmtdStartDate and :lmsEndDate  then foi.quantity else 0 end)"
36
				+ "	)"
37
				+ " from FofoStore fs join FofoOrder fo on fs.id = fo.fofoId join FofoOrderItem foi on foi.orderId = fo.id  join Item i on i.id = foi.itemId "
38
				+ "  where fo.cancelledTimestamp is null and fs.active = true "
27723 tejbeer 39
				+ " and foi.createTimestamp >= :lmtdStartDate and fs.warehouseId in :warehouseId"
27748 tejbeer 40
				+ " group by foi.brand "),
27723 tejbeer 41
 
27738 tejbeer 42
		@NamedQuery(name = "FofoOrder.selectItemPartnerTertiaryByBrand", query = "select new com.spice.profitmandi.dao.model.BrandItemWiseTertiaryModel(foi.brand, i.modelName,"
43
				+ " i.modelNumber, i.color, foi.quantity*foi.mop, foi.quantity)"
44
				+ " from FofoStore fs join FofoOrder fo on fs.id = fo.fofoId join FofoOrderItem foi on foi.orderId = fo.id  join "
27748 tejbeer 45
				+ " Item i on i.id = foi.itemId where fo.cancelledTimestamp is null and fs.active = true "
46
				+ " and foi.createTimestamp >= :startDate and foi.createTimestamp < :endDate and fs.warehouseId in :warehouseId and foi.brand in :brand order by foi.itemId desc"),
27738 tejbeer 47
 
48
		@NamedQuery(name = "FofoOrder.selectTodayItemPartnerTertiaryByBrand", query = "select new com.spice.profitmandi.dao.model.BrandItemWiseTertiaryModel(foi.brand, i.modelName,"
49
				+ " i.modelNumber, i.color, foi.quantity*foi.mop, foi.quantity)"
50
				+ " from FofoStore fs join FofoOrder fo on fs.id = fo.fofoId join FofoOrderItem foi on foi.orderId = fo.id  join "
27748 tejbeer 51
				+ " Item i on i.id = foi.itemId where fo.cancelledTimestamp is null and fs.active = true "
52
				+ " and foi.createTimestamp >= :startDate and fs.warehouseId in :warehouseId and foi.brand in :brand order by foi.itemId desc"),
27738 tejbeer 53
 
28008 tejbeer 54
		@NamedQuery(name = "FofoOrder.selectValueOfActivatedImeis", query = "select new com.spice.profitmandi.common.model.ActivatedImeisWithSellingPrice("
55
				+ "  fo.fofoId, foi.brand, sum(CAST(foi.mop  AS int) * foi.quantity)) "
56
				+ " from FofoOrder fo join FofoOrderItem foi on fo.id = foi.orderId join FofoLineItem fli on foi.id = fli.fofoOrderItemId join ActivatedImei ai on "
57
				+ " fli.serialNumber = ai.serialNumber where  fo.createTimestamp between :startDate and :endDate and  fo.fofoId = :fofoId and fo.cancelledTimestamp is null group by foi.brand"),
28020 tejbeer 58
 
28004 tejbeer 59
		@NamedQuery(name = "FofoOrder.selectPartnersSaleByCatalogId", query = "select new com.spice.profitmandi.dao.model.FofoIdQtyModel("
28020 tejbeer 60
				+ "  fs.warehouseId, fs.id,sum(case when foi.quantity is null then 0 else  foi.quantity end))"
28004 tejbeer 61
				+ " from FofoStore fs  join FofoOrder fo on fs.id = fo.fofoId  "
62
				+ " join FofoOrderItem foi on foi.orderId = fo.id join  TagListing tl on tl.itemId = foi.itemId "
63
				+ " join Item i on i.id = tl.itemId"
28020 tejbeer 64
				+ " where fs.active = 1 and fs.internal = 0 and fo.cancelledTimestamp is null and fo.createTimestamp > :startDate and i.catalogItemId in :catalogItemId and  i.categoryId=10006 group by fs.id"),
27884 tejbeer 65
 
28004 tejbeer 66
		@NamedQuery(name = "FofoOrder.selectPartnersSaleByRange", query = "select new com.spice.profitmandi.dao.model.FofoIdItemDetailModel("
28020 tejbeer 67
				+ " fs.warehouseId, fs.id,sum(case when foi.quantity is null then 0 else  foi.quantity end),i.brand,i.modelName,i.modelNumber,i.catalogItemId)"
28004 tejbeer 68
				+ " from FofoStore fs  join FofoOrder fo on fs.id = fo.fofoId  "
69
				+ " join FofoOrderItem foi on foi.orderId = fo.id join TagListing tl on tl.itemId = foi.itemId "
70
				+ " join Item i on i.id = tl.itemId"
71
				+ " where fs.active = 1 and fs.internal = 0 and fo.cancelledTimestamp is null "
72
				+ " and fo.createTimestamp > :startDate and tl.mop between :startPrice and :endPrice and  i.categoryId=10006 group by fs.id,i.catalogItemId,i.brand,i.modelName,i.modelNumber"),
73
 
28032 tejbeer 74
		@NamedQuery(name = "FofoOrder.selectPartnersSaleItemByCatalogIdFofoId", query = "select new com.spice.profitmandi.dao.model.FofoIdItemDetailModel("
75
				+ "  fs.warehouseId, fs.id,sum(foi.quantity),i.brand,i.modelName,i.modelNumber,i.catalogItemId)"
76
				+ " from FofoStore fs  join FofoOrder fo on fs.id = fo.fofoId  "
77
				+ " join FofoOrderItem foi on foi.orderId = fo.id join  TagListing tl on tl.itemId = foi.itemId "
78
				+ " join Item i on i.id = tl.itemId"
79
				+ " where fs.active = 1 and fs.internal = 0 and fo.cancelledTimestamp is null and fo.createTimestamp > :startDate and i.catalogItemId in :catalogItemId and  i.categoryId=10006 and fs.id = :fofoId group by i.catalogItemId, i.brand,i.modelName,i.modelNumber"),
80
 
28474 tejbeer 81
		@NamedQuery(name = "FofoOrder.selectSaleByCatalogId", query = "select new com.spice.profitmandi.dao.model.FofoIdCatalogQtyModel("
82
				+ "  fs.warehouseId, fs.id,i.catalogItemId, sum(case when foi.quantity is null then 0 else  foi.quantity end))"
83
				+ " from FofoStore fs  join FofoOrder fo on fs.id = fo.fofoId  "
84
				+ " join FofoOrderItem foi on foi.orderId = fo.id join  TagListing tl on tl.itemId = foi.itemId "
85
				+ " join Item i on i.id = tl.itemId"
28477 tejbeer 86
				+ " where fs.active = 1 and fs.internal = 0 and fo.cancelledTimestamp is null and fo.createTimestamp > :startDate and i.catalogItemId in :catalogItemId and fs.warehouseId in :warehouseId and  i.categoryId=10006 group by i.catalogItemId, fs.id"),
28474 tejbeer 87
 
30160 manish 88
 
89
		@NamedQuery(name = "FofoOrder.selectFocoSaleReport", query = "select new com.spice.profitmandi.dao.model.FocoSaleReportModel(fs.code, ua.name,ua.city, ua.state, w.displayName, foi.itemId,"
90
				+ " foi.brand, foi.modelName, foi.modelNumber, foi.color, foi.quantity, cast(foi.dp As int), cast(foi.sellingPrice As int), cast(foi.mop As int), fli.serialNumber, foi.createTimestamp, ca.name, ca.phoneNumber,"
91
				+ " ca.city, ca.pinCode, fo.invoiceNumber, p.purchaseReference, fo.customerGstNumber, fo.cancelledTimestamp, p.completeTimestamp, hd.hygieneRating,hd.rating, hd.status, hd.remark,"
92
				+ " hd.createdTimestamp, hd.disposedTimestamp, hd.nextTimestamp, ai.activationTimestamp, ai.createTimestamp, c.label)"
93
				+ " from FofoStore fs join Warehouse w on w.id=fs.warehouseId join com.spice.profitmandi.dao.entity.user.User u on u.id=fs.id join Address ua on u.addressId = ua.id join FofoOrder fo on fo.fofoId=fs.id left join FofoOrderItem foi"
94
				+ " on foi.orderId=fo.id join Item i on i.id=foi.itemId join Category c on c.id=i.categoryId left join CustomerAddress ca on ca.id=fo.customerAddressId left join FofoLineItem fli on fli.fofoOrderItemId=foi.id"
95
				+ " left join InventoryItem ii on ii.id=fli.inventoryItemId left join Purchase p on ii.purchaseId=p.id left join HygieneData hd on hd.orderId=fo.id left join ActivatedImei ai on ai.serialNumber=fli.serialNumber"
96
				+ " where 1=1 and (foi.createTimestamp between :startDate and :endDate or foi.createTimestamp is null) and fs.code= :code and fs.id=:fofoId  group by fo.id "),
97
 
98
	   @NamedQuery(name = "FofoOrder.selectWalletSummaryReport", query = "select new com.spice.profitmandi.dao.model.WalletSummaryReportModel(uwh.id, fs.code, ua.name, "
99
				+ " u.emailId, ua.phoneNumber, uwh.amount, uwh.refundableAmount, uwh.reference, uwh.referenceType, uwh.timestamp, uwh.businessTimestamp, uwh.description)"
100
				+ " from FofoStore fs join com.spice.profitmandi.dao.entity.user.User u on u.id=fs.id join"
101
				+ " Address ua on u.addressId=ua.id join UserWallet uw on  uw.userId=fs.id join UserWalletHistory uwh on uwh.walletId=uw.id "
102
				+ " where 1=1 and uwh.timestamp between :startDate and :endDate and fs.id=:fofoId group by uwh.timestamp"),
103
 
104
 
105
	    @NamedQuery(name = "FofoOrder.selectPendingIndentReport", query = "select new com.spice.profitmandi.dao.model.PendingIndentReportModel(o.transactionId , o.id, o.createTimestamp,"
106
				+ "  l.itemId, l.brand, l.modelName, l.modelNumber, l.color, l.quantity, l.unitPrice, o.walletAmount,case o.status when 3 then  'In Process' when 4  then 'Accepted' "
107
		        + "  when 7  then 'Billed' when 9   then 'Shipped' when 12  then 'Delivered' when 13  then 'Cancellation in process' when 15 then 'Cancelled,amount refunded to wallet' "
108
		        + "  when 31  then 'Returned to Origin, refunded' when 34 then 'Low inventory cancellation, refunded' "
109
		        + "  else o.statusDescription end as Description, o.invoiceNumber, o.billingTimestamp ) from Order o join LineItem l on l.orderId=o.id "
110
		        + "  where o.partnerGrnTimestamp is null and o.retailerId= :fofoId and o.status != 1 and o.createTimestamp between :startDate and :endDate group by o.status,o.createTimestamp "),
111
 
112
	    @NamedQuery(name = "FofoOrder.selectSchemePayoutReport", query = "select new com.spice.profitmandi.dao.model.SchemePayoutReportModel(i.id, i.brand, i.modelName, i.modelNumber,"
113
	   		   + " i.color,ii.unitPrice-ii.priceDropAmount,foi.dp, s.id, s.name, s.type, s.amountType, s.amount,p.purchaseReference, fo.invoiceNumber,(case when sio.rolledBackTimestamp is null "
30195 manish 114
	   		   + " then sio.amount when sio.rolledBackTimestamp  is not null then 0 end),sio.status, sio.statusDescription, sio.createTimestamp, sio.rolledBackTimestamp, ii.serialNumber ) from "
115
	   		   + " SchemeInOut sio join InventoryItem ii on sio.inventoryItemId=ii.id join com.spice.profitmandi.dao.entity.catalog.Item i on i.id=ii.itemId join FofoStore fs on fs.id=ii.fofoId "
116
	   		   + " join com.spice.profitmandi.dao.entity.user.User u on u.id = fs.id join Address ua on u.addressId = ua.id join Scheme s on sio.schemeId=s.id join Purchase p on p.id=ii.purchaseId"
117
	   		   + " left join FofoLineItem fli on fli.inventoryItemId=ii.id left join FofoOrderItem foi on foi.id=fli.fofoOrderItemId left join FofoOrder fo on fo.id=foi.orderId where  foi.createTimestamp"
118
	   		   + " between :startDate and :endDate and ii.fofoId= :fofoId "),
30160 manish 119
 
120
	    @NamedQuery(name = "FofoOrder.selectInvoiceSchemeOutSummaryReport", query = "select new com.spice.profitmandi.dao.model.FocoSchemeOutReportModel(fo.invoiceNumber, foi.quantity, foi.brand,"
121
	    		+ " foi.modelName, foi.modelNumber, foi.color,  sum(cast(sio.amount As float)) ) FROM FofoOrderItem foi join FofoOrder fo on fo.id=foi.orderId join FofoLineItem fli on "
122
	    		+ " fli.fofoOrderItemId=foi.id join SchemeInOut sio on sio.inventoryItemId=fli.inventoryItemId join Scheme s on s.id=sio.schemeId where s.type ='IN' and fo.fofoId= :fofoId and"
123
	    		+ " fo.createTimestamp between :startDate and :endDate and sio.rolledBackTimestamp is null group by fo.id, foi.id "),
124
 
125
 
30178 manish 126
	    @NamedQuery(name = "FofoOrder.selectPartnerBillingSummaryReport", query = "select new com.spice.profitmandi.dao.model.PartnerBillingSummaryModel(o.id,  o.createTimestamp, o.billingTimestamp,"
127
	    		+ " o.deliveryTimestamp, o.partnerGrnTimestamp, o.transactionId, case when o.logisticsTransactionId is null then 'NA' else o.logisticsTransactionId end,o.airwayBillNumber,  "
128
	    		+ " os.statusSubGroup, os.statusName, o.retailerId, o.retailerName, i.id, i.brand, i.modelName, i.modelNumber, i.color, l.unitPrice, l.quantity, l.totalPrice,  o.invoiceNumber,"
129
	    		+ " l.igstRate, l.cgstRate, l.sgstRate ) From Order o join LineItem l on l.orderId = o.id join Item i on l.itemId = i.id join Category c on i.categoryId = c.id join OrderStatus os on os.status=o.status"
130
	    		+ " join FofoStore fs on fs.id=o.retailerId where 1=1 and  o.billingTimestamp between :startDate and :endDate and o.retailerId = :fofoId "),
131
 
27579 tejbeer 132
})
133
public class FofoOrder implements Serializable {
134
 
21596 ashik.ali 135
	private static final long serialVersionUID = 1L;
136
 
137
	@Id
138
	@Column(name = "id")
139
	@GeneratedValue(strategy = GenerationType.IDENTITY)
140
	private int id;
27579 tejbeer 141
 
21596 ashik.ali 142
	@Column(name = "fofo_id")
143
	private int fofoId;
27579 tejbeer 144
 
21596 ashik.ali 145
	@Column(name = "customer_id")
146
	private int customerId;
27579 tejbeer 147
 
21710 ashik.ali 148
	@Column(name = "customer_address_id")
149
	private int customerAddressId;
27579 tejbeer 150
 
23369 ashik.ali 151
	@Column(name = "customer_gst_number")
152
	private String customerGstNumber;
27579 tejbeer 153
 
21596 ashik.ali 154
	@Column(name = "total_amount")
155
	private float totalAmount;
27579 tejbeer 156
 
21609 ashik.ali 157
	@Column(name = "invoice_number", length = 50)
21596 ashik.ali 158
	private String invoiceNumber;
27579 tejbeer 159
 
22859 ashik.ali 160
	@Column(name = "cashback")
161
	private float cashback;
27579 tejbeer 162
 
22009 ashik.ali 163
	@Convert(converter = LocalDateTimeAttributeConverter.class)
21596 ashik.ali 164
	@Column(name = "create_timestamp")
27579 tejbeer 165
	private LocalDateTime createTimestamp = LocalDateTime.now();
166
 
24264 amit.gupta 167
	@Convert(converter = LocalDateTimeAttributeConverter.class)
168
	@Column(name = "cancelled_timestamp")
27579 tejbeer 169
	private LocalDateTime cancelledTimestamp;
170
 
171
	// @Convert(converter = LocalDateTimeAttributeConverter.class)
172
	// @Column(name = "billing_timestamp")
25083 amit.gupta 173
	@Transient
27579 tejbeer 174
	private LocalDateTime billingTimestamp;
175
 
26817 amit.gupta 176
	@Transient
25083 amit.gupta 177
	private FofoOrderItem orderItem;
27579 tejbeer 178
 
25726 amit.gupta 179
	@Transient
180
	private LocalDate dateOfBirth;
27579 tejbeer 181
 
25726 amit.gupta 182
	public LocalDate getDateOfBirth() {
183
		return dateOfBirth;
184
	}
27579 tejbeer 185
 
25726 amit.gupta 186
	public void setDateOfBirth(LocalDate dateOfBirth) {
187
		this.dateOfBirth = dateOfBirth;
188
	}
27579 tejbeer 189
 
25083 amit.gupta 190
	public FofoOrderItem getOrderItem() {
191
		return orderItem;
192
	}
27579 tejbeer 193
 
25083 amit.gupta 194
	public void setOrderItem(FofoOrderItem orderItem) {
195
		this.orderItem = orderItem;
196
	}
27579 tejbeer 197
 
24264 amit.gupta 198
	public LocalDateTime getCancelledTimestamp() {
199
		return cancelledTimestamp;
200
	}
27579 tejbeer 201
 
24264 amit.gupta 202
	public void setCancelledTimestamp(LocalDateTime cancelledTimestamp) {
203
		this.cancelledTimestamp = cancelledTimestamp;
204
	}
27579 tejbeer 205
 
21984 kshitij.so 206
	public int getId() {
207
		return id;
208
	}
27579 tejbeer 209
 
21984 kshitij.so 210
	public void setId(int id) {
211
		this.id = id;
212
	}
27579 tejbeer 213
 
21984 kshitij.so 214
	public int getFofoId() {
215
		return fofoId;
216
	}
27579 tejbeer 217
 
21984 kshitij.so 218
	public void setFofoId(int fofoId) {
219
		this.fofoId = fofoId;
220
	}
27579 tejbeer 221
 
21984 kshitij.so 222
	public int getCustomerId() {
223
		return customerId;
224
	}
27579 tejbeer 225
 
21984 kshitij.so 226
	public void setCustomerId(int customerId) {
227
		this.customerId = customerId;
228
	}
27579 tejbeer 229
 
21984 kshitij.so 230
	public int getCustomerAddressId() {
231
		return customerAddressId;
232
	}
27579 tejbeer 233
 
21984 kshitij.so 234
	public void setCustomerAddressId(int customerAddressId) {
235
		this.customerAddressId = customerAddressId;
236
	}
27579 tejbeer 237
 
23369 ashik.ali 238
	public String getCustomerGstNumber() {
239
		return customerGstNumber;
240
	}
27579 tejbeer 241
 
23369 ashik.ali 242
	public void setCustomerGstNumber(String customerGstNumber) {
243
		this.customerGstNumber = customerGstNumber;
244
	}
27579 tejbeer 245
 
21984 kshitij.so 246
	public float getTotalAmount() {
247
		return totalAmount;
248
	}
27579 tejbeer 249
 
21984 kshitij.so 250
	public void setTotalAmount(float totalAmount) {
251
		this.totalAmount = totalAmount;
252
	}
27579 tejbeer 253
 
21984 kshitij.so 254
	public String getInvoiceNumber() {
255
		return invoiceNumber;
256
	}
27579 tejbeer 257
 
21984 kshitij.so 258
	public void setInvoiceNumber(String invoiceNumber) {
259
		this.invoiceNumber = invoiceNumber;
260
	}
27579 tejbeer 261
 
22859 ashik.ali 262
	public float getCashback() {
263
		return cashback;
264
	}
27579 tejbeer 265
 
22859 ashik.ali 266
	public void setCashback(float cashback) {
267
		this.cashback = cashback;
268
	}
27579 tejbeer 269
 
21984 kshitij.so 270
	public LocalDateTime getCreateTimestamp() {
271
		return createTimestamp;
272
	}
27579 tejbeer 273
 
21984 kshitij.so 274
	public void setCreateTimestamp(LocalDateTime createTimestamp) {
275
		this.createTimestamp = createTimestamp;
276
	}
27579 tejbeer 277
 
278
	public String getFormattedDate() {
279
		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm");
22243 ashik.ali 280
		return this.createTimestamp.format(formatter);
27579 tejbeer 281
	}
282
 
21924 ashik.ali 283
	@Override
22009 ashik.ali 284
	public int hashCode() {
285
		final int prime = 31;
286
		int result = 1;
26817 amit.gupta 287
		result = prime * result + ((billingTimestamp == null) ? 0 : billingTimestamp.hashCode());
288
		result = prime * result + ((cancelledTimestamp == null) ? 0 : cancelledTimestamp.hashCode());
289
		result = prime * result + Float.floatToIntBits(cashback);
290
		result = prime * result + ((createTimestamp == null) ? 0 : createTimestamp.hashCode());
291
		result = prime * result + customerAddressId;
292
		result = prime * result + ((customerGstNumber == null) ? 0 : customerGstNumber.hashCode());
293
		result = prime * result + customerId;
294
		result = prime * result + ((dateOfBirth == null) ? 0 : dateOfBirth.hashCode());
295
		result = prime * result + fofoId;
22009 ashik.ali 296
		result = prime * result + id;
26817 amit.gupta 297
		result = prime * result + ((invoiceNumber == null) ? 0 : invoiceNumber.hashCode());
298
		result = prime * result + ((orderItem == null) ? 0 : orderItem.hashCode());
299
		result = prime * result + Float.floatToIntBits(totalAmount);
22009 ashik.ali 300
		return result;
301
	}
27579 tejbeer 302
 
22009 ashik.ali 303
	@Override
304
	public boolean equals(Object obj) {
305
		if (this == obj)
306
			return true;
307
		if (obj == null)
308
			return false;
309
		if (getClass() != obj.getClass())
310
			return false;
311
		FofoOrder other = (FofoOrder) obj;
26817 amit.gupta 312
		if (billingTimestamp == null) {
313
			if (other.billingTimestamp != null)
314
				return false;
315
		} else if (!billingTimestamp.equals(other.billingTimestamp))
316
			return false;
317
		if (cancelledTimestamp == null) {
318
			if (other.cancelledTimestamp != null)
319
				return false;
320
		} else if (!cancelledTimestamp.equals(other.cancelledTimestamp))
321
			return false;
322
		if (Float.floatToIntBits(cashback) != Float.floatToIntBits(other.cashback))
323
			return false;
324
		if (createTimestamp == null) {
325
			if (other.createTimestamp != null)
326
				return false;
327
		} else if (!createTimestamp.equals(other.createTimestamp))
328
			return false;
329
		if (customerAddressId != other.customerAddressId)
330
			return false;
331
		if (customerGstNumber == null) {
332
			if (other.customerGstNumber != null)
333
				return false;
334
		} else if (!customerGstNumber.equals(other.customerGstNumber))
335
			return false;
336
		if (customerId != other.customerId)
337
			return false;
338
		if (dateOfBirth == null) {
339
			if (other.dateOfBirth != null)
340
				return false;
341
		} else if (!dateOfBirth.equals(other.dateOfBirth))
342
			return false;
343
		if (fofoId != other.fofoId)
344
			return false;
22009 ashik.ali 345
		if (id != other.id)
346
			return false;
26817 amit.gupta 347
		if (invoiceNumber == null) {
348
			if (other.invoiceNumber != null)
349
				return false;
350
		} else if (!invoiceNumber.equals(other.invoiceNumber))
351
			return false;
352
		if (orderItem == null) {
353
			if (other.orderItem != null)
354
				return false;
355
		} else if (!orderItem.equals(other.orderItem))
356
			return false;
357
		if (Float.floatToIntBits(totalAmount) != Float.floatToIntBits(other.totalAmount))
358
			return false;
22009 ashik.ali 359
		return true;
360
	}
27586 tejbeer 361
 
22009 ashik.ali 362
	@Override
21602 ashik.ali 363
	public String toString() {
21710 ashik.ali 364
		return "FofoOrder [id=" + id + ", fofoId=" + fofoId + ", customerId=" + customerId + ", customerAddressId="
23369 ashik.ali 365
				+ customerAddressId + ", customerGstNumber=" + customerGstNumber + ", totalAmount=" + totalAmount
366
				+ ", invoiceNumber=" + invoiceNumber + ", cashback=" + cashback + ", createTimestamp=" + createTimestamp
26817 amit.gupta 367
				+ ", cancelledTimestamp=" + cancelledTimestamp + ", billingTimestamp=" + billingTimestamp
368
				+ ", orderItem=" + orderItem + ", dateOfBirth=" + dateOfBirth + "]";
21602 ashik.ali 369
	}
27586 tejbeer 370
 
21596 ashik.ali 371
}