Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
22653 ashik.ali 1
package com.spice.profitmandi.dao.entity.fofo;
22418 ashik.ali 2
 
3
import java.io.Serializable;
24349 amit.gupta 4
import java.time.LocalDate;
28166 tejbeer 5
import java.time.LocalDateTime;
22418 ashik.ali 6
 
7
import javax.persistence.Column;
8
import javax.persistence.Entity;
23786 amit.gupta 9
import javax.persistence.EnumType;
10
import javax.persistence.Enumerated;
22418 ashik.ali 11
import javax.persistence.Id;
27556 tejbeer 12
import javax.persistence.NamedQueries;
13
import javax.persistence.NamedQuery;
22418 ashik.ali 14
import javax.persistence.Table;
23786 amit.gupta 15
import javax.persistence.Transient;
22418 ashik.ali 16
 
23786 amit.gupta 17
import com.spice.profitmandi.common.enumuration.CounterSize;
28825 tejbeer 18
import com.spice.profitmandi.common.enumuration.FofoType;
23786 amit.gupta 19
import com.spice.profitmandi.dao.entity.user.Address;
20
 
22418 ashik.ali 21
/**
22
 * This class basically contains store code details
23
 * 
24
 * @author ashikali
25
 *
26
 */
27
@Entity
27556 tejbeer 28
@Table(name = "fofo.fofo_store", schema = "fofo")
29
 
30
@NamedQueries({
31
 
27594 tejbeer 32
		@NamedQuery(name = "FofoStore.selectGroupByBrandWarehousePartnerSale", query = "select new com.spice.profitmandi.dao.model.BrandWisePartnerSaleModel(foi.brand, "
33
				+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :lms then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
34
				+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :lms then foi.quantity  else 0 end),"
35
				+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :mtd  then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
36
				+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :mtd  then foi.quantity else 0 end), "
37
				+ "sum(case when foi.createTimestamp between  :lmtdStartDate and :lmtdEndDate  then CAST(foi.quantity*foi.mop  AS int) else 0 end), "
38
				+ "sum(case when foi.createTimestamp between  :lmtdStartDate and :lmtdEndDate then foi.quantity else 0 end))"
39
				+ " 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  where fo.cancelledTimestamp is null and fs.active = true "
27701 tejbeer 40
				+ "and foi.createTimestamp >= :lmtdStartDate and i.categoryId = :categoryId and fs.id in :fofoId"
41
				+ " group by foi.brand"),
27594 tejbeer 42
 
27592 tejbeer 43
		@NamedQuery(name = "FofoStore.selectGroupByWarehouseBrandWisePartnerSale", query = "select new com.spice.profitmandi.dao.model.WarehouseWiseBrandSaleModel("
44
				+ "(case when a.city in ('Noida', 'Ghaziabad')  and foi.brand = 'Vivo' then 7573 else fs.warehouseId end) AS col_0_0_,"
27574 tejbeer 45
				+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :lms then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
46
				+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :lms then foi.quantity  else 0 end),"
47
				+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :mtd  then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
48
				+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :mtd  then foi.quantity else 0 end), "
49
				+ "sum(case when foi.createTimestamp between  :lmtdStartDate and :lmtdEndDate  then CAST(foi.quantity*foi.mop  AS int) else 0 end), "
50
				+ "sum(case when foi.createTimestamp between  :lmtdStartDate and :lmtdEndDate then foi.quantity else 0 end))"
27592 tejbeer 51
				+ " 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"
52
				+ " join com.spice.profitmandi.dao.entity.user.User u on u.id = fs.id join Address a on a.id = u.addressId"
53
				+ " where fo.cancelledTimestamp is null and fs.active = true"
27701 tejbeer 54
				+ " and foi.createTimestamp >= :lmtdStartDate and foi.brand = :brand and i.categoryId = :categoryId and fs.id in :fofoId"
27592 tejbeer 55
				+ " group by col_0_0_"),
27556 tejbeer 56
 
27670 tejbeer 57
		@NamedQuery(name = "FofoStore.selectWarehouseBrandItemSale", query = "select new com.spice.profitmandi.dao.model.WarehouseBrandWiseItemSaleModel(fs.warehouseId,i.id, i.brand, i.modelName, i.modelNumber,i.color,"
27574 tejbeer 58
				+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :lms then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
59
				+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :lms then foi.quantity  else 0 end),"
60
				+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :mtd  then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
61
				+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :mtd  then foi.quantity else 0 end), "
62
				+ "sum(case when foi.createTimestamp between  :lmtdStartDate and :lmtdEndDate  then CAST(foi.quantity*foi.mop  AS int) else 0 end), "
63
				+ "sum(case when foi.createTimestamp between  :lmtdStartDate and :lmtdEndDate then foi.quantity else 0 end))"
27594 tejbeer 64
				+ " 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  where fo.cancelledTimestamp is null and fs.active = true"
27701 tejbeer 65
				+ " and  foi.createTimestamp >= :lmtdStartDate and fs.warehouseId in :warehouseId and i.brand = :brand and i.categoryId = :categoryId and fs.id in :fofoId group by i.id"),
27594 tejbeer 66
 
67
		@NamedQuery(name = "FofoStore.selectGroupByBrandAccesoriesWarehousePartnerSale", query = "select new com.spice.profitmandi.dao.model.BrandWisePartnerSaleModel(foi.brand, "
68
				+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :lms then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
69
				+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :lms then foi.quantity  else 0 end),"
70
				+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :mtd  then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
71
				+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :mtd  then foi.quantity else 0 end), "
72
				+ "sum(case when foi.createTimestamp between  :lmtdStartDate and :lmtdEndDate  then CAST(foi.quantity*foi.mop  AS int) else 0 end), "
73
				+ "sum(case when foi.createTimestamp between  :lmtdStartDate and :lmtdEndDate then foi.quantity else 0 end))"
27592 tejbeer 74
				+ " 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  where fo.cancelledTimestamp is null and fs.active = true "
27701 tejbeer 75
				+ "and foi.createTimestamp >= :lmtdStartDate and i.categoryId != :categoryId and fs.id in :fofoId"
76
				+ " group by foi.brand"),
27556 tejbeer 77
 
27594 tejbeer 78
		@NamedQuery(name = "FofoStore.selectGroupByWarehouseAccesoriesBrandWisePartnerSale", query = "select new com.spice.profitmandi.dao.model.WarehouseWiseBrandSaleModel(fs.warehouseId,"
79
				+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :lms then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
80
				+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :lms then foi.quantity  else 0 end),"
81
				+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :mtd  then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
82
				+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :mtd  then foi.quantity else 0 end), "
83
				+ "sum(case when foi.createTimestamp between  :lmtdStartDate and :lmtdEndDate  then CAST(foi.quantity*foi.mop  AS int) else 0 end), "
84
				+ "sum(case when foi.createTimestamp between  :lmtdStartDate and :lmtdEndDate then foi.quantity else 0 end))"
85
				+ " 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  where fo.cancelledTimestamp is null and fs.active = true"
27701 tejbeer 86
				+ " and foi.createTimestamp >= :lmtdStartDate and foi.brand = :brand and i.categoryId != :categoryId and fs.id in :fofoId"
27594 tejbeer 87
				+ " group by fs.warehouseId"),
27592 tejbeer 88
 
27670 tejbeer 89
		@NamedQuery(name = "FofoStore.selectWarehouseAccesoriesBrandItemSale", query = "select new com.spice.profitmandi.dao.model.WarehouseBrandWiseItemSaleModel(fs.warehouseId,i.id, i.brand, i.modelName, i.modelNumber,i.color,"
27591 tejbeer 90
				+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :lms then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
91
				+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :lms then foi.quantity  else 0 end),"
92
				+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :mtd  then CAST(foi.quantity*foi.mop  AS int) else 0 end),"
93
				+ "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :mtd  then foi.quantity else 0 end), "
94
				+ "sum(case when foi.createTimestamp between  :lmtdStartDate and :lmtdEndDate  then CAST(foi.quantity*foi.mop  AS int) else 0 end), "
95
				+ "sum(case when foi.createTimestamp between  :lmtdStartDate and :lmtdEndDate then foi.quantity else 0 end))"
27556 tejbeer 96
				+ " 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  where fo.cancelledTimestamp is null and fs.active = true"
27701 tejbeer 97
				+ " and  foi.createTimestamp >= :lmtdStartDate and fs.warehouseId in :warehouseId and i.brand = :brand and i.categoryId != :categoryId  and fs.id in :fofoId group by i.id"),
27556 tejbeer 98
 
27599 tejbeer 99
		@NamedQuery(name = "FofoStore.selectPartnerPendingIndentItem", query = "select new com.spice.profitmandi.dao.model.PartnerPendingIndentItemModel(o.retailerName,"
100
				+ " li.quantity, li.totalPrice)"
101
				+ " from FofoStore fs join Order o on fs.id = o.retailerId join  LineItem li on li.orderId = o.id "
102
				+ " where li.itemId = :itemId and fs.warehouseId = :warehouseId and o.status = 3"),
103
 
27670 tejbeer 104
		@NamedQuery(name = "FofoStore.selectUnbilledActivateStockGroupByBrand", query = "select new com.spice.profitmandi.dao.model.BrandWiseUnbilledActivateStockModel(i.brand,"
27676 tejbeer 105
				+ "  sum(case when concat(year(ai.activationTimestamp), month(ai.activationTimestamp)) = :almtd then 1 else 0 end),"
27670 tejbeer 106
				+ "  sum(case when concat(year(ai.activationTimestamp), month(ai.activationTimestamp)) = :almtd then CAST(tl.sellingPrice  AS int) else 0 end))"
107
				+ " from FofoStore fs join InventoryItem ii on fs.id = ii.fofoId join ActivatedImei ai on ai.serialNumber = ii.serialNumber join Item i on i.id = ii.itemId join TagListing tl on tl.itemId = i.id"
27701 tejbeer 108
				+ " where fs.active = true and ii.goodQuantity >= 1 and fs.id in :fofoId group by i.brand"),
27670 tejbeer 109
 
110
		@NamedQuery(name = "FofoStore.selectUnbilledActivateStockGroupByWarehouse", query = "select new com.spice.profitmandi.dao.model.WarehouseWiseBrandUnbilledActivatedModel(fs.warehouseId,"
27676 tejbeer 111
				+ "  sum(case when concat(year(ai.activationTimestamp), month(ai.activationTimestamp)) = :almtd then 1 else 0 end),"
27670 tejbeer 112
				+ "  sum(case when concat(year(ai.activationTimestamp), month(ai.activationTimestamp)) = :almtd then CAST(tl.sellingPrice  AS int) else 0 end))"
113
				+ " from FofoStore fs join InventoryItem ii on fs.id = ii.fofoId join ActivatedImei ai on ai.serialNumber = ii.serialNumber join Item i on i.id = ii.itemId join TagListing tl on tl.itemId = i.id"
27701 tejbeer 114
				+ " where fs.active = true and ii.goodQuantity >= 1 and i.brand = :brand and fs.id in :fofoId group by fs.warehouseId"),
27670 tejbeer 115
 
116
		@NamedQuery(name = "FofoStore.selectWarehouseBrandItemUnbilledActivateStock", query = "select new com.spice.profitmandi.dao.model.WarehouseBrandItemUnbilledActivatedModel(fs.warehouseId,i.id, i.brand, i.modelName, i.modelNumber,i.color,"
27676 tejbeer 117
				+ "  sum(case when concat(year(ai.activationTimestamp), month(ai.activationTimestamp)) = :almtd then 1 else 0 end),"
27670 tejbeer 118
				+ "  sum(case when concat(year(ai.activationTimestamp), month(ai.activationTimestamp)) = :almtd then CAST(tl.sellingPrice  AS int) else 0 end))"
119
				+ " from FofoStore fs join InventoryItem ii on fs.id = ii.fofoId join ActivatedImei ai on ai.serialNumber = ii.serialNumber join Item i on i.id = ii.itemId join TagListing tl on tl.itemId = i.id"
27701 tejbeer 120
				+ " where fs.active = true and ii.goodQuantity >= 1 and i.brand = :brand and fs.warehouseId in :warehouseId and fs.id in :fofoId  group by i.id"),
27670 tejbeer 121
 
28451 tejbeer 122
		@NamedQuery(name = "FofoStore.selectGroupByBrandLms", query = "select new com.spice.profitmandi.dao.model.BrandWiseModel(foi.brand, DATE_FORMAT(fo.createTimestamp, '%m-%Y'),sum(cast(foi.mop*foi.quantity As int)))"
123
				+ " 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  where fo.cancelledTimestamp is null and fs.active = true "
124
				+ " and foi.createTimestamp >= :lmsStartDate and i.categoryId = :categoryId and fs.id in :fofoId and fs.warehouseId in :warehouseId"
125
				+ " group by foi.brand,DATE_FORMAT(fo.createTimestamp, '%m-%Y')"), })
27599 tejbeer 126
 
27556 tejbeer 127
public class FofoStore implements Serializable {
128
 
22418 ashik.ali 129
	private static final long serialVersionUID = 1L;
27556 tejbeer 130
 
22418 ashik.ali 131
	public FofoStore() {
132
	}
27556 tejbeer 133
 
22418 ashik.ali 134
	@Id
27556 tejbeer 135
	@Column(name = "id", unique = true, updatable = false)
22418 ashik.ali 136
	private int id;
27556 tejbeer 137
 
138
	@Column(name = "code", unique = true)
22418 ashik.ali 139
	private String code;
27556 tejbeer 140
 
23847 ashik.ali 141
	@Column(name = "latitude")
142
	private String latitude;
27556 tejbeer 143
 
23847 ashik.ali 144
	@Column(name = "longitude")
145
	private String longitude;
27556 tejbeer 146
 
147
	@Column(name = "counter_size")
23786 amit.gupta 148
	@Enumerated(EnumType.STRING)
149
	private CounterSize counterSize = CounterSize.TEN_LAC;
27556 tejbeer 150
 
151
	@Column(name = "warehouse_id")
25069 amit.gupta 152
	private int warehouseId;
27556 tejbeer 153
 
154
	@Column(name = "minimum_investment")
23884 amit.gupta 155
	private float minimumInvestment;
27556 tejbeer 156
 
157
	@Column(name = "grace_date")
24349 amit.gupta 158
	private LocalDate graceDate;
27556 tejbeer 159
 
160
	@Column(name = "investment_ok")
25276 amit.gupta 161
	private boolean investmentOk;
27556 tejbeer 162
 
27903 tejbeer 163
	@Column
164
	private boolean active = true;
165
 
166
	@Transient
167
	private Address userAddress;
168
 
169
	@Column(name = "internal")
170
	private boolean internal;
171
 
28166 tejbeer 172
	@Column(name = "bags_last_credited")
173
	private LocalDateTime bagsLastCredited;
28825 tejbeer 174
 
175
	@Column(name = "fofo_type")
176
	@Enumerated(EnumType.STRING)
177
	private FofoType fofoType;
178
 
28709 amit.gupta 179
	@Column(name = "active_timestamp")
180
	private LocalDateTime activeTimeStamp;
28166 tejbeer 181
 
182
	public LocalDateTime getBagsLastCredited() {
183
		return bagsLastCredited;
184
	}
185
 
186
	public void setBagsLastCredited(LocalDateTime bagsLastCredited) {
187
		this.bagsLastCredited = bagsLastCredited;
188
	}
189
 
27903 tejbeer 190
	public boolean isInternal() {
191
		return internal;
192
	}
193
 
194
	public void setInternal(boolean internal) {
195
		this.internal = internal;
196
	}
197
 
198
	public int getWarehouseId() {
199
		return warehouseId;
200
	}
201
 
202
	public void setWarehouseId(int warehouseId) {
203
		this.warehouseId = warehouseId;
204
	}
205
 
25276 amit.gupta 206
	public boolean isInvestmentOk() {
207
		return investmentOk;
208
	}
27556 tejbeer 209
 
25276 amit.gupta 210
	public void setInvestmentOk(boolean investmentOk) {
211
		this.investmentOk = investmentOk;
212
	}
213
 
27556 tejbeer 214
	@Column(name = "grace_count")
24349 amit.gupta 215
	private int graceCount;
24843 govind 216
 
24349 amit.gupta 217
	public int getGraceCount() {
218
		return graceCount;
219
	}
27556 tejbeer 220
 
24843 govind 221
	public boolean isActive() {
222
		return active;
223
	}
27556 tejbeer 224
 
24843 govind 225
	public void setActive(boolean active) {
226
		this.active = active;
227
	}
27556 tejbeer 228
 
24349 amit.gupta 229
	public void setGraceCount(int graceCount) {
230
		this.graceCount = graceCount;
231
	}
27556 tejbeer 232
 
24349 amit.gupta 233
	public LocalDate getGraceDate() {
234
		return graceDate;
235
	}
27556 tejbeer 236
 
24349 amit.gupta 237
	public void setGraceDate(LocalDate graceDate) {
238
		this.graceDate = graceDate;
239
	}
27556 tejbeer 240
 
23884 amit.gupta 241
	public float getMinimumInvestment() {
242
		return minimumInvestment;
243
	}
27556 tejbeer 244
 
23884 amit.gupta 245
	public void setMinimumInvestment(float minimumInvestment) {
246
		this.minimumInvestment = minimumInvestment;
247
	}
248
 
27556 tejbeer 249
	/*
250
	 * public int getCreditCycle() { return creditCycle; } public void
251
	 * setCreditCycle(int creditCycle) { this.creditCycle = creditCycle; }
252
	 */
23786 amit.gupta 253
	public CounterSize getCounterSize() {
23716 amit.gupta 254
		return counterSize;
255
	}
27556 tejbeer 256
 
23786 amit.gupta 257
	public void setCounterSize(CounterSize counterSize) {
23716 amit.gupta 258
		this.counterSize = counterSize;
259
	}
27556 tejbeer 260
 
22418 ashik.ali 261
	public int getId() {
262
		return id;
263
	}
27556 tejbeer 264
 
22418 ashik.ali 265
	public void setId(int id) {
266
		this.id = id;
267
	}
27556 tejbeer 268
 
269
	public String getCode() {
22418 ashik.ali 270
		return code;
271
	}
27556 tejbeer 272
 
273
	public void setCode(String code) {
22418 ashik.ali 274
		this.code = code;
275
	}
27556 tejbeer 276
 
277
	public String getLatitude() {
23847 ashik.ali 278
		return latitude;
279
	}
27556 tejbeer 280
 
281
	public void setLatitude(String latitude) {
23847 ashik.ali 282
		this.latitude = latitude;
283
	}
27556 tejbeer 284
 
285
	public String getLongitude() {
23847 ashik.ali 286
		return longitude;
287
	}
27556 tejbeer 288
 
289
	public void setLongitude(String longitude) {
23847 ashik.ali 290
		this.longitude = longitude;
291
	}
27556 tejbeer 292
 
23786 amit.gupta 293
	public Address getUserAddress() {
294
		return userAddress;
295
	}
27556 tejbeer 296
 
23786 amit.gupta 297
	public void setUserAddress(Address userAddress) {
298
		this.userAddress = userAddress;
299
	}
27556 tejbeer 300
 
28709 amit.gupta 301
	public LocalDateTime getActiveTimeStamp() {
302
		return activeTimeStamp;
303
	}
304
 
305
	public void setActiveTimeStamp(LocalDateTime activeTimeStamp) {
306
		this.activeTimeStamp = activeTimeStamp;
307
	}
308
 
28825 tejbeer 309
	public FofoType getFofoType() {
310
		return fofoType;
311
	}
312
 
313
	public void setFofoType(FofoType fofoType) {
314
		this.fofoType = fofoType;
315
	}
316
 
22418 ashik.ali 317
	@Override
318
	public int hashCode() {
319
		final int prime = 31;
320
		int result = 1;
25276 amit.gupta 321
		result = prime * result + (active ? 1231 : 1237);
28825 tejbeer 322
		result = prime * result + ((activeTimeStamp == null) ? 0 : activeTimeStamp.hashCode());
323
		result = prime * result + ((bagsLastCredited == null) ? 0 : bagsLastCredited.hashCode());
24349 amit.gupta 324
		result = prime * result + ((code == null) ? 0 : code.hashCode());
325
		result = prime * result + ((counterSize == null) ? 0 : counterSize.hashCode());
28825 tejbeer 326
		result = prime * result + ((fofoType == null) ? 0 : fofoType.hashCode());
24349 amit.gupta 327
		result = prime * result + graceCount;
328
		result = prime * result + ((graceDate == null) ? 0 : graceDate.hashCode());
22418 ashik.ali 329
		result = prime * result + id;
27903 tejbeer 330
		result = prime * result + (internal ? 1231 : 1237);
25276 amit.gupta 331
		result = prime * result + (investmentOk ? 1231 : 1237);
24349 amit.gupta 332
		result = prime * result + ((latitude == null) ? 0 : latitude.hashCode());
333
		result = prime * result + ((longitude == null) ? 0 : longitude.hashCode());
334
		result = prime * result + Float.floatToIntBits(minimumInvestment);
335
		result = prime * result + ((userAddress == null) ? 0 : userAddress.hashCode());
25276 amit.gupta 336
		result = prime * result + warehouseId;
22418 ashik.ali 337
		return result;
338
	}
27556 tejbeer 339
 
22418 ashik.ali 340
	@Override
341
	public boolean equals(Object obj) {
342
		if (this == obj)
343
			return true;
344
		if (obj == null)
345
			return false;
346
		if (getClass() != obj.getClass())
347
			return false;
348
		FofoStore other = (FofoStore) obj;
25276 amit.gupta 349
		if (active != other.active)
350
			return false;
28825 tejbeer 351
		if (activeTimeStamp == null) {
352
			if (other.activeTimeStamp != null)
353
				return false;
354
		} else if (!activeTimeStamp.equals(other.activeTimeStamp))
355
			return false;
356
		if (bagsLastCredited == null) {
357
			if (other.bagsLastCredited != null)
358
				return false;
359
		} else if (!bagsLastCredited.equals(other.bagsLastCredited))
360
			return false;
24349 amit.gupta 361
		if (code == null) {
362
			if (other.code != null)
363
				return false;
364
		} else if (!code.equals(other.code))
365
			return false;
366
		if (counterSize != other.counterSize)
367
			return false;
28825 tejbeer 368
		if (fofoType != other.fofoType)
369
			return false;
24349 amit.gupta 370
		if (graceCount != other.graceCount)
371
			return false;
372
		if (graceDate == null) {
373
			if (other.graceDate != null)
374
				return false;
375
		} else if (!graceDate.equals(other.graceDate))
376
			return false;
22418 ashik.ali 377
		if (id != other.id)
378
			return false;
27903 tejbeer 379
		if (internal != other.internal)
380
			return false;
25276 amit.gupta 381
		if (investmentOk != other.investmentOk)
382
			return false;
24349 amit.gupta 383
		if (latitude == null) {
384
			if (other.latitude != null)
385
				return false;
386
		} else if (!latitude.equals(other.latitude))
387
			return false;
388
		if (longitude == null) {
389
			if (other.longitude != null)
390
				return false;
391
		} else if (!longitude.equals(other.longitude))
392
			return false;
393
		if (Float.floatToIntBits(minimumInvestment) != Float.floatToIntBits(other.minimumInvestment))
394
			return false;
395
		if (userAddress == null) {
396
			if (other.userAddress != null)
397
				return false;
398
		} else if (!userAddress.equals(other.userAddress))
399
			return false;
25276 amit.gupta 400
		if (warehouseId != other.warehouseId)
401
			return false;
22418 ashik.ali 402
		return true;
403
	}
27556 tejbeer 404
 
22418 ashik.ali 405
	@Override
406
	public String toString() {
23884 amit.gupta 407
		return "FofoStore [id=" + id + ", code=" + code + ", latitude=" + latitude + ", longitude=" + longitude
25069 amit.gupta 408
				+ ", counterSize=" + counterSize + ", warehouseId=" + warehouseId + ", minimumInvestment="
27903 tejbeer 409
				+ minimumInvestment + ", graceDate=" + graceDate + ", investmentOk=" + investmentOk + ", active="
28709 amit.gupta 410
				+ active + ", userAddress=" + userAddress + ", internal=" + internal + ", bagsLastCredited="
28825 tejbeer 411
				+ bagsLastCredited + ", fofoType=" + fofoType + ", activeTimeStamp=" + activeTimeStamp + ", graceCount="
412
				+ graceCount + "]";
22418 ashik.ali 413
	}
27556 tejbeer 414
 
22418 ashik.ali 415
}