Subversion Repositories SmartDukaan

Rev

Rev 28653 | Rev 30454 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 28653 Rev 30121
Line 1... Line 1...
1
package com.spice.profitmandi.dao.entity.catalog;
1
package com.spice.profitmandi.dao.entity.catalog;
2
 
2
 
-
 
3
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
-
 
4
import com.spice.profitmandi.dao.entity.fofo.PartnerType;
-
 
5
import com.spice.profitmandi.dao.enumuration.catalog.AmountType;
-
 
6
import com.spice.profitmandi.dao.enumuration.catalog.SchemeType;
-
 
7
 
-
 
8
import javax.persistence.*;
3
import java.io.Serializable;
9
import java.io.Serializable;
4
import java.time.LocalDateTime;
10
import java.time.LocalDateTime;
5
import java.time.format.DateTimeFormatter;
11
import java.time.format.DateTimeFormatter;
6
import java.util.HashMap;
12
import java.util.HashMap;
7
import java.util.HashSet;
13
import java.util.HashSet;
8
import java.util.Map;
14
import java.util.Map;
9
import java.util.Set;
15
import java.util.Set;
10
 
16
 
11
import javax.persistence.Column;
-
 
12
import javax.persistence.Convert;
-
 
13
import javax.persistence.Entity;
-
 
14
import javax.persistence.EnumType;
-
 
15
import javax.persistence.Enumerated;
-
 
16
import javax.persistence.GeneratedValue;
-
 
17
import javax.persistence.GenerationType;
-
 
18
import javax.persistence.Id;
-
 
19
import javax.persistence.Table;
-
 
20
import javax.persistence.Transient;
-
 
21
 
-
 
22
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
-
 
23
import com.spice.profitmandi.dao.entity.fofo.PartnerType;
-
 
24
import com.spice.profitmandi.dao.enumuration.catalog.AmountType;
-
 
25
import com.spice.profitmandi.dao.enumuration.catalog.SchemeType;
-
 
26
 
-
 
27
/**
17
/**
28
 * This class basically contains scheme details
18
 * This class basically contains scheme details
29
 * 
19
 * 
30
 * @author ashikali
20
 * @author ashikali
31
 *
21
 *
Line 117... Line 107...
117
	@Column(name="partner_type")
107
	@Column(name="partner_type")
118
	@Enumerated(EnumType.STRING)
108
	@Enumerated(EnumType.STRING)
119
	private PartnerType partnerType;
109
	private PartnerType partnerType;
120
 
110
 
121
	@Transient
111
	@Transient
122
	private Map<Integer, String> itemStringMap = new HashMap<>();
112
	private Map<Integer, String> catalogStringMap = new HashMap<>();
123
 
113
 
124
	public int getId() {
114
	public int getId() {
125
		return id;
115
		return id;
126
	}
116
	}
127
 
117
 
Line 176... Line 166...
176
		return "Scheme [id=" + id + ", name=" + name + ", description=" + description + ", type=" + type
166
		return "Scheme [id=" + id + ", name=" + name + ", description=" + description + ", type=" + type
177
				+ ", amountType=" + amountType + ", amount=" + amount + ", startDateTime=" + startDateTime
167
				+ ", amountType=" + amountType + ", amount=" + amount + ", startDateTime=" + startDateTime
178
				+ ", endDateTime=" + endDateTime + ", createTimestamp=" + createTimestamp + ", activeTimestamp="
168
				+ ", endDateTime=" + endDateTime + ", createTimestamp=" + createTimestamp + ", activeTimestamp="
179
				+ activeTimestamp + ", expireTimestamp=" + expireTimestamp + ", createdBy=" + createdBy + ", cashback="
169
				+ activeTimestamp + ", expireTimestamp=" + expireTimestamp + ", createdBy=" + createdBy + ", cashback="
180
				+ cashback + ", retailerIds=" + retailerIds + ", amountModel=" + amountModel + ", schemeValue="
170
				+ cashback + ", retailerIds=" + retailerIds + ", amountModel=" + amountModel + ", schemeValue="
181
				+ schemeValue + ", partnerType=" + partnerType + ", itemStringMap=" + itemStringMap + "]";
171
				+ schemeValue + ", partnerType=" + partnerType + ", itemStringMap=" + catalogStringMap + "]";
182
	}
172
	}
183
 
173
 
184
	public AmountType getAmountType() {
174
	public AmountType getAmountType() {
185
		return amountType;
175
		return amountType;
186
	}
176
	}
Line 301... Line 291...
301
			}
291
			}
302
		}
292
		}
303
		return String.join(", ", stringRetailerIds);
293
		return String.join(", ", stringRetailerIds);
304
	}
294
	}
305
 
295
 
306
	public Map<Integer, String> getItemStringMap() {
296
	public Map<Integer, String> getCatalogStringMap() {
307
		return itemStringMap;
297
		return catalogStringMap;
308
	}
298
	}
309
 
299
 
310
	public void setItemStringMap(Map<Integer, String> itemStringMap) {
300
	public void setCatalogStringMap(Map<Integer, String> catalogStringMap) {
311
		this.itemStringMap = itemStringMap;
301
		this.catalogStringMap = catalogStringMap;
312
	}
302
	}
313
 
303
 
314
	/*
304
	/*
315
	 * public String getItemIdsString(){ Set<String> stringItemIds = new
305
	 * public String getItemIdsString(){ Set<String> stringItemIds = new
316
	 * HashSet<>(); if(!itemIds.isEmpty()){ for(int itemId : itemIds){
306
	 * HashSet<>(); if(!itemIds.isEmpty()){ for(int itemId : itemIds){
Line 330... Line 320...
330
		result = prime * result + createdBy;
320
		result = prime * result + createdBy;
331
		result = prime * result + ((description == null) ? 0 : description.hashCode());
321
		result = prime * result + ((description == null) ? 0 : description.hashCode());
332
		result = prime * result + ((endDateTime == null) ? 0 : endDateTime.hashCode());
322
		result = prime * result + ((endDateTime == null) ? 0 : endDateTime.hashCode());
333
		result = prime * result + ((expireTimestamp == null) ? 0 : expireTimestamp.hashCode());
323
		result = prime * result + ((expireTimestamp == null) ? 0 : expireTimestamp.hashCode());
334
		result = prime * result + id;
324
		result = prime * result + id;
335
		result = prime * result + ((itemStringMap == null) ? 0 : itemStringMap.hashCode());
325
		result = prime * result + ((catalogStringMap == null) ? 0 : catalogStringMap.hashCode());
336
		result = prime * result + ((name == null) ? 0 : name.hashCode());
326
		result = prime * result + ((name == null) ? 0 : name.hashCode());
337
		result = prime * result + ((partnerType == null) ? 0 : partnerType.hashCode());
327
		result = prime * result + ((partnerType == null) ? 0 : partnerType.hashCode());
338
		result = prime * result + ((retailerIds == null) ? 0 : retailerIds.hashCode());
328
		result = prime * result + ((retailerIds == null) ? 0 : retailerIds.hashCode());
339
		result = prime * result + ((startDateTime == null) ? 0 : startDateTime.hashCode());
329
		result = prime * result + ((startDateTime == null) ? 0 : startDateTime.hashCode());
340
		result = prime * result + ((type == null) ? 0 : type.hashCode());
330
		result = prime * result + ((type == null) ? 0 : type.hashCode());
Line 383... Line 373...
383
				return false;
373
				return false;
384
		} else if (!expireTimestamp.equals(other.expireTimestamp))
374
		} else if (!expireTimestamp.equals(other.expireTimestamp))
385
			return false;
375
			return false;
386
		if (id != other.id)
376
		if (id != other.id)
387
			return false;
377
			return false;
388
		if (itemStringMap == null) {
378
		if (catalogStringMap == null) {
389
			if (other.itemStringMap != null)
379
			if (other.catalogStringMap != null)
390
				return false;
380
				return false;
391
		} else if (!itemStringMap.equals(other.itemStringMap))
381
		} else if (!catalogStringMap.equals(other.catalogStringMap))
392
			return false;
382
			return false;
393
		if (name == null) {
383
		if (name == null) {
394
			if (other.name != null)
384
			if (other.name != null)
395
				return false;
385
				return false;
396
		} else if (!name.equals(other.name))
386
		} else if (!name.equals(other.name))