Subversion Repositories SmartDukaan

Rev

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