Subversion Repositories SmartDukaan

Rev

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