Subversion Repositories SmartDukaan

Rev

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

Rev 31860 Rev 34276
Line 1... Line 1...
1
package com.spice.profitmandi.dao.entity.user;
1
package com.spice.profitmandi.dao.entity.user;
2
 
2
 
3
import java.time.LocalDateTime;
-
 
4
import java.util.List;
-
 
5
 
-
 
6
import javax.persistence.Column;
-
 
7
import javax.persistence.Entity;
-
 
8
import javax.persistence.EnumType;
-
 
9
import javax.persistence.Enumerated;
-
 
10
import javax.persistence.GeneratedValue;
-
 
11
import javax.persistence.GenerationType;
-
 
12
import javax.persistence.Id;
-
 
13
import javax.persistence.Table;
-
 
14
import javax.persistence.Transient;
-
 
15
 
-
 
16
import com.spice.profitmandi.dao.enumuration.dtr.FranchiseeVisitStatus;
3
import com.spice.profitmandi.dao.enumuration.dtr.FranchiseeVisitStatus;
17
import com.spice.profitmandi.dao.enumuration.dtr.VisitStatus;
4
import com.spice.profitmandi.dao.enumuration.dtr.VisitStatus;
18
 
5
 
-
 
6
import javax.persistence.*;
-
 
7
import java.time.LocalDateTime;
-
 
8
import java.util.List;
-
 
9
import java.util.Objects;
-
 
10
 
19
@Entity
11
@Entity
20
@Table(name = "user.my_franchisee_visit")
12
@Table(name = "user.my_franchisee_visit")
-
 
13
@NamedQueries({
-
 
14
		@NamedQuery(
-
 
15
				name = "Visit.FindAverageRatingByRbmIds",
-
 
16
				query = "SELECT new com.spice.profitmandi.dao.model.RbMRatingModel(v.rbmId, AVG(v.rbmRating)) " +
-
 
17
						"FROM FranchiseeVisit v WHERE v.rbmId IN :rbmIds GROUP BY v.rbmId"
-
 
18
		)
-
 
19
})
-
 
20
 
21
public class FranchiseeVisit {
21
public class FranchiseeVisit {
22
 
22
 
23
	@Id
23
	@Id
24
	@Column(name = "id", unique = true, updatable = false)
24
	@Column(name = "id", unique = true, updatable = false)
25
	@GeneratedValue(strategy = GenerationType.IDENTITY)
25
	@GeneratedValue(strategy = GenerationType.IDENTITY)
26
	private int id;
26
	private int id;
27
 
27
 
28
	@Column(name = "fofo_id")
28
	@Column(name = "fofo_id")
29
	private int fofoId;
29
	private int fofoId;
30
 
30
 
-
 
31
	@Column(name = "rbm_id")
-
 
32
	private int rbmId;
-
 
33
 
-
 
34
	@Column(name = "rbm_rating")
-
 
35
	private int rbmRating;
-
 
36
 
31
	@Column(name = "partner_name")
37
	@Column(name = "partner_name")
32
	private String partnerName;
38
	private String partnerName;
33
 
39
 
34
	public String getPartnerName() {
40
	public String getPartnerName() {
35
		return partnerName;
41
		return partnerName;
Line 351... Line 357...
351
 
357
 
352
	public void setFranchiseActivityId(int franchiseActivityId) {
358
	public void setFranchiseActivityId(int franchiseActivityId) {
353
		this.franchiseActivityId = franchiseActivityId;
359
		this.franchiseActivityId = franchiseActivityId;
354
	}
360
	}
355
 
361
 
-
 
362
	public int getRbmId() {
-
 
363
		return rbmId;
-
 
364
	}
-
 
365
 
-
 
366
	public void setRbmId(int rbmId) {
-
 
367
		this.rbmId = rbmId;
-
 
368
	}
-
 
369
 
-
 
370
	public int getRbmRating() {
-
 
371
		return rbmRating;
-
 
372
	}
-
 
373
 
-
 
374
	public void setRbmRating(int rbmRating) {
-
 
375
		this.rbmRating = rbmRating;
-
 
376
	}
-
 
377
 
356
	@Override
378
	@Override
357
	public int hashCode() {
379
	public boolean equals(Object o) {
358
		final int prime = 31;
-
 
359
		int result = 1;
-
 
360
		result = prime * result + ((agenda == null) ? 0 : agenda.hashCode());
-
 
361
		result = prime * result + authId;
380
		if (this == o) return true;
362
		result = prime * result + ((brands == null) ? 0 : brands.hashCode());
381
		if (o == null || getClass() != o.getClass()) return false;
363
		result = prime * result + ((carryBags == null) ? 0 : carryBags.hashCode());
-
 
364
		result = prime * result + ((createdBy == null) ? 0 : createdBy.hashCode());
-
 
365
		result = prime * result + ((createdTimestamp == null) ? 0 : createdTimestamp.hashCode());
-
 
366
		result = prime * result + fofoId;
-
 
367
		result = prime * result + franchiseActivityId;
382
		FranchiseeVisit that = (FranchiseeVisit) o;
368
		result = prime * result + ((franchiseeActivity == null) ? 0 : franchiseeActivity.hashCode());
-
 
369
		result = prime * result + ((hygiene == null) ? 0 : hygiene.hashCode());
-
 
370
		result = prime * result + id;
-
 
371
		result = prime * result + ((informedAboutOnline == null) ? 0 : informedAboutOnline.hashCode());
-
 
372
		result = prime * result + ((instoreVisibility == null) ? 0 : instoreVisibility.hashCode());
-
 
373
		result = prime * result + ((investment == null) ? 0 : investment.hashCode());
-
 
374
		result = prime * result + ((latestDummies == null) ? 0 : latestDummies.hashCode());
-
 
375
		result = prime * result + mtd;
-
 
376
		result = prime * result + ((outsideStock == null) ? 0 : outsideStock.hashCode());
-
 
377
		result = prime * result + ((outsideVisibity == null) ? 0 : outsideVisibity.hashCode());
-
 
378
		result = prime * result + ((partnerName == null) ? 0 : partnerName.hashCode());
-
 
379
		result = prime * result + ((partnerRemark == null) ? 0 : partnerRemark.hashCode());
-
 
380
		result = prime * result + pendingBilling;
-
 
381
		result = prime * result + ((scheduleTimestamp == null) ? 0 : scheduleTimestamp.hashCode());
-
 
382
		result = prime * result + ((smartdukaanTshirt == null) ? 0 : smartdukaanTshirt.hashCode());
-
 
383
		result = prime * result + ((status == null) ? 0 : status.hashCode());
-
 
384
		result = prime * result + ((systemKnowledge == null) ? 0 : systemKnowledge.hashCode());
-
 
385
		result = prime * result + ((updatedTimestamp == null) ? 0 : updatedTimestamp.hashCode());
-
 
386
		result = prime * result + ((visitTimestamp == null) ? 0 : visitTimestamp.hashCode());
-
 
387
		result = prime * result + ((workingDevice == null) ? 0 : workingDevice.hashCode());
-
 
388
		result = prime * result + ((workingPrinter == null) ? 0 : workingPrinter.hashCode());
-
 
389
		return result;
383
		return id == that.id && fofoId == that.fofoId && rbmId == that.rbmId && rbmRating == that.rbmRating && mtd == that.mtd && pendingBilling == that.pendingBilling && franchiseActivityId == that.franchiseActivityId && authId == that.authId && Objects.equals(partnerName, that.partnerName) && Objects.equals(franchiseeActivity, that.franchiseeActivity) && Objects.equals(scheduleTimestamp, that.scheduleTimestamp) && Objects.equals(agenda, that.agenda) && Objects.equals(partnerRemark, that.partnerRemark) && Objects.equals(outsideVisibity, that.outsideVisibity) && Objects.equals(instoreVisibility, that.instoreVisibility) && Objects.equals(outsideStock, that.outsideStock) && Objects.equals(systemKnowledge, that.systemKnowledge) && Objects.equals(workingDevice, that.workingDevice) && Objects.equals(workingPrinter, that.workingPrinter) && Objects.equals(carryBags, that.carryBags) && Objects.equals(smartdukaanTshirt, that.smartdukaanTshirt) && Objects.equals(latestDummies, that.latestDummies) && Objects.equals(investment, that.investment) && status == that.status && Objects.equals(hygiene, that.hygiene) && Objects.equals(createdTimestamp, that.createdTimestamp) && Objects.equals(informedAboutOnline, that.informedAboutOnline) && Objects.equals(updatedTimestamp, that.updatedTimestamp) && Objects.equals(visitTimestamp, that.visitTimestamp) && Objects.equals(brands, that.brands) && Objects.equals(createdBy, that.createdBy) && visitStatus == that.visitStatus;
390
	}
384
	}
391
 
385
 
392
	@Override
386
	@Override
393
	public boolean equals(Object obj) {
387
	public int hashCode() {
394
		if (this == obj)
-
 
395
			return true;
-
 
396
		if (obj == null)
-
 
397
			return false;
-
 
398
		if (getClass() != obj.getClass())
-
 
399
			return false;
-
 
400
		FranchiseeVisit other = (FranchiseeVisit) obj;
-
 
401
		if (agenda == null) {
-
 
402
			if (other.agenda != null)
-
 
403
				return false;
-
 
404
		} else if (!agenda.equals(other.agenda))
-
 
405
			return false;
-
 
406
		if (authId != other.authId)
-
 
407
			return false;
-
 
408
		if (brands == null) {
-
 
409
			if (other.brands != null)
-
 
410
				return false;
-
 
411
		} else if (!brands.equals(other.brands))
-
 
412
			return false;
-
 
413
		if (carryBags == null) {
-
 
414
			if (other.carryBags != null)
-
 
415
				return false;
-
 
416
		} else if (!carryBags.equals(other.carryBags))
-
 
417
			return false;
-
 
418
		if (createdBy == null) {
-
 
419
			if (other.createdBy != null)
-
 
420
				return false;
-
 
421
		} else if (!createdBy.equals(other.createdBy))
-
 
422
			return false;
-
 
423
		if (createdTimestamp == null) {
-
 
424
			if (other.createdTimestamp != null)
-
 
425
				return false;
-
 
426
		} else if (!createdTimestamp.equals(other.createdTimestamp))
-
 
427
			return false;
-
 
428
		if (fofoId != other.fofoId)
-
 
429
			return false;
-
 
430
		if (franchiseActivityId != other.franchiseActivityId)
-
 
431
			return false;
-
 
432
		if (franchiseeActivity == null) {
-
 
433
			if (other.franchiseeActivity != null)
-
 
434
				return false;
-
 
435
		} else if (!franchiseeActivity.equals(other.franchiseeActivity))
-
 
436
			return false;
-
 
437
		if (hygiene == null) {
-
 
438
			if (other.hygiene != null)
-
 
439
				return false;
-
 
440
		} else if (!hygiene.equals(other.hygiene))
-
 
441
			return false;
-
 
442
		if (id != other.id)
-
 
443
			return false;
-
 
444
		if (informedAboutOnline == null) {
-
 
445
			if (other.informedAboutOnline != null)
-
 
446
				return false;
-
 
447
		} else if (!informedAboutOnline.equals(other.informedAboutOnline))
-
 
448
			return false;
-
 
449
		if (instoreVisibility == null) {
-
 
450
			if (other.instoreVisibility != null)
-
 
451
				return false;
-
 
452
		} else if (!instoreVisibility.equals(other.instoreVisibility))
-
 
453
			return false;
-
 
454
		if (investment == null) {
-
 
455
			if (other.investment != null)
-
 
456
				return false;
-
 
457
		} else if (!investment.equals(other.investment))
-
 
458
			return false;
-
 
459
		if (latestDummies == null) {
-
 
460
			if (other.latestDummies != null)
-
 
461
				return false;
-
 
462
		} else if (!latestDummies.equals(other.latestDummies))
-
 
463
			return false;
-
 
464
		if (mtd != other.mtd)
-
 
465
			return false;
-
 
466
		if (outsideStock == null) {
-
 
467
			if (other.outsideStock != null)
-
 
468
				return false;
-
 
469
		} else if (!outsideStock.equals(other.outsideStock))
-
 
470
			return false;
-
 
471
		if (outsideVisibity == null) {
-
 
472
			if (other.outsideVisibity != null)
-
 
473
				return false;
-
 
474
		} else if (!outsideVisibity.equals(other.outsideVisibity))
-
 
475
			return false;
-
 
476
		if (partnerName == null) {
-
 
477
			if (other.partnerName != null)
-
 
478
				return false;
-
 
479
		} else if (!partnerName.equals(other.partnerName))
-
 
480
			return false;
-
 
481
		if (partnerRemark == null) {
-
 
482
			if (other.partnerRemark != null)
-
 
483
				return false;
-
 
484
		} else if (!partnerRemark.equals(other.partnerRemark))
-
 
485
			return false;
-
 
486
		if (pendingBilling != other.pendingBilling)
-
 
487
			return false;
-
 
488
		if (scheduleTimestamp == null) {
-
 
489
			if (other.scheduleTimestamp != null)
-
 
490
				return false;
-
 
491
		} else if (!scheduleTimestamp.equals(other.scheduleTimestamp))
-
 
492
			return false;
-
 
493
		if (smartdukaanTshirt == null) {
-
 
494
			if (other.smartdukaanTshirt != null)
-
 
495
				return false;
-
 
496
		} else if (!smartdukaanTshirt.equals(other.smartdukaanTshirt))
-
 
497
			return false;
-
 
498
		if (status != other.status)
-
 
499
			return false;
-
 
500
		if (systemKnowledge == null) {
-
 
501
			if (other.systemKnowledge != null)
-
 
502
				return false;
-
 
503
		} else if (!systemKnowledge.equals(other.systemKnowledge))
-
 
504
			return false;
-
 
505
		if (updatedTimestamp == null) {
-
 
506
			if (other.updatedTimestamp != null)
-
 
507
				return false;
-
 
508
		} else if (!updatedTimestamp.equals(other.updatedTimestamp))
-
 
509
			return false;
-
 
510
		if (visitTimestamp == null) {
-
 
511
			if (other.visitTimestamp != null)
-
 
512
				return false;
-
 
513
		} else if (!visitTimestamp.equals(other.visitTimestamp))
-
 
514
			return false;
-
 
515
		if (workingDevice == null) {
-
 
516
			if (other.workingDevice != null)
-
 
517
				return false;
-
 
518
		} else if (!workingDevice.equals(other.workingDevice))
-
 
519
			return false;
-
 
520
		if (workingPrinter == null) {
-
 
521
			if (other.workingPrinter != null)
-
 
522
				return false;
-
 
523
		} else if (!workingPrinter.equals(other.workingPrinter))
-
 
524
			return false;
-
 
525
		return true;
388
		return Objects.hash(id, fofoId, rbmId, rbmRating, partnerName, franchiseeActivity, scheduleTimestamp, agenda, partnerRemark, outsideVisibity, instoreVisibility, outsideStock, systemKnowledge, workingDevice, workingPrinter, carryBags, smartdukaanTshirt, latestDummies, investment, mtd, status, hygiene, createdTimestamp, pendingBilling, informedAboutOnline, updatedTimestamp, visitTimestamp, brands, franchiseActivityId, createdBy, authId, visitStatus);
526
	}
389
	}
527
 
390
 
528
	@Override
391
	@Override
529
	public String toString() {
392
	public String toString() {
-
 
393
		return "FranchiseeVisit{" +
-
 
394
				"id=" + id +
-
 
395
				", fofoId=" + fofoId +
-
 
396
				", rbmId=" + rbmId +
-
 
397
				", rbmRating=" + rbmRating +
530
		return "FranchiseeVisit [id=" + id + ", fofoId=" + fofoId + ", partnerName=" + partnerName
398
				", partnerName='" + partnerName + '\'' +
531
				+ ", franchiseeActivity=" + franchiseeActivity + ", scheduleTimestamp=" + scheduleTimestamp
399
				", franchiseeActivity=" + franchiseeActivity +
-
 
400
				", scheduleTimestamp=" + scheduleTimestamp +
-
 
401
				", agenda='" + agenda + '\'' +
532
				+ ", agenda=" + agenda + ", partnerRemark=" + partnerRemark + ", outsideVisibity=" + outsideVisibity
402
				", partnerRemark='" + partnerRemark + '\'' +
-
 
403
				", outsideVisibity='" + outsideVisibity + '\'' +
533
				+ ", instoreVisibility=" + instoreVisibility + ", outsideStock=" + outsideStock + ", systemKnowledge="
404
				", instoreVisibility='" + instoreVisibility + '\'' +
-
 
405
				", outsideStock='" + outsideStock + '\'' +
-
 
406
				", systemKnowledge='" + systemKnowledge + '\'' +
534
				+ systemKnowledge + ", workingDevice=" + workingDevice + ", workingPrinter=" + workingPrinter
407
				", workingDevice='" + workingDevice + '\'' +
-
 
408
				", workingPrinter='" + workingPrinter + '\'' +
-
 
409
				", carryBags='" + carryBags + '\'' +
535
				+ ", carryBags=" + carryBags + ", smartdukaanTshirt=" + smartdukaanTshirt + ", latestDummies="
410
				", smartdukaanTshirt='" + smartdukaanTshirt + '\'' +
-
 
411
				", latestDummies='" + latestDummies + '\'' +
536
				+ latestDummies + ", investment=" + investment + ", mtd=" + mtd + ", status=" + status + ", hygiene="
412
				", investment='" + investment + '\'' +
-
 
413
				", mtd=" + mtd +
-
 
414
				", status=" + status +
-
 
415
				", hygiene='" + hygiene + '\'' +
537
				+ hygiene + ", createdTimestamp=" + createdTimestamp + ", pendingBilling=" + pendingBilling
416
				", createdTimestamp=" + createdTimestamp +
-
 
417
				", pendingBilling=" + pendingBilling +
538
				+ ", informedAboutOnline=" + informedAboutOnline + ", updatedTimestamp=" + updatedTimestamp
418
				", informedAboutOnline='" + informedAboutOnline + '\'' +
-
 
419
				", updatedTimestamp=" + updatedTimestamp +
539
				+ ", visitTimestamp=" + visitTimestamp + ", brands=" + brands + ", franchiseActivityId="
420
				", visitTimestamp=" + visitTimestamp +
-
 
421
				", brands=" + brands +
540
				+ franchiseActivityId + ", createdBy=" + createdBy + ", authId=" + authId + ", visitStatus="
422
				", franchiseActivityId=" + franchiseActivityId +
-
 
423
				", createdBy='" + createdBy + '\'' +
-
 
424
				", authId=" + authId +
541
				+ visitStatus + "]";
425
				", visitStatus=" + visitStatus +
-
 
426
				'}';
542
	}
427
	}
543
 
428
 
544
}
429
}