Subversion Repositories SmartDukaan

Rev

Rev 32308 | Rev 33124 | 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
32615 raveendra. 15
 *
22418 ashik.ali 16
 * @author ashikali
17
 */
18
@Entity
31730 tejbeer 19
@Table(name = "fofo.fofo_store")
27556 tejbeer 20
 
21
@NamedQueries({
22
 
32615 raveendra. 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
 
32615 raveendra. 26
        @NamedQuery(name = "FofoStore.selectGroupByBrandWarehousePartnerSale", query = "select new com.spice.profitmandi.dao.model.BrandWisePartnerSaleModel(foi.brand, "
27
                + "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :lms then CAST(foi.quantity*foi.mop  AS integer ) else 0 end),"
28
                + "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :lms then foi.quantity  else 0 end),"
29
                + "sum(case when concat(year(foi.createTimestamp), month(foi.createTimestamp))= :mtd  then CAST(foi.quantity*foi.mop  AS integer ) else 0 end),"
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 "
34
                + "and foi.createTimestamp >= :lmtdStartDate and i.categoryId = :categoryId and fs.id in :fofoId"
35
                + " group by foi.brand"),
27594 tejbeer 36
 
32615 raveendra. 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_,"
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))"
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"
48
                + " and foi.createTimestamp >= :lmtdStartDate and foi.brand = :brand and i.categoryId = :categoryId and fs.id in :fofoId"
49
                + " group by col_0_0_"),
27556 tejbeer 50
 
32615 raveendra. 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,"
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))"
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"
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
 
32615 raveendra. 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))"
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 "
69
                + "and foi.createTimestamp >= :lmtdStartDate and i.categoryId != :categoryId and fs.id in :fofoId"
70
                + " group by foi.brand"),
27556 tejbeer 71
 
32615 raveendra. 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"
80
                + " and foi.createTimestamp >= :lmtdStartDate and foi.brand = :brand and i.categoryId != :categoryId and fs.id in :fofoId"
81
                + " group by fs.warehouseId"),
27592 tejbeer 82
 
32615 raveendra. 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,"
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))"
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"
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
 
32615 raveendra. 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"),
27599 tejbeer 97
 
32615 raveendra. 98
        @NamedQuery(name = "FofoStore.selectUnbilledActivateStockGroupByBrand", query = "select new com.spice.profitmandi.dao.model.BrandWiseUnbilledActivateStockModel(i.brand,"
99
                + "  sum(case when concat(year(ai.activationTimestamp), month(ai.activationTimestamp)) = :almtd then 1 else 0 end),"
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"
102
                + " where fs.active = true and ii.goodQuantity >= 1 and fs.id in :fofoId group by i.brand"),
27670 tejbeer 103
 
32615 raveendra. 104
        @NamedQuery(name = "FofoStore.selectUnbilledActivateStockGroupByWarehouse", query = "select new com.spice.profitmandi.dao.model.WarehouseWiseBrandUnbilledActivatedModel(fs.warehouseId,"
105
                + "  sum(case when concat(year(ai.activationTimestamp), month(ai.activationTimestamp)) = :almtd then 1 else 0 end),"
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"
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
 
32615 raveendra. 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,"
111
                + "  sum(case when concat(year(ai.activationTimestamp), month(ai.activationTimestamp)) = :almtd then 1 else 0 end),"
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"
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
 
32615 raveendra. 116
        @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)))"
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 between :lmsStartDate and :endDate) and i.categoryId = :categoryId and fs.id in :fofoId and fs.warehouseId in :warehouseId"
119
                + " group by foi.brand,DATE_FORMAT(fo.createTimestamp, :groupParameter)"),})
27599 tejbeer 120
 
27556 tejbeer 121
public class FofoStore implements Serializable {
122
 
32615 raveendra. 123
    private static final long serialVersionUID = 1L;
124
    @Id
125
    @Column(name = "id", unique = true, updatable = false)
126
    private int id;
127
    private int codeInt;
128
    @Column(name = "code", unique = true)
129
    private String code;
130
    @Column(name = "latitude")
131
    private String latitude;
132
    @Column(name = "longitude")
133
    private String longitude;
134
    @Column(name = "counter_size")
135
    @Enumerated(EnumType.STRING)
136
    private CounterSize counterSize = CounterSize.TEN_LAC;
137
    @Column(name = "counter_potential")
138
    private float counterPotential;
139
    @Column(name = "warehouse_id")
140
    private int warehouseId;
141
    @Column(name = "minimum_investment")
142
    private float minimumInvestment;
143
    @Column(name = "grace_date")
144
    private LocalDate graceDate;
145
    @Column(name = "investment_ok")
146
    private boolean investmentOk;
147
    @Column
148
    private boolean active = true;
149
    @Column
150
    private String pan;
151
    @Transient
152
    private Address userAddress;
153
    @Column(name = "internal")
154
    private boolean internal;
155
    @Column(name = "bags_last_credited")
156
    private LocalDateTime bagsLastCredited;
157
    @Column(name = "fofo_type")
158
    @Enumerated(EnumType.STRING)
159
    private FofoType fofoType;
160
    @Column(name = "activation_type")
161
    @Enumerated(EnumType.STRING)
162
    private ActivationType activationType = ActivationType.BILLING_PENDING;
163
    @Column(name = "active_timestamp")
164
    private LocalDateTime activeTimeStamp;
165
    @Column(name = "target")
166
    private int target;
167
    @Column(name = "grace_count")
168
    private int graceCount;
27556 tejbeer 169
 
32615 raveendra. 170
    public FofoStore() {
171
    }
27556 tejbeer 172
 
32615 raveendra. 173
    public int getCodeInt() {
174
        return codeInt;
175
    }
27556 tejbeer 176
 
32615 raveendra. 177
    public void setCodeInt(int codeInt) {
178
        this.codeInt = codeInt;
179
    }
27556 tejbeer 180
 
32615 raveendra. 181
    public int getTarget() {
182
        return target;
183
    }
27556 tejbeer 184
 
32615 raveendra. 185
    public void setTarget(int target) {
186
        this.target = target;
187
    }
27556 tejbeer 188
 
32615 raveendra. 189
    public ActivationType getActivationType() {
190
        return activationType;
191
    }
27556 tejbeer 192
 
32615 raveendra. 193
    public void setActivationType(ActivationType activationType) {
194
        this.activationType = activationType;
195
    }
31730 tejbeer 196
 
32615 raveendra. 197
    public float getCounterPotential() {
198
        return counterPotential;
199
    }
27556 tejbeer 200
 
32615 raveendra. 201
    public void setCounterPotential(float counterPotential) {
202
        this.counterPotential = counterPotential;
203
    }
27556 tejbeer 204
 
32615 raveendra. 205
    public LocalDateTime getBagsLastCredited() {
206
        return bagsLastCredited;
207
    }
27556 tejbeer 208
 
32615 raveendra. 209
    public void setBagsLastCredited(LocalDateTime bagsLastCredited) {
210
        this.bagsLastCredited = bagsLastCredited;
211
    }
27556 tejbeer 212
 
32615 raveendra. 213
    public boolean isInternal() {
214
        return internal;
215
    }
27903 tejbeer 216
 
32615 raveendra. 217
    public void setInternal(boolean internal) {
218
        this.internal = internal;
219
    }
29497 amit.gupta 220
 
32615 raveendra. 221
    public int getWarehouseId() {
222
        return warehouseId;
223
    }
30046 tejbeer 224
 
32615 raveendra. 225
    public void setWarehouseId(int warehouseId) {
226
        this.warehouseId = warehouseId;
227
    }
27903 tejbeer 228
 
32615 raveendra. 229
    public boolean isInvestmentOk() {
230
        return investmentOk;
231
    }
28825 tejbeer 232
 
32615 raveendra. 233
    public void setInvestmentOk(boolean investmentOk) {
234
        this.investmentOk = investmentOk;
235
    }
28825 tejbeer 236
 
32615 raveendra. 237
    public String getPan() {
238
        return pan;
239
    }
30046 tejbeer 240
 
32615 raveendra. 241
    public void setPan(String pan) {
242
        this.pan = pan;
243
    }
28166 tejbeer 244
 
32615 raveendra. 245
    public int getGraceCount() {
246
        return graceCount;
247
    }
32308 amit.gupta 248
 
32615 raveendra. 249
    public void setGraceCount(int graceCount) {
250
        this.graceCount = graceCount;
251
    }
32308 amit.gupta 252
 
32615 raveendra. 253
    public boolean isActive() {
254
        return active;
255
    }
32308 amit.gupta 256
 
32615 raveendra. 257
    public void setActive(boolean active) {
258
        this.active = active;
259
    }
30046 tejbeer 260
 
32615 raveendra. 261
    public LocalDate getGraceDate() {
262
        return graceDate;
263
    }
31730 tejbeer 264
 
32615 raveendra. 265
    public void setGraceDate(LocalDate graceDate) {
266
        this.graceDate = graceDate;
267
    }
31730 tejbeer 268
 
32615 raveendra. 269
    public float getMinimumInvestment() {
270
        return minimumInvestment;
271
    }
30046 tejbeer 272
 
32615 raveendra. 273
    public void setMinimumInvestment(float minimumInvestment) {
274
        this.minimumInvestment = minimumInvestment;
275
    }
28166 tejbeer 276
 
32615 raveendra. 277
    /*
278
     * public int getCreditCycle() { return creditCycle; } public void
279
     * setCreditCycle(int creditCycle) { this.creditCycle = creditCycle; }
280
     */
281
    public CounterSize getCounterSize() {
282
        return counterSize;
283
    }
28166 tejbeer 284
 
32615 raveendra. 285
    public void setCounterSize(CounterSize counterSize) {
286
        this.counterSize = counterSize;
287
    }
27903 tejbeer 288
 
32615 raveendra. 289
    public int getId() {
290
        return id;
291
    }
27903 tejbeer 292
 
32615 raveendra. 293
    public void setId(int id) {
294
        this.id = id;
295
    }
27903 tejbeer 296
 
32615 raveendra. 297
    public String getCode() {
298
        return code;
299
    }
27903 tejbeer 300
 
32615 raveendra. 301
    public void setCode(String code) {
302
        this.code = code;
303
    }
27556 tejbeer 304
 
32615 raveendra. 305
    public String getLatitude() {
306
        return latitude;
307
    }
25276 amit.gupta 308
 
32615 raveendra. 309
    public void setLatitude(String latitude) {
310
        this.latitude = latitude;
311
    }
24843 govind 312
 
32615 raveendra. 313
    public String getLongitude() {
314
        return longitude;
315
    }
29497 amit.gupta 316
 
32615 raveendra. 317
    public void setLongitude(String longitude) {
318
        this.longitude = longitude;
319
    }
29497 amit.gupta 320
 
32615 raveendra. 321
    public Address getUserAddress() {
322
        return userAddress;
323
    }
27556 tejbeer 324
 
32615 raveendra. 325
    public void setUserAddress(Address userAddress) {
326
        this.userAddress = userAddress;
327
    }
27556 tejbeer 328
 
32615 raveendra. 329
    public LocalDateTime getActiveTimeStamp() {
330
        return activeTimeStamp;
331
    }
27556 tejbeer 332
 
32615 raveendra. 333
    public void setActiveTimeStamp(LocalDateTime activeTimeStamp) {
334
        this.activeTimeStamp = activeTimeStamp;
335
    }
27556 tejbeer 336
 
32615 raveendra. 337
    public FofoType getFofoType() {
338
        return fofoType;
339
    }
27556 tejbeer 340
 
32615 raveendra. 341
    public void setFofoType(FofoType fofoType) {
342
        this.fofoType = fofoType;
343
    }
27556 tejbeer 344
 
32615 raveendra. 345
    @Override
346
    public int hashCode() {
347
        final int prime = 31;
348
        int result = 1;
349
        result = prime * result + ((activationType == null) ? 0 : activationType.hashCode());
350
        result = prime * result + (active ? 1231 : 1237);
351
        result = prime * result + ((activeTimeStamp == null) ? 0 : activeTimeStamp.hashCode());
352
        result = prime * result + ((bagsLastCredited == null) ? 0 : bagsLastCredited.hashCode());
353
        result = prime * result + ((code == null) ? 0 : code.hashCode());
354
        result = prime * result + Float.floatToIntBits(counterPotential);
355
        result = prime * result + ((counterSize == null) ? 0 : counterSize.hashCode());
356
        result = prime * result + ((fofoType == null) ? 0 : fofoType.hashCode());
357
        result = prime * result + graceCount;
358
        result = prime * result + ((graceDate == null) ? 0 : graceDate.hashCode());
359
        result = prime * result + id;
360
        result = prime * result + (internal ? 1231 : 1237);
361
        result = prime * result + (investmentOk ? 1231 : 1237);
362
        result = prime * result + ((latitude == null) ? 0 : latitude.hashCode());
363
        result = prime * result + ((longitude == null) ? 0 : longitude.hashCode());
364
        result = prime * result + Float.floatToIntBits(minimumInvestment);
365
        result = prime * result + ((pan == null) ? 0 : pan.hashCode());
366
        result = prime * result + ((userAddress == null) ? 0 : userAddress.hashCode());
367
        result = prime * result + warehouseId;
368
        return result;
369
    }
27556 tejbeer 370
 
32615 raveendra. 371
    @Override
372
    public boolean equals(Object obj) {
373
        if (this == obj)
374
            return true;
375
        if (obj == null)
376
            return false;
377
        if (getClass() != obj.getClass())
378
            return false;
379
        FofoStore other = (FofoStore) obj;
380
        if (activationType != other.activationType)
381
            return false;
382
        if (active != other.active)
383
            return false;
384
        if (activeTimeStamp == null) {
385
            if (other.activeTimeStamp != null)
386
                return false;
387
        } else if (!activeTimeStamp.equals(other.activeTimeStamp))
388
            return false;
389
        if (bagsLastCredited == null) {
390
            if (other.bagsLastCredited != null)
391
                return false;
392
        } else if (!bagsLastCredited.equals(other.bagsLastCredited))
393
            return false;
394
        if (code == null) {
395
            if (other.code != null)
396
                return false;
397
        } else if (!code.equals(other.code))
398
            return false;
399
        if (Float.floatToIntBits(counterPotential) != Float.floatToIntBits(other.counterPotential))
400
            return false;
401
        if (counterSize != other.counterSize)
402
            return false;
403
        if (fofoType != other.fofoType)
404
            return false;
405
        if (graceCount != other.graceCount)
406
            return false;
407
        if (graceDate == null) {
408
            if (other.graceDate != null)
409
                return false;
410
        } else if (!graceDate.equals(other.graceDate))
411
            return false;
412
        if (id != other.id)
413
            return false;
414
        if (internal != other.internal)
415
            return false;
416
        if (investmentOk != other.investmentOk)
417
            return false;
418
        if (latitude == null) {
419
            if (other.latitude != null)
420
                return false;
421
        } else if (!latitude.equals(other.latitude))
422
            return false;
423
        if (longitude == null) {
424
            if (other.longitude != null)
425
                return false;
426
        } else if (!longitude.equals(other.longitude))
427
            return false;
428
        if (Float.floatToIntBits(minimumInvestment) != Float.floatToIntBits(other.minimumInvestment))
429
            return false;
430
        if (pan == null) {
431
            if (other.pan != null)
432
                return false;
433
        } else if (!pan.equals(other.pan))
434
            return false;
435
        if (userAddress == null) {
436
            if (other.userAddress != null)
437
                return false;
438
        } else if (!userAddress.equals(other.userAddress))
439
            return false;
440
        if (warehouseId != other.warehouseId)
441
            return false;
442
        return true;
443
    }
23884 amit.gupta 444
 
32615 raveendra. 445
    @Override
446
    public String toString() {
447
        return "FofoStore [id=" + id + ", code=" + code + ", latitude=" + latitude + ", longitude=" + longitude
448
                + ", counterSize=" + counterSize + ", counterPotential=" + counterPotential + ", warehouseId="
449
                + warehouseId + ", minimumInvestment=" + minimumInvestment + ", graceDate=" + graceDate
450
                + ", investmentOk=" + investmentOk + ", active=" + active + ", pan=" + pan + ", userAddress="
451
                + userAddress + ", internal=" + internal + ", bagsLastCredited=" + bagsLastCredited + ", fofoType="
452
                + fofoType + ", activationType=" + activationType + ", activeTimeStamp=" + activeTimeStamp
453
                + ", graceCount=" + graceCount + "]";
454
    }
27556 tejbeer 455
 
22418 ashik.ali 456
}