Subversion Repositories SmartDukaan

Rev

Rev 32615 | Rev 35079 | 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;
33124 ranu 169
    @Column(name = "astId")
170
    private int astId;
27556 tejbeer 171
 
32615 raveendra. 172
    public FofoStore() {
173
    }
27556 tejbeer 174
 
33124 ranu 175
    public int getAstId() {
176
        return astId;
177
    }
178
 
179
    public void setAstId(int astId) {
180
        this.astId = astId;
181
    }
182
 
32615 raveendra. 183
    public int getCodeInt() {
184
        return codeInt;
185
    }
27556 tejbeer 186
 
32615 raveendra. 187
    public void setCodeInt(int codeInt) {
188
        this.codeInt = codeInt;
189
    }
27556 tejbeer 190
 
32615 raveendra. 191
    public int getTarget() {
192
        return target;
193
    }
27556 tejbeer 194
 
32615 raveendra. 195
    public void setTarget(int target) {
196
        this.target = target;
197
    }
27556 tejbeer 198
 
32615 raveendra. 199
    public ActivationType getActivationType() {
200
        return activationType;
201
    }
27556 tejbeer 202
 
32615 raveendra. 203
    public void setActivationType(ActivationType activationType) {
204
        this.activationType = activationType;
205
    }
31730 tejbeer 206
 
32615 raveendra. 207
    public float getCounterPotential() {
208
        return counterPotential;
209
    }
27556 tejbeer 210
 
32615 raveendra. 211
    public void setCounterPotential(float counterPotential) {
212
        this.counterPotential = counterPotential;
213
    }
27556 tejbeer 214
 
32615 raveendra. 215
    public LocalDateTime getBagsLastCredited() {
216
        return bagsLastCredited;
217
    }
27556 tejbeer 218
 
32615 raveendra. 219
    public void setBagsLastCredited(LocalDateTime bagsLastCredited) {
220
        this.bagsLastCredited = bagsLastCredited;
221
    }
27556 tejbeer 222
 
32615 raveendra. 223
    public boolean isInternal() {
224
        return internal;
225
    }
27903 tejbeer 226
 
32615 raveendra. 227
    public void setInternal(boolean internal) {
228
        this.internal = internal;
229
    }
29497 amit.gupta 230
 
32615 raveendra. 231
    public int getWarehouseId() {
232
        return warehouseId;
233
    }
30046 tejbeer 234
 
32615 raveendra. 235
    public void setWarehouseId(int warehouseId) {
236
        this.warehouseId = warehouseId;
237
    }
27903 tejbeer 238
 
32615 raveendra. 239
    public boolean isInvestmentOk() {
240
        return investmentOk;
241
    }
28825 tejbeer 242
 
32615 raveendra. 243
    public void setInvestmentOk(boolean investmentOk) {
244
        this.investmentOk = investmentOk;
245
    }
28825 tejbeer 246
 
32615 raveendra. 247
    public String getPan() {
248
        return pan;
249
    }
30046 tejbeer 250
 
32615 raveendra. 251
    public void setPan(String pan) {
252
        this.pan = pan;
253
    }
28166 tejbeer 254
 
32615 raveendra. 255
    public int getGraceCount() {
256
        return graceCount;
257
    }
32308 amit.gupta 258
 
32615 raveendra. 259
    public void setGraceCount(int graceCount) {
260
        this.graceCount = graceCount;
261
    }
32308 amit.gupta 262
 
32615 raveendra. 263
    public boolean isActive() {
264
        return active;
265
    }
32308 amit.gupta 266
 
32615 raveendra. 267
    public void setActive(boolean active) {
268
        this.active = active;
269
    }
30046 tejbeer 270
 
32615 raveendra. 271
    public LocalDate getGraceDate() {
272
        return graceDate;
273
    }
31730 tejbeer 274
 
32615 raveendra. 275
    public void setGraceDate(LocalDate graceDate) {
276
        this.graceDate = graceDate;
277
    }
31730 tejbeer 278
 
32615 raveendra. 279
    public float getMinimumInvestment() {
280
        return minimumInvestment;
281
    }
30046 tejbeer 282
 
32615 raveendra. 283
    public void setMinimumInvestment(float minimumInvestment) {
284
        this.minimumInvestment = minimumInvestment;
285
    }
28166 tejbeer 286
 
32615 raveendra. 287
    /*
288
     * public int getCreditCycle() { return creditCycle; } public void
289
     * setCreditCycle(int creditCycle) { this.creditCycle = creditCycle; }
290
     */
291
    public CounterSize getCounterSize() {
292
        return counterSize;
293
    }
28166 tejbeer 294
 
32615 raveendra. 295
    public void setCounterSize(CounterSize counterSize) {
296
        this.counterSize = counterSize;
297
    }
27903 tejbeer 298
 
32615 raveendra. 299
    public int getId() {
300
        return id;
301
    }
27903 tejbeer 302
 
32615 raveendra. 303
    public void setId(int id) {
304
        this.id = id;
305
    }
27903 tejbeer 306
 
32615 raveendra. 307
    public String getCode() {
308
        return code;
309
    }
27903 tejbeer 310
 
32615 raveendra. 311
    public void setCode(String code) {
312
        this.code = code;
313
    }
27556 tejbeer 314
 
32615 raveendra. 315
    public String getLatitude() {
316
        return latitude;
317
    }
25276 amit.gupta 318
 
32615 raveendra. 319
    public void setLatitude(String latitude) {
320
        this.latitude = latitude;
321
    }
24843 govind 322
 
32615 raveendra. 323
    public String getLongitude() {
324
        return longitude;
325
    }
29497 amit.gupta 326
 
32615 raveendra. 327
    public void setLongitude(String longitude) {
328
        this.longitude = longitude;
329
    }
29497 amit.gupta 330
 
32615 raveendra. 331
    public Address getUserAddress() {
332
        return userAddress;
333
    }
27556 tejbeer 334
 
32615 raveendra. 335
    public void setUserAddress(Address userAddress) {
336
        this.userAddress = userAddress;
337
    }
27556 tejbeer 338
 
32615 raveendra. 339
    public LocalDateTime getActiveTimeStamp() {
340
        return activeTimeStamp;
341
    }
27556 tejbeer 342
 
32615 raveendra. 343
    public void setActiveTimeStamp(LocalDateTime activeTimeStamp) {
344
        this.activeTimeStamp = activeTimeStamp;
345
    }
27556 tejbeer 346
 
32615 raveendra. 347
    public FofoType getFofoType() {
348
        return fofoType;
349
    }
27556 tejbeer 350
 
32615 raveendra. 351
    public void setFofoType(FofoType fofoType) {
352
        this.fofoType = fofoType;
353
    }
27556 tejbeer 354
 
32615 raveendra. 355
    @Override
356
    public int hashCode() {
357
        final int prime = 31;
358
        int result = 1;
359
        result = prime * result + ((activationType == null) ? 0 : activationType.hashCode());
360
        result = prime * result + (active ? 1231 : 1237);
361
        result = prime * result + ((activeTimeStamp == null) ? 0 : activeTimeStamp.hashCode());
362
        result = prime * result + ((bagsLastCredited == null) ? 0 : bagsLastCredited.hashCode());
363
        result = prime * result + ((code == null) ? 0 : code.hashCode());
364
        result = prime * result + Float.floatToIntBits(counterPotential);
365
        result = prime * result + ((counterSize == null) ? 0 : counterSize.hashCode());
366
        result = prime * result + ((fofoType == null) ? 0 : fofoType.hashCode());
367
        result = prime * result + graceCount;
368
        result = prime * result + ((graceDate == null) ? 0 : graceDate.hashCode());
369
        result = prime * result + id;
370
        result = prime * result + (internal ? 1231 : 1237);
371
        result = prime * result + (investmentOk ? 1231 : 1237);
372
        result = prime * result + ((latitude == null) ? 0 : latitude.hashCode());
373
        result = prime * result + ((longitude == null) ? 0 : longitude.hashCode());
374
        result = prime * result + Float.floatToIntBits(minimumInvestment);
375
        result = prime * result + ((pan == null) ? 0 : pan.hashCode());
376
        result = prime * result + ((userAddress == null) ? 0 : userAddress.hashCode());
377
        result = prime * result + warehouseId;
378
        return result;
379
    }
27556 tejbeer 380
 
32615 raveendra. 381
    @Override
382
    public boolean equals(Object obj) {
383
        if (this == obj)
384
            return true;
385
        if (obj == null)
386
            return false;
387
        if (getClass() != obj.getClass())
388
            return false;
389
        FofoStore other = (FofoStore) obj;
390
        if (activationType != other.activationType)
391
            return false;
392
        if (active != other.active)
393
            return false;
394
        if (activeTimeStamp == null) {
395
            if (other.activeTimeStamp != null)
396
                return false;
397
        } else if (!activeTimeStamp.equals(other.activeTimeStamp))
398
            return false;
399
        if (bagsLastCredited == null) {
400
            if (other.bagsLastCredited != null)
401
                return false;
402
        } else if (!bagsLastCredited.equals(other.bagsLastCredited))
403
            return false;
404
        if (code == null) {
405
            if (other.code != null)
406
                return false;
407
        } else if (!code.equals(other.code))
408
            return false;
409
        if (Float.floatToIntBits(counterPotential) != Float.floatToIntBits(other.counterPotential))
410
            return false;
411
        if (counterSize != other.counterSize)
412
            return false;
413
        if (fofoType != other.fofoType)
414
            return false;
415
        if (graceCount != other.graceCount)
416
            return false;
417
        if (graceDate == null) {
418
            if (other.graceDate != null)
419
                return false;
420
        } else if (!graceDate.equals(other.graceDate))
421
            return false;
422
        if (id != other.id)
423
            return false;
33124 ranu 424
        if (astId != other.astId)
425
            return false;
32615 raveendra. 426
        if (internal != other.internal)
427
            return false;
428
        if (investmentOk != other.investmentOk)
429
            return false;
430
        if (latitude == null) {
431
            if (other.latitude != null)
432
                return false;
433
        } else if (!latitude.equals(other.latitude))
434
            return false;
435
        if (longitude == null) {
436
            if (other.longitude != null)
437
                return false;
438
        } else if (!longitude.equals(other.longitude))
439
            return false;
440
        if (Float.floatToIntBits(minimumInvestment) != Float.floatToIntBits(other.minimumInvestment))
441
            return false;
442
        if (pan == null) {
443
            if (other.pan != null)
444
                return false;
445
        } else if (!pan.equals(other.pan))
446
            return false;
447
        if (userAddress == null) {
448
            if (other.userAddress != null)
449
                return false;
450
        } else if (!userAddress.equals(other.userAddress))
451
            return false;
452
        if (warehouseId != other.warehouseId)
453
            return false;
454
        return true;
455
    }
23884 amit.gupta 456
 
32615 raveendra. 457
    @Override
458
    public String toString() {
33124 ranu 459
        return "FofoStore [id=" + id + ",astId=" + astId + ", code=" + code + ", latitude=" + latitude + ", longitude=" + longitude
32615 raveendra. 460
                + ", counterSize=" + counterSize + ", counterPotential=" + counterPotential + ", warehouseId="
461
                + warehouseId + ", minimumInvestment=" + minimumInvestment + ", graceDate=" + graceDate
462
                + ", investmentOk=" + investmentOk + ", active=" + active + ", pan=" + pan + ", userAddress="
463
                + userAddress + ", internal=" + internal + ", bagsLastCredited=" + bagsLastCredited + ", fofoType="
464
                + fofoType + ", activationType=" + activationType + ", activeTimeStamp=" + activeTimeStamp
465
                + ", graceCount=" + graceCount + "]";
466
    }
27556 tejbeer 467
 
22418 ashik.ali 468
}