| 26588 |
tejbeer |
1 |
package com.spice.profitmandi.dao.model;
|
|
|
2 |
|
|
|
3 |
import java.time.LocalDateTime;
|
|
|
4 |
import java.util.List;
|
|
|
5 |
|
| 29785 |
amit.gupta |
6 |
import org.apache.logging.log4j.LogManager;
|
|
|
7 |
import org.apache.logging.log4j.Logger;
|
| 28541 |
amit.gupta |
8 |
|
| 28019 |
amit.gupta |
9 |
import com.spice.profitmandi.dao.enumuration.catalog.AchievementType;
|
| 29785 |
amit.gupta |
10 |
import com.spice.profitmandi.dao.enumuration.catalog.AmountType;
|
| 27878 |
amit.gupta |
11 |
import com.spice.profitmandi.dao.enumuration.catalog.OfferSchemeType;
|
|
|
12 |
import com.spice.profitmandi.service.offers.ItemCriteria;
|
|
|
13 |
import com.spice.profitmandi.service.offers.PartnerCriteria;
|
| 29785 |
amit.gupta |
14 |
import com.spice.profitmandi.service.offers.PayoutSlab;
|
| 26588 |
tejbeer |
15 |
|
|
|
16 |
public class CreateOfferRequest {
|
| 27360 |
tejbeer |
17 |
private int id;
|
| 27878 |
amit.gupta |
18 |
private boolean active;
|
| 28019 |
amit.gupta |
19 |
private boolean incrementalTarget;
|
| 26588 |
tejbeer |
20 |
private String name;
|
|
|
21 |
private LocalDateTime startDate;
|
|
|
22 |
private LocalDateTime endDate;
|
| 27878 |
amit.gupta |
23 |
private String offerNotes;
|
|
|
24 |
private String terms;
|
| 27918 |
amit.gupta |
25 |
private AchievementType targetType;
|
|
|
26 |
private AchievementType payoutType;
|
| 27878 |
amit.gupta |
27 |
private String activationBrands;
|
|
|
28 |
private OfferSchemeType schemeType;
|
|
|
29 |
private double sellinPercentage;
|
|
|
30 |
private double brandShareTerms;
|
|
|
31 |
private ItemCriteria itemCriteria;
|
|
|
32 |
private String itemCriteriaString;
|
|
|
33 |
private LocalDateTime createdOn;
|
|
|
34 |
private List<TargetSlab> targetSlabs;
|
|
|
35 |
private PartnerCriteria partnerCriteria;
|
|
|
36 |
private String partnerCriteriaString;
|
|
|
37 |
|
| 29785 |
amit.gupta |
38 |
private static final Logger LOGGER = LogManager.getLogger(CreateOfferRequest.class);
|
|
|
39 |
|
| 27878 |
amit.gupta |
40 |
public int getEligibleSale() {
|
|
|
41 |
return eligibleSale;
|
| 26694 |
tejbeer |
42 |
}
|
| 29785 |
amit.gupta |
43 |
|
| 27878 |
amit.gupta |
44 |
public void setEligibleSale(int eligibleSale) {
|
|
|
45 |
this.eligibleSale = eligibleSale;
|
| 27353 |
tejbeer |
46 |
}
|
|
|
47 |
|
| 29785 |
amit.gupta |
48 |
private void addAchievementPayoutString(StringBuffer sb, ItemCriteriaPayout itemCriteriaPayout,
|
|
|
49 |
PayoutSlab payoutSlab) {
|
|
|
50 |
this.addAchievementString(sb, itemCriteriaPayout);
|
|
|
51 |
sb.append(", Get ");
|
|
|
52 |
this.addPayoutString(sb, itemCriteriaPayout, payoutSlab);
|
|
|
53 |
}
|
|
|
54 |
|
|
|
55 |
private void addAchievementString(StringBuffer sb, ItemCriteriaPayout itemCriteriaPayout) {
|
|
|
56 |
if (this.getPayoutType().equals(AchievementType.QUANTITY)) {
|
|
|
57 |
sb.append(itemCriteriaPayout.getShortValue()).append(" more pc(s)");
|
|
|
58 |
} else if (this.getPayoutType().equals(AchievementType.VALUE)) {
|
|
|
59 |
sb.append("items worth Rs.").append("<span class=\"currency\">").append(itemCriteriaPayout.getShortValue())
|
|
|
60 |
.append("</span>");
|
|
|
61 |
}
|
|
|
62 |
}
|
|
|
63 |
|
|
|
64 |
private void addPayoutString(StringBuffer sb, ItemCriteriaPayout itemCriteriaPayout, PayoutSlab payoutSlab) {
|
|
|
65 |
if (itemCriteriaPayout.getAmountType().equals(AmountType.PERCENTAGE)) {
|
|
|
66 |
sb.append(payoutSlab.getPayoutAmount()).append("% of total sale value");
|
|
|
67 |
} else if (itemCriteriaPayout.getAmountType().equals(AmountType.FIXED)) {
|
|
|
68 |
sb.append("Rs.").append("<span class=\"currency\">").append(payoutSlab.getPayoutAmount())
|
|
|
69 |
.append("</span> per pc");
|
|
|
70 |
} else {
|
|
|
71 |
sb.append("flat Rs.").append("<span class=\"currency\">").append(payoutSlab.getPayoutAmount())
|
|
|
72 |
.append("</span>");
|
|
|
73 |
}
|
|
|
74 |
}
|
|
|
75 |
|
| 28028 |
amit.gupta |
76 |
public String getDashboardHtml() {
|
| 29785 |
amit.gupta |
77 |
LOGGER.info("getDahsboard html --- {}", this.getId());
|
|
|
78 |
String activityString = null;
|
|
|
79 |
if (this.getSchemeType().equals(OfferSchemeType.ACTIVATION)) {
|
|
|
80 |
activityString = "Activate";
|
|
|
81 |
} else if (this.getSchemeType().equals(OfferSchemeType.SELLIN)) {
|
|
|
82 |
activityString = "Purchase";
|
|
|
83 |
} else {
|
|
|
84 |
activityString = "Sell";
|
|
|
85 |
}
|
| 28028 |
amit.gupta |
86 |
StringBuffer sb = new StringBuffer();
|
| 29785 |
amit.gupta |
87 |
int i=0;
|
|
|
88 |
for (ItemCriteriaPayout itemCriteriaPayout : this.getTargetSlabs().get(0).getItemCriteriaPayouts()) {
|
|
|
89 |
LOGGER.info("itemCriteriaPayout {}", itemCriteriaPayout);
|
|
|
90 |
PayoutSlab currentSlab = itemCriteriaPayout.getCurrentSlab();
|
|
|
91 |
PayoutSlab nextSlab = itemCriteriaPayout.getNextSlab();
|
|
|
92 |
if(i>0) {
|
|
|
93 |
sb.append("<br>");
|
| 28153 |
amit.gupta |
94 |
}
|
| 29785 |
amit.gupta |
95 |
i++;
|
|
|
96 |
if (currentSlab == null) {
|
|
|
97 |
sb.append(activityString).append(" ");
|
|
|
98 |
this.addAchievementPayoutString(sb, itemCriteriaPayout, nextSlab);
|
| 28028 |
amit.gupta |
99 |
} else {
|
| 29785 |
amit.gupta |
100 |
if (itemCriteriaPayout.getNextSlab() != null) {
|
|
|
101 |
sb.append("Congratulations, you have qualified to get ");
|
|
|
102 |
this.addPayoutString(sb, itemCriteriaPayout, currentSlab);
|
|
|
103 |
sb.append(". ");
|
|
|
104 |
sb.append(activityString).append(" ");
|
|
|
105 |
this.addAchievementPayoutString(sb, itemCriteriaPayout, nextSlab);
|
| 28541 |
amit.gupta |
106 |
} else {
|
| 29785 |
amit.gupta |
107 |
sb.append("Congratulations for achieving the highest slab,");
|
|
|
108 |
sb.append(" you have qualified to get ");
|
|
|
109 |
this.addPayoutString(sb, itemCriteriaPayout, currentSlab);
|
|
|
110 |
sb.append(", keep it up!!");
|
| 28541 |
amit.gupta |
111 |
}
|
| 28028 |
amit.gupta |
112 |
}
|
|
|
113 |
}
|
|
|
114 |
return sb.toString();
|
| 29785 |
amit.gupta |
115 |
|
| 28028 |
amit.gupta |
116 |
}
|
| 28967 |
amit.gupta |
117 |
|
| 28019 |
amit.gupta |
118 |
public boolean isIncrementalTarget() {
|
|
|
119 |
return incrementalTarget;
|
|
|
120 |
}
|
| 28967 |
amit.gupta |
121 |
|
| 28019 |
amit.gupta |
122 |
public void setIncrementalTarget(boolean incrementalTarget) {
|
|
|
123 |
this.incrementalTarget = incrementalTarget;
|
|
|
124 |
}
|
| 28967 |
amit.gupta |
125 |
|
| 28019 |
amit.gupta |
126 |
@Override
|
|
|
127 |
public String toString() {
|
|
|
128 |
return "CreateOfferRequest [id=" + id + ", active=" + active + ", incrementalTarget=" + incrementalTarget
|
|
|
129 |
+ ", name=" + name + ", startDate=" + startDate + ", endDate=" + endDate + ", offerNotes=" + offerNotes
|
|
|
130 |
+ ", terms=" + terms + ", targetType=" + targetType + ", payoutType=" + payoutType
|
|
|
131 |
+ ", activationBrands=" + activationBrands + ", schemeType=" + schemeType + ", sellinPercentage="
|
|
|
132 |
+ sellinPercentage + ", brandShareTerms=" + brandShareTerms + ", itemCriteria=" + itemCriteria
|
|
|
133 |
+ ", itemCriteriaString=" + itemCriteriaString + ", createdOn=" + createdOn + ", targetSlabs="
|
|
|
134 |
+ targetSlabs + ", partnerCriteria=" + partnerCriteria + ", partnerCriteriaString="
|
|
|
135 |
+ partnerCriteriaString + ", eligibleSale=" + eligibleSale + ", nextTargetSlab=" + nextTargetSlab
|
|
|
136 |
+ ", currentTargetSlab=" + currentTargetSlab + "]";
|
|
|
137 |
}
|
|
|
138 |
|
| 27878 |
amit.gupta |
139 |
private int eligibleSale;
|
|
|
140 |
private TargetSlab nextTargetSlab;
|
|
|
141 |
private TargetSlab currentTargetSlab;
|
| 28153 |
amit.gupta |
142 |
private String currentTarget;
|
|
|
143 |
private String nextTarget;
|
| 27353 |
tejbeer |
144 |
|
| 28153 |
amit.gupta |
145 |
public String getCurrentTarget() {
|
|
|
146 |
return currentTarget;
|
|
|
147 |
}
|
| 28967 |
amit.gupta |
148 |
|
| 28153 |
amit.gupta |
149 |
public void setCurrentTarget(String currentTarget) {
|
|
|
150 |
this.currentTarget = currentTarget;
|
|
|
151 |
}
|
| 28967 |
amit.gupta |
152 |
|
| 28153 |
amit.gupta |
153 |
public String getNextTarget() {
|
|
|
154 |
return nextTarget;
|
|
|
155 |
}
|
| 28967 |
amit.gupta |
156 |
|
| 28153 |
amit.gupta |
157 |
public void setNextTarget(String nextTarget) {
|
|
|
158 |
this.nextTarget = nextTarget;
|
|
|
159 |
}
|
| 28967 |
amit.gupta |
160 |
|
| 27878 |
amit.gupta |
161 |
public TargetSlab getNextTargetSlab() {
|
|
|
162 |
return nextTargetSlab;
|
| 27353 |
tejbeer |
163 |
}
|
| 28967 |
amit.gupta |
164 |
|
| 27878 |
amit.gupta |
165 |
public void setNextTargetSlab(TargetSlab nextTargetSlab) {
|
|
|
166 |
this.nextTargetSlab = nextTargetSlab;
|
| 26694 |
tejbeer |
167 |
}
|
| 28967 |
amit.gupta |
168 |
|
| 27878 |
amit.gupta |
169 |
public TargetSlab getCurrentTargetSlab() {
|
|
|
170 |
return currentTargetSlab;
|
| 26694 |
tejbeer |
171 |
}
|
| 28967 |
amit.gupta |
172 |
|
| 27878 |
amit.gupta |
173 |
public void setCurrentTargetSlab(TargetSlab currentTargetSlab) {
|
|
|
174 |
this.currentTargetSlab = currentTargetSlab;
|
| 26694 |
tejbeer |
175 |
}
|
|
|
176 |
|
| 27878 |
amit.gupta |
177 |
public boolean isActive() {
|
|
|
178 |
return active;
|
| 26694 |
tejbeer |
179 |
}
|
|
|
180 |
|
| 27878 |
amit.gupta |
181 |
public void setActive(boolean active) {
|
|
|
182 |
this.active = active;
|
| 26694 |
tejbeer |
183 |
}
|
|
|
184 |
|
| 27878 |
amit.gupta |
185 |
public LocalDateTime getCreatedOn() {
|
|
|
186 |
return createdOn;
|
| 26694 |
tejbeer |
187 |
}
|
|
|
188 |
|
| 27918 |
amit.gupta |
189 |
public AchievementType getPayoutType() {
|
|
|
190 |
return payoutType;
|
|
|
191 |
}
|
| 28967 |
amit.gupta |
192 |
|
| 27918 |
amit.gupta |
193 |
public void setPayoutType(AchievementType payoutType) {
|
|
|
194 |
this.payoutType = payoutType;
|
|
|
195 |
}
|
| 28967 |
amit.gupta |
196 |
|
| 27878 |
amit.gupta |
197 |
public String getActivationBrands() {
|
|
|
198 |
return activationBrands;
|
| 26694 |
tejbeer |
199 |
}
|
| 28967 |
amit.gupta |
200 |
|
| 27878 |
amit.gupta |
201 |
public void setActivationBrands(String activationBrands) {
|
|
|
202 |
this.activationBrands = activationBrands;
|
| 26674 |
tejbeer |
203 |
}
|
| 28967 |
amit.gupta |
204 |
|
| 27878 |
amit.gupta |
205 |
public void setCreatedOn(LocalDateTime createdOn) {
|
|
|
206 |
this.createdOn = createdOn;
|
|
|
207 |
}
|
| 26674 |
tejbeer |
208 |
|
| 27878 |
amit.gupta |
209 |
public String getItemCriteriaString() {
|
|
|
210 |
return itemCriteriaString;
|
| 26674 |
tejbeer |
211 |
}
|
|
|
212 |
|
| 27878 |
amit.gupta |
213 |
public String getPartnerCriteriaString() {
|
|
|
214 |
return partnerCriteriaString;
|
| 26674 |
tejbeer |
215 |
}
|
|
|
216 |
|
| 27878 |
amit.gupta |
217 |
public void setPartnerCriteriaString(String partnerCriteriaString) {
|
|
|
218 |
this.partnerCriteriaString = partnerCriteriaString;
|
| 26674 |
tejbeer |
219 |
}
|
|
|
220 |
|
| 27878 |
amit.gupta |
221 |
public PartnerCriteria getPartnerCriteria() {
|
|
|
222 |
return partnerCriteria;
|
| 26674 |
tejbeer |
223 |
}
|
|
|
224 |
|
| 27878 |
amit.gupta |
225 |
public void setPartnerCriteria(PartnerCriteria partnerCriteria) {
|
|
|
226 |
this.partnerCriteria = partnerCriteria;
|
| 26588 |
tejbeer |
227 |
}
|
|
|
228 |
|
| 27878 |
amit.gupta |
229 |
public ItemCriteria getItemCriteria() {
|
|
|
230 |
return itemCriteria;
|
| 26588 |
tejbeer |
231 |
}
|
|
|
232 |
|
| 27878 |
amit.gupta |
233 |
public void setItemCriteria(ItemCriteria itemCriteria) {
|
|
|
234 |
this.itemCriteria = itemCriteria;
|
| 26588 |
tejbeer |
235 |
}
|
|
|
236 |
|
| 27878 |
amit.gupta |
237 |
public double getBrandShareTerms() {
|
|
|
238 |
return brandShareTerms;
|
| 26588 |
tejbeer |
239 |
}
|
|
|
240 |
|
| 27878 |
amit.gupta |
241 |
public void setBrandShareTerms(double brandShareTerms) {
|
|
|
242 |
this.brandShareTerms = brandShareTerms;
|
| 26588 |
tejbeer |
243 |
}
|
|
|
244 |
|
| 27878 |
amit.gupta |
245 |
public List<TargetSlab> getTargetSlabs() {
|
|
|
246 |
return targetSlabs;
|
| 26588 |
tejbeer |
247 |
}
|
|
|
248 |
|
| 27878 |
amit.gupta |
249 |
public void setTargetSlabs(List<TargetSlab> targetSlabs) {
|
|
|
250 |
this.targetSlabs = targetSlabs;
|
| 26588 |
tejbeer |
251 |
}
|
|
|
252 |
|
| 27878 |
amit.gupta |
253 |
public int getId() {
|
|
|
254 |
return id;
|
| 26588 |
tejbeer |
255 |
}
|
|
|
256 |
|
| 27878 |
amit.gupta |
257 |
public void setId(int id) {
|
|
|
258 |
this.id = id;
|
| 26588 |
tejbeer |
259 |
}
|
|
|
260 |
|
|
|
261 |
public String getName() {
|
|
|
262 |
return name;
|
|
|
263 |
}
|
|
|
264 |
|
|
|
265 |
public void setName(String name) {
|
|
|
266 |
this.name = name;
|
|
|
267 |
}
|
|
|
268 |
|
| 27878 |
amit.gupta |
269 |
public LocalDateTime getStartDate() {
|
|
|
270 |
return startDate;
|
| 26588 |
tejbeer |
271 |
}
|
|
|
272 |
|
| 27878 |
amit.gupta |
273 |
public void setStartDate(LocalDateTime startDate) {
|
|
|
274 |
this.startDate = startDate;
|
| 26588 |
tejbeer |
275 |
}
|
|
|
276 |
|
| 27878 |
amit.gupta |
277 |
public LocalDateTime getEndDate() {
|
|
|
278 |
return endDate;
|
| 26588 |
tejbeer |
279 |
}
|
|
|
280 |
|
| 27878 |
amit.gupta |
281 |
public void setEndDate(LocalDateTime endDate) {
|
|
|
282 |
this.endDate = endDate;
|
| 26588 |
tejbeer |
283 |
}
|
|
|
284 |
|
| 27918 |
amit.gupta |
285 |
public AchievementType getTargetType() {
|
| 27878 |
amit.gupta |
286 |
return targetType;
|
| 26588 |
tejbeer |
287 |
}
|
|
|
288 |
|
| 27918 |
amit.gupta |
289 |
public void setTargetType(AchievementType targetType) {
|
| 27878 |
amit.gupta |
290 |
this.targetType = targetType;
|
| 26588 |
tejbeer |
291 |
}
|
|
|
292 |
|
| 27878 |
amit.gupta |
293 |
public OfferSchemeType getSchemeType() {
|
|
|
294 |
return schemeType;
|
| 26588 |
tejbeer |
295 |
}
|
|
|
296 |
|
| 27878 |
amit.gupta |
297 |
public void setSchemeType(OfferSchemeType schemeType) {
|
|
|
298 |
this.schemeType = schemeType;
|
| 26588 |
tejbeer |
299 |
}
|
|
|
300 |
|
| 27878 |
amit.gupta |
301 |
public double getSellinPercentage() {
|
|
|
302 |
return sellinPercentage;
|
| 26588 |
tejbeer |
303 |
}
|
|
|
304 |
|
| 27878 |
amit.gupta |
305 |
public void setSellinPercentage(double sellinPercentage) {
|
|
|
306 |
this.sellinPercentage = sellinPercentage;
|
| 26588 |
tejbeer |
307 |
}
|
|
|
308 |
|
| 27878 |
amit.gupta |
309 |
public String getOfferNotes() {
|
|
|
310 |
return offerNotes;
|
| 26588 |
tejbeer |
311 |
}
|
|
|
312 |
|
| 27878 |
amit.gupta |
313 |
public void setOfferNotes(String offerNotes) {
|
|
|
314 |
this.offerNotes = offerNotes;
|
| 26588 |
tejbeer |
315 |
}
|
|
|
316 |
|
| 27878 |
amit.gupta |
317 |
public String getTerms() {
|
|
|
318 |
return terms;
|
| 26588 |
tejbeer |
319 |
}
|
|
|
320 |
|
| 27878 |
amit.gupta |
321 |
public void setTerms(String terms) {
|
|
|
322 |
this.terms = terms;
|
| 26588 |
tejbeer |
323 |
}
|
|
|
324 |
|
| 27878 |
amit.gupta |
325 |
public void setItemCriteriaString(String itemCriteriaString) {
|
|
|
326 |
this.itemCriteriaString = itemCriteriaString;
|
| 26588 |
tejbeer |
327 |
}
|
|
|
328 |
|
| 27878 |
amit.gupta |
329 |
@Override
|
|
|
330 |
public boolean equals(Object obj) {
|
|
|
331 |
if (this == obj)
|
|
|
332 |
return true;
|
|
|
333 |
if (obj == null)
|
|
|
334 |
return false;
|
|
|
335 |
if (getClass() != obj.getClass())
|
|
|
336 |
return false;
|
|
|
337 |
CreateOfferRequest other = (CreateOfferRequest) obj;
|
|
|
338 |
if (activationBrands == null) {
|
|
|
339 |
if (other.activationBrands != null)
|
|
|
340 |
return false;
|
|
|
341 |
} else if (!activationBrands.equals(other.activationBrands))
|
|
|
342 |
return false;
|
|
|
343 |
if (active != other.active)
|
|
|
344 |
return false;
|
|
|
345 |
if (Double.doubleToLongBits(brandShareTerms) != Double.doubleToLongBits(other.brandShareTerms))
|
|
|
346 |
return false;
|
|
|
347 |
if (createdOn == null) {
|
|
|
348 |
if (other.createdOn != null)
|
|
|
349 |
return false;
|
|
|
350 |
} else if (!createdOn.equals(other.createdOn))
|
|
|
351 |
return false;
|
|
|
352 |
if (currentTargetSlab == null) {
|
|
|
353 |
if (other.currentTargetSlab != null)
|
|
|
354 |
return false;
|
|
|
355 |
} else if (!currentTargetSlab.equals(other.currentTargetSlab))
|
|
|
356 |
return false;
|
|
|
357 |
if (eligibleSale != other.eligibleSale)
|
|
|
358 |
return false;
|
|
|
359 |
if (endDate == null) {
|
|
|
360 |
if (other.endDate != null)
|
|
|
361 |
return false;
|
|
|
362 |
} else if (!endDate.equals(other.endDate))
|
|
|
363 |
return false;
|
|
|
364 |
if (id != other.id)
|
|
|
365 |
return false;
|
| 28019 |
amit.gupta |
366 |
if (incrementalTarget != other.incrementalTarget)
|
|
|
367 |
return false;
|
| 27878 |
amit.gupta |
368 |
if (itemCriteria == null) {
|
|
|
369 |
if (other.itemCriteria != null)
|
|
|
370 |
return false;
|
|
|
371 |
} else if (!itemCriteria.equals(other.itemCriteria))
|
|
|
372 |
return false;
|
|
|
373 |
if (itemCriteriaString == null) {
|
|
|
374 |
if (other.itemCriteriaString != null)
|
|
|
375 |
return false;
|
|
|
376 |
} else if (!itemCriteriaString.equals(other.itemCriteriaString))
|
|
|
377 |
return false;
|
|
|
378 |
if (name == null) {
|
|
|
379 |
if (other.name != null)
|
|
|
380 |
return false;
|
|
|
381 |
} else if (!name.equals(other.name))
|
|
|
382 |
return false;
|
|
|
383 |
if (nextTargetSlab == null) {
|
|
|
384 |
if (other.nextTargetSlab != null)
|
|
|
385 |
return false;
|
|
|
386 |
} else if (!nextTargetSlab.equals(other.nextTargetSlab))
|
|
|
387 |
return false;
|
|
|
388 |
if (offerNotes == null) {
|
|
|
389 |
if (other.offerNotes != null)
|
|
|
390 |
return false;
|
|
|
391 |
} else if (!offerNotes.equals(other.offerNotes))
|
|
|
392 |
return false;
|
|
|
393 |
if (partnerCriteria == null) {
|
|
|
394 |
if (other.partnerCriteria != null)
|
|
|
395 |
return false;
|
|
|
396 |
} else if (!partnerCriteria.equals(other.partnerCriteria))
|
|
|
397 |
return false;
|
|
|
398 |
if (partnerCriteriaString == null) {
|
|
|
399 |
if (other.partnerCriteriaString != null)
|
|
|
400 |
return false;
|
|
|
401 |
} else if (!partnerCriteriaString.equals(other.partnerCriteriaString))
|
|
|
402 |
return false;
|
| 27918 |
amit.gupta |
403 |
if (payoutType != other.payoutType)
|
|
|
404 |
return false;
|
| 27878 |
amit.gupta |
405 |
if (schemeType != other.schemeType)
|
|
|
406 |
return false;
|
|
|
407 |
if (Double.doubleToLongBits(sellinPercentage) != Double.doubleToLongBits(other.sellinPercentage))
|
|
|
408 |
return false;
|
|
|
409 |
if (startDate == null) {
|
|
|
410 |
if (other.startDate != null)
|
|
|
411 |
return false;
|
|
|
412 |
} else if (!startDate.equals(other.startDate))
|
|
|
413 |
return false;
|
|
|
414 |
if (targetSlabs == null) {
|
|
|
415 |
if (other.targetSlabs != null)
|
|
|
416 |
return false;
|
|
|
417 |
} else if (!targetSlabs.equals(other.targetSlabs))
|
|
|
418 |
return false;
|
|
|
419 |
if (targetType != other.targetType)
|
|
|
420 |
return false;
|
|
|
421 |
if (terms == null) {
|
|
|
422 |
if (other.terms != null)
|
|
|
423 |
return false;
|
|
|
424 |
} else if (!terms.equals(other.terms))
|
|
|
425 |
return false;
|
|
|
426 |
return true;
|
| 26588 |
tejbeer |
427 |
}
|
|
|
428 |
|
| 27878 |
amit.gupta |
429 |
@Override
|
|
|
430 |
public int hashCode() {
|
|
|
431 |
final int prime = 31;
|
|
|
432 |
int result = 1;
|
|
|
433 |
result = prime * result + ((activationBrands == null) ? 0 : activationBrands.hashCode());
|
|
|
434 |
result = prime * result + (active ? 1231 : 1237);
|
|
|
435 |
long temp;
|
|
|
436 |
temp = Double.doubleToLongBits(brandShareTerms);
|
|
|
437 |
result = prime * result + (int) (temp ^ (temp >>> 32));
|
|
|
438 |
result = prime * result + ((createdOn == null) ? 0 : createdOn.hashCode());
|
|
|
439 |
result = prime * result + ((currentTargetSlab == null) ? 0 : currentTargetSlab.hashCode());
|
|
|
440 |
result = prime * result + eligibleSale;
|
|
|
441 |
result = prime * result + ((endDate == null) ? 0 : endDate.hashCode());
|
|
|
442 |
result = prime * result + id;
|
| 28019 |
amit.gupta |
443 |
result = prime * result + (incrementalTarget ? 1231 : 1237);
|
| 27878 |
amit.gupta |
444 |
result = prime * result + ((itemCriteria == null) ? 0 : itemCriteria.hashCode());
|
|
|
445 |
result = prime * result + ((itemCriteriaString == null) ? 0 : itemCriteriaString.hashCode());
|
|
|
446 |
result = prime * result + ((name == null) ? 0 : name.hashCode());
|
|
|
447 |
result = prime * result + ((offerNotes == null) ? 0 : offerNotes.hashCode());
|
|
|
448 |
result = prime * result + ((partnerCriteria == null) ? 0 : partnerCriteria.hashCode());
|
| 27918 |
amit.gupta |
449 |
result = prime * result + ((payoutType == null) ? 0 : payoutType.hashCode());
|
| 27878 |
amit.gupta |
450 |
result = prime * result + ((schemeType == null) ? 0 : schemeType.hashCode());
|
|
|
451 |
temp = Double.doubleToLongBits(sellinPercentage);
|
|
|
452 |
result = prime * result + (int) (temp ^ (temp >>> 32));
|
|
|
453 |
result = prime * result + ((startDate == null) ? 0 : startDate.hashCode());
|
|
|
454 |
result = prime * result + ((targetSlabs == null) ? 0 : targetSlabs.hashCode());
|
|
|
455 |
result = prime * result + ((targetType == null) ? 0 : targetType.hashCode());
|
|
|
456 |
result = prime * result + ((terms == null) ? 0 : terms.hashCode());
|
|
|
457 |
return result;
|
| 26588 |
tejbeer |
458 |
}
|
|
|
459 |
}
|