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